From 12ab1d2d8a6f865693c9896d253c0faa8406691e Mon Sep 17 00:00:00 2001
From: Pranav C <61551451+pranavxc@users.noreply.github.com>
Date: Thu, 15 Jul 2021 16:31:36 +0530
Subject: [PATCH] fix: Bulk add users
Enabled option to add bulk add user with comma separated emails
re #300
Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com>
---
.../nc-gui/components/auth/userManagement.vue | 22 +-
.../project/spreadsheet/components/extras.vue | 96 ++
.../components/spreadsheetNavDrawer.vue | 81 +-
packages/nc-gui/layouts/default.vue | 1194 +++++++++--------
packages/nc-gui/nuxt.config.js | 1 +
packages/nc-gui/pages/projects/index.vue | 2 +-
packages/nc-gui/plugins/globalEventBus.js | 9 +
packages/nc-gui/static/lang/en.json | 1 +
packages/nc-gui/static/lang/fr.json | 1 +
packages/nc-gui/static/lang/ja.json | 1 +
packages/nc-gui/static/lang/zh.json | 2 +-
packages/nc-lib-gui/package.json | 2 +-
.../src/lib/noco/rest/RestAuthCtrlEE.ts | 103 +-
13 files changed, 823 insertions(+), 692 deletions(-)
create mode 100644 packages/nc-gui/components/project/spreadsheet/components/extras.vue
create mode 100644 packages/nc-gui/plugins/globalEventBus.js
diff --git a/packages/nc-gui/components/auth/userManagement.vue b/packages/nc-gui/components/auth/userManagement.vue
index b19e893d54..43e5f5d092 100644
--- a/packages/nc-gui/components/auth/userManagement.vue
+++ b/packages/nc-gui/components/auth/userManagement.vue
@@ -346,7 +346,7 @@
>
-
+
Copy Invite Token
@@ -388,7 +388,10 @@
Looks like you have not configured mailer yet!
Please copy above
invite
- link and send it to {{ invite_token && invite_token.email }}.
+ link and send it to {{ invite_token && (invite_token.email || invite_token.emails && invite_token.emails.join(', ')) }}.
+
+
+
@@ -403,6 +406,8 @@
v-model="selectedUser.email"
:rules="emailRules"
@input="edited=true"
+ validate-on-blur
+ hint="You can add multiple comma(,) separated emails"
label="Email">
@@ -476,14 +481,21 @@ export default {
valid: null,
emailRules: [
v => !!v || 'E-mail is required',
- v => isEmail(v) || 'E-mail must be valid'
+ v => {
+ const invalidEmails = (v||'').split(/\s*,\s*/).filter(e => !isEmail(e));
+ return !invalidEmails.length || `"${invalidEmails.join(', ')}" - invalid email`
+ }
],
userList: []
}),
async created() {
+ this.$eventBus.$on('show-add-user', this.addUser);
await this.loadUsers();
await this.loadRoles();
},
+ beforeDestroy() {
+ this.$eventBus.$off('show-add-user', this.addUser);
+ },
methods: {
simpleAnim() {
var count = 30;
@@ -619,7 +631,7 @@ export default {
addUser() {
this.invite_token = null;
this.selectedUser = {
- roles: 'creator,editor'
+ roles: 'editor'
}
this.userEditDialog = true
},
@@ -733,7 +745,7 @@ export default {
this.selectedUser = this.users[i];
}
}
- }
+ },
}
diff --git a/packages/nc-gui/components/project/spreadsheet/components/extras.vue b/packages/nc-gui/components/project/spreadsheet/components/extras.vue
new file mode 100644
index 0000000000..cf6c6862d0
--- /dev/null
+++ b/packages/nc-gui/components/project/spreadsheet/components/extras.vue
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
diff --git a/packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue b/packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue
index f4c9166cc3..a3ebfb269d 100644
--- a/packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue
+++ b/packages/nc-gui/components/project/spreadsheet/components/spreadsheetNavDrawer.vue
@@ -29,7 +29,7 @@
x-small
v-if="viewIcons[view.show_as]"
:color="viewIcons[view.show_as].color"
- >{{ viewIcons[view.show_as].icon }}
+ >{{ viewIcons[view.show_as].icon }}
mdi-table
@@ -49,7 +49,7 @@
@blur="updateViewName(view)"
/>
{{ view.alias || view.title }}{{ view.alias || view.title }}
@@ -93,13 +93,14 @@
mdi-check-boldmdi-check-bold
+
-
+
mdi-shield-lock-outline
+ >mdi-shield-lock-outline
@@ -137,7 +138,7 @@
mdi-grid-large
+ >
{{ $t('nav_drawer.virtual_views.grid') }}
mdi-camera-image
+ >
{{ $t('nav_drawer.virtual_views.gallery') }}
@@ -183,7 +184,7 @@
mdi-calendar
+ >
{{ $t('nav_drawer.virtual_views.calendar') }}
mdi-tablet-dashboard
+ >
{{ $t('nav_drawer.virtual_views.kanban') }}
mdi-form-select
+ >
{{ $t('nav_drawer.virtual_views.form') }}
@@ -256,9 +257,13 @@
v-if="time - $store.state.windows.miniSponsorCard > 15 * 60 * 1000"
>
mdi-close-circle-outlinemdi-close-circle-outline
+
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -407,12 +390,12 @@
{{ shareLink.url }}
-
+
mdi-open-in-new
mdi-content-copy
+ >mdi-content-copy
@@ -461,11 +444,11 @@