feat: Add onboarding flow (#7212)

Github issue / Community forum post (link here to close automatically):
This commit is contained in:
Mutasem Aldmour
2023-09-25 15:49:36 +02:00
committed by GitHub
parent 60c152dc72
commit 01e9340621
22 changed files with 1373 additions and 18 deletions

View File

@@ -41,6 +41,7 @@ import SettingsSourceControl from './views/SettingsSourceControl.vue';
import SettingsExternalSecrets from './views/SettingsExternalSecrets.vue';
import SettingsAuditLogs from './views/SettingsAuditLogs.vue';
import WorkflowHistory from '@/views/WorkflowHistory.vue';
import WorkflowOnboardingView from '@/views/WorkflowOnboardingView.vue';
import { EnterpriseEditionFeature, VIEWS } from '@/constants';
interface IRouteConfig {
@@ -57,11 +58,11 @@ interface IRouteConfig {
};
}
function getTemplatesRedirect() {
function getTemplatesRedirect(defaultRedirect: VIEWS[keyof VIEWS]) {
const settingsStore = useSettingsStore();
const isTemplatesEnabled: boolean = settingsStore.isTemplatesEnabled;
if (!isTemplatesEnabled) {
return { name: VIEWS.NOT_FOUND };
return { name: defaultRedirect || VIEWS.NOT_FOUND };
}
return false;
@@ -334,6 +335,24 @@ export const routes = [
},
},
},
{
path: '/workflows/onboarding/:id',
name: VIEWS.WORKFLOW_ONBOARDING,
components: {
default: WorkflowOnboardingView,
header: MainHeader,
sidebar: MainSidebar,
},
meta: {
templatesEnabled: true,
getRedirect: () => getTemplatesRedirect(VIEWS.NEW_WORKFLOW),
permissions: {
allow: {
loginStatus: [LOGIN_STATUS.LoggedIn],
},
},
},
},
{
path: '/workflow/new',
name: VIEWS.NEW_WORKFLOW,