Skip to content

Commit

Permalink
Merge pull request #10 from equinor/feat/export-portalservice
Browse files Browse the repository at this point in the history
Export portal service so it can be used by ACL
  • Loading branch information
mariush2 authored Jul 15, 2024
2 parents e3e41d6 + 96090ef commit a6a0667
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/api/core/OpenAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import type { GraphUser } from './GraphUser';

export type Feature = {
export type FeatureAPIType = {
uuid: string;
featureKey: string;
description: string;
Expand Down
4 changes: 2 additions & 2 deletions src/api/models/FeatureToggleDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Feature>;
features: Array<FeatureAPIType>;
};
15 changes: 15 additions & 0 deletions src/api/models/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export type * from './AccessRole';
export type * from './Applications';
export type * from './CustomTutorialStep';
export type * from './FeatureAPIType';
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';
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ export * from './providers';
export * from './types';

export * from './utils';

export { PortalService } from 'src/api/services/PortalService';
6 changes: 3 additions & 3 deletions src/providers/FeatureToggleProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -24,7 +24,7 @@ export const isUserInActiveUserArray = (
interface FeatureToggleContextType {
isLoading: boolean;
isError: boolean;
features?: Feature[] | null;
features?: FeatureAPIType[] | null;
}

const FeatureToggleContext = createContext<
Expand Down
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './Environment';
export * from './ReleaseNotes';
export type * from 'src/api/models';

0 comments on commit a6a0667

Please sign in to comment.