mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix workflow redirection in accompanying period work edit
This commit is contained in:
parent
170ce2d51c
commit
829bf01eca
@ -12,6 +12,7 @@
|
|||||||
:relatedEntityClass="this.relatedEntityClass"
|
:relatedEntityClass="this.relatedEntityClass"
|
||||||
:relatedEntityId="this.relatedEntityId"
|
:relatedEntityId="this.relatedEntityId"
|
||||||
:workflowsAvailables="workflowsAvailables"
|
:workflowsAvailables="workflowsAvailables"
|
||||||
|
@go-to-generate-workflow="goToGenerateWorkflow"
|
||||||
></pick-workflow>
|
></pick-workflow>
|
||||||
|
|
||||||
<teleport to="body">
|
<teleport to="body">
|
||||||
@ -34,6 +35,8 @@
|
|||||||
:relatedEntityClass="this.relatedEntityClass"
|
:relatedEntityClass="this.relatedEntityClass"
|
||||||
:relatedEntityId="this.relatedEntityId"
|
:relatedEntityId="this.relatedEntityId"
|
||||||
:workflowsAvailables="workflowsAvailables"
|
:workflowsAvailables="workflowsAvailables"
|
||||||
|
:preventDefaultMoveToGenerate="this.$props.preventDefaultMoveToGenerate"
|
||||||
|
@go-to-generate-workflow="this.goToGenerateWorkflow"
|
||||||
></pick-workflow>
|
></pick-workflow>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -53,6 +56,7 @@ export default {
|
|||||||
PickWorkflow,
|
PickWorkflow,
|
||||||
ListWorkflowVue
|
ListWorkflowVue
|
||||||
},
|
},
|
||||||
|
emits: ['goToGenerateWorkflow'],
|
||||||
props: {
|
props: {
|
||||||
workflows: {
|
workflows: {
|
||||||
type: Array,
|
type: Array,
|
||||||
@ -73,9 +77,14 @@ export default {
|
|||||||
workflowsAvailables: {
|
workflowsAvailables: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
}
|
},
|
||||||
|
preventDefaultMoveToGenerate: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
modal: {
|
modal: {
|
||||||
showModal: false,
|
showModal: false,
|
||||||
@ -95,6 +104,10 @@ export default {
|
|||||||
openModal() {
|
openModal() {
|
||||||
this.modal.showModal = true;
|
this.modal.showModal = true;
|
||||||
},
|
},
|
||||||
|
goToGenerateWorkflow(data) {
|
||||||
|
console.log('go to generate workflow intercepted');
|
||||||
|
this.$emit('goToGenerateWorkflow', data);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
i18n: {
|
i18n: {
|
||||||
messages: {
|
messages: {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu" aria-labelledby="createWorkflowButton">
|
<ul class="dropdown-menu" aria-labelledby="createWorkflowButton">
|
||||||
<li v-for="w in workflowsAvailables" :key="w.name">
|
<li v-for="w in workflowsAvailables" :key="w.name">
|
||||||
<a class="dropdown-item" :href="makeLink(w.name)" @click="goToGenerateWorkflow($event, w.name)">{{ w.text }}</a>
|
<a class="dropdown-item" :href="makeLink(w.name)" @click.prevent="goToGenerateWorkflow($event, w.name)">{{ w.text }}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -31,7 +31,12 @@ export default {
|
|||||||
workflowsAvailables: {
|
workflowsAvailables: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: true,
|
required: true,
|
||||||
}
|
},
|
||||||
|
preventDefaultMoveToGenerate: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
emits: ['goToGenerateWorkflow'],
|
emits: ['goToGenerateWorkflow'],
|
||||||
methods: {
|
methods: {
|
||||||
@ -39,6 +44,12 @@ export default {
|
|||||||
return buildLinkCreate(workflowName, this.relatedEntityClass, this.relatedEntityId);
|
return buildLinkCreate(workflowName, this.relatedEntityClass, this.relatedEntityId);
|
||||||
},
|
},
|
||||||
goToGenerateWorkflow(event, workflowName) {
|
goToGenerateWorkflow(event, workflowName) {
|
||||||
|
console.log('goToGenerateWorkflow', event, workflowName);
|
||||||
|
|
||||||
|
if (!this.$props.preventDefaultMoveToGenerate) {
|
||||||
|
event.target.click();
|
||||||
|
}
|
||||||
|
|
||||||
this.$emit('goToGenerateWorkflow', {event, workflowName, link: this.makeLink(workflowName)});
|
this.$emit('goToGenerateWorkflow', {event, workflowName, link: this.makeLink(workflowName)});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -251,6 +251,7 @@
|
|||||||
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork"
|
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork"
|
||||||
:relatedEntityId="this.work.id"
|
:relatedEntityId="this.work.id"
|
||||||
:workflowsAvailables="this.work.workflows_availables"
|
:workflowsAvailables="this.work.workflows_availables"
|
||||||
|
@go-to-generate-workflow="goToGenerateWorkflow"
|
||||||
></list-workflow-modal>
|
></list-workflow-modal>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -284,6 +285,7 @@ import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
|
|||||||
import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue';
|
import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue';
|
||||||
import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue';
|
import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue';
|
||||||
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
|
import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue';
|
||||||
|
import {buildLinkCreate} from 'ChillMainAssets/lib/entity-workflow/api.js';
|
||||||
|
|
||||||
const i18n = {
|
const i18n = {
|
||||||
messages: {
|
messages: {
|
||||||
@ -334,7 +336,6 @@ export default {
|
|||||||
ListWorkflowModal,
|
ListWorkflowModal,
|
||||||
OnTheFly,
|
OnTheFly,
|
||||||
PickWorkflow,
|
PickWorkflow,
|
||||||
OnTheFly,
|
|
||||||
PersonText,
|
PersonText,
|
||||||
},
|
},
|
||||||
i18n,
|
i18n,
|
||||||
@ -461,6 +462,15 @@ export default {
|
|||||||
removeThirdParty(t) {
|
removeThirdParty(t) {
|
||||||
this.$store.commit('removeThirdParty', t);
|
this.$store.commit('removeThirdParty', t);
|
||||||
},
|
},
|
||||||
|
goToGenerateWorkflow({link}) {
|
||||||
|
console.log('save before leave to generate workflow')
|
||||||
|
const callback = (data) => {
|
||||||
|
window.location.assign(link);
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.$store.dispatch('submit', callback)
|
||||||
|
.catch(e => { console.log(e); throw e; });
|
||||||
|
},
|
||||||
submit() {
|
submit() {
|
||||||
this.$store.dispatch('submit');
|
this.$store.dispatch('submit');
|
||||||
},
|
},
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
<list-workflow-modal
|
<list-workflow-modal
|
||||||
:workflows="evaluation.workflows"
|
:workflows="evaluation.workflows"
|
||||||
:allowCreate="true"
|
:allowCreate="true"
|
||||||
relatedEntityClass="faked"
|
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation"
|
||||||
:relatedEntityId="evaluation.id"
|
:relatedEntityId="evaluation.id"
|
||||||
:workflowsAvailables="evaluation.workflows_availables"
|
:workflowsAvailables="evaluation.workflows_availables"
|
||||||
@goToGenerateWorkflow="goToGenerateWorkflow"
|
@go-to-generate-workflow="goToGenerateWorkflow"
|
||||||
></list-workflow-modal>
|
></list-workflow-modal>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
@ -106,8 +106,7 @@ export default {
|
|||||||
this.toggleEditEvaluation();
|
this.toggleEditEvaluation();
|
||||||
},
|
},
|
||||||
goToGenerateWorkflow({event, link, workflowName}) {
|
goToGenerateWorkflow({event, link, workflowName}) {
|
||||||
event.preventDefault();
|
console.log('goToGenerate in evaluation', event, link, workflowName);
|
||||||
console.log(event, link, workflowName);
|
|
||||||
|
|
||||||
const callback = (data) => {
|
const callback = (data) => {
|
||||||
let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id;
|
let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id;
|
||||||
|
@ -210,6 +210,7 @@ const store = createStore({
|
|||||||
editEvaluation: true,
|
editEvaluation: true,
|
||||||
workflows_availables: state.work.workflows_availables_evaluation,
|
workflows_availables: state.work.workflows_availables_evaluation,
|
||||||
documents: [],
|
documents: [],
|
||||||
|
workflows: [],
|
||||||
};
|
};
|
||||||
state.evaluationsPicked.push(e);
|
state.evaluationsPicked.push(e);
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user