feat(editor): Use website as the main templates repository (#8591)

This commit is contained in:
Milorad FIlipović
2024-02-09 13:47:43 +01:00
committed by GitHub
parent 5ab34fe335
commit 79b09fdf84
12 changed files with 281 additions and 154 deletions

View File

@@ -78,7 +78,7 @@ export const routes = [
{
path: '/',
name: VIEWS.HOMEPAGE,
redirect: (to) => {
redirect: () => {
return { name: VIEWS.WORKFLOWS };
},
meta: {
@@ -130,6 +130,15 @@ export const routes = [
},
middleware: ['authenticated'],
},
beforeEnter: (to, _from, next) => {
const templatesStore = useTemplatesStore();
if (!templatesStore.hasCustomTemplatesHost) {
const id = Array.isArray(to.params.id) ? to.params.id[0] : to.params.id;
window.location.href = templatesStore.getWebsiteTemplatePageURL(id);
} else {
next();
}
},
},
{
path: '/templates/:id/setup',
@@ -180,6 +189,14 @@ export const routes = [
},
middleware: ['authenticated'],
},
beforeEnter: (_to, _from, next) => {
const templatesStore = useTemplatesStore();
if (!templatesStore.hasCustomTemplatesHost) {
window.location.href = templatesStore.getWebsiteTemplateRepositoryURL;
} else {
next();
}
},
},
{
path: '/credentials',