From 956bf8d320c7aa45a77ae2b1f6511b2d536759d4 Mon Sep 17 00:00:00 2001 From: dbarber-cps Date: Thu, 25 Jun 2026 15:23:07 +0100 Subject: [PATCH 1/3] bugfix temp removal of e2e tests (#411) --- materials_devops_pipelines/Materials-PR.yml | 105 ++++++++++---------- 1 file changed, 53 insertions(+), 52 deletions(-) diff --git a/materials_devops_pipelines/Materials-PR.yml b/materials_devops_pipelines/Materials-PR.yml index 06367779..52753b40 100644 --- a/materials_devops_pipelines/Materials-PR.yml +++ b/materials_devops_pipelines/Materials-PR.yml @@ -211,59 +211,60 @@ stages: # ---------- E2E TESTS (Playwright) ---------- - - script: | - npx playwright install - displayName: 'Install Playwright browsers' - condition: ne(variables['PLAYWRIGHT_CACHE_RESTORED'], 'true') - workingDirectory: '$(workingDir)' - env: - PLAYWRIGHT_BROWSERS_PATH: '$(Pipeline.Workspace)/.playwright' +#temp removal of E2E tests until pipeline issues resolved + # - script: | + # npx playwright install + # displayName: 'Install Playwright browsers' + # condition: ne(variables['PLAYWRIGHT_CACHE_RESTORED'], 'true') + # workingDirectory: '$(workingDir)' + # env: + # PLAYWRIGHT_BROWSERS_PATH: '$(Pipeline.Workspace)/.playwright' - - script: | - npx playwright install-deps - displayName: 'Install Playwright OS dependencies' - condition: and(eq(variables['Agent.OS'], 'Linux'), ne(variables['PLAYWRIGHT_CACHE_RESTORED'], 'true')) - workingDirectory: '$(workingDir)' - env: - PLAYWRIGHT_BROWSERS_PATH: '$(Pipeline.Workspace)/.playwright' + # - script: | + # npx playwright install-deps + # displayName: 'Install Playwright OS dependencies' + # condition: and(eq(variables['Agent.OS'], 'Linux'), ne(variables['PLAYWRIGHT_CACHE_RESTORED'], 'true')) + # workingDirectory: '$(workingDir)' + # env: + # PLAYWRIGHT_BROWSERS_PATH: '$(Pipeline.Workspace)/.playwright' - - task: Npm@1 - displayName: 'Run E2E Tests with Coverage' - inputs: - command: 'custom' - customCommand: 'run e2e' - workingDir: '$(workingDir)' - env: - PLAYWRIGHT_BROWSERS_PATH: '$(Pipeline.Workspace)/.playwright' - E2E_TEST_MS_USERNAME: $(e2e_username) - E2E_TEST_MS_PASSWORD: $(e2e_password) - E2E_CIN3_USERNAME: $(e2e_cin3_username) - E2E_CIN3_PASSWORD: $(e2e_cin3_password) - E2E_CMS_COOKIE_URL: $(e2e_cms_cookie_url) - E2E_URN: $(e2e_urn) - E2E_CASE: $(e2e_case) - VITE_MSAL_CLIENT_ID: $(MSAL_CLIENT_ID) - VITE_MSAL_TENANT_ID: $(MSAL_TENANT_ID) - VITE_MSAL_REDIRECT_URI: $(MSAL_REDIRECT_URI_LOCAL) - VITE_POLARIS_GATEWAY_URL: $(POLARIS_GATEWAY_URL) - VITE_POLARIS_GATEWAY_SCOPE: $(POLARIS_GATEWAY_SCOPE) - VITE_GLOBAL_SCRIPT_URL: $(GLOBAL_SCRIPT_URL) - VITE_BASE_URL: $(BASE_URL) - VITE_E2E: True + # - task: Npm@1 + # displayName: 'Run E2E Tests with Coverage' + # inputs: + # command: 'custom' + # customCommand: 'run e2e' + # workingDir: '$(workingDir)' + # env: + # PLAYWRIGHT_BROWSERS_PATH: '$(Pipeline.Workspace)/.playwright' + # E2E_TEST_MS_USERNAME: $(e2e_username) + # E2E_TEST_MS_PASSWORD: $(e2e_password) + # E2E_CIN3_USERNAME: $(e2e_cin3_username) + # E2E_CIN3_PASSWORD: $(e2e_cin3_password) + # E2E_CMS_COOKIE_URL: $(e2e_cms_cookie_url) + # E2E_URN: $(e2e_urn) + # E2E_CASE: $(e2e_case) + # VITE_MSAL_CLIENT_ID: $(MSAL_CLIENT_ID) + # VITE_MSAL_TENANT_ID: $(MSAL_TENANT_ID) + # VITE_MSAL_REDIRECT_URI: $(MSAL_REDIRECT_URI_LOCAL) + # VITE_POLARIS_GATEWAY_URL: $(POLARIS_GATEWAY_URL) + # VITE_POLARIS_GATEWAY_SCOPE: $(POLARIS_GATEWAY_SCOPE) + # VITE_GLOBAL_SCRIPT_URL: $(GLOBAL_SCRIPT_URL) + # VITE_BASE_URL: $(BASE_URL) + # VITE_E2E: True - - task: PublishPipelineArtifact@1 - displayName: 'Publish E2E Artifact' - inputs: - targetPath: '$(workingDir)/tests/playwright-report' - artifact: 'playwright-report' - publishLocation: 'pipeline' - condition: succeededOrFailed() + # - task: PublishPipelineArtifact@1 + # displayName: 'Publish E2E Artifact' + # inputs: + # targetPath: '$(workingDir)/tests/playwright-report' + # artifact: 'playwright-report' + # publishLocation: 'pipeline' + # condition: succeededOrFailed() - - task: PublishTestResults@2 - displayName: 'Publish E2E Test Results (JUnit)' - inputs: - testResultsFormat: 'JUnit' - testResultsFiles: '$(workingDir)/tests/e2e-test-results.xml' - testRunTitle: 'E2E Tests' - publishRunAttachments: false - condition: always() \ No newline at end of file + # - task: PublishTestResults@2 + # displayName: 'Publish E2E Test Results (JUnit)' + # inputs: + # testResultsFormat: 'JUnit' + # testResultsFiles: '$(workingDir)/tests/e2e-test-results.xml' + # testRunTitle: 'E2E Tests' + # publishRunAttachments: false + # condition: always() \ No newline at end of file From 15c8315df64a53b09f3066961699c37a1827b8f6 Mon Sep 17 00:00:00 2001 From: kramduny-cps Date: Thu, 25 Jun 2026 15:26:14 +0100 Subject: [PATCH 2/3] Sync Dev branch with Main (#409) * FCT2-19669 move doc buttons (#407) * move doc buttons * fix doc refetch on exiting full width mode * updating branch triggers for new strategy (#405) * updating branch triggers for new strategy * updated stage Determine_Changes to support multiple branches * adding checkout self * removed main from PR trigger --------- Co-authored-by: benrome-cps Co-authored-by: dbarber-cps --- materials_devops_pipelines/Materials-PR.yml | 30 ++++++- .../Materials-UI-Build-Prod.yml | 2 +- .../Materials-UI-Build-Staging.yml | 2 +- .../Materials-UI-Release-Prod.yml | 2 +- .../Materials-UI-Release-Staging.yml | 2 +- .../dropDownButton/DropdownButton.tsx | 1 - .../src/caseWorkApp/components/tabs/Tabs.tsx | 42 ++++++--- .../ReviewAndRedactPage.tsx | 42 ++++++--- .../DocumentTabPanel/DocumentTabPanel.tsx | 12 +-- .../DocumentActionsDropdown.tsx | 89 +++++++++++++++++++ .../documenViewportArea/index.tsx | 78 +--------------- 11 files changed, 186 insertions(+), 116 deletions(-) create mode 100644 materials_ui/src/materials_components/documenViewportArea/DocumentActionsDropdown.tsx diff --git a/materials_devops_pipelines/Materials-PR.yml b/materials_devops_pipelines/Materials-PR.yml index 52753b40..59bf53dc 100644 --- a/materials_devops_pipelines/Materials-PR.yml +++ b/materials_devops_pipelines/Materials-PR.yml @@ -6,7 +6,8 @@ trigger: none pr: branches: include: - - main + - development + paths: include: - terraform/* @@ -59,13 +60,34 @@ stages: pool: name: $(dev-build-agent) steps: + - checkout: self + fetchDepth: 0 + - task: PowerShell@2 inputs: targetType: 'inline' script: | - git fetch origin main - $files = $(git diff --name-only origin/main) - $temp=$files -split ' ' + $targetBranch = $env:SYSTEM_PULLREQUEST_TARGETBRANCH + $targetBranchOverride = $env:TARGETBRANCHOVERRIDE + + # Optional override to support manual runs. + if ([string]::IsNullOrWhiteSpace($targetBranch) -and -not [string]::IsNullOrWhiteSpace($targetBranchOverride)) + { + $targetBranch = $targetBranchOverride + } + + if ([string]::IsNullOrWhiteSpace($targetBranch)) + { + # Default for non-PR runs when no override is provided. + $targetBranch = "refs/heads/development" + } + + $targetBranchName = $targetBranch -replace '^refs/heads/', '' + echo "Comparing changes against origin/$targetBranchName" + + git fetch origin "+refs/heads/${targetBranchName}:refs/remotes/origin/${targetBranchName}" --depth=200 + + $temp = @(git diff --name-only "origin/$targetBranchName...HEAD" | ForEach-Object { $_.Trim() } | Where-Object { -not [string]::IsNullOrWhiteSpace($_) }) $count=$temp.Length echo "Total changed $count files" diff --git a/materials_devops_pipelines/Materials-UI-Build-Prod.yml b/materials_devops_pipelines/Materials-UI-Build-Prod.yml index d02b74e6..305e6f19 100644 --- a/materials_devops_pipelines/Materials-UI-Build-Prod.yml +++ b/materials_devops_pipelines/Materials-UI-Build-Prod.yml @@ -5,7 +5,7 @@ trigger: batch: true branches: include: - - development ## TBC once branching confirmed + - main paths: include: - materials_ui diff --git a/materials_devops_pipelines/Materials-UI-Build-Staging.yml b/materials_devops_pipelines/Materials-UI-Build-Staging.yml index 8621c25c..f4a63349 100644 --- a/materials_devops_pipelines/Materials-UI-Build-Staging.yml +++ b/materials_devops_pipelines/Materials-UI-Build-Staging.yml @@ -5,7 +5,7 @@ trigger: batch: true branches: include: - - development ## TBC once branching confirmed + - main paths: include: - materials_ui diff --git a/materials_devops_pipelines/Materials-UI-Release-Prod.yml b/materials_devops_pipelines/Materials-UI-Release-Prod.yml index 3709b443..65f9760f 100644 --- a/materials_devops_pipelines/Materials-UI-Release-Prod.yml +++ b/materials_devops_pipelines/Materials-UI-Release-Prod.yml @@ -9,7 +9,7 @@ resources: trigger: branches: include: - - refs/heads/development + - refs/heads/main stages: - Publish_Artifacts diff --git a/materials_devops_pipelines/Materials-UI-Release-Staging.yml b/materials_devops_pipelines/Materials-UI-Release-Staging.yml index 4aeedabb..fcfd7b33 100644 --- a/materials_devops_pipelines/Materials-UI-Release-Staging.yml +++ b/materials_devops_pipelines/Materials-UI-Release-Staging.yml @@ -9,7 +9,7 @@ resources: trigger: branches: include: - - refs/heads/development + - refs/heads/main stages: - Publish_Artifacts diff --git a/materials_ui/src/caseWorkApp/components/dropDownButton/DropdownButton.tsx b/materials_ui/src/caseWorkApp/components/dropDownButton/DropdownButton.tsx index 7caa5796..dc3b86e7 100644 --- a/materials_ui/src/caseWorkApp/components/dropDownButton/DropdownButton.tsx +++ b/materials_ui/src/caseWorkApp/components/dropDownButton/DropdownButton.tsx @@ -84,7 +84,6 @@ export const DropdownButton2 = (p: { + + + )} - )} + {documentActions} +
= ({ alignItems: 'start' }} > -
- -
-
({ diff --git a/materials_ui/src/caseWorkApp/pages/ReviewAndRedactPage/ReviewAndRedactPage.tsx b/materials_ui/src/caseWorkApp/pages/ReviewAndRedactPage/ReviewAndRedactPage.tsx index 930da37a..a13b814c 100644 --- a/materials_ui/src/caseWorkApp/pages/ReviewAndRedactPage/ReviewAndRedactPage.tsx +++ b/materials_ui/src/caseWorkApp/pages/ReviewAndRedactPage/ReviewAndRedactPage.tsx @@ -21,6 +21,7 @@ import { DocSearchContext, DocumentTabPanel } from '../../../materials_components/DocumentTabPanel/DocumentTabPanel'; +import { DocumentActionsDropdown } from '../../../materials_components/documenViewportArea/DocumentActionsDropdown'; import { TRedaction } from '../../../materials_components/PdfRedactor/utils/coordUtils'; import { isRedactionEnabledMode, @@ -87,6 +88,9 @@ export const ReviewAndRedactPage = () => { const [modeByParentId, setModeByParentId] = useState>( {} ); + const [numOfPagesByParentId, setNumOfPagesByParentId] = useState< + Record + >({}); const [searchModalOpen, setSearchModalOpen] = useState(false); @@ -229,15 +233,12 @@ export const ReviewAndRedactPage = () => { reloadSidebarTrigger.fire(); }} initRedactions={redactionsIndexedOnParentId[doc.parentId]} - onViewInNewWindowClick={() => { - if (!urn || !caseId) return; - navigateToViewDocumentPageInNewTab({ - urn, - caseId, - materialId: doc.parentId - }); - }} - onRedactionLogClick={() => setShowRedactionLogModal(true)} + onNumOfPagesChange={(numOfPages) => + setNumOfPagesByParentId((prev) => ({ + ...prev, + [doc.parentId]: numOfPages + })) + } searchContext={searchContextByParentId[doc.parentId]} onFocusedSearchIndexChange={(index) => setFocusedSearchIndex(doc.parentId, index) @@ -290,6 +291,7 @@ export const ReviewAndRedactPage = () => { setOpenParentIds([]); setSearchContextByParentId({}); setRedactionsIndexedOnParentId({}); + setNumOfPagesByParentId({}); const sidebarFocusTarget = document.querySelector( @@ -475,7 +477,9 @@ export const ReviewAndRedactPage = () => { onSetDocumentOpenIds={setOpenParentIds} onDocumentClick={requestActiveTabChange} reloadTriggerData={reloadSidebarTrigger.data} - onDocumentsChange={setDocuments} + onDocumentsChange={(docs) => { + if (docs !== undefined) setDocuments(docs); + }} /> ) : undefined @@ -491,6 +495,24 @@ export const ReviewAndRedactPage = () => { noMargin onShowHideCategoriesClick={() => setIsSidebarVisible((v) => !v)} isShowCategories={isSidebarVisible} + documentActions={ + + handleModeChange(activeTabId, newMode) + } + onRedactionLogClick={() => setShowRedactionLogModal(true)} + onViewInNewWindowClick={() => { + if (!urn || !caseId) return; + navigateToViewDocumentPageInNewTab({ + urn, + caseId, + materialId: activeTabId + }); + }} + numOfDocumentPages={numOfPagesByParentId[activeTabId] ?? 0} + /> + } /> )} diff --git a/materials_ui/src/materials_components/DocumentTabPanel/DocumentTabPanel.tsx b/materials_ui/src/materials_components/DocumentTabPanel/DocumentTabPanel.tsx index fc58950c..dad3c6f1 100644 --- a/materials_ui/src/materials_components/DocumentTabPanel/DocumentTabPanel.tsx +++ b/materials_ui/src/materials_components/DocumentTabPanel/DocumentTabPanel.tsx @@ -42,9 +42,8 @@ export type DocumentTabPanelProps = { onModeChange: (mode: TMode) => void; onRedactionsChange: (redactions: TRedaction[]) => void; onModification: (x: TDocument) => void; - onViewInNewWindowClick: () => void; initRedactions?: TRedaction[]; - onRedactionLogClick: () => void; + onNumOfPagesChange: (numOfPages: number) => void; searchContext?: DocSearchContext; onFocusedSearchIndexChange?: (index: number) => void; onBackToSearchResults?: () => void; @@ -62,8 +61,7 @@ export const DocumentTabPanel = ({ onRedactionsChange, onModification, initRedactions, - onViewInNewWindowClick, - onRedactionLogClick, + onNumOfPagesChange, searchContext, onFocusedSearchIndexChange, onBackToSearchResults, @@ -121,7 +119,6 @@ export const DocumentTabPanel = ({ } }; }, [parentId, childId, urn, caseId]); - const [numOfDocumentPages, setNumOfDocumentPages] = useState(0); useEffect(() => { const loadLookups = async () => { @@ -178,9 +175,6 @@ export const DocumentTabPanel = ({ documentName={document.presentationTitle} mode={mode} onModeChange={onModeChange} - onViewInNewWindowButtonClick={onViewInNewWindowClick} - onRedactionLogClick={onRedactionLogClick} - numOfDocumentPages={numOfDocumentPages} searchMode={ searchContext ? { @@ -220,7 +214,7 @@ export const DocumentTabPanel = ({ setShowRedactionLogModal(true); }} onRedactionSaveStatusChange={setRedactionSaveStatus} - onNumOfPagesDocumentChange={(x) => setNumOfDocumentPages(x)} + onNumOfPagesDocumentChange={onNumOfPagesChange} searchHighlights={searchContext?.highlights} focusedSearchIndex={searchContext?.focusedIndex} checkInDocumentTriggerData={checkInDocumentTriggerData} diff --git a/materials_ui/src/materials_components/documenViewportArea/DocumentActionsDropdown.tsx b/materials_ui/src/materials_components/documenViewportArea/DocumentActionsDropdown.tsx new file mode 100644 index 00000000..798ab197 --- /dev/null +++ b/materials_ui/src/materials_components/documenViewportArea/DocumentActionsDropdown.tsx @@ -0,0 +1,89 @@ +import { useState } from 'react'; +import { + DropdownButton2, + DropdownListItem +} from '../../caseWorkApp/components/dropDownButton/DropdownButton'; +import { TMode } from '../PdfRedactor/utils/modeUtils'; + +const DROPDOWN_ACTIONS = { + LOG_REDACTION: 'log-redaction', + ROTATE: 'rotate', + DELETE: 'delete', + VIEW_NEW_WINDOW: 'view-new-window' +} as const; + +type DocumentActionsDropdownProps = { + mode: TMode; + onModeChange: (mode: TMode) => void; + onRedactionLogClick: () => void; + onViewInNewWindowClick: () => void; + numOfDocumentPages: number; +}; + +export const DocumentActionsDropdown = ({ + mode, + onModeChange, + onRedactionLogClick, + onViewInNewWindowClick, + numOfDocumentPages +}: DocumentActionsDropdownProps) => { + const [isDropdownOpen, setIsDropdownOpen] = useState(false); + + return ( + Document actions} + isOpen={isDropdownOpen} + setIsOpen={(x) => setIsDropdownOpen(x)} + > +
+ { + onRedactionLogClick(); + setIsDropdownOpen(false); + }} + borderBottom + > + Log an Under/Over redaction + + { + onModeChange(mode === 'rotation' ? 'disabled' : 'rotation'); + setIsDropdownOpen(false); + }} + > + {mode === 'rotation' + ? 'Hide rotate document pages' + : 'Rotate document pages'} + + {numOfDocumentPages > 1 && ( + { + onModeChange(mode === 'deletion' ? 'disabled' : 'deletion'); + setIsDropdownOpen(false); + }} + > + {mode === 'deletion' + ? 'Hide delete page options' + : 'Show delete page options'} + + )} + { + onViewInNewWindowClick(); + setIsDropdownOpen(false); + }} + > + View in new window + +
+
+ ); +}; diff --git a/materials_ui/src/materials_components/documenViewportArea/index.tsx b/materials_ui/src/materials_components/documenViewportArea/index.tsx index ad4c4492..8bdcfd9e 100644 --- a/materials_ui/src/materials_components/documenViewportArea/index.tsx +++ b/materials_ui/src/materials_components/documenViewportArea/index.tsx @@ -1,17 +1,6 @@ -import { CSSProperties, useState } from 'react'; -import { - DropdownButton2, - DropdownListItem -} from '../../caseWorkApp/components/dropDownButton/DropdownButton'; +import { CSSProperties } from 'react'; import { isRedactionEnabledMode, TMode } from '../PdfRedactor/utils/modeUtils'; -const DROPDOWN_ACTIONS = { - LOG_REDACTION: 'log-redaction', - ROTATE: 'rotate', - DELETE: 'delete', - VIEW_NEW_WINDOW: 'view-new-window' -} as const; - const linkButtonStyle: CSSProperties = { margin: '0.125rem', display: 'inline', @@ -38,9 +27,6 @@ type DocumentViewportAreaProps = { documentName: string; mode: TMode; onModeChange: (mode: TMode) => void; - onViewInNewWindowButtonClick: () => void; - onRedactionLogClick: () => void; - numOfDocumentPages: number; searchMode?: SearchModeProps; }; @@ -48,12 +34,8 @@ export const DocumentViewportArea = ({ documentName, mode, onModeChange, - onViewInNewWindowButtonClick, - onRedactionLogClick, - numOfDocumentPages, searchMode }: DocumentViewportAreaProps) => { - const [isDropdownOpen, setIsDropdownOpen] = useState(false); return (
{searchMode ? ( @@ -159,61 +142,6 @@ export const DocumentViewportArea = ({ ? 'Stop redacting' : 'Start redacting'} - Document Actions} - isOpen={isDropdownOpen} - setIsOpen={(x) => setIsDropdownOpen(x)} - > -
- { - onRedactionLogClick(); - setIsDropdownOpen(false); - }} - borderBottom - > - Log an Under/Over redaction - - { - onModeChange(mode === 'rotation' ? 'disabled' : 'rotation'); - setIsDropdownOpen(false); - }} - > - {mode === 'rotation' - ? 'Hide rotate document pages' - : 'Rotate document pages'} - - {numOfDocumentPages > 1 && ( - { - onModeChange(mode === 'deletion' ? 'disabled' : 'deletion'); - setIsDropdownOpen(false); - }} - > - {mode === 'deletion' - ? 'Hide delete page options' - : 'Show delete page options'} - - )} - { - onViewInNewWindowButtonClick(); - setIsDropdownOpen(false); - }} - > - View in new window - -
-
From 814e0efece77105af59b012ee92d3d4329624175 Mon Sep 17 00:00:00 2001 From: afeescps Date: Thu, 25 Jun 2026 15:47:26 +0100 Subject: [PATCH 3/3] fix(materials): only show update option for exhibits and statements (#408) --- materials_ui/src/pages/Materials.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/materials_ui/src/pages/Materials.tsx b/materials_ui/src/pages/Materials.tsx index 1ee62e82..b8612c0e 100644 --- a/materials_ui/src/pages/Materials.tsx +++ b/materials_ui/src/pages/Materials.tsx @@ -138,11 +138,11 @@ export const MaterialsPage = () => { onClick: () => handleEditClick(row as CaseMaterialsType, getRoute('MATERIALS')), hide: (() => { - const itemCommsCategory = selectedItems.communications[0]?.category; - if (!itemCommsCategory) return; + const itemMaterialsCategory = selectedItems.materials[0]?.category; + if (!itemMaterialsCategory) return; return ( - selectedItems.communications.length > 1 || - !['Exhibit', 'Statement'].includes(itemCommsCategory) + selectedItems.materials.length > 1 || + !['Exhibit', 'Statement'].includes(itemMaterialsCategory) ); })() },