@@ -17,6 +35,7 @@ function Header({ current, onCancel, onSave, isNew }: any) {
+ {!isNew ? : null}
>
);
diff --git a/frontend/app/components/FFlags/NewFFlag/Helpers.tsx b/frontend/app/components/FFlags/NewFFlag/Helpers.tsx
index a1c2ecbaa..652fd80bc 100644
--- a/frontend/app/components/FFlags/NewFFlag/Helpers.tsx
+++ b/frontend/app/components/FFlags/NewFFlag/Helpers.tsx
@@ -4,15 +4,15 @@ import { QuestionMarkHint } from 'UI';
function Rollout() {
return (
- Payload
(Optional)
+
+ Payload (Optional)
)
}
diff --git a/frontend/app/components/FFlags/NewFFlag/NewFFlag.tsx b/frontend/app/components/FFlags/NewFFlag/NewFFlag.tsx
index 23936c307..c7e4d7abd 100644
--- a/frontend/app/components/FFlags/NewFFlag/NewFFlag.tsx
+++ b/frontend/app/components/FFlags/NewFFlag/NewFFlag.tsx
@@ -23,6 +23,9 @@ function NewFFlag({ siteId, fflagId }: { siteId: string; fflagId?: string }) {
} else {
featureFlagsStore.initNewFlag();
}
+ return () => {
+ featureFlagsStore.setCurrentFlag(null);
+ }
}, [fflagId]);
const current = featureFlagsStore.currentFflag;
@@ -47,7 +50,6 @@ function NewFFlag({ siteId, fflagId }: { siteId: string; fflagId?: string }) {
};
const onCancel = () => {
- featureFlagsStore.setCurrentFlag(null);
history.push(withSiteId(fflags(), siteId));
};
@@ -90,7 +92,7 @@ function NewFFlag({ siteId, fflagId }: { siteId: string; fflagId?: string }) {
/>
-
+
diff --git a/frontend/app/components/Overview/Overview.tsx b/frontend/app/components/Overview/Overview.tsx
index 2014ab905..4e5d0be78 100644
--- a/frontend/app/components/Overview/Overview.tsx
+++ b/frontend/app/components/Overview/Overview.tsx
@@ -9,8 +9,9 @@ import OverviewMenu from 'Shared/OverviewMenu';
import FFlagsList from 'Components/FFlags';
import NewFFlag from 'Components/FFlags/NewFFlag';
import { Switch, Route } from 'react-router';
-import { sessions, fflags, withSiteId, newFFlag, fflag, notes, bookmarks } from 'App/routes';
+import { sessions, fflags, withSiteId, newFFlag, fflag, notes, fflagRead, bookmarks } from 'App/routes';
import { withRouter, RouteComponentProps } from 'react-router-dom';
+import FlagView from 'Components/FFlags/FlagView/FlagView'
// @ts-ignore
interface IProps extends RouteComponentProps {
@@ -50,6 +51,9 @@ function Overview({ match: { params } }: IProps) {
+
+
+
diff --git a/frontend/app/mstore/types/FeatureFlag.ts b/frontend/app/mstore/types/FeatureFlag.ts
index cbd8a5b22..9b6f689c2 100644
--- a/frontend/app/mstore/types/FeatureFlag.ts
+++ b/frontend/app/mstore/types/FeatureFlag.ts
@@ -106,9 +106,14 @@ export default class FeatureFlag {
...data,
isSingleOption: data ? data.flagType === 'single' : true,
conditions: data?.conditions?.map(c => new Conditions(c)) || [new Conditions()],
- variants: data?.flagType === 'multi' ? data?.variants?.map((v, i) => new Variant(i, v)) : [new Variant(1)],
+ variants: data?.flagType === 'multi' ? data?.variants?.map((v, i) => new Variant(i, v)) : [],
});
+ if (this.variants?.length === 0) {
+ this.addVariant()
+ this.addVariant()
+ this.hasChanged = false
+ }
makeAutoObservable(this);
}
diff --git a/frontend/app/routes.js b/frontend/app/routes.js
index 0337820e8..c597c46a7 100644
--- a/frontend/app/routes.js
+++ b/frontend/app/routes.js
@@ -86,6 +86,8 @@ export const sessions = params => queried('/sessions', params);
export const fflags = params => queried('/feature-flags', params);
export const newFFlag = () => '/feature-flags/create';
export const fflag = (id = ':fflagId', hash) => hashed(`/feature-flags/${ id }`, hash);
+export const fflagRead = (id = ':fflagId', hash) => hashed(`/feature-flags/get/${ id }`, hash);
+
export const notes = params => queried('/notes', params);
export const bookmarks = params => queried('/bookmarks', params);
export const assist = params => queried('/assist', params);