feat(editor): Load fixed template list as experiment (#6632)

* feat(editor): Load fixed template list as experiment

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* Improve templates loading

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* get rid of endResult message

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* Do not lazy-load when fixedListExperiment

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

---------

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
OlegIvaniv
2023-07-10 17:11:42 +02:00
committed by GitHub
parent aa53c46367
commit e9966224ea
8 changed files with 71 additions and 59 deletions

View File

@@ -33,7 +33,6 @@ import VariablesView from '@/views/VariablesView.vue';
import type { IPermissions } from './Interface';
import { LOGIN_STATUS, ROLE } from '@/utils';
import type { RouteConfigSingleView } from 'vue-router/types/router';
import { TEMPLATE_EXPERIMENT, VIEWS } from './constants';
import { useSettingsStore } from './stores/settings.store';
import { useTemplatesStore } from './stores/templates.store';
import { useSSOStore } from './stores/sso.store';
@@ -43,7 +42,7 @@ import SignoutView from '@/views/SignoutView.vue';
import SamlOnboarding from '@/views/SamlOnboarding.vue';
import SettingsSourceControl from './views/SettingsSourceControl.vue';
import SettingsAuditLogs from './views/SettingsAuditLogs.vue';
import { usePostHog } from './stores/posthog.store';
import { VIEWS } from '@/constants';
Vue.use(Router);
@@ -63,12 +62,8 @@ interface IRouteConfig extends RouteConfigSingleView {
function getTemplatesRedirect() {
const settingsStore = useSettingsStore();
const posthog = usePostHog();
const isTemplatesEnabled: boolean = settingsStore.isTemplatesEnabled;
if (
!posthog.isVariantEnabled(TEMPLATE_EXPERIMENT.name, TEMPLATE_EXPERIMENT.variant) &&
!isTemplatesEnabled
) {
if (!isTemplatesEnabled) {
return { name: VIEWS.NOT_FOUND };
}