Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: portal administration application #710

Merged
merged 126 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 116 commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
4cd4f62
feat: init code fro admin app
Noggling Aug 9, 2024
5b6dd5c
fix: some changes
Noggling Aug 12, 2024
05b7689
fix: somr files
Noggling Aug 13, 2024
eab7fc7
more
Noggling Aug 14, 2024
73de1d3
blaaaaa
Noggling Aug 15, 2024
d864662
blaaa
Noggling Aug 16, 2024
84541c3
blæææ
Noggling Aug 16, 2024
0b39f86
chore: moore
Noggling Aug 19, 2024
1e41b26
chore: even more
Noggling Aug 19, 2024
04a97e8
feat: Portal Admin Side Menu and Selected Portal
Noggling Aug 19, 2024
ee0e133
chore: tab and messaging
Noggling Aug 20, 2024
75ae61c
chore: Refactor styling and add actions to PortalTable component
Noggling Aug 22, 2024
cc7fcb0
chore: Refactor PortalApps component and remove unused imports
Noggling Aug 22, 2024
a373990
Refactor components and update imports
Noggling Aug 23, 2024
8778a5f
Fix import paths in PortalForm and EditPortalForm components
Noggling Aug 23, 2024
fc0a9b5
Fix import paths and rename files for OnboardedContexts components
Noggling Aug 23, 2024
911ec02
Remove console.log statement in PortalForm component
Noggling Aug 23, 2024
81a2af8
Refactor import paths and update components in OnboardedApps and Cont…
Noggling Aug 23, 2024
7004a95
Add new context-related hooks and components
Noggling Aug 23, 2024
a25992b
Add ContextAppSideSheet component and update ActionBar in PortalApps
Noggling Aug 26, 2024
bdbcefe
Refactor PortalAppList component and remove unused imports
Noggling Aug 26, 2024
c53453c
Refactor import paths and update components in OnboardedApps and Cont…
Noggling Aug 27, 2024
36aa2ca
chore: Update portal-administration package and add router components
Noggling Aug 28, 2024
cf2c026
Update router components and import paths in portal-administration pa…
Noggling Aug 28, 2024
44811ca
Refactor import paths and update components in portal-administration …
Noggling Aug 28, 2024
df3c6e1
Refactor import paths and update components in EditPortalForm.tsx
Noggling Aug 28, 2024
496ab04
Refactor import paths and update components in portal-administration …
Noggling Aug 28, 2024
eef12d6
chore: blaaaa
Noggling Aug 29, 2024
dbe46ea
dsafdsa
Noggling Aug 29, 2024
95153d4
chore : styling changes
Noggling Sep 2, 2024
6dc4f6a
chore : add icon
Noggling Sep 2, 2024
e5ccc7d
feat: logo
Noggling Sep 3, 2024
ea78573
feat: router hooks and queries
Noggling Sep 3, 2024
59921c3
chore: root
Noggling Sep 3, 2024
3b63c42
.
Gustav-Eikaas Sep 4, 2024
7c5640a
fingers crossed
Gustav-Eikaas Sep 4, 2024
313dfca
.
Gustav-Eikaas Sep 4, 2024
5fe7e0d
.
Gustav-Eikaas Sep 4, 2024
f180ca1
.
Gustav-Eikaas Sep 4, 2024
8a04d56
.
Gustav-Eikaas Sep 4, 2024
e659f33
.
Gustav-Eikaas Sep 4, 2024
2f8bd84
.
Gustav-Eikaas Sep 4, 2024
f1a5215
.
Gustav-Eikaas Sep 4, 2024
b96ac34
.
Gustav-Eikaas Sep 4, 2024
54a749d
.
Gustav-Eikaas Sep 4, 2024
e2cd776
.
Gustav-Eikaas Sep 4, 2024
301d602
try not to cry
Gustav-Eikaas Sep 4, 2024
40d706b
add publish
Gustav-Eikaas Sep 4, 2024
b1b21c4
.
Gustav-Eikaas Sep 4, 2024
0670e42
ci: trigger on push main
Gustav-Eikaas Sep 4, 2024
7a17577
chore: add app config and manifest config
Noggling Sep 4, 2024
e6b9add
ci: add trigger on path
Gustav-Eikaas Sep 5, 2024
86e801e
Merge branch 'feat/portal-administration' of https://github.com/equin…
Gustav-Eikaas Sep 5, 2024
87f3ae8
.
Gustav-Eikaas Sep 5, 2024
37f7935
ci: test trigger
Gustav-Eikaas Sep 5, 2024
7cb475c
.
Gustav-Eikaas Sep 5, 2024
240e2c5
chore: Update PortalApps component to use table view as default
Noggling Sep 5, 2024
19ec5aa
chore: Update Portals component to use table view as default
Noggling Sep 5, 2024
5dd8593
chore: Update PortalTable component to use styled-components for cons…
Noggling Sep 5, 2024
c2562d5
chore: Add AgStyle component for consistent styling in portal adminis…
Noggling Sep 6, 2024
b75c385
chore: Add DataClarification component for displaying internal data a…
Noggling Sep 6, 2024
e67e72a
chore: Add InfoPopover component for displaying information with a po…
Noggling Sep 6, 2024
bc40459
chore: Add DeleteDialog component for confirming deletion of items
Noggling Sep 6, 2024
8d43a23
feat: Add DescriptionInput, IconInput, IdInput, NameInput, ShortNameI…
Noggling Sep 6, 2024
61bbb3f
chore: Refactor OnboardApp component to use styled-components for con…
Noggling Sep 6, 2024
00e8f3a
chore: Refactor router-actions.ts for improved code organization and …
Noggling Sep 6, 2024
8aa5278
chore: Update Root.tsx to use styled-components for consistent styling
Noggling Sep 6, 2024
9e12b62
chore: Refactor EditPortal.tsx for improved code organization and rea…
Noggling Sep 6, 2024
a4eaad5
refactor: Organize and improve code readability in FormActionBar and …
Noggling Sep 6, 2024
9ea035b
refactor: Organize and improve code readability in RouterEdit and Rou…
Noggling Sep 6, 2024
5ec9ca0
refactor: Update portal schema and input types for improved code orga…
Noggling Sep 6, 2024
3832267
refactor: Update portal schema and input types for improved code orga…
Noggling Sep 6, 2024
230a0a9
refactor: Update PortalSideSheet component to improve code organizati…
Noggling Sep 6, 2024
61a7756
refactor: Improve code organization and readability in FormActionBar …
Noggling Sep 6, 2024
ed54759
refactor: Update EditPortalForm component for improved code organizat…
Noggling Sep 6, 2024
4f63748
refactor: Update FormActionBar component for improved code organizati…
Noggling Sep 6, 2024
803fa14
refactor: Improve code organization and readability in PortalList com…
Noggling Sep 6, 2024
7dcc2f1
chore: tables refactor loading and config
Noggling Sep 9, 2024
6489e82
refactor: Add Message component to EditPortal page for displaying err…
Noggling Sep 9, 2024
cc303e9
refactor: Remove console.log statement and update Message component t…
Noggling Sep 9, 2024
a5b6bda
refactor: Update AgStyle and Snack components for improved code organ…
Noggling Sep 10, 2024
c12adc7
refactor: Update AgStyle and Snack components for improved code organ…
Noggling Sep 10, 2024
5757ed6
chore: Update npm dependency to latest stable version
Noggling Sep 10, 2024
b9ad72a
chore: Install Fusion CLI globally for project dependencies
Noggling Sep 10, 2024
553c989
chore: Update npm dependency to latest stable version
Noggling Sep 10, 2024
c23087e
chore: Install App Deps and Update npm dependency to latest stable ve…
Noggling Sep 10, 2024
bba22ba
chore: Update npm dependency to latest stable version
Noggling Sep 10, 2024
c5a2977
chore: Update npm dependency to latest stable version
Noggling Sep 10, 2024
dc375f2
chore: Update npm dependencies to latest stable versions
Noggling Sep 10, 2024
9544980
test
Noggling Sep 10, 2024
26c5ea5
chore: Update npm dependency to latest stable version
Noggling Sep 10, 2024
be3a9f5
test
Noggling Sep 11, 2024
ff464d2
chore: Update workflow trigger to workflow_dispatch
Noggling Sep 11, 2024
1e86a91
chore: Update workflow trigger to push for all branches
Noggling Sep 11, 2024
7f6370d
chore: Update workflow trigger to workflow_dispatch for feat/portal-a…
Noggling Sep 11, 2024
9e1abbe
chore: Update workflow trigger to push for all branches
Noggling Sep 11, 2024
231ee3c
chore: Update echo message in test.yml to reflect changes in client/a…
Noggling Sep 11, 2024
e590bfe
chore: Update createApp function in index.ts to improve readability
Noggling Sep 11, 2024
3af24f1
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
dc5fc79
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
735a5ee
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
7e34f15
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
bbfbba9
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
4a118a7
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
1cb663a
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
f227923
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
e8585aa
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
dd7752b
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
1c66e3e
chore: Update test.yml to handle changes in client/apps/portal-admini…
Noggling Sep 11, 2024
a28e04b
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
14f8bb6
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
a664153
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
44f2310
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
356a7d8
chore: create pr-710-2025280865.md
Noggling Sep 11, 2024
474d89c
chore: Update test.yml to handle changes in client/apps/ directory
Noggling Sep 11, 2024
44f4a75
chore: Update test.yml to handle changes in client/apps/portal-admini…
Noggling Sep 11, 2024
3aacf6a
chore: Update test.yml to handle changes in client/apps/portal-admini…
Noggling Sep 11, 2024
2612d48
chore: wow now its awesome
Noggling Sep 12, 2024
fc3aaf6
chore: Update test.yml to handle changes in client/apps/portal-admini…
Noggling Sep 13, 2024
31a17ac
chore: Update test.yml to handle changes in client/apps/portal-admini…
Noggling Sep 13, 2024
c758955
chore: Update styling and form labels in portal administration compon…
Noggling Sep 13, 2024
17bd3e5
chore: Fix formating
EdwardBrunton Sep 13, 2024
15fa999
chore: Update EditPortalForm to reset form after submitting changes
Noggling Sep 13, 2024
0061ef1
chore: Improve event handling in InfoPopover and OnboardedApps compon…
Noggling Sep 13, 2024
a4e7bd5
chore: Update actions/upload-artifact to v4 in es-lint action.yml
Noggling Sep 13, 2024
5604cba
chore: update pr-710-2025280865.md
Noggling Sep 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/pr-710-2025280865.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

