Commit 24c21542 authored by Kevin Robert's avatar Kevin Robert
Browse files

Merge branch 'develop' into feature/gestion_responsables

parents 11e76946 b063125c
......@@ -9,6 +9,7 @@ import com.unantes.orientactive.service.dto.WorkspaceDTO;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
......@@ -22,6 +23,7 @@ import java.util.Optional;
* Contrôleur permettant de récupérer le fils d'ariane pour un élément.
*/
@RestController
@RequestMapping("/api/filariane")
public class FilArianeController {
/**
......@@ -60,7 +62,7 @@ public class FilArianeController {
*
* @return Le fil d'ariane.
*/
@GetMapping("/home")
@GetMapping("/user/home")
@ResponseBody
public String getUserHome() {
if (PermissionService.currentUserHasAuthority(AuthoritiesConstants.AUTHORITY_VIEW_WORKSPACE)) {
......@@ -78,7 +80,7 @@ public class FilArianeController {
*
* @return Le fil d'ariane.
*/
@GetMapping("/filariane/home")
@GetMapping("/home")
@ResponseBody
public List<FilArianeElement> getFilArianeForHome() {
return Collections.singletonList(filArianeHome);
......@@ -90,7 +92,7 @@ public class FilArianeController {
* @param idWorkspace L'identifiant du workspace.
* @return Le fil d'ariane.
*/
@GetMapping("/filariane/workspace/{idWorkspace}")
@GetMapping("/workspace/{idWorkspace}")
@ResponseBody
public List<FilArianeElement> getFilArianeForWorkspace(@PathVariable("idWorkspace") final Long idWorkspace) {
LinkedList<FilArianeElement> filAriane = new LinkedList<>();
......@@ -105,7 +107,7 @@ public class FilArianeController {
* @param idForm L'identifiant du formulaire.
* @return Le fil d'ariane.
*/
@GetMapping("/filariane/form/{idForm}")
@GetMapping("/form/{idForm}")
@ResponseBody
public List<FilArianeElement> getFilArianeForForm(@PathVariable("idForm") final Long idForm) {
LinkedList<FilArianeElement> filAriane = new LinkedList<>();
......
......@@ -3,7 +3,7 @@
<!-- Navigation -->
<nav>
<ol class="px-4 py-2 border-t border-b md:flex md:py-0 md:text-lg">
<nav-item v-for="(nav, index) in navs()" :key="index" :title="nav.title" :link="nav.path" :current="index == Object.keys(nav).length - 1"/>
<nav-item v-for="(nav, index) in navs()" :key="index" :title="nav.title" :link="nav.path" :current="index === navs().length - 1"/>
</ol>
<!-- Tabs-->
<ul class="px-4 py-2 border-b md:flex md:justify-center md:text-center md:py-0">
......
......@@ -12,7 +12,7 @@ export default [
},
{
path: '/admin/user/creation',
name: 'UserEditComponent',
name: 'UserCreateComponent',
component: UserEditComponent,
meta: { authorities: [Authority.ADMIN] },
},
......
......@@ -19,7 +19,7 @@ export default [
},
{
path: '/admin/workspace/:idWorkspace/form/:idForm/variable/creation',
name: 'VariableEditComponent',
name: 'VariableCreateComponent',
component: VariableEditComponent,
meta: { authorities: [Authority.ADMIN] },
},
......
......@@ -3,15 +3,15 @@ import axios from 'axios';
import VueI18n from 'vue-i18n';
import TranslationService from '@/locale/translation.service';
const filArianeBaseApiUrl = 'filariane';
const filArianeBaseApiUrl = 'api/filariane';
export default class HeaderService {
static readonly TAB_KEY_SETTINGS = 'settings';
static readonly TAB_KEY_VIEW = 'view';
static readonly TAB_KEY_VARIABLE = 'variable';
static readonly TAB_KEY_WORKSPACES = 'workspaces';
static readonly TAB_KEY_USERS= 'users';
public static readonly TAB_KEY_SETTINGS = 'settings';
public static readonly TAB_KEY_VIEW = 'view';
public static readonly TAB_KEY_VARIABLE = 'variable';
public static readonly TAB_KEY_WORKSPACES = 'workspaces';
public static readonly TAB_KEY_USERS= 'users';
constructor(private store: Store<any>, private translationService: TranslationService, private i18n: VueI18n) {
this.translationService.refreshTranslation(this.store.getters.currentLanguage);
......
......@@ -37,7 +37,7 @@ export default class FormSettings extends Vue {
next(vm => {
vm.headerService().filArianeForForm(to.params.idForm);
if (to.params.idForm) {
vm.headerService().updateTabsForFormId(to.params.idWorkspace, to.params.idForm, vm.headerService().TAB_KEY_SETTINGS);
vm.headerService().updateTabsForFormId(to.params.idWorkspace, to.params.idForm, HeaderService.TAB_KEY_SETTINGS);
vm.retrieveForm(to.params.idForm);
vm.retrieveAuthorizedUsers(to.params.idForm);
}
......
......@@ -25,7 +25,7 @@ export default class UserList extends Vue {
beforeRouteEnter(to, from, next) {
next(vm => {
vm.headerService().filArianeForHome();
vm.headerService().updateTabsForAdmin(vm.headerService().TAB_KEY_USERS);
vm.headerService().updateTabsForAdmin(HeaderService.TAB_KEY_USERS);
});
}
......
......@@ -34,7 +34,7 @@ export default class VariableEdit extends Vue {
beforeRouteEnter(to, from, next) {
next(vm => {
vm.headerService().updateTabsForFormId(to.params.idWorkspace, to.params.idForm, vm.headerService().TAB_KEY_VARIABLE);
vm.headerService().updateTabsForFormId(to.params.idWorkspace, to.params.idForm, HeaderService.TAB_KEY_VARIABLE);
let idVariable = to.params.idVariable;
vm.variable.formId = to.params.idForm;
if (idVariable) {
......
......@@ -33,7 +33,7 @@ export default class VariableList extends Vue {
next(vm => {
vm.idForm = to.params.idForm;
vm.idWorkspace = to.params.idWorkspace;
vm.headerService().updateTabsForFormId(vm.idWorkspace, vm.idForm, vm.headerService().TAB_KEY_VARIABLE);
vm.headerService().updateTabsForFormId(vm.idWorkspace, vm.idForm, HeaderService.TAB_KEY_VARIABLE);
vm.loadAll(to.params.idForm)
});
}
......
......@@ -35,7 +35,7 @@ export default class WorkspaceList extends Vue {
beforeRouteEnter(to, from, next) {
next(vm => {
vm.retrieveWorkspace();
vm.headerService().updateTabsForAdmin(vm.headerService().TAB_KEY_WORKSPACES);
vm.headerService().updateTabsForAdmin(HeaderService.TAB_KEY_WORKSPACES);
vm.headerService().filArianeForHome();
});
}
......
......@@ -38,7 +38,7 @@ export default class WorkspaceSettings extends Vue {
if (to.params.idWorkspace) {
vm.retrieveWorkspace(to.params.idWorkspace);
vm.retrieveAuthorizedUsers(to.params.idWorkspace);
vm.headerService().updateTabsForWorkspaceId(to.params.idWorkspace, vm.headerService().TAB_KEY_SETTINGS);
vm.headerService().updateTabsForWorkspaceId(to.params.idWorkspace, HeaderService.TAB_KEY_SETTINGS);
vm.headerService().filArianeForWorkspace(to.params.idWorkspace);
}
});
......
......@@ -38,7 +38,7 @@ export default class WorkspaceView extends Vue {
beforeRouteEnter(to, from, next) {
next(vm => {
vm.retrieveWorkspace(to.params.idWorkspace);
vm.headerService().updateTabsForWorkspaceId(to.params.idWorkspace, vm.headerService().TAB_KEY_VIEW);
vm.headerService().updateTabsForWorkspaceId(to.params.idWorkspace, HeaderService.TAB_KEY_VIEW);
vm.headerService().filArianeForWorkspace(to.params.idWorkspace);
});
}
......@@ -56,4 +56,8 @@ export default class WorkspaceView extends Vue {
})
.catch(() => (this.forms = []));
}
public getFormLink(idForm: string): string {
return `/admin/workspace/${this.idWorkspace}/form/${idForm}/view`;
}
}
......@@ -13,7 +13,7 @@
:title="form.name"
:number="form.number_element"
type="Formulaire"
:link="'/admin/form/' + form.id + '/view'"
:link="getFormLink(form.id)"
></card>
</div>
</section>
......
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