Merge pull request #7336 from wandji20/wb-SCI-10455

Pre-select current user in new task designated user dropdown [SCI-10455]
This commit is contained in:
aignatov-bio 2024-03-20 16:15:12 +01:00 committed by GitHub
commit ea22a3f23e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View file

@ -35,6 +35,7 @@
:createUrl="createUrl"
:projectTagsUrl="projectTagsUrl"
:assignedUsersUrl="assignedUsersUrl"
:currentUserId="currentUserId"
@create="updateTable"
@close="newModalOpen = false" />
<EditModal v-if="editModalObject"
@ -84,6 +85,7 @@ export default {
activePageUrl: { type: String },
archivedPageUrl: { type: String },
currentViewMode: { type: String, required: true },
currentUserId: { type: String, required: true },
createUrl: { type: String, required: true },
userRolesUrl: { type: String, required: true },
canvasUrl: { type: String, required: true },

View file

@ -54,6 +54,7 @@
:option-renderer="usersRenderer"
:label-renderer="usersRenderer"
:multiple="true"
:value="users"
:searchable="true"
:placeholder="i18n.t('experiments.canvas.new_my_module_modal.assigned_users_placeholder')"
:tagsView="true" ></SelectDropdown>
@ -83,7 +84,8 @@ export default {
props: {
createUrl: String,
projectTagsUrl: String,
assignedUsersUrl: String
assignedUsersUrl: String,
currentUserId: { type: String, required: true }
},
components: {
DateTimePicker,
@ -171,6 +173,7 @@ export default {
loadUsers() {
axios.get(this.assignedUsersUrl).then((response) => {
this.allUsers = response.data.data;
this.users = [this.currentUserId];
});
},
tagsRenderer(tag) {

View file

@ -11,6 +11,7 @@
active-page-url="<%= my_modules_path(experiment_id: @experiment, view_mode: :active) %>"
archived-page-url="<%= my_modules_path(experiment_id: @experiment, view_mode: :archived) %>"
current-view-mode="<%= view_mode %>"
current-user-id="<%= current_user.id %>"
assigned-users-url="<%= assigned_users_experiment_path(@experiment) %>"
users-filter-url="<%= users_filter_projects_path %>"v
user-roles-url="<%= user_roles_projects_path %>"