From 413de693c5234147a39883098495cd114a18d199 Mon Sep 17 00:00:00 2001 From: Marius Tobiassen Bungum Date: Mon, 15 Jul 2024 09:00:53 +0200 Subject: [PATCH 1/3] :label: Added src/api/models types to export --- src/api/models/index.ts | 15 +++++++++++++++ src/types/index.ts | 1 + 2 files changed, 16 insertions(+) create mode 100644 src/api/models/index.ts diff --git a/src/api/models/index.ts b/src/api/models/index.ts new file mode 100644 index 0000000..c7f8de0 --- /dev/null +++ b/src/api/models/index.ts @@ -0,0 +1,15 @@ +export type * from './AccessRole'; +export type * from './Applications'; +export type * from './CustomTutorialStep'; +export type * from './Feature'; +export type * from './FeatureToggleDto'; +export type * from './GenericTutorialStep'; +export type * from './GraphUser'; +export type * from './ReleaseNote'; +export type * from './ReleaseNotePatch'; +export type * from './ServiceNowIncidentAttachmentResponse'; +export type * from './ServiceNowIncidentResponse'; +export type * from './ServiceNowUrgency'; +export type * from './Tutorial'; +export type * from './TutorialPosition'; +export type * from './TutorialStepBase'; diff --git a/src/types/index.ts b/src/types/index.ts index 9c6ab10..22faf00 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,2 +1,3 @@ export * from './Environment'; export * from './ReleaseNotes'; +export type * from 'src/api/models'; From 8e6966c5bfced91a1eabbe3b4b9bc50db19e49f8 Mon Sep 17 00:00:00 2001 From: Marius Tobiassen Bungum Date: Mon, 15 Jul 2024 09:10:07 +0200 Subject: [PATCH 2/3] :package: Export src/api/services/PortalService --- src/api/core/OpenAPI.ts | 2 +- src/api/index.ts | 2 +- src/api/models/{Feature.ts => FeatureAPIType.ts} | 2 +- src/api/models/FeatureToggleDto.ts | 4 ++-- src/api/models/index.ts | 2 +- src/index.ts | 2 ++ src/providers/FeatureToggleProvider.tsx | 6 +++--- 7 files changed, 11 insertions(+), 9 deletions(-) rename src/api/models/{Feature.ts => FeatureAPIType.ts} (89%) diff --git a/src/api/core/OpenAPI.ts b/src/api/core/OpenAPI.ts index 3d17b62..56f5828 100644 --- a/src/api/core/OpenAPI.ts +++ b/src/api/core/OpenAPI.ts @@ -3,7 +3,7 @@ /* eslint-disable */ import type { ApiRequestOptions } from './ApiRequestOptions'; import { auth, environment } from 'src/utils'; -import { CancelablePromise } from 'src/api/core/CancelablePromise'; +import { CancelablePromise } from 'src/api'; import { request as __request } from 'src/api/core/request'; import { getLocalStorage, updateLocalStorage } from 'src/utils/localStorage'; import { JwtPayload, jwtDecode } from 'jwt-decode'; diff --git a/src/api/index.ts b/src/api/index.ts index a95c657..f98c4c7 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,7 +7,7 @@ export { OpenAPI } from './core/OpenAPI'; export { request } from './core/request'; export type { OpenAPIConfig } from './core/OpenAPI'; -export type { Feature } from './models/Feature'; +export type { FeatureAPIType } from './models/FeatureAPIType'; export type { CustomTutorialStep } from './models/CustomTutorialStep'; export type { GenericTutorialStep } from './models/GenericTutorialStep'; export type { Tutorial } from './models/Tutorial'; diff --git a/src/api/models/Feature.ts b/src/api/models/FeatureAPIType.ts similarity index 89% rename from src/api/models/Feature.ts rename to src/api/models/FeatureAPIType.ts index ece4cfc..57cf566 100644 --- a/src/api/models/Feature.ts +++ b/src/api/models/FeatureAPIType.ts @@ -4,7 +4,7 @@ import type { GraphUser } from './GraphUser'; -export type Feature = { +export type FeatureAPIType = { uuid: string; featureKey: string; description: string; diff --git a/src/api/models/FeatureToggleDto.ts b/src/api/models/FeatureToggleDto.ts index 67c36df..bdfdb56 100644 --- a/src/api/models/FeatureToggleDto.ts +++ b/src/api/models/FeatureToggleDto.ts @@ -2,9 +2,9 @@ /* tslint:disable */ /* eslint-disable */ -import type { Feature } from './Feature'; +import type { FeatureAPIType } from './FeatureAPIType'; export type FeatureToggleDto = { applicationName: string; - features: Array; + features: Array; }; diff --git a/src/api/models/index.ts b/src/api/models/index.ts index c7f8de0..5130a50 100644 --- a/src/api/models/index.ts +++ b/src/api/models/index.ts @@ -1,7 +1,7 @@ export type * from './AccessRole'; export type * from './Applications'; export type * from './CustomTutorialStep'; -export type * from './Feature'; +export type * from './FeatureAPIType'; export type * from './FeatureToggleDto'; export type * from './GenericTutorialStep'; export type * from './GraphUser'; diff --git a/src/index.ts b/src/index.ts index 489d4a2..6742705 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,3 +7,5 @@ export * from './providers'; export * from './types'; export * from './utils'; + +export { PortalService } from 'src/api/services/PortalService'; diff --git a/src/providers/FeatureToggleProvider.tsx b/src/providers/FeatureToggleProvider.tsx index f1f4566..defab3e 100644 --- a/src/providers/FeatureToggleProvider.tsx +++ b/src/providers/FeatureToggleProvider.tsx @@ -3,9 +3,9 @@ import { createContext, FC, ReactNode, useContext } from 'react'; import { FullPageSpinner } from '@equinor/amplify-components'; import { useQuery } from '@tanstack/react-query'; -import { Feature, FeatureToggleDto, GraphUser } from '../api'; -import { PortalService } from '../api/services/PortalService'; import { environment } from '../utils'; +import { FeatureAPIType, FeatureToggleDto, GraphUser } from 'src/api'; +import { PortalService } from 'src/api/services/PortalService'; const { getAppName } = environment; @@ -24,7 +24,7 @@ export const isUserInActiveUserArray = ( interface FeatureToggleContextType { isLoading: boolean; isError: boolean; - features?: Feature[] | null; + features?: FeatureAPIType[] | null; } const FeatureToggleContext = createContext< From 96090efce4b9e104a5266a0fd74c5b10462fb8ca Mon Sep 17 00:00:00 2001 From: Marius Tobiassen Bungum Date: Mon, 15 Jul 2024 09:15:48 +0200 Subject: [PATCH 3/3] :bookmark: 1.0.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c4b74db..7276228 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@equinor/subsurface-app-management", - "version": "1.0.2", + "version": "1.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@equinor/subsurface-app-management", - "version": "1.0.2", + "version": "1.0.3", "license": "ISC", "dependencies": { "@azure/msal-browser": "3.10.0", diff --git a/package.json b/package.json index f5c3494..bb668cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/subsurface-app-management", - "version": "1.0.2", + "version": "1.0.3", "description": "React Typescript components/hooks to communicate with equinor/sam", "main": "dist/index.js", "types": "dist/index.d.ts",