mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
add a spinner
This commit is contained in:
parent
3abfdbf6fd
commit
aa4a9e874a
@ -6,6 +6,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="hasSocialIssuePicked">
|
<div v-if="hasSocialIssuePicked">
|
||||||
|
<h2>{{ $t('pick_an_action') }}</h2>
|
||||||
|
|
||||||
<vue-multiselect
|
<vue-multiselect
|
||||||
v-model="socialActionPicked"
|
v-model="socialActionPicked"
|
||||||
label="text"
|
label="text"
|
||||||
@ -17,11 +19,30 @@
|
|||||||
></vue-multiselect>
|
></vue-multiselect>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="isLoadingSocialActions">
|
||||||
|
<p>spinner</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-if="hasSocialActionPicked">
|
<div v-if="hasSocialActionPicked">
|
||||||
<p><label>{{ $t('start_date') }}</label> <input type="date" v-model="startDate" /></p>
|
<p><label>{{ $t('start_date') }}</label> <input type="date" v-model="startDate" /></p>
|
||||||
<p><label>{{ $t('end_date') }}</label> <input type="date" v-model="endDate" /></p>
|
<p><label>{{ $t('end_date') }}</label> <input type="date" v-model="endDate" /></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div >
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li class="cancel">
|
||||||
|
<a href="#" class="sc-button bt-cancel">
|
||||||
|
{{ $t('Cancel') }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li v-if="hasSocialActionPicked">
|
||||||
|
<button class="sc-button bt-save" @click="submit">
|
||||||
|
{{ $t('Save') }}
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
@ -35,6 +56,11 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
VueMultiselect,
|
VueMultiselect,
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
submit() {
|
||||||
|
this.$store.dispatch('submit');
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState([
|
...mapState([
|
||||||
'socialIssues',
|
'socialIssues',
|
||||||
@ -43,6 +69,7 @@ export default {
|
|||||||
...mapGetters([
|
...mapGetters([
|
||||||
'hasSocialIssuePicked',
|
'hasSocialIssuePicked',
|
||||||
'hasSocialActionPicked',
|
'hasSocialActionPicked',
|
||||||
|
'isLoadingSocialActions',
|
||||||
]),
|
]),
|
||||||
socialIssuePicked: {
|
socialIssuePicked: {
|
||||||
get() {
|
get() {
|
||||||
|
@ -16,6 +16,7 @@ const store = createStore({
|
|||||||
socialActionPicked: null,
|
socialActionPicked: null,
|
||||||
startDate: new Date(),
|
startDate: new Date(),
|
||||||
endDate: null,
|
endDate: null,
|
||||||
|
isLoadingSocialActions: false,
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
hasSocialActionPicked(state) {
|
hasSocialActionPicked(state) {
|
||||||
@ -26,6 +27,9 @@ const store = createStore({
|
|||||||
console.log(state.socialIssuePicked);
|
console.log(state.socialIssuePicked);
|
||||||
return null !== state.socialIssuePicked;
|
return null !== state.socialIssuePicked;
|
||||||
},
|
},
|
||||||
|
isLoadingSocialActions(state) {
|
||||||
|
return state.isLoadingSocialActions;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
setSocialActionsReachables(state, actions) {
|
setSocialActionsReachables(state, actions) {
|
||||||
@ -43,12 +47,16 @@ const store = createStore({
|
|||||||
state.socialIssuePicked = state.socialIssues
|
state.socialIssuePicked = state.socialIssues
|
||||||
.find(e => e.id === socialIssueId);
|
.find(e => e.id === socialIssueId);
|
||||||
},
|
},
|
||||||
|
setIsLoadingSocialActions(state, s) {
|
||||||
|
state.isLoadingSocialActions = s;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
pickSocialIssue({ commit }, payload) {
|
pickSocialIssue({ commit }, payload) {
|
||||||
console.log('pick social issue');
|
console.log('pick social issue');
|
||||||
console.log(payload);
|
console.log(payload);
|
||||||
|
|
||||||
|
commit('setIsLoadingSocialActions', true);
|
||||||
|
|
||||||
findSocialActionsBySocialIssue(payload).then(
|
findSocialActionsBySocialIssue(payload).then(
|
||||||
(response) => {
|
(response) => {
|
||||||
@ -56,12 +64,19 @@ const store = createStore({
|
|||||||
console.log(response.results);
|
console.log(response.results);
|
||||||
commit('setSocialIssue', payload);
|
commit('setSocialIssue', payload);
|
||||||
commit('setSocialActionsReachables', response.results);
|
commit('setSocialActionsReachables', response.results);
|
||||||
|
commit('setIsLoadingSocialActions', false);
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
submit({ commit, getters }) {
|
||||||
|
console.log('submit');
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export { store };
|
export { store };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user