From d1441c9f73789129397126e51d645a3c6c406709 Mon Sep 17 00:00:00 2001 From: Trym Helle Date: Mon, 9 Dec 2024 11:07:35 +0100 Subject: [PATCH 1/6] wip trying to fix ci issues --- .gitignore | 1 + frontend/package.json | 3 ++- .../EditTechnicalInput/PROSPCaseList.tsx | 8 ++++++++ frontend/src/Utils/config.ts | 2 +- frontend/src/config.ts | 15 ++++++++++----- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 52a65faf9..cca89b6d6 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ version.ts # Environment variables .env +frontend/src/agGridLisence.ts # Python venv diff --git a/frontend/package.json b/frontend/package.json index 5d899cf05..695d3badf 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "conceptapp", - "version": "1.0.0", + "version": "2.2.1", "description": "", "type": "module", "license": "ISC", @@ -113,6 +113,7 @@ }, "manifest": { "name": "Concept App", + "version": "2.2.1", "shortName": "conceptapp", "description": "Concept App", "type": "standalone", diff --git a/frontend/src/Components/EditTechnicalInput/PROSPCaseList.tsx b/frontend/src/Components/EditTechnicalInput/PROSPCaseList.tsx index 9cff1c824..d9fd7edd5 100644 --- a/frontend/src/Components/EditTechnicalInput/PROSPCaseList.tsx +++ b/frontend/src/Components/EditTechnicalInput/PROSPCaseList.tsx @@ -71,6 +71,7 @@ const PROSPCaseList = ({ if (apiData && apiData.commonProjectAndRevisionData.cases) { const tableCases: RowData[] = [] apiData.commonProjectAndRevisionData.cases.forEach((c) => { + console.log(c) const tableCase: RowData = { id: c.id!, name: c.name ?? "", @@ -191,6 +192,13 @@ const PROSPCaseList = ({ } const getRowId = useMemo(() => (params: GetRowIdParams) => params.data.id, []) + // const getRowId = useMemo( + // () => (params: GetRowIdParams) => { + // console.log(params.data) + // return params.data.id + // }, + // [], + // ) const getFileLink = (p: any, selectedFileId: any) => { const driveItemChosen = p.data?.driveItem[0] diff --git a/frontend/src/Utils/config.ts b/frontend/src/Utils/config.ts index 51c0ff35e..d9a4f653a 100644 --- a/frontend/src/Utils/config.ts +++ b/frontend/src/Utils/config.ts @@ -41,7 +41,7 @@ export const resolveConfiguration = (env: string) => { } case "dev": return { - REACT_APP_API_BASE_URL: "https://backend-dcd-dev.radix.equinor.com", + REACT_APP_API_BASE_URL: "http://localhost:5000", BACKEND_APP_SCOPE: [ "api://151950a5-f886-47cd-b361-afb81e75c345/Project.ReadWrite", ], diff --git a/frontend/src/config.ts b/frontend/src/config.ts index 38e504c01..0f34e296d 100644 --- a/frontend/src/config.ts +++ b/frontend/src/config.ts @@ -13,11 +13,10 @@ import { MultiFilterModule } from "@ag-grid-enterprise/multi-filter" import { RangeSelectionModule } from "@ag-grid-enterprise/range-selection" import { SetFilterModule } from "@ag-grid-enterprise/set-filter" import { ExcelExportModule } from "@ag-grid-enterprise/excel-export" +import { AgGridLisenceKey } from "./agGridLisence" export const configure: AppModuleInitiator = (configurator, args) => { - const { agGridLicense } = (args.env.config?.environment as { agGridLicense?: string }) - console.log("agGridLicense", agGridLicense) - console.log("args", args) + // const { agGridLicense } = (args.env.config?.environment as { agGridLicense?: string }) const { basename } = args.env ModuleRegistry.registerModules([ @@ -40,10 +39,16 @@ export const configure: AppModuleInitiator = (configurator, args) => { // } else { // enableAgGrid(configurator) // } - enableAgGrid(configurator) + + if (AgGridLisenceKey && AgGridLisenceKey.length > 0) { + enableAgGrid(configurator, { + licenseKey: AgGridLisenceKey || "", + }) + } else { + enableAgGrid(configurator) + } configurator.useFrameworkServiceClient("portal") - configurator.useFrameworkServiceClient("people") enableNavigation(configurator, basename) From 99812714e368c90ef1f4d376a5e4df19bf83515a Mon Sep 17 00:00:00 2001 From: Trym Helle Date: Mon, 9 Dec 2024 11:21:56 +0100 Subject: [PATCH 2/6] add changes to correct branch --- .gitignore | 2 +- frontend/src/config.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index cca89b6d6..2c5ce8932 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,7 @@ version.ts # Environment variables .env -frontend/src/agGridLisence.ts +frontend/src/agGridLicense.ts # Python venv diff --git a/frontend/src/config.ts b/frontend/src/config.ts index 0f34e296d..9748bdf3c 100644 --- a/frontend/src/config.ts +++ b/frontend/src/config.ts @@ -13,7 +13,7 @@ import { MultiFilterModule } from "@ag-grid-enterprise/multi-filter" import { RangeSelectionModule } from "@ag-grid-enterprise/range-selection" import { SetFilterModule } from "@ag-grid-enterprise/set-filter" import { ExcelExportModule } from "@ag-grid-enterprise/excel-export" -import { AgGridLisenceKey } from "./agGridLisence" +import { agGridLicenseKey } from "./agGridLicense" export const configure: AppModuleInitiator = (configurator, args) => { // const { agGridLicense } = (args.env.config?.environment as { agGridLicense?: string }) @@ -40,9 +40,9 @@ export const configure: AppModuleInitiator = (configurator, args) => { // enableAgGrid(configurator) // } - if (AgGridLisenceKey && AgGridLisenceKey.length > 0) { + if (agGridLicenseKey && agGridLicenseKey.length > 0) { enableAgGrid(configurator, { - licenseKey: AgGridLisenceKey || "", + licenseKey: agGridLicenseKey || "", }) } else { enableAgGrid(configurator) From 9d94fbadbaff9f4cbcb56395d1acd32690f07dbd Mon Sep 17 00:00:00 2001 From: Trym Helle Date: Mon, 9 Dec 2024 11:34:31 +0100 Subject: [PATCH 3/6] fixing render issue --- .../EditTechnicalInputModal.tsx | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/frontend/src/Components/EditTechnicalInput/EditTechnicalInputModal.tsx b/frontend/src/Components/EditTechnicalInput/EditTechnicalInputModal.tsx index d0ed1c3df..e140ea223 100644 --- a/frontend/src/Components/EditTechnicalInput/EditTechnicalInputModal.tsx +++ b/frontend/src/Components/EditTechnicalInput/EditTechnicalInputModal.tsx @@ -42,10 +42,6 @@ const EditTechnicalInputModal = () => { enabled: !!externalId, }) - if (!apiData) { - return
Loading...
- } - const [ explorationOperationalWellCosts, setExplorationOperationalWellCosts, @@ -64,13 +60,22 @@ const EditTechnicalInputModal = () => { setOriginalDevelopmentOperationalWellCosts, ] = useState(apiData?.commonProjectAndRevisionData.developmentOperationalWellCosts) - const [wellProjectWells, setWellProjectWells] = useState(apiData?.commonProjectAndRevisionData.wells?.filter((w) => !isExplorationWell(w)) ?? []) - const [explorationWells, setExplorationWells] = useState(apiData?.commonProjectAndRevisionData.wells?.filter((w) => isExplorationWell(w)) ?? []) + const [wellProjectWells, setWellProjectWells] = useState( + apiData?.commonProjectAndRevisionData.wells?.filter((w) => !isExplorationWell(w)) ?? [], + ) + const [explorationWells, setExplorationWells] = useState( + apiData?.commonProjectAndRevisionData.wells?.filter((w) => isExplorationWell(w)) ?? [], + ) - const [originalWellProjectWells, setOriginalWellProjectWells] = useState(apiData?.commonProjectAndRevisionData.wells?.filter((w) => !isExplorationWell(w)) ?? []) - const [originalExplorationWells, setOriginalExplorationWells] = useState(apiData?.commonProjectAndRevisionData.wells?.filter((w) => isExplorationWell(w)) ?? []) + const [originalWellProjectWells, setOriginalWellProjectWells] = useState( + apiData?.commonProjectAndRevisionData.wells?.filter((w) => !isExplorationWell(w)) ?? [], + ) + const [originalExplorationWells, setOriginalExplorationWells] = useState( + apiData?.commonProjectAndRevisionData.wells?.filter((w) => isExplorationWell(w)) ?? [], + ) const handleSave = async () => { + if (!apiData) { return } try { const dto: Components.Schemas.UpdateTechnicalInputDto = {} setIsSaving(true) @@ -119,7 +124,7 @@ const EditTechnicalInputModal = () => { setOriginalExplorationWells(structuredClone(apiData?.commonProjectAndRevisionData.wells?.filter((w) => isExplorationWell(w)) ?? [])) }, [apiData]) - if (!explorationOperationalWellCosts || !developmentOperationalWellCosts) { + if (!apiData || !explorationOperationalWellCosts || !developmentOperationalWellCosts) { return (
Loading...
) } From 3ccbe1fa54011c3f1733140fc51ffa07f385d771 Mon Sep 17 00:00:00 2001 From: Trym Helle Date: Mon, 9 Dec 2024 11:36:38 +0100 Subject: [PATCH 4/6] cleanup --- .../src/Components/EditTechnicalInput/PROSPCaseList.tsx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/frontend/src/Components/EditTechnicalInput/PROSPCaseList.tsx b/frontend/src/Components/EditTechnicalInput/PROSPCaseList.tsx index 9da4e949b..dfa55d4d1 100644 --- a/frontend/src/Components/EditTechnicalInput/PROSPCaseList.tsx +++ b/frontend/src/Components/EditTechnicalInput/PROSPCaseList.tsx @@ -71,7 +71,6 @@ const PROSPCaseList = ({ if (apiData && apiData.commonProjectAndRevisionData.cases) { const tableCases: RowData[] = [] apiData.commonProjectAndRevisionData.cases.forEach((c) => { - console.log(c) const tableCase: RowData = { id: c.caseId!, name: c.name ?? "", @@ -192,13 +191,6 @@ const PROSPCaseList = ({ } const getRowId = useMemo(() => (params: GetRowIdParams) => params.data.id, []) - // const getRowId = useMemo( - // () => (params: GetRowIdParams) => { - // console.log(params.data) - // return params.data.id - // }, - // [], - // ) const getFileLink = (p: any, selectedFileId: any) => { const driveItemChosen = p.data?.driveItem[0] From f7f928401855bc1ce1b0cc7da1e70af4c7fc39de Mon Sep 17 00:00:00 2001 From: Trym Helle Date: Mon, 9 Dec 2024 11:41:30 +0100 Subject: [PATCH 5/6] dotnet format --- .../api/Features/ProjectData/Dtos/AssetDtos/CaseOverviewDto.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/api/Features/ProjectData/Dtos/AssetDtos/CaseOverviewDto.cs b/backend/api/Features/ProjectData/Dtos/AssetDtos/CaseOverviewDto.cs index 044ef6902..67cc9e65b 100644 --- a/backend/api/Features/ProjectData/Dtos/AssetDtos/CaseOverviewDto.cs +++ b/backend/api/Features/ProjectData/Dtos/AssetDtos/CaseOverviewDto.cs @@ -11,7 +11,7 @@ public class CaseOverviewDto [Required] public required string Name { get; set; } [Required] public required string Description { get; set; } [Required] public required bool Archived { get; set; } - [Required] public required bool ReferenceCase {get; set; } + [Required] public required bool ReferenceCase { get; set; } [Required] public required ProductionStrategyOverview ProductionStrategyOverview { get; set; } [Required] public required ArtificialLift ArtificialLift { get; set; } [Required] public required int ProducerCount { get; set; } From 017f34868e954c926b144cc716bad0b4f570a5f3 Mon Sep 17 00:00:00 2001 From: Trym Helle Date: Mon, 9 Dec 2024 11:44:35 +0100 Subject: [PATCH 6/6] remove local aggrid workaround --- frontend/src/config.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/frontend/src/config.ts b/frontend/src/config.ts index 9748bdf3c..02c0e5ce2 100644 --- a/frontend/src/config.ts +++ b/frontend/src/config.ts @@ -13,7 +13,7 @@ import { MultiFilterModule } from "@ag-grid-enterprise/multi-filter" import { RangeSelectionModule } from "@ag-grid-enterprise/range-selection" import { SetFilterModule } from "@ag-grid-enterprise/set-filter" import { ExcelExportModule } from "@ag-grid-enterprise/excel-export" -import { agGridLicenseKey } from "./agGridLicense" +// import { agGridLicenseKey } from "./agGridLicense" export const configure: AppModuleInitiator = (configurator, args) => { // const { agGridLicense } = (args.env.config?.environment as { agGridLicense?: string }) @@ -32,21 +32,15 @@ export const configure: AppModuleInitiator = (configurator, args) => { ExcelExportModule, ]) - // if (agGridLicense && agGridLicense.length > 0) { + // if (agGridLicenseKey && agGridLicenseKey.length > 0) { // enableAgGrid(configurator, { - // licenseKey: agGridLicense || "", + // licenseKey: agGridLicenseKey || "", // }) // } else { // enableAgGrid(configurator) // } - if (agGridLicenseKey && agGridLicenseKey.length > 0) { - enableAgGrid(configurator, { - licenseKey: agGridLicenseKey || "", - }) - } else { - enableAgGrid(configurator) - } + enableAgGrid(configurator) configurator.useFrameworkServiceClient("portal")