---
"fusion-project-portal": minor
---
portal administration app hello
32 changes: 32 additions & 0 deletions .github/actions/get-fusion-token/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Get Fusion token
description: "Runs a composite step action"
inputs:
client-id:
description: "SP client id"
required: true
tenant-id:
description: "Equinor tenant id"
required: true
resource-id:
description: "Resource id"
required: true

outputs:
token:
description: "Fusion token"
value: ${{ steps.token.outputs.token }}

runs:
using: "composite"
steps:
- name: "Login to Azure"
uses: azure/login@v1
with:
client-id: ${{inputs.client-id}}
tenant-id: ${{ inputs.tenant-id }}
allow-no-subscriptions: true

- name: "Obtain token for upload"
id: token
shell: bash
run: echo "token=$(az account get-access-token --resource '${{ inputs.resource-id }}' | jq '.accessToken')" >> $GITHUB_OUTPUT
11 changes: 11 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@ runs:
cd client
yarn install --frozen-lockfile
shell: bash

- name: Install Fusion CLI
run: |
npm i -g @equinor/fusion-framework-cli
shell: bash

- name: Install App Deps
run: |
cd client/apps/portal-administration
yarn install
shell: bash
43 changes: 43 additions & 0 deletions .github/workflows/common-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,46 @@ jobs:
--from-environment test
--to-environment prod
--deployment ${{ steps.get_active_deployments.outputs.activeDeploymentApi }}

