@equinor/subsurface-app-management 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as r}from"react/jsx-runtime";import{useFeatureToggling as
|
|
1
|
+
import{jsx as e,Fragment as r}from"react/jsx-runtime";import"../../providers/FeatureToggleProvider.js";import{useFeatureToggling as o}from"../../hooks/useFeatureToggling.js";import"@tanstack/react-query";import"../../api/core/OpenAPI.js";const t=({featureKey:t,children:s,fallback:i,showIfKeyIsMissing:n=!0})=>{const{showContent:a}=o({featureKey:t,showIfKeyIsMissing:n});return e(r,a?{children:s}:{children:i??null})};export{t as Feature};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useFeatureToggleContext } from "../providers/FeatureToggleProvider";
|
|
1
2
|
import { useFeatureToggling } from './useFeatureToggling';
|
|
2
3
|
import { useReleaseNotesQuery } from './useReleaseNotesQuery';
|
|
3
|
-
export { useFeatureToggling, useReleaseNotesQuery };
|
|
4
|
+
export { useFeatureToggling, useReleaseNotesQuery, useFeatureToggleContext };
|
|
@@ -2,8 +2,9 @@ interface UseFeatureTogglingOptions {
|
|
|
2
2
|
featureKey: string;
|
|
3
3
|
username?: string;
|
|
4
4
|
showIfKeyIsMissing?: boolean;
|
|
5
|
+
showIfIsLoading?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare function useFeatureToggling({ featureKey, username, showIfKeyIsMissing, }: UseFeatureTogglingOptions): {
|
|
7
|
+
export declare function useFeatureToggling({ featureKey, username, showIfKeyIsMissing, showIfIsLoading, }: UseFeatureTogglingOptions): {
|
|
7
8
|
showContent: boolean;
|
|
8
9
|
};
|
|
9
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as e}from"react";import{useFeatureToggleContext as
|
|
1
|
+
import{useMemo as e}from"react";import{useFeatureToggleContext as t,isUserInActiveUserArray as r}from"../providers/FeatureToggleProvider.js";function n({featureKey:n,username:o,showIfKeyIsMissing:s=!0,showIfIsLoading:a=!1}){const{features:i,isError:u,environmentName:g,isLoading:l}=t();s||console.warn(`[FeatureToggle] Feature: ${n} will not show when the feature toggle is removed! Was this intentional?`);return{showContent:e((()=>{if(!a&&l||u)return!1;const e=i?.find((e=>e.featureKey===n));return e?(void 0===o&&e.activeUsers&&e.activeUsers.length>0&&console.warn(`[FeatureToggle] Feature ${e.featureKey} has activeUsers set but username wasn't provided! Was this intentional?`),!!r(o,e.activeUsers)||e.activeEnvironments.includes(g)):(console.warn(`[FeatureToggle] Feature ${n} was not found, has it been removed?`),s)}),[a,l,u,i,s,n,o,g])}}export{n as useFeatureToggling};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Feature}from"./components/Feature/Feature.js";export{
|
|
1
|
+
export{Feature}from"./components/Feature/Feature.js";export{FeatureToggleProvider,useFeatureToggleContext}from"./providers/FeatureToggleProvider.js";export{useFeatureToggling}from"./hooks/useFeatureToggling.js";export{useReleaseNotesQuery}from"./hooks/useReleaseNotesQuery.js";export{TutorialProvider}from"./providers/TutorialProvider/TutorialProvider.js";export{EnvironmentType}from"./types/Environment.js";export{RELEASENOTE_TYPES_INFORMATION,ReleaseNoteType}from"./types/ReleaseNotes.js";import*as e from"./utils/environment.js";export{e as environment};export{ApiError}from"./api/core/ApiError.js";export{CancelError,CancelablePromise}from"./api/core/CancelablePromise.js";export{OpenAPI_SAM,getPortalToken}from"./api/core/OpenAPI.js";export{request}from"./api/core/request.js";export{ServiceNowUrgency}from"./api/models/ServiceNowUrgency.js";export{TutorialPosition}from"./api/models/TutorialPosition.js";export{PortalService}from"./api/services/PortalService.js";export{ReleaseNotesService}from"./api/services/ReleaseNotesService.js";export{TutorialService}from"./api/services/TutorialService.js";
|