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

✨ 3D widget and tab for 3D in Workorder app #774

Merged
merged 96 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
c5bfbb2
init
espenkalle Dec 14, 2023
b28536e
Merge branch 'main' into feat/3d-workorder
espenkalle Dec 14, 2023
7d57eaf
3d tab
espenkalle Dec 18, 2023
a210304
facilities
espenkalle Dec 18, 2023
b151f33
no tags message
espenkalle Dec 20, 2023
3569acd
Merge branch 'main' into feat/3d-workorder
espenkalle Jan 3, 2024
68a977f
Merge branches 'feat/3d-workorder' and 'feat/3d-workorder' of https:/…
espenkalle Jan 3, 2024
06b145c
Merge branch 'main' into feat/3d-workorder
espenkalle Jan 3, 2024
ebe7de3
cropping bug, filter tagoverlay
espenkalle Jan 4, 2024
b16b3c4
no tags found message
espenkalle Jan 4, 2024
9e50dcf
no tags message styling
espenkalle Jan 4, 2024
50bb7ee
legend does not include "notfoundtags"
espenkalle Jan 4, 2024
8161b48
handling for empty tag list
espenkalle Jan 4, 2024
9cc797b
Merge branch 'main' into feat/3d-workorder
espenkalle Jan 4, 2024
aeea643
init punch
espenkalle Jan 4, 2024
71bfa58
Merge branch 'feat/3d-workorder' of https://github.com/equinor/cc-com…
espenkalle Jan 4, 2024
d440462
lockfile
espenkalle Jan 4, 2024
21b4d25
tagfetch spinner
espenkalle Jan 5, 2024
3d05d31
modelviewer config
espenkalle Jan 5, 2024
51f3d29
Merge branch 'main' into feat/3d-workorder
espenkalle Jan 11, 2024
4e996f9
rewrote modelViewerTab
espenkalle Jan 12, 2024
2346fec
fix return type
espenkalle Jan 12, 2024
61bc977
fix import
espenkalle Jan 15, 2024
4fdbd82
Merge branch 'main' into feat/3d-workorder
espenkalle Jan 15, 2024
ec22ce0
update imports
espenkalle Jan 15, 2024
5352b87
modelviewertest app
espenkalle Jan 17, 2024
ca0fa2e
Merge branch 'main' into feat/3d-workorder
espenkalle Jan 17, 2024
cfe810e
deploy action modelviewer
espenkalle Jan 17, 2024
ba2d061
actions list
espenkalle Jan 17, 2024
acb4a54
viteconfig
espenkalle Jan 17, 2024
388363f
build: inject process
Gustav-Eikaas Jan 18, 2024
1c39c9d
chore: add 3d patch
Gustav-Eikaas Jan 18, 2024
a19f99b
Merge branch 'main' into feat/3d-workorder
espenkalle Jan 22, 2024
e3f7593
Merge branch 'main' into feat/3d-workorder
espenkalle Jan 29, 2024
1182558
Merge branch 'main' into feat/3d-workorder
espenkalle Feb 1, 2024
60b2795
Merge branch 'main' into feat/3d-workorder
espenkalle Feb 6, 2024
a49ae27
Merge branch 'main' into feat/3d-workorder
espenkalle Feb 14, 2024
207ea60
Merge branch 'main' into feat/3d-workorder
espenkalle Feb 21, 2024
7016f6a
widget working ish
espenkalle Feb 27, 2024
c41d323
edit vite config
espenkalle Feb 27, 2024
c9de2c3
cleanup
espenkalle Feb 27, 2024
3559b46
Merge branch 'main' into feat/3d-workorder
espenkalle Feb 27, 2024
e991044
Added API support
kjellhaaland Mar 1, 2024
9859a75
Fixed model loading + cleanup
kjellhaaland Mar 1, 2024
18ede22
Refactored modelviewer
kjellhaaland Mar 1, 2024
d48f5bb
Merge branch 'main' into feat/3d-workorder
kjellhaaland Mar 1, 2024
04d66ba
Refactoring
kjellhaaland Mar 1, 2024
110d843
Removed modelviewer from punch
kjellhaaland Mar 1, 2024
925de92
Simplified and fixed issues
kjellhaaland Mar 4, 2024
864847c
Updated selection service
kjellhaaland Mar 4, 2024
3eb30ec
Refactored providers, contexts and some ui components
kjellhaaland Mar 5, 2024
6d66957
Refactored model selection.
kjellhaaland Mar 5, 2024
9347c95
Refactored context providers. Refactoring and cleanup.
kjellhaaland Mar 7, 2024
9e41fa6
Fixed styling/environment variables/
kjellhaaland Mar 7, 2024
568a91d
Moved env variables to app.config for the apps. Added new prodiver fo…
kjellhaaland Mar 7, 2024
14a7390
Merge branch 'main' into feat/3d-workorder
Gustav-Eikaas Mar 7, 2024
3c28115
Merge branch 'feat/3d-workorder' of https://github.com/equinor/cc-com…
kjellhaaland Mar 7, 2024
3adec20
Updated PlantSelection
kjellhaaland Mar 7, 2024
88fe9b6
Added widget versioning. Added suspense.
kjellhaaland Mar 8, 2024
3c24a5d
Optimized ModelViewerProvider
kjellhaaland Mar 8, 2024
407ffe2
Added suspense to model selection provider
kjellhaaland Mar 8, 2024
bc994c2
Splitted tags state in selection provider out in a hook
kjellhaaland Mar 8, 2024
26a5deb
Removed effects from selection provider
kjellhaaland Mar 8, 2024
3f944e7
Refactoring
kjellhaaland Mar 14, 2024
5f70992
Added error boundary
kjellhaaland Mar 14, 2024
b5c65d8
Fixes
kjellhaaland Mar 19, 2024
fd5f6a4
Updated deps
kjellhaaland Mar 19, 2024
e61cc92
Added modelviewerconfig to deploy pipeline
kjellhaaland Mar 19, 2024
553dd00
Added widget module enable
kjellhaaland Mar 19, 2024
d9395f1
Added widget module enable
kjellhaaland Mar 19, 2024
5bcceb7
Merge branch 'feat/3d-workorder' of https://github.com/equinor/cc-com…
kjellhaaland Mar 19, 2024
37c2362
Added apps http client
kjellhaaland Mar 20, 2024
05f32ad
added enableWidgetModule
kjellhaaland Mar 20, 2024
a64da80
Moved ModelViewer out of shared and into modelviewer package
kjellhaaland Mar 27, 2024
9f90151
Removed widget-spesific frameworks and code
kjellhaaland Mar 27, 2024
3fb5622
Added Lazy Loading
kjellhaaland Mar 27, 2024
6c16e59
Build
kjellhaaland Mar 27, 2024
421c94f
Merge branch 'main' into feat/3d-workorder
kjellhaaland Apr 3, 2024
5951b5f
Moved echo instance loader
kjellhaaland Apr 8, 2024
e837644
Fixed re-rendering loop issue
kjellhaaland Apr 10, 2024
b803529
Removed old modules.
kjellhaaland Apr 10, 2024
cf182c8
Removed logs
kjellhaaland Apr 10, 2024
c951103
Updated ModelViewer exports to fix lazy loading issue
kjellhaaland Apr 10, 2024
1e175f6
Added env provider
kjellhaaland Apr 11, 2024
03a8833
Merge branch 'main' into feat/3d-workorder
kjellhaaland Apr 11, 2024
5223771
Updated echo deps to latest version
kjellhaaland Apr 11, 2024
4380ded
Removed chunking and patch
kjellhaaland Apr 11, 2024
cdaffb8
Removed chunking and patch
kjellhaaland Apr 11, 2024
c980b08
Removed chunking and patch
kjellhaaland Apr 11, 2024
3a81d2c
Removed chunking and patch
kjellhaaland Apr 11, 2024
c2ef47f
Removed chunking and patch
kjellhaaland Apr 11, 2024
9877773
Updated deps
kjellhaaland Apr 11, 2024
c3b5b76
Updated deployment scripts
kjellhaaland Apr 11, 2024
d03cdd1
Merge branch 'main' into feat/3d-workorder
kjellhaaland Apr 11, 2024
f31b305
Fixed query client
kjellhaaland Apr 11, 2024
27bb131
Fixed minor pr comments
kjellhaaland Apr 11, 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
2 changes: 1 addition & 1 deletion .github/workflows/fprd-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
env:
#Runs out of memory when bundling more apps otherwise even though concurrency is 1
NODE_OPTIONS: '--max_old_space_size=4096'
run: npx turbo run fprd:deploy --since ${{github.event.before}} --concurrency 1 -- --token ${{ steps.get-fusion-token.outputs.token }} --ai '${{secrets.ai}}' --sha '${{github.sha}}'
run: npx turbo run fprd:deploy --since ${{github.event.before}} --concurrency 1 -- --token ${{ steps.get-fusion-token.outputs.token }} --ai '${{secrets.ai}}' --modelViewerConfig '${{vars.modelViewerConfig}}' --sha '${{github.sha}}'
2 changes: 1 addition & 1 deletion .github/workflows/manual-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ jobs:
env:
#Runs out of memory when bundling more apps otherwise even though concurrency is 1
NODE_OPTIONS: '--max_old_space_size=4096'
run: npx turbo run fprd:deploy --filter=${{inputs.appKey}} --concurrency 1 -- --token ${{ steps.get-fusion-token.outputs.token }} --ai '${{secrets.ai}}' --sha '${{github.sha}}'
run: npx turbo run fprd:deploy --filter=${{inputs.appKey}} --concurrency 1 -- --token ${{ steps.get-fusion-token.outputs.token }} --ai '${{secrets.ai}}' --modelViewerConfig '${{vars.modelViewerConfig}}' --sha '${{github.sha}}'
2 changes: 1 addition & 1 deletion .github/workflows/manual-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ jobs:
env:
#Runs out of memory when bundling more apps otherwise even though concurrency is 1
NODE_OPTIONS: '--max_old_space_size=4096'
run: npx turbo run pr:deploy --filter='${{inputs.category}}' --concurrency 1 -- --token ${{ steps.get-fusion-token.outputs.token }} --ai '${{secrets.ai}}' --sha '${{github.sha}}'
run: npx turbo run pr:deploy --filter='${{inputs.category}}' --concurrency 1 -- --token ${{ steps.get-fusion-token.outputs.token }} --ai '${{secrets.ai}}' --modelViewerConfig '${{vars.modelViewerConfig}}' --sha '${{github.sha}}'
2 changes: 1 addition & 1 deletion .github/workflows/pr-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
env:
#Runs out of memory when bundling more apps otherwise even though concurrency is 1
NODE_OPTIONS: '--max_old_space_size=4096'
run: npx turbo run pr:deploy --since origin/main --concurrency 1 -- --token ${{ steps.get-fusion-token.outputs.token }} --pr '${{ github.event.issue.number }}' --ai '${{secrets.ai}}' --sha '${{steps.comment-branch.outputs.head_sha}}'
run: npx turbo run pr:deploy --since origin/main --concurrency 1 -- --token ${{ steps.get-fusion-token.outputs.token }} --pr '${{ github.event.issue.number }}' --ai '${{secrets.ai}}' --modelViewerConfig '${{vars.modelViewerConfig}}' --sha '${{steps.comment-branch.outputs.head_sha}}'