releas-admin:
name: Production Release Portal Administartion Application
needs: changesets
environment: production
runs-on: ubuntu-latest
if: needs.changesets.outputs.published == 'true'
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Get fusion token
id: "get-fusion-token"
uses: ./.github/actions/get-fusion-token
with:
client-id: ${{secrets.AZURE_SP_FUSION}}
tenant-id: ${{secrets.AZURE_TENANT_ID}}
resource-id: ${{secrets.AZURE_FUSION_SCOPE}}

- name: Install
run: |
cd client
yarn install
npm i -g @equinor/fusion-framework-cli
cd apps/portal-administration
yarn install

- name: Build
run: |
cd client
yarn build

- name: Deploy
run: |
cd client/apps/portal-administration
yarn bundle
curl -T "app-bundle.zip" -H "Authorization: bearer ${{steps.get-fusion-token.outputs.token}}" -H "Content-Disposition: attachment; filename=app-bundle.zip" -H "Content-Type: application/zip" -X POST --show-error -i --url https://fusion-s-portal-fprd.azurewebsites.net/api/apps/portal-administration/versions

- name: Publish
run: |
curl -H "Authorization: bearer ${{steps.get-fusion-token.outputs.token}}" -X POST --show-error -i --url https://fusion-s-portal-fprd.azurewebsites.net/api/apps/portal-administration/publish
58 changes: 58 additions & 0 deletions .github/workflows/deploy-apps-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy apps CI

