|
|
@ -155,9 +155,8 @@ |
|
|
|
> |
|
|
|
> |
|
|
|
mdi-pencil-outline |
|
|
|
mdi-pencil-outline |
|
|
|
</x-icon> |
|
|
|
</x-icon> |
|
|
|
|
|
|
|
<span v-if="!item.project_id"> |
|
|
|
<x-icon |
|
|
|
<x-icon |
|
|
|
v-if="!item.project_id" |
|
|
|
|
|
|
|
tooltip="Add user to project" |
|
|
|
tooltip="Add user to project" |
|
|
|
color="primary" |
|
|
|
color="primary" |
|
|
|
small |
|
|
|
small |
|
|
@ -165,13 +164,23 @@ |
|
|
|
> |
|
|
|
> |
|
|
|
mdi-plus |
|
|
|
mdi-plus |
|
|
|
</x-icon> |
|
|
|
</x-icon> |
|
|
|
|
|
|
|
<x-icon |
|
|
|
|
|
|
|
tooltip="Delete user from NocoDB" |
|
|
|
|
|
|
|
class="ml-2" |
|
|
|
|
|
|
|
color="error" |
|
|
|
|
|
|
|
small |
|
|
|
|
|
|
|
@click.prevent.stop="deleteId = item.id; deleteItem = item.id;showConfirmDlg = true;deleteUserType='DELETE_FROM_NOCODB'" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
mdi-delete-forever-outline |
|
|
|
|
|
|
|
</x-icon> |
|
|
|
|
|
|
|
</span> |
|
|
|
<x-icon |
|
|
|
<x-icon |
|
|
|
v-else |
|
|
|
v-else |
|
|
|
tooltip="Remove user from project" |
|
|
|
tooltip="Remove user from project" |
|
|
|
class="ml-2" |
|
|
|
class="ml-2" |
|
|
|
color="error" |
|
|
|
color="error" |
|
|
|
small |
|
|
|
small |
|
|
|
@click.prevent.stop="deleteId = item.id; deleteItem = item.id;showConfirmDlg = true" |
|
|
|
@click.prevent.stop="deleteId = item.id; deleteItem = item.id;showConfirmDlg = true;deleteUserType='DELETE_FROM_PROJECT'" |
|
|
|
> |
|
|
|
> |
|
|
|
mdi-delete-outline |
|
|
|
mdi-delete-outline |
|
|
|
</x-icon> |
|
|
|
</x-icon> |
|
|
@ -296,7 +305,7 @@ |
|
|
|
<dlg-label-submit-cancel |
|
|
|
<dlg-label-submit-cancel |
|
|
|
type="primary" |
|
|
|
type="primary" |
|
|
|
:actions-mtd="confirmDelete" |
|
|
|
:actions-mtd="confirmDelete" |
|
|
|
heading="Do you want to remove the user from project?" |
|
|
|
:heading="dialogMessage" |
|
|
|
:dialog-show="showConfirmDlg" |
|
|
|
:dialog-show="showConfirmDlg" |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
@ -497,7 +506,8 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
userList: [], |
|
|
|
userList: [], |
|
|
|
roleDescriptions: {} |
|
|
|
roleDescriptions: {}, |
|
|
|
|
|
|
|
deleteUserType: '' // [DELETE_FROM_PROJECT, DELETE_FROM_NOCODB] |
|
|
|
}), |
|
|
|
}), |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
|
roleNames() { |
|
|
|
roleNames() { |
|
|
@ -530,6 +540,12 @@ export default { |
|
|
|
set(i) { |
|
|
|
set(i) { |
|
|
|
this.selectedUser = this.users[i] |
|
|
|
this.selectedUser = this.users[i] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
dialogMessage() { |
|
|
|
|
|
|
|
let msg = 'Do you want to remove the user' |
|
|
|
|
|
|
|
if (this.deleteUserType === 'DELETE_FROM_PROJECT') { msg += ' from Project' } else if (this.deleteUserType === 'DELETE_FROM_NOCODB') { msg += ' from NocoDB' } |
|
|
|
|
|
|
|
msg += '?' |
|
|
|
|
|
|
|
return msg |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
@ -669,30 +685,30 @@ export default { |
|
|
|
console.log(e) |
|
|
|
console.log(e) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
async deleteUser(id) { |
|
|
|
async deleteUser(id, type) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
await this.$axios.delete('/admin/' + id, { |
|
|
|
await this.$axios.delete('/admin/' + id, { |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
project_id: this.$route.params.project_id, |
|
|
|
project_id: this.$route.params.project_id, |
|
|
|
email: this.deleteItem.email |
|
|
|
email: this.deleteItem.email, |
|
|
|
|
|
|
|
type |
|
|
|
}, |
|
|
|
}, |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
|
'xc-auth': this.$store.state.users.token |
|
|
|
'xc-auth': this.$store.state.users.token |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$toast.success('Successfully removed the user from project').goAway(3000) |
|
|
|
this.$toast.success(`Successfully removed the user from ${type === 'DELETE_FROM_PROJECT' ? 'project' : 'NocoDB'}`).goAway(3000) |
|
|
|
await this.loadUsers() |
|
|
|
await this.loadUsers() |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
this.$toast.error(e.response.data.msg).goAway(3000) |
|
|
|
this.$toast.error(e.response.data.msg).goAway(3000) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async confirmDelete(hideDialog) { |
|
|
|
async confirmDelete(hideDialog) { |
|
|
|
if (hideDialog) { |
|
|
|
if (hideDialog) { |
|
|
|
this.showConfirmDlg = false |
|
|
|
this.showConfirmDlg = false |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
await this.deleteUser(this.deleteId) |
|
|
|
await this.deleteUser(this.deleteId, this.deleteUserType) |
|
|
|
this.showConfirmDlg = false |
|
|
|
this.showConfirmDlg = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
addUser() { |
|
|
|
addUser() { |
|
|
@ -832,6 +848,7 @@ export default { |
|
|
|
* |
|
|
|
* |
|
|
|
* @author Naveen MR <oof1lab@gmail.com> |
|
|
|
* @author Naveen MR <oof1lab@gmail.com> |
|
|
|
* @author Pranav C Balan <pranavxc@gmail.com> |
|
|
|
* @author Pranav C Balan <pranavxc@gmail.com> |
|
|
|
|
|
|
|
* @author Wing-Kam Wong <wingkwong.code@gmail.com> |
|
|
|
* |
|
|
|
* |
|
|
|
* @license GNU AGPL version 3 or any later version |
|
|
|
* @license GNU AGPL version 3 or any later version |
|
|
|
* |
|
|
|
* |
|
|
|