|
@@ -36,6 +36,10 @@ export type GuideStoreState = {
|
|
|
* Current step of the current guide
|
|
|
*/
|
|
|
currentStep: number;
|
|
|
+ /**
|
|
|
+ * Hides guides that normally would be shown
|
|
|
+ */
|
|
|
+ forceHide: boolean;
|
|
|
/**
|
|
|
* We force show a guide if the URL contains #assistant
|
|
|
*/
|
|
@@ -59,6 +63,7 @@ export type GuideStoreState = {
|
|
|
};
|
|
|
|
|
|
const defaultState: GuideStoreState = {
|
|
|
+ forceHide: false,
|
|
|
guides: [],
|
|
|
anchors: new Set(),
|
|
|
currentGuide: null,
|
|
@@ -74,6 +79,7 @@ interface GuideStoreDefinition extends StoreDefinition {
|
|
|
|
|
|
onFetchSucceeded(data: GuidesServerData): void;
|
|
|
onRegisterAnchor(target: string): void;
|
|
|
+ onSetForceHide(forceHide: boolean): void;
|
|
|
onUnregisterAnchor(target: string): void;
|
|
|
recordCue(guide: string): void;
|
|
|
state: GuideStoreState;
|
|
@@ -102,6 +108,9 @@ const storeConfig: GuideStoreDefinition = {
|
|
|
this.unsubscribeListeners.push(
|
|
|
this.listenTo(GuideActions.unregisterAnchor, this.onUnregisterAnchor)
|
|
|
);
|
|
|
+ this.unsubscribeListeners.push(
|
|
|
+ this.listenTo(GuideActions.setForceHide, this.onSetForceHide)
|
|
|
+ );
|
|
|
this.unsubscribeListeners.push(
|
|
|
this.listenTo(OrganizationsActions.setActive, this.onSetActiveOrganization)
|
|
|
);
|
|
@@ -190,6 +199,11 @@ const storeConfig: GuideStoreDefinition = {
|
|
|
this.updateCurrentGuide();
|
|
|
},
|
|
|
|
|
|
+ onSetForceHide(forceHide) {
|
|
|
+ this.state.forceHide = forceHide;
|
|
|
+ this.trigger(this.state);
|
|
|
+ },
|
|
|
+
|
|
|
recordCue(guide) {
|
|
|
const user = ConfigStore.get('user');
|
|
|
if (!user) {
|