on:
push:
branches: ["main"]
paths:
- "client/apps/portal-administration/**"

permissions:
actions: read
checks: write
contents: read
deployments: write
id-token: write

jobs:
build:
environment: non-prod
name: Deploy
timeout-minutes: 15
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Get fusion token
id: "get-fusion-token"
uses: ./.github/actions/get-fusion-token
with:
client-id: ${{secrets.AZURE_SP_FUSION}}
tenant-id: ${{secrets.AZURE_TENANT_ID}}
resource-id: ${{secrets.AZURE_FUSION_SCOPE}}

- name: Install
run: |
cd client
yarn install
npm i -g @equinor/fusion-framework-cli
cd apps/portal-administration
yarn install

- name: Build
run: |
cd client
yarn build

- name: Deploy
run: |
cd client/apps/portal-administration
yarn bundle
curl -T "app-bundle.zip" -H "Authorization: bearer ${{steps.get-fusion-token.outputs.token}}" -H "Content-Disposition: attachment; filename=app-bundle.zip" -H "Content-Type: application/zip" -X POST --show-error -i --url https://fusion-s-portal-ci.azurewebsites.net/api/apps/portal-administration/versions

- name: Publish
run: |
curl -H "Authorization: bearer ${{steps.get-fusion-token.outputs.token}}" -X POST --show-error -i --url https://fusion-s-portal-ci.azurewebsites.net/api/apps/portal-administration/publish
3 changes: 2 additions & 1 deletion client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ testem.log

# System Files
.DS_Store
Thumbs.db
Thumbs.db
*.zip
13 changes: 13 additions & 0 deletions client/apps/portal-administration/app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { mergeAppConfigs, defineAppConfig } from '@equinor/fusion-framework-cli';
export default defineAppConfig((_env, { base }) =>
mergeAppConfigs(base, {
environment: {
endpoints: {
client: {
baseUri: 'https://backend-fusion-project-portal-test.radix.equinor.com',
defaultScopes: ['api://02f3484c-cad0-4d1d-853d-3a9e604b38f3/access_as_user'],
},
},
},
})
);
9 changes: 9 additions & 0 deletions client/apps/portal-administration/app.manifest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineAppManifest, mergeManifests } from '@equinor/fusion-framework-cli';

