From 5ea4d835bd32c4ccf3bfecd99bb3f5b33c88f490 Mon Sep 17 00:00:00 2001
From: Troplo
Date: Tue, 2 Aug 2022 21:15:16 +1000
Subject: [PATCH] 1.0.12
---
.github/workflows/desktop.yml | 34 ++
.../20220802105441-removeOldUserColumns.js | 17 +
backend/models/users.js | 10 -
frontend/package.json | 2 +-
frontend/src/assets/styles.css | 10 +
frontend/src/components/CommsInput.vue | 15 +-
frontend/src/components/Message.vue | 212 +++++++---
frontend/src/main.js | 19 +-
.../Communications/CommunicationsChat.vue | 400 ++++--------------
frontend/src/views/Login.vue | 5 +-
frontend/src/views/Register.vue | 49 ++-
frontend/src/views/Settings/SettingsSite.vue | 6 +-
12 files changed, 351 insertions(+), 428 deletions(-)
create mode 100644 .github/workflows/desktop.yml
create mode 100644 backend/migrations/20220802105441-removeOldUserColumns.js
diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml
new file mode 100644
index 0000000..c0993b9
--- /dev/null
+++ b/.github/workflows/desktop.yml
@@ -0,0 +1,34 @@
+name: Build/release
+
+on: push
+
+jobs:
+ release:
+ runs-on: ${{ matrix.os }}
+
+ strategy:
+ matrix:
+ os: [macos-latest, ubuntu-latest, windows-latest]
+
+ steps:
+ - name: Check out Git repository
+ uses: actions/checkout@v1
+
+ - name: Install Node.js, NPM and Yarn
+ uses: actions/setup-node@v1
+ with:
+ node-version: 10
+
+ - name: Build/release Electron app
+ uses: samuelmeuli/action-electron-builder@v1
+ with:
+ # GitHub token, automatically provided to the action
+ # (No need to define this secret in the repo settings)
+ github_token: ${{ secrets.github_token }}
+
+ # If the commit is tagged with a version (e.g. "v1.0.0"),
+ # release the app after building
+ release: ${{ startsWith(github.ref, 'refs/tags/v') }}
+ package_root: "./frontend",
+ use_vue_cli: true,
+ build_script_name: "electron:build"
\ No newline at end of file
diff --git a/backend/migrations/20220802105441-removeOldUserColumns.js b/backend/migrations/20220802105441-removeOldUserColumns.js
new file mode 100644
index 0000000..d36e98b
--- /dev/null
+++ b/backend/migrations/20220802105441-removeOldUserColumns.js
@@ -0,0 +1,17 @@
+"use strict"
+
+module.exports = {
+ async up(queryInterface, Sequelize) {
+ await queryInterface.removeColumn("Users", "guidedWizard")
+ await queryInterface.removeColumn("Users", "emailDirectLogin")
+ },
+
+ async down(queryInterface, Sequelize) {
+ /**
+ * Add reverting commands here.
+ *
+ * Example:
+ * await queryInterface.dropTable('users');
+ */
+ }
+}
diff --git a/backend/models/users.js b/backend/models/users.js
index 8ec451b..9246ceb 100644
--- a/backend/models/users.js
+++ b/backend/models/users.js
@@ -64,11 +64,6 @@ module.exports = (sequelize, DataTypes) => {
allowNull: true,
defaultValue: null
},
- guidedWizard: {
- type: DataTypes.BOOLEAN,
- allowNull: false,
- defaultValue: true
- },
privacy: {
type: DataTypes.JSON,
defaultValue: {
@@ -99,11 +94,6 @@ module.exports = (sequelize, DataTypes) => {
allowNull: false,
defaultValue: false
},
- emailDirectLogin: {
- type: DataTypes.BOOLEAN,
- allowNull: false,
- defaultValue: false
- },
email: {
type: DataTypes.STRING,
allowNull: true,
diff --git a/frontend/package.json b/frontend/package.json
index 5d2bfd5..ac1801f 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -1,6 +1,6 @@
{
"name": "colubrina",
- "version": "1.0.11",
+ "version": "1.0.12",
"private": true,
"author": "Troplo ",
"scripts": {
diff --git a/frontend/src/assets/styles.css b/frontend/src/assets/styles.css
index 27d6d4f..c256ec7 100644
--- a/frontend/src/assets/styles.css
+++ b/frontend/src/assets/styles.css
@@ -1,3 +1,13 @@
+.offset-message {
+ padding-left: 47px;
+}
+.message-action-card {
+ position: absolute;
+ top: 0;
+ right: 0;
+ margin-top: 5px;
+ margin-right: 5px;
+}
/* large codeblock */
code {
background-color: var(--v-bg-base) !important;
diff --git a/frontend/src/components/CommsInput.vue b/frontend/src/components/CommsInput.vue
index 023fbd2..03102d1 100644
--- a/frontend/src/components/CommsInput.vue
+++ b/frontend/src/components/CommsInput.vue
@@ -19,7 +19,11 @@
-
+
-
+
mdi-account
-
-
+
+ {{ $date(message.createdAt).format("hh:mm A") }}
+
+
+
{{ getName(message.user) }}
-
- {{ message.content }}
-
+
+ {{ message.content }}
+
+
+
+
+ mdi-pencil
+
+
+
+ {{
+ $date(message.editedAt).format("DD/MM/YYYY hh:mm:ss A")
+ }}
+
+
+
+
-
+
{{ attachment.name }} -
{{ friendlySize(attachment.size) }}
@@ -366,64 +395,108 @@
v-if="edit.id === message.id"
>
-
-
-
- mdi-delete
-
-
- mdi-pencil
-
-
- mdi-close
-
-
- mdi-reply
-
-
- mdi-pin
-
-
-
+
+
+
+
+
+ mdi-delete
+
+
+
+ Delete
+
+
+
+
+
+ mdi-pencil
+
+
+
+ Edit
+
+
+
+
+
+ mdi-close
+
+
+
+ Discard Edits
+
+
+
+
+
+ mdi-reply
+
+
+
+ Reply
+
+
+
+
+
+ mdi-pin
+
+
+
+ Pin to Chat
+
+
@@ -721,7 +794,7 @@
-
+
@@ -764,7 +837,8 @@ export default {
"index",
"show",
"setImagePreview",
- "deleteMessage"
+ "deleteMessage",
+ "lastMessage"
],
components: {
CommsInput,
diff --git a/frontend/src/main.js b/frontend/src/main.js
index 5ab37ca..bc66a24 100644
--- a/frontend/src/main.js
+++ b/frontend/src/main.js
@@ -18,26 +18,13 @@ import "highlight.js/styles/github.css"
const md = require("markdown-it")({
html: false, // Enable HTML tags in source
xhtmlOut: false, // Use '/' to close single tags (
).
- // This is only for full CommonMark compatibility.
breaks: true, // Convert '\n' in paragraphs into
langPrefix: "language-", // CSS language prefix for fenced blocks. Can be
- // useful for external highlighters.
linkify: true, // Autoconvert URL-like text to links
-
- // Enable some language-neutral replacement + quotes beautification
- // For the full list of replacements, see https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.js
typographer: false,
- // Double + single quotes replacement pairs, when typographer enabled,
- // and smartquotes on. Could be either a String or an Array.
- //
- // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
- // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
quotes: "“”‘’",
- // Highlighter function. Should return escaped HTML,
- // or '' if the source string is not changed and should be escaped externally.
- // If result starts with ", "")
+ .replaceAll("
", "")
}
})
if (process.env.NODE_ENV === "development") {
diff --git a/frontend/src/views/Communications/CommunicationsChat.vue b/frontend/src/views/Communications/CommunicationsChat.vue
index 60b9909..9e3c1c5 100644
--- a/frontend/src/views/Communications/CommunicationsChat.vue
+++ b/frontend/src/views/Communications/CommunicationsChat.vue
@@ -1,5 +1,5 @@
-
+
+
+
+ {{ usersTyping.map((user) => getName(user)).join(", ") }}
+ {{ usersTyping.length > 1 ? " are" : " is" }} typing...
+
+
+
-
-
+
-
- {{ usersTyping.map((user) => getName(user)).join(", ") }}
- {{ usersTyping.length > 1 ? " are" : " is" }} typing...
-
-
+ {{ usersTyping.map((user) => getName(user)).join(", ") }}
+ {{ usersTyping.length > 1 ? " are" : " is" }} typing...
+
@@ -421,314 +455,28 @@
>
-
- mdi-reply
-
-
- mdi-account
-
-
- mdi-file-image
-
-
- Click to view attachment
-
- {{ message.reply.content.substring(0, 100) }}
-
-
-
-
- mdi-account
-
-
-
- {{ getName(message.user) }}
-
- {{
- $date(message.createdAt).format("DD/MM/YYYY hh:mm A")
- }}
-
-
-
-
- mdi-pencil
-
-
-
-
- {{
- $date(message.editedAt).format(
- "DD/MM/YYYY hh:mm:ss A"
- )
- }}
-
-
-
-
- {{ message.content }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ embed.openGraph.ogSiteName }}
-
-
-
- {{ embed.openGraph.ogTitle }}
-
-
-
- {{ embed.openGraph.ogDescription }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- mdi-arrow-expand-all
-
-
-
-
-
-
-
- MediaProxy Image
-
-
- mdi-download
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- mdi-arrow-expand-all
-
-
-
-
-
-
-
-
- {{ fileTypes[attachment.extension] || "mdi-file" }}
-
-
- {{ attachment.name }}
-
-
-
- {{ attachment.name }} -
- {{ friendlySize(attachment.size) }}
-
-
- mdi-download
-
-
-
-
-
-
-
+
+
@@ -912,7 +660,8 @@ export default {
dialog: false,
src: "",
height: 0,
- width: 0
+ width: 0,
+ name: ""
},
fileTypes: {
png: "mdi-file-image",
@@ -1207,6 +956,7 @@ export default {
this.preview.height = img.height
this.preview.width = img.width
this.preview.dialog = true
+ this.preview.name = attachment.name
}
img.src = link
},
diff --git a/frontend/src/views/Login.vue b/frontend/src/views/Login.vue
index ecb6cea..1c21970 100644
--- a/frontend/src/views/Login.vue
+++ b/frontend/src/views/Login.vue
@@ -159,6 +159,10 @@ export default {
this.loading = false
this.$socket.disconnect()
this.$socket.connect()
+ if (this.isElectron()) {
+ this.axios.defaults.baseURL = this.instance
+ localStorage.setItem("instance", this.instance)
+ }
if (
this.$store.state.site.emailVerification &&
!this.$store.state.user.emailVerified
@@ -191,7 +195,6 @@ export default {
.then((res) => {
this.instanceString = res.data.name + " v" + res.data.latestVersion
this.axios.defaults.baseURL = this.instance
- localStorage.setItem("instance", this.instance)
this.$store.dispatch("getState")
})
.catch(() => {
diff --git a/frontend/src/views/Register.vue b/frontend/src/views/Register.vue
index 2d1a4d4..c109458 100644
--- a/frontend/src/views/Register.vue
+++ b/frontend/src/views/Register.vue
@@ -7,10 +7,23 @@
- Login to
+ Register to
{{ $store.state.site.name }}beta
+
+ {{
+ instanceString
+ }}
{
+ this.instanceString = res.data.name + " v" + res.data.latestVersion
+ this.axios.defaults.baseURL = this.instance
+ this.$store.dispatch("getState")
+ })
+ .catch(() => {
+ this.instanceString = "Error connecting to instance"
+ })
+ }
+ },
viewport() {
return window.innerHeight
},
@@ -106,6 +138,10 @@ export default {
this.loading = false
this.$socket.disconnect()
this.$socket.connect()
+ if (this.isElectron()) {
+ this.axios.defaults.baseURL = this.instance
+ localStorage.setItem("instance", this.instance)
+ }
if (
this.$store.state.site.emailVerification &&
!this.$store.state.user.emailVerified
@@ -114,6 +150,9 @@ export default {
} else {
this.$router.push("/")
}
+ if (this.isElectron()) {
+ window.location.reload()
+ }
})
.catch((e) => {
if (
@@ -133,6 +172,12 @@ export default {
if (this.$store.state.user?.id) {
this.$router.push("/")
}
+ this.testInstance()
+ },
+ watch: {
+ instance() {
+ this.testInstance()
+ }
}
}
diff --git a/frontend/src/views/Settings/SettingsSite.vue b/frontend/src/views/Settings/SettingsSite.vue
index 216fc4c..b84d592 100644
--- a/frontend/src/views/Settings/SettingsSite.vue
+++ b/frontend/src/views/Settings/SettingsSite.vue
@@ -26,7 +26,11 @@