Commit 9bf8ead9 authored by Julien BOUYER's avatar Julien BOUYER
Browse files

UNOTOPLYS-164 feat(screen) : ajout d'un écran

parent edfbb84d
......@@ -24,4 +24,12 @@ export default class Panel extends Vue {
current: true,
},
];
public get idWorkspace(): string {
return this.$store.getters.idWorkspace;
}
public get idForm(): string {
return this.$store.getters.idForm;
}
}
......@@ -2,12 +2,13 @@
<aside class="bg-white border-r">
<div class="sticky top-0 left-0">
<div class="flex items-center mb-2 border-b">
<button
<router-link
class="flex items-center flex-grow p-2 text-sm text-blue-600 transition border-r hover:bg-blue-600 hover:text-white focus:ring hover:border-blue-600"
:to="{ name: 'ScreenCreateComponent', params: { idWorkspace: idWorkspace, idForm: idForm } }"
>
<icon name="add" />
<span class="ml-2">Ajouter un écran</span>
</button>
<span class="ml-2" v-text="$t('screen.add')"></span>
</router-link>
<button class="flex items-center p-2 text-red-600 transition hover:bg-red-600 focus:ring hover:text-red-100">
<icon name="trash" />
</button>
......
......@@ -7,6 +7,8 @@ import VueCookie from 'vue-cookie';
import Vue2Filters from 'vue2-filters';
import { formStore } from '@/shared/config/store/admin/form-store';
import { screenStore } from '@/shared/config/store/admin/screen-store';
import { workspaceStore } from '@/shared/config/store/admin/workspace-store';
import { accountStore } from '@/shared/config/store/common/account-store';
import { alertStore } from '@/shared/config/store/common/alert-store';
import { translationStore } from '@/shared/config/store/common/translation-store';
......@@ -61,6 +63,8 @@ export function initVueXStore(vue) {
return new Vuex.Store({
modules: {
formStore,
screenStore,
workspaceStore,
accountStore,
alertStore,
translationStore,
......
......@@ -2,25 +2,20 @@ import { Module } from 'vuex';
export const formStore: Module<any, any> = {
state: {
idForm: 0,
form: null,
screen: null,
screenList: [],
},
getters: {
idForm: state => state.idForm,
form: state => state.form,
screen: state => state.screen,
screenList: state => state.screenList,
},
actions: {},
mutations: {
setIdForm(state, idForm) {
state.idForm = idForm;
},
setForm(state, form) {
state.form = form;
},
setScreen(state, screen) {
state.screen = screen;
},
setScreenList(state, screenList) {
state.screenList = screenList;
},
},
};
import { Module } from 'vuex';
export const screenStore: Module<any, any> = {
state: {
screen: null,
screenList: [],
},
getters: {
screen: state => state.screen,
screenList: state => state.screenList,
},
actions: {},
mutations: {
setScreen(state, screen) {
state.screen = screen;
},
setScreenList(state, screenList) {
state.screenList = screenList;
},
},
};
import { Module } from 'vuex';
export const workspaceStore: Module<any, any> = {
state: {
idWorkspace: 0,
},
getters: {
idWorkspace: state => state.idWorkspace,
},
actions: {},
mutations: {
setIdWorkspace(state, idWorkspace) {
state.idWorkspace = idWorkspace;
},
},
};
......@@ -19,7 +19,8 @@ export default class FormEdit extends Vue {
beforeRouteEnter(to, from, next) {
next(vm => {
// récupération de l'idScreen et appel du service
vm.$store.commit('setIdWorkspace', to.params.idWorkspace);
vm.$store.commit('setIdForm', to.params.idForm);
});
}
}
......@@ -2,20 +2,19 @@ import Vue from 'vue';
import Component from 'vue-class-component';
import OaInput from '@/components/forms/input/oa-input.vue';
import OaTextarea from '@/components/forms/textarea/oa-textarea.vue';
import {Inject} from 'vue-property-decorator';
import { Inject } from 'vue-property-decorator';
import WorkspaceService from '@/entities/workspace/workspace.service';
import Workspace from '@/shared/model/workspace.model';
import { Workspace } from '@/shared/model/workspace.model';
import OaButton from '@/components/button/oa-button.vue';
@Component({
components: {
OaInput,
OaTextarea,
OaButton
}
OaButton,
},
})
export default class WorkspaceCreation extends Vue {
/**
* Service des workspaces.
*/
......@@ -27,7 +26,6 @@ export default class WorkspaceCreation extends Vue {
public description: String;
public save(): void {
let workspace = new Workspace();
workspace.name = this.name;
workspace.description = this.description;
......
......@@ -31,5 +31,8 @@
"reference": "reference du screen pour constituer l&#39;URL"
}
}
},
"screen": {
"add": "Ajouter un écran"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment