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

Temporarily rollback branch #992

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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}} --scope * --concurrency 1 -- --token ${{ steps.get-fusion-token.outputs.token }} --ai '${{secrets.ai}}' --modelViewerConfig '${{vars.modelViewerConfig}}' --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/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 --scope * --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}}'
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
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,3 @@ Apps has to be *onboarded* onto a context in order to be availible for end users

They way we bundle our applications makes it so that they can be used in any Fusion Portal. By utilzing the [Fusion Framework](https://github.com/equinor/fusion-framework) we allow for communication between the portal and the application. Our applications do not have an index.html but rather exposes a mount function that the portal can call when dynamically importing our bundle.
You can read more about the fusion framework [here](https://equinor.github.io/fusion-framework)

## Updating package dependencies

To update all package dependencies, use the command `pnpm run bump-deps` to open the interactive pnpm package update propt in the terminal. Use `pnpm run compile` to compile all packages/apps in the repo.
4 changes: 2 additions & 2 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "3.3.1",
"astro": "4.7.0"
"@astrojs/react": "2.0.2",
"astro": "2.0.0"
}
}
7 changes: 0 additions & 7 deletions apps/heattrace/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { defineConfig } from 'vite';
import EnvironmentPlugin from 'vite-plugin-environment';
import { InjectProcessPlugin } from '../../patches/3d-patch.ts';

export default defineConfig({
plugins: [
Expand All @@ -11,12 +10,6 @@ export default defineConfig({
appType: 'custom',
build: {
emptyOutDir: true,
rollupOptions: {
plugins: [InjectProcessPlugin],
output: {
inlineDynamicImports: true,
},
},
lib: {
entry: './src/main.tsx',
fileName: 'app-bundle',
Expand Down
3 changes: 1 addition & 2 deletions apps/loop/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"**/*.spec.jsx",
"**/*.test.jsx",
"dist",
".turbo",
"vite.config.ts"
".turbo"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
}
7 changes: 0 additions & 7 deletions apps/loop/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { defineConfig } from 'vite';
import EnvironmentPlugin from 'vite-plugin-environment';
import { InjectProcessPlugin } from '../../patches/3d-patch.ts';

export default defineConfig({
plugins: [
Expand All @@ -11,12 +10,6 @@ export default defineConfig({
appType: 'custom',
build: {
emptyOutDir: true,
rollupOptions: {
plugins: [InjectProcessPlugin],
output: {
inlineDynamicImports: true,
},
},
lib: {
entry: './src/main.tsx',
fileName: 'app-bundle',
Expand Down
8 changes: 0 additions & 8 deletions apps/piping/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ 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: 0 additions & 8 deletions apps/piping/app.config.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ 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: {},
});
7 changes: 0 additions & 7 deletions apps/piping/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { defineConfig } from 'vite';
import EnvironmentPlugin from 'vite-plugin-environment';
import { InjectProcessPlugin } from '../../patches/3d-patch.ts';

export default defineConfig({
plugins: [
Expand All @@ -11,12 +10,6 @@ export default defineConfig({
appType: 'custom',
build: {
emptyOutDir: true,
rollupOptions: {
plugins: [InjectProcessPlugin],
output: {
inlineDynamicImports: true,
},
},
lib: {
entry: './src/main.tsx',
fileName: 'app-bundle',
Expand Down
7 changes: 0 additions & 7 deletions apps/scopechangerequest/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { defineConfig } from 'vite';
import EnvironmentPlugin from 'vite-plugin-environment';
import { InjectProcessPlugin } from '../../patches/3d-patch.ts';

export default defineConfig({
plugins: [
Expand All @@ -11,12 +10,6 @@ export default defineConfig({
appType: 'custom',
build: {
emptyOutDir: true,
rollupOptions: {
plugins: [InjectProcessPlugin],
output: {
inlineDynamicImports: true,
},
},
lib: {
entry: './src/main.tsx',
fileName: 'app-bundle',
Expand Down
3 changes: 1 addition & 2 deletions apps/swcr/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"**/*.test.js",
"**/*.spec.jsx",
"**/*.test.jsx",
"dist",
"vite.config.ts"
"dist"
],
"include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
}
7 changes: 0 additions & 7 deletions apps/swcr/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { defineConfig } from 'vite';
import EnvironmentPlugin from 'vite-plugin-environment';
import { InjectProcessPlugin } from '../../patches/3d-patch.ts';

export default defineConfig({
plugins: [
Expand All @@ -11,12 +10,6 @@ export default defineConfig({
appType: 'custom',
build: {
emptyOutDir: true,
rollupOptions: {
plugins: [InjectProcessPlugin],
output: {
inlineDynamicImports: true,
},
},
lib: {
entry: './src/main.tsx',
fileName: 'app-bundle',
Expand Down
8 changes: 4 additions & 4 deletions github-action/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"author": "",
"license": "ISC",
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"adm-zip": "^0.5.12",
"commander": "12.0.0",
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"adm-zip": "^0.5.10",
"commander": "11.0.0",
"markdown-table": "3.0.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,17 @@ type HandoverProps = {
export const HandoverSidesheet = ({ id, close: closeSidesheet, item }: HandoverProps) => {
const client = useHttpClient('cc-app');
const contextId = useContextId();
const { isLoading, data, error } = useQuery({
queryKey: ['handover', id],
queryFn: async () => {
const { isLoading, data, error } = useQuery(
['handover', id],
async () => {
const res = await client.fetch(`/api/contexts/${contextId}/handover/${id}`);
if (!res.ok) {
throw new Error(`Failed to get handover with id ${id}`);
}
return res.json() as Promise<HandoverPackage>;
},
refetchOnWindowFocus: false,
initialData: item ?? undefined,
});
{ refetchOnWindowFocus: false, initialData: item ?? undefined }
);

if (isLoading) {
return <SidesheetSkeleton close={() => closeSidesheet()} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,19 @@ export function HeattraceSidesheet({ id, item, close }: HeatTraceProps) {
data: heatTrace,
error,
isLoading: isLoadingSidesheet,
} = useQuery<HeatTrace>({
queryKey: ['heat-trace', id],
queryFn: async () => {
} = useQuery<HeatTrace>(
['heat-trace', id],
async () => {
const res = await client.fetch(`/api/contexts/${contextId}/heat-trace/${id}`);
if (!res.ok) throw res;
return res.json();
},
initialData: item ?? undefined,
throwOnError: false,
});
{
suspense: false,
initialData: item ?? undefined,
useErrorBoundary: false,
}
);

if (isLoadingSidesheet) {
return <SidesheetSkeleton close={close} />;
Expand All @@ -142,9 +145,10 @@ const useCircuitDiagramTab = (ht: HeatTrace) => {
data: elenetwork,
isLoading: isLoadingEle,
error: errorEle,
} = useQuery<ElectricalNetwork | null>({
queryKey: [ht.heatTraceCableNo, ht.facility, ht.project],
queryFn: async ({ signal }) => {
} = useQuery<ElectricalNetwork | null>(
/**Change facility to project */
/** facility*/[ht.heatTraceCableNo, ht.facility, ht.project],
async ({ signal }) => {
const res = await client.fetch(
`api/contexts/${contextId}/electrical/electrical-network/${encodeURIComponent(
ht.heatTraceCableNo
Expand All @@ -164,8 +168,11 @@ const useCircuitDiagramTab = (ht: HeatTrace) => {
}
return res.json();
},
throwOnError: false,
});
{
suspense: false,
useErrorBoundary: false,
}
);

const tab = useMemo(() => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import { HeatTraceChecklist } from '@cc-components/heattraceshared';
export const useGetHeatTraceChecklists = (heatTraceCabelId: string) => {
const client = useHttpClient('cc-api');
const contextId = useContextId();

const { data, isLoading, error } = useQuery<HeatTraceChecklist[], Error>({
queryKey: ['heat-trace', heatTraceCabelId, 'checklists'],
queryFn: async ({ signal }) => {
const { data, isLoading, error } = useQuery<HeatTraceChecklist[], Error>(
['heat-trace', heatTraceCabelId, 'checklists'],
async ({ signal }) => {
const respons = await client.fetch(
`/api/contexts/${contextId}/heat-trace/${heatTraceCabelId}/checklists`,
{ signal }
Expand All @@ -18,8 +17,8 @@ export const useGetHeatTraceChecklists = (heatTraceCabelId: string) => {
throw new Error();
}
return respons.json();
},
});
}
);

return {
dataChecklists: data,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { WorkorderBase, useContextId, useHttpClient } from '@cc-components/shared';
import { useQuery } from '@tanstack/react-query';

export const useGetWorkorders = (heatTraceCableId: string) => {
export const useGetWorkorders = (heatTraceCabelId: string) => {
const client = useHttpClient();
const contextId = useContextId();

const { data, isLoading, error } = useQuery<WorkorderBase[], Error>({
queryKey: ['heat-trace', heatTraceCableId, 'workorders'],
queryFn: async ({ signal }) => {
const { data, isLoading, error } = useQuery<WorkorderBase[], Error>(
['heat-trace', heatTraceCabelId, 'workorders'],
async ({ signal }) => {
const response = await client.fetch(
`/api/contexts/${contextId}/heat-trace/${heatTraceCableId}/work-orders`,
`/api/contexts/${contextId}/heat-trace/${heatTraceCabelId}/work-orders`,
{ signal }
);
if (response.status === 204) {
Expand All @@ -19,8 +18,8 @@ export const useGetWorkorders = (heatTraceCableId: string) => {
throw new Error();
}
return response.json();
},
});
}
);

return {
dataWorkorders: data,
Expand Down
15 changes: 9 additions & 6 deletions libs/loopsidesheet/src/lib/ui-sidesheet/LoopSidesheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,21 @@ export const LoopSidesheet = (props: {
data: loop,
error: sidesheetError,
isLoading: isLoadingSidesheet,
} = useQuery<Loop>({
queryKey: ['loop', props.id],
queryFn: async () => {
} = useQuery<Loop>(
['loop', props.id],
async () => {
const res = await client.fetch(`/api/contexts/${contextId}/loop/${props.id}`);
if (!res.ok) {
throw res;
}
return res.json();
},
throwOnError: false,
initialData: props.item ?? undefined,
});
{
suspense: false,
useErrorBoundary: false,
initialData: props.item ?? undefined,
}
);

const { data, isLoading, error } = useGetWorkorders(loop?.loopId);

Expand Down
11 changes: 5 additions & 6 deletions libs/loopsidesheet/src/lib/utils-sidesheet/useGetChecklists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import { ChecklistForLoop } from '../types';
export const useGetChecklists = (loopId: string) => {
const client = useHttpClient('cc-api');
const contextId = useContextId();

const { data, isLoading, error } = useQuery<ChecklistForLoop[], Error>({
queryKey: ['loop', loopId, 'checklist'],
queryFn: async ({ signal }) => {
const { data, isLoading, error } = useQuery<ChecklistForLoop[], Error>(
['loop', loopId, 'checklist'],
async ({ signal }) => {
const respons = await client.fetch(
`/api/contexts/${contextId}/loop/${loopId}/checklists`,
{ signal }
Expand All @@ -18,8 +17,8 @@ export const useGetChecklists = (loopId: string) => {
throw new Error();
}
return respons.json();
},
});
}
);

return {
data: data,
Expand Down
Loading
Loading