mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-24 11:09:40 +08:00
Merge pull request #8698 from andrej-scinote/aj_SCI_12157
Remove not needed user roles path [SCI-12157]
This commit is contained in:
commit
2e0ff86063
7 changed files with 6 additions and 51 deletions
|
|
@ -82,13 +82,9 @@
|
|||
id: data.data.id,
|
||||
type: data.data.type
|
||||
};
|
||||
const { rolesUrl } = container.dataset;
|
||||
const params = {
|
||||
object,
|
||||
roles_path: rolesUrl
|
||||
};
|
||||
|
||||
const modal = $('#accessModalComponent').data('accessModal');
|
||||
modal.params = params;
|
||||
modal.params = { object };
|
||||
modal.open();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ module Dashboard
|
|||
end
|
||||
|
||||
def create_project_params
|
||||
params.require(:project).permit(:name, :visibility, :default_public_user_role_id)
|
||||
params.require(:project).permit(:name)
|
||||
end
|
||||
|
||||
def create_experiment_params
|
||||
|
|
|
|||
|
|
@ -22,24 +22,6 @@
|
|||
@change="changeProject"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="selectedProject == 0">
|
||||
<div class="flex gap-2 text-xs items-center">
|
||||
<div class="sci-checkbox-container">
|
||||
<input type="checkbox" class="sci-checkbox" v-model="publicProject" value="visible"/>
|
||||
<span class="sci-checkbox-label"></span>
|
||||
</div>
|
||||
<span v-html="i18n.t('projects.index.modal_new_project.visibility_html')"></span>
|
||||
</div>
|
||||
<div class="mt-4" :class="{'hidden': !publicProject}">
|
||||
<label class="sci-label">{{ i18n.t("dashboard.create_task_modal.user_role") }}</label>
|
||||
<SelectDropdown
|
||||
:options="userRoles"
|
||||
:value="defaultRole"
|
||||
@change="changeRole"
|
||||
:placeholder="i18n.t('dashboard.create_task_modal.user_role_placeholder')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<label class="sci-label">{{ i18n.t("dashboard.create_task_modal.experiment") }}</label>
|
||||
<SelectDropdown
|
||||
|
|
@ -94,7 +76,6 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
this.fetchUserRoles();
|
||||
$('#create-task-modal').on('hidden.bs.modal', () => {
|
||||
this.$emit('close');
|
||||
});
|
||||
|
|
@ -113,10 +94,6 @@ export default {
|
|||
type: String,
|
||||
required: true
|
||||
},
|
||||
rolesUrl: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
createUrl: {
|
||||
type: String,
|
||||
required: true
|
||||
|
|
@ -130,10 +107,7 @@ export default {
|
|||
experiments: [],
|
||||
selectedExperiment: null,
|
||||
newExperimentName: '',
|
||||
userRoles: [],
|
||||
taskName: '',
|
||||
publicProject: false,
|
||||
defaultRole: null,
|
||||
creatingTask: false
|
||||
};
|
||||
},
|
||||
|
|
@ -153,9 +127,7 @@ export default {
|
|||
},
|
||||
project: {
|
||||
id: this.selectedProject,
|
||||
name: this.newProjectName,
|
||||
visibility: (this.publicProject ? 'visible' : 'hidden'),
|
||||
default_public_user_role_id: this.defaultRole
|
||||
name: this.newProjectName
|
||||
}
|
||||
})
|
||||
.then((response) => {
|
||||
|
|
@ -163,9 +135,6 @@ export default {
|
|||
window.location.href = response.data.my_module_path;
|
||||
});
|
||||
},
|
||||
changeRole(value) {
|
||||
this.defaultRole = value;
|
||||
},
|
||||
changeProject(value, label) {
|
||||
this.selectedProject = value;
|
||||
this.newProjectName = label;
|
||||
|
|
@ -204,12 +173,6 @@ export default {
|
|||
this.selectedExperiment = null;
|
||||
this.newExperimentName = '';
|
||||
},
|
||||
fetchUserRoles() {
|
||||
axios.get(this.rolesUrl)
|
||||
.then((response) => {
|
||||
this.userRoles = response.data.data;
|
||||
});
|
||||
},
|
||||
focusInput() {
|
||||
this.$refs.taskName.focus();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@
|
|||
<%= link_to t('experiments.canvas.edit.task_access'), nil,
|
||||
class: "openAccessModal",
|
||||
data: {
|
||||
url: my_module_path(@my_module, format: :json),
|
||||
roles_url: user_roles_projects_path
|
||||
url: my_module_path(@my_module, format: :json)
|
||||
}
|
||||
%>
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
projects-url="<%= dashboard_quick_start_project_filter_path %>"
|
||||
experiments-url="<%= dashboard_quick_start_experiment_filter_path %>"
|
||||
create-url="<%= dashboard_quick_start_create_task_path %>"
|
||||
roles-url="<%= user_roles_projects_path %>"
|
||||
></dashboard-new-task>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@
|
|||
<action-toolbar actions-url="<%= actions_toolbar_my_modules_url %>" />
|
||||
</div>
|
||||
|
||||
<div id="accessModalContainer" class="vue-access-modal"
|
||||
data-roles-url="<%= user_roles_projects_path %>">
|
||||
<div id="accessModalContainer" class="vue-access-modal">
|
||||
<div ref="accessModal" id="accessModalComponent"></div>
|
||||
<teleport to="body">
|
||||
<access-modal
|
||||
|
|
|
|||
|
|
@ -165,7 +165,6 @@
|
|||
</div>
|
||||
<div id="accessModalContainer" class="vue-access-modal"
|
||||
data-url="<%= my_module_path(@my_module, format: :json) %>"
|
||||
data-roles-url="<%= user_roles_projects_path %>"
|
||||
>
|
||||
<div ref="accessModal" id="accessModalComponent"></div>
|
||||
<teleport to="body">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue