Skip to content
Snippets Groups Projects
Commit be3d50fd authored by Timothee P's avatar Timothee P :sunflower:
Browse files

disable filters while loading results and re-enable set forbidden project at created

parent 0f49f5aa
No related branches found
No related tags found
1 merge request!786REDMINE_ISSUE-19722 | Créer des filtres pour les attributs projet sur l'accueil de l'application && REDMINE_ISSUE-21098 | La recherche textuelle n'est pas conservé au changement de page
......@@ -15,6 +15,8 @@
:clear-on-select="false"
:preserve-search="true"
:multiple="multiple"
:loading="loading"
:disabled="loading"
@select="select"
@remove="remove"
@close="close"
......@@ -65,6 +67,10 @@ export default {
return [];
}
},
loading: {
type: Boolean,
default: false
},
multiple: {
type: Boolean,
default: false
......
......@@ -39,11 +39,13 @@
<DropdownMenuItem
v-else-if="!filter.id"
:options="filter.options"
:loading="loading"
v-on="$listeners"
/>
<DropdownMenuItem
v-else
:options="filter.options"
:loading="loading"
:multiple="isMultiple(filter)"
:current-selection="attributesFilter[filter.id]"
:default-filter="filter.default_filter_enabled ? filter.default_filter_value : null"
......@@ -70,6 +72,13 @@ export default {
SearchProjects,
},
props: {
loading: {
type: Boolean,
default: false
},
},
data() {
return {
displayFilters: false,
......
......@@ -35,6 +35,7 @@
<!-- FILTRES DES PROJETS -->
<ProjectsMenu
:loading="loading"
@filter="setProjectsFilters"
@getData="getData"
@loading="setLoader"
......@@ -134,7 +135,7 @@ export default {
this.SET_CURRENT_PAGE(1);
this.$store.commit('projects/SET_PROJECT', null);
this.displayForbiddenProjects = this.configuration.DISPLAY_FORBIDDEN_PROJECTS_DEFAULT;
//this.setForbiddenProjectsFilter();
this.setForbiddenProjectsFilter(true);
},
methods: {
......@@ -147,7 +148,6 @@ export default {
]),
getData(page) {
//console.trace('getData', this.filters);
this.loading = true;
this.GET_PROJECTS({ page })
.then(() => {
......@@ -166,10 +166,11 @@ export default {
this.getData(e);
},
setProjectsFilters(e) {
setProjectsFilters(e, noUpdate) {
this.SET_PROJECTS_FILTER(e);
// TODO disable only at load, reenable for manual selection...
this.getData();
if (!noUpdate) {
this.getData();
}
},
toggleForbiddenProjects(e) {
......@@ -177,11 +178,11 @@ export default {
this.setForbiddenProjectsFilter();
},
setForbiddenProjectsFilter() {
setForbiddenProjectsFilter(noUpdate) {
this.setProjectsFilters({
filter: 'accessible',
value: this.displayForbiddenProjects ? 'true' : null
});
}, noUpdate);
},
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment