mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-17 14:19:05 +08:00
Merge pull request #7211 from aignatov-bio/ai-sci-10357-access-member-fixes
Update access modal interactions [SCI-10357][SCI-10348]
This commit is contained in:
commit
d47b98f6fb
4 changed files with 15 additions and 6 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="sci-label mb-2">
|
<div class="sci-label mb-2">
|
||||||
{{ i18n.t('access_permissions.partials.new_assignments_form.grant_access') }}
|
{{ i18n.t('access_permissions.partials.new_assignments_form.grant_access') }}
|
||||||
</div>
|
</div>
|
||||||
<GeneralDropdown @open="$emit('assigningNewUsers', true)" @close="$emit('assigningNewUsers', false)" :fieldOnlyOpen="true" :fixed-width="true">
|
<GeneralDropdown ref="dropdown" @open="$emit('assigningNewUsers', true)" @close="$emit('assigningNewUsers', false)" :fieldOnlyOpen="true" :fixed-width="true">
|
||||||
<template v-slot:field>
|
<template v-slot:field>
|
||||||
<div class="sci-input-container-v2 left-icon">
|
<div class="sci-input-container-v2 left-icon">
|
||||||
<input type="text" v-model="query" class="sci-input-field"
|
<input type="text" v-model="query" class="sci-input-field"
|
||||||
|
|
@ -28,14 +28,14 @@
|
||||||
@setRole="(...args) => this.assignRole('all', ...args)"
|
@setRole="(...args) => this.assignRole('all', ...args)"
|
||||||
></MenuDropdown>
|
></MenuDropdown>
|
||||||
</div>
|
</div>
|
||||||
<perfect-scrollbar class="h-80 relative">
|
<perfect-scrollbar class="max-h-80 relative">
|
||||||
<div v-for="user in filteredUsers" :key="user.id" class="py-2 flex items-center w-full">
|
<div v-for="user in filteredUsers" :key="user.id" class="py-2 flex items-center w-full">
|
||||||
<div>
|
<div>
|
||||||
<img :src="user.attributes.avatar_url" class="rounded-full w-8 h-8">
|
<img :src="user.attributes.avatar_url" class="rounded-full w-8 h-8">
|
||||||
</div>
|
</div>
|
||||||
<div class="truncate ml-2" :title="user.attributes.name">{{ user.attributes.name }}</div>
|
<div class="truncate ml-2" :title="user.attributes.name">{{ user.attributes.name }}</div>
|
||||||
<div v-if="user.attributes.current_user" class="text-nowrap">
|
<div v-if="user.attributes.current_user" class="text-nowrap">
|
||||||
{{ `(${i18n.t('access_permissions.you')})` }}
|
{{ i18n.t('access_permissions.you') }}
|
||||||
</div>
|
</div>
|
||||||
<MenuDropdown
|
<MenuDropdown
|
||||||
class="ml-auto"
|
class="ml-auto"
|
||||||
|
|
@ -46,6 +46,9 @@
|
||||||
@setRole="(...args) => this.assignRole(user.id, ...args)"
|
@setRole="(...args) => this.assignRole(user.id, ...args)"
|
||||||
></MenuDropdown>
|
></MenuDropdown>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="filteredUsers.length === 0" class="p-2 flex items-center w-full">
|
||||||
|
{{ i18n.t('access_permissions.no_results') }}
|
||||||
|
</div>
|
||||||
</perfect-scrollbar>
|
</perfect-scrollbar>
|
||||||
</template>
|
</template>
|
||||||
</GeneralDropdown>
|
</GeneralDropdown>
|
||||||
|
|
@ -59,7 +62,7 @@ import GeneralDropdown from '../general_dropdown.vue';
|
||||||
import axios from '../../../packs/custom_axios.js';
|
import axios from '../../../packs/custom_axios.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
emits: ['modified', 'usersReloaded', 'changeVisibility'],
|
emits: ['modified', 'usersReloaded', 'changeVisibility', 'assigningNewUsers'],
|
||||||
props: {
|
props: {
|
||||||
params: {
|
params: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|
@ -138,6 +141,8 @@ export default {
|
||||||
this.$emit('modified');
|
this.$emit('modified');
|
||||||
HelperModule.flashAlertMsg(response.data.message, 'success');
|
HelperModule.flashAlertMsg(response.data.message, 'success');
|
||||||
this.getUnAssignedUsers();
|
this.getUnAssignedUsers();
|
||||||
|
this.query = '';
|
||||||
|
this.$refs.dropdown.closeMenu();
|
||||||
|
|
||||||
if (id === 'all') {
|
if (id === 'all') {
|
||||||
this.$emit('changeVisibility', true, roleId);
|
this.$emit('changeVisibility', true, roleId);
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ import MenuDropdown from '../menu_dropdown.vue';
|
||||||
import axios from '../../../packs/custom_axios.js';
|
import axios from '../../../packs/custom_axios.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
emits: ['modified', 'usersReloaded', 'changeVisibility'],
|
emits: ['modified', 'usersReloaded', 'changeVisibility', 'assigningNewUsers'],
|
||||||
props: {
|
props: {
|
||||||
params: {
|
params: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
export default {
|
export default {
|
||||||
template: `
|
template: `
|
||||||
<div class="w-full grid items-center gap-2 grid-cols-[auto_1.5rem]"
|
<div class="w-full grid items-center group gap-2 grid-cols-[auto_1.5rem]"
|
||||||
:class="{'cursor-pointer': params.enableSorting}"
|
:class="{'cursor-pointer': params.enableSorting}"
|
||||||
:data-e2e="'e2e-CO-TableHeader-' + params.column.colId "
|
:data-e2e="'e2e-CO-TableHeader-' + params.column.colId "
|
||||||
@click="onSortRequested((activeSort == 'asc' ? 'desc' : 'asc'), $event)">
|
@click="onSortRequested((activeSort == 'asc' ? 'desc' : 'asc'), $event)">
|
||||||
|
|
@ -12,6 +12,9 @@ export default {
|
||||||
<div v-if="activeSort == 'desc'" class="customSortUpLabel text-sn-black">
|
<div v-if="activeSort == 'desc'" class="customSortUpLabel text-sn-black">
|
||||||
<i class="sn-icon sn-icon-sort-down"></i>
|
<i class="sn-icon sn-icon-sort-down"></i>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="activeSort == null && params.enableSorting" class="text-sn-black tw-hidden group-hover:block">
|
||||||
|
<i class="sn-icon sn-icon-sort"></i>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
data() {
|
data() {
|
||||||
|
|
|
||||||
|
|
@ -3715,6 +3715,7 @@ en:
|
||||||
remove_access: "Remove access"
|
remove_access: "Remove access"
|
||||||
grant_access: "Grant new access"
|
grant_access: "Grant new access"
|
||||||
you: "you"
|
you: "you"
|
||||||
|
no_results: "No results"
|
||||||
create:
|
create:
|
||||||
success: "You have successfully granted access to %{member_name}."
|
success: "You have successfully granted access to %{member_name}."
|
||||||
failure: "Something went wrong"
|
failure: "Something went wrong"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue