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 @@ ...@@ -15,6 +15,8 @@
:clear-on-select="false" :clear-on-select="false"
:preserve-search="true" :preserve-search="true"
:multiple="multiple" :multiple="multiple"
:loading="loading"
:disabled="loading"
@select="select" @select="select"
@remove="remove" @remove="remove"
@close="close" @close="close"
...@@ -65,6 +67,10 @@ export default { ...@@ -65,6 +67,10 @@ export default {
return []; return [];
} }
}, },
loading: {
type: Boolean,
default: false
},
multiple: { multiple: {
type: Boolean, type: Boolean,
default: false default: false
......
...@@ -39,11 +39,13 @@ ...@@ -39,11 +39,13 @@
<DropdownMenuItem <DropdownMenuItem
v-else-if="!filter.id" v-else-if="!filter.id"
:options="filter.options" :options="filter.options"
:loading="loading"
v-on="$listeners" v-on="$listeners"
/> />
<DropdownMenuItem <DropdownMenuItem
v-else v-else
:options="filter.options" :options="filter.options"
:loading="loading"
:multiple="isMultiple(filter)" :multiple="isMultiple(filter)"
:current-selection="attributesFilter[filter.id]" :current-selection="attributesFilter[filter.id]"
:default-filter="filter.default_filter_enabled ? filter.default_filter_value : null" :default-filter="filter.default_filter_enabled ? filter.default_filter_value : null"
...@@ -70,6 +72,13 @@ export default { ...@@ -70,6 +72,13 @@ export default {
SearchProjects, SearchProjects,
}, },
props: {
loading: {
type: Boolean,
default: false
},
},
data() { data() {
return { return {
displayFilters: false, displayFilters: false,
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<!-- FILTRES DES PROJETS --> <!-- FILTRES DES PROJETS -->
<ProjectsMenu <ProjectsMenu
:loading="loading"
@filter="setProjectsFilters" @filter="setProjectsFilters"
@getData="getData" @getData="getData"
@loading="setLoader" @loading="setLoader"
...@@ -134,7 +135,7 @@ export default { ...@@ -134,7 +135,7 @@ export default {
this.SET_CURRENT_PAGE(1); this.SET_CURRENT_PAGE(1);
this.$store.commit('projects/SET_PROJECT', null); this.$store.commit('projects/SET_PROJECT', null);
this.displayForbiddenProjects = this.configuration.DISPLAY_FORBIDDEN_PROJECTS_DEFAULT; this.displayForbiddenProjects = this.configuration.DISPLAY_FORBIDDEN_PROJECTS_DEFAULT;
//this.setForbiddenProjectsFilter(); this.setForbiddenProjectsFilter(true);
}, },
methods: { methods: {
...@@ -147,7 +148,6 @@ export default { ...@@ -147,7 +148,6 @@ export default {
]), ]),
getData(page) { getData(page) {
//console.trace('getData', this.filters);
this.loading = true; this.loading = true;
this.GET_PROJECTS({ page }) this.GET_PROJECTS({ page })
.then(() => { .then(() => {
...@@ -166,10 +166,11 @@ export default { ...@@ -166,10 +166,11 @@ export default {
this.getData(e); this.getData(e);
}, },
setProjectsFilters(e) { setProjectsFilters(e, noUpdate) {
this.SET_PROJECTS_FILTER(e); this.SET_PROJECTS_FILTER(e);
// TODO disable only at load, reenable for manual selection... if (!noUpdate) {
this.getData(); this.getData();
}
}, },
toggleForbiddenProjects(e) { toggleForbiddenProjects(e) {
...@@ -177,11 +178,11 @@ export default { ...@@ -177,11 +178,11 @@ export default {
this.setForbiddenProjectsFilter(); this.setForbiddenProjectsFilter();
}, },
setForbiddenProjectsFilter() { setForbiddenProjectsFilter(noUpdate) {
this.setProjectsFilters({ this.setProjectsFilters({
filter: 'accessible', filter: 'accessible',
value: this.displayForbiddenProjects ? 'true' : null 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