export default defineAppManifest((env, { base }) => {
return mergeManifests(base, {
name: 'Portal Administration',
shortName: 'PA',
description: 'Portal Administration tool for fusion as a service',
});
});
46 changes: 46 additions & 0 deletions client/apps/portal-administration/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "portal-administration",
"version": "1.0.0",
"description": "",
"private": true,
"type": "module",
"main": "src/index.ts",
"scripts": {
"build": "fusion-framework-cli app build",
"dev": "fusion-framework-cli app dev",
"docker": "cd .. && sh docker-script.sh app-react",
"bundle": "fusion-framework-cli app pack"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@equinor/fusion-framework-cli": "^9.12.14",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"typescript": "^5.1.3",
"vitest": "^2.0.5"
},
"dependencies": {
"react-router-dom": "^6.26.0",
"@equinor/fusion-react-side-sheet": "^1.3.3",
"@equinor/fusion-framework-module-navigation": "^4.0.6",
"@equinor/fusion-framework-react-app": "^5.2.7",
"@ag-grid-community/core": "^32.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@ag-grid-community/react": "^32.1.0",
"@equinor/eds-core-react": "^0.40.1",
"@equinor/eds-icons": "^0.19.3",
"@equinor/eds-tokens": "^0.9.2",
"@equinor/fusion-react-searchable-dropdown": "^0.5.2",
"@equinor/workspace-ag-grid": "^3.0.2",
"@hookform/resolvers": "^3.9.0",
"@tanstack/react-query": "^5.51.23",
"@tanstack/react-query-devtools": "^5.51.23",
"react-hook-form": "^7.52.2",
"rxjs": "^7.8.1",
"styled-components": "^6.1.1",
"uuidv7": "^1.0.1",
"zod": "^3.23.8"
}
}
29 changes: 29 additions & 0 deletions client/apps/portal-administration/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { RouterProvider } from 'react-router-dom';
import { useRouter } from '@equinor/fusion-framework-react-app/navigation';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import styled from 'styled-components';
import routes from './routes';
import { tokens } from '@equinor/eds-tokens';

const queryClient = new QueryClient();

const Style = {
Root: styled.div`
background-color: ${tokens.colors.ui.background__light.hex};
position: absolute;
height: 100%;
width: 100%;
overflow: hidden;
`,
};

export default function () {
const router = useRouter(routes);
return (
<Style.Root>
<QueryClientProvider client={queryClient}>
<RouterProvider router={router} fallbackElement={<p>Error...</p>} />
</QueryClientProvider>
</Style.Root>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Button, Icon } from '@equinor/eds-core-react';
import { AppManifestResponse, FormattedError, PortalApp } from '../../types';
import { UseMutateAsyncFunction } from '@tanstack/react-query';
import { Result } from '../../query/apps-queries';
import { add_circle_outlined } from '@equinor/eds-icons';

type ActivateSelectedButtonProps = {
selection: PortalApp[];
activateSelected: UseMutateAsyncFunction<
Result[],
FormattedError,
PortalApp[],
{
prevApps: AppManifestResponse[];
newApps: AppManifestResponse[];
}
>;
};

export const ActivateSelectedButton = ({ selection, activateSelected }: ActivateSelectedButtonProps) => {
const isActive = selection.some((a) => a.isActive);

if (isActive) {
return null;
}

return (
<Button
id="activate-selected"
onClick={() => {
activateSelected(selection.filter((a) => !a.isActive));
}}
>
<Icon data={add_circle_outlined} size={16} /> Activate Selected
</Button>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Button, Icon } from '@equinor/eds-core-react';
import { PortalApp } from '../../types';

import { add_circle_filled } from '@equinor/eds-icons';

type ActivateSelectedWithContextButtonProps = {
selection: PortalApp[];
activateSelectedWithContext: VoidFunction;
};

export const ActivateSelectedWithContextButton = ({
selection,
activateSelectedWithContext,
}: ActivateSelectedWithContextButtonProps) => {
const isActive = selection.some((a) => a.isActive);

if (isActive) {
return null;
}

return (
<Button
id="activate-selected"
variant="ghost"
onClick={() => {
activateSelectedWithContext();
}}
>
<Icon data={add_circle_filled} size={16} /> Activate Selected with Context
</Button>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Button, Icon } from '@equinor/eds-core-react';
import { PortalApp } from '../../types';

import { add_circle_outlined, edit } from '@equinor/eds-icons';

type EditSelectedButtonProps = {
selection: PortalApp[];
editSelection: VoidFunction;
};

export const EditSelectedButton = ({ selection, editSelection }: EditSelectedButtonProps) => {
const isActive = selection.some((a) => !a.isActive);

if (isActive) {
return null;
}

return (
<Button
id="activate-selected"
variant="ghost"
onClick={() => {
editSelection();
}}
>
<Icon data={edit} size={16} /> Edit Selected
</Button>
);
};
Loading
Loading