- name: Comment pr
uses: actions/github-script@v7
Expand Down
3 changes: 0 additions & 3 deletions apps/modelviewer/README.md

This file was deleted.

20 changes: 0 additions & 20 deletions apps/modelviewer/package.json

This file was deleted.

61 changes: 0 additions & 61 deletions apps/modelviewer/src/main.tsx

This file was deleted.

22 changes: 0 additions & 22 deletions apps/modelviewer/tsconfig.app.json

This file was deleted.

22 changes: 0 additions & 22 deletions apps/modelviewer/tsconfig.json

This file was deleted.

4 changes: 0 additions & 4 deletions apps/modelviewer/vite.config.ts

This file was deleted.

8 changes: 8 additions & 0 deletions apps/workorder/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ export default () => ({
environment: {
uri: 'https://backend-fusion-data-gateway-test.radix.equinor.com',
defaultScopes: ['api://ed6de162-dd30-4757-95eb-0ffc8d34fbe0/access_as_user'],
modelViewerConfig: {
hierarchyClientBaseUrl: 'https://app-echo-hierarchy-dev.azurewebsites.net',
hierarchyClientScope: 'ebc04930-bf9c-43e5-98bc-bc90865600b8/user_impersonation',
modelClientBaseUrl: 'https://app-echomodeldist-dev.azurewebsites.net',
modelClientScope: 'd484c551-acf8-45bc-b1e8-3f4373bd0d42/user_impersonation',
echoClientBaseUrl: 'https://dt-echopedia-api-dev.azurewebsites.net',
echoClientScope: 'aef35d97-53d4-4fd0-adaf-c5a514b38436/user_impersonation',
},
},
endpoints: {},
});
8 changes: 8 additions & 0 deletions apps/workorder/app.config.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ export default () => ({
environment: {
uri: 'https://localhost:7074',
defaultScopes: ['api://ed6de162-dd30-4757-95eb-0ffc8d34fbe0/access_as_user'],
modelViewerConfig: {
hierarchyClientBaseUrl: 'https://app-echo-hierarchy-dev.azurewebsites.net',
hierarchyClientScope: 'ebc04930-bf9c-43e5-98bc-bc90865600b8/user_impersonation',
modelClientBaseUrl: 'https://app-echomodeldist-dev.azurewebsites.net',
modelClientScope: 'd484c551-acf8-45bc-b1e8-3f4373bd0d42/user_impersonation',
echoClientBaseUrl: 'https://dt-echopedia-api-dev.azurewebsites.net',
echoClientScope: 'aef35d97-53d4-4fd0-adaf-c5a514b38436/user_impersonation',
},
},
endpoints: {},
});
13 changes: 7 additions & 6 deletions apps/workorder/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { defineConfig } from 'vite';
import EnvironmentPlugin from 'vite-plugin-environment';
import { InjectProcessPlugin } from '../../patches/3d-patch.ts';

export default defineConfig({
plugins: [
EnvironmentPlugin({
NODE_ENV: 'production',
}),
],
appType: 'custom',
build: {
emptyOutDir: true,
rollupOptions: {
plugins: [InjectProcessPlugin],
output: {
inlineDynamicImports: true,
},
},
lib: {
entry: './src/main.tsx',
fileName: 'app-bundle',
Expand Down
12 changes: 11 additions & 1 deletion github-action/src/releaseMain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,20 @@ program.name('Release');
type ReleaseArgs = {
token: string;
ai: string;
modelViewerConfig: string;
pr: string;
sha: string;
};

program
.command('release')
.option('-T, --token <token>', 'azure token')
.option('-pr, --pr <pr>', 'Pr number')
.option('-ai, --ai <ai>', 'ai key')
.option(
'-modelViewerConfig, --modelViewerConfig <modelViewerConfig>',
'modelviewer config'
)
.option('-sha, --sha <sha>', 'commit sha')
.action(async (args) => {
if (!args.token) {
Expand Down Expand Up @@ -61,7 +67,11 @@ export async function release(config: ReleaseArgs) {

await uploadBundle(prodUrl, config.token, pkg.name, zipped);
await patchAppConfig(
{ ai: config.ai, commit: config.sha },
{
ai: config.ai,
commit: config.sha,
modelViewerConfig: JSON.parse(config.modelViewerConfig),
},
config.token,
pkg.name,
prodUrl
Expand Down
12 changes: 11 additions & 1 deletion github-action/src/releasePr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ program.name('Release');
type ReleaseArgs = {
token: string;
ai: string;
modelViewerConfig: string;
pr: string;
sha: string;
};
Expand All @@ -27,6 +28,10 @@ program
.option('-T, --token <token>', 'azure token')
.option('-pr, --pr <pr>', 'Pr number')
.option('-ai, --ai <ai>', 'ai key')
.option(
'-modelViewerConfig, --modelViewerConfig <modelViewerConfig>',
'modelviewer config'
)
.option('-sha, --sha <sha>', 'commit sha')
.action(async (args) => {
if (!args.token) {
Expand All @@ -53,7 +58,12 @@ export async function release(context: ReleaseArgs) {
}
await uploadBundle(ciUrl, context.token, r.name, zipped);
await patchAppConfig(
{ ai: context.ai, commit: context.sha, pr: context.pr },
{
ai: context.ai,
commit: context.sha,
pr: context.pr,
modelViewerConfig: JSON.parse(context.modelViewerConfig),
},
context.token,
r.name,
ciUrl
Expand Down
8 changes: 8 additions & 0 deletions github-action/src/utils/patchAppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ export async function getAppConfig(token: string, appKey: string, url: string) {
type AppConfig = {
commit: string;
ai: string;
modelViewerConfig: {
hierarchyClientBaseUrl: string;
hierarchyClientScope: string;
modelClientBaseUrl: string;
modelClientScope: string;
echoClientBaseUrl: string;
echoClientScope: string;
};
};

export async function patchAppConfig<T extends Record<PropertyKey, unknown> = {}>(
Expand Down
20 changes: 20 additions & 0 deletions libs/modelviewer/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,23 @@ sequenceDiagram


```

Get details about a clicked 3D element
```ts

useEffect(() => {
const callback = async (e: Event) => {
const index = (e as Test).detail.treeIndex;

const data = selectionControls.getNodeFromTreeId(index);
console.log({ data });
};

window.addEventListener('selectionStarted', callback);

return () => {
window.removeEventListener('selectionStarted', callback);
};
}, [selectionControls]);
```

3 changes: 2 additions & 1 deletion libs/modelviewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
"test:coverage": "vitest run --coverage"
},
"dependencies": {
"@equinor/echo-3d-viewer": "^0.0.1",
"@equinor/echo-3d-viewer": "^0.0.3",
"@cognite/reveal": "4.2.2",
"@cognite/sdk": "8.2.0",
"throttle-typescript": "^1.1.0",
"three": "0.154.0",
"rxjs": "^7.5.7"
},
Expand Down
Loading
Loading