Skip to content

Commit

Permalink
Merge branch 'master' into EXUI-1227-MP3AndMP4NotOpeningInCaseFileView
Browse files Browse the repository at this point in the history
  • Loading branch information
RiteshHMCTS authored Jan 22, 2025
2 parents 457bca3 + ead614d commit d964220
Show file tree
Hide file tree
Showing 107 changed files with 15,986 additions and 11,774 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: corepack enable && yarn --version
- run: yarn install
- run: yarn test:audit
- run: yarn lint
- run: yarn build
- run: yarn test
Expand All @@ -31,7 +32,7 @@ jobs:
- name: Change Report Path
run: sed -i 's+/home/runner/work/ccd-case-ui-toolkit/ccd-case-ui-toolkit+/github/workspace+g' coverage/ccd-case-ui-toolkit/lcov.info
- name: Archive code coverage results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: coverage
Expand All @@ -42,23 +43,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Download code coverage results
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: code-coverage-report
path: coverage
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@v3.0.0
uses: sonarsource/sonarcloud-github-action@v4.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Send slack
if: failure()
uses: sonots/slack-notice-action@v3
uses: sonots/slack-notice-action@v3.2.0
with:
status: ${{ job.status }}
env:
Expand All @@ -70,8 +71,8 @@ jobs:
needs: sonarcloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
Expand All @@ -88,8 +89,8 @@ jobs:
needs: sonarcloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://npm.pkg.github.com/
Expand Down
874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.4.cjs

This file was deleted.

925 changes: 925 additions & 0 deletions .yarn/releases/yarn-4.5.0.cjs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ compressionLevel: mixed

enableGlobalCache: false

enableStrictSsl: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.4.cjs
yarnPath: .yarn/releases/yarn-4.5.0.cjs
45 changes: 44 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,46 @@
## RELEASE NOTES
## RELEASE NOTES

### Version 7.1.27
**EXUI-2672** Incorrect Timestamp in CaseFileView

### Version 7.1.26
**EXUI-2223** Accessibility-issue

### Version 7.1.25
**EXUI-1951** Retrieve current user language selection

### Version 7.1.24
Taken by PR

### Version 7.0.75-exui-2575
**EXUI-2536** issue with DynamicMultiSelectList
**EXUI-2431** Special characters stopping events
**EXUI-2537** upgrade pdf-dist in media viewer
**EXUI-2389** PED and Media Viewer

### Version 7.0.75-exui-2315
**EXUI-2315** etrieve current user language selection


### Version 7.0.75-exui-2515
**EXUI-2515** case-link-issue

### Version 7.0.75-exui-2462-rc1
**EXUI-2462** DynamicRadioList incorrectly selects the wrong radio button

### Version 7.0.75
**EXUI-2415** Redirect to an new event by a hyperlink

### Version 7.0.74
**EXUI-1108** Fix yarn npm audit in ccd-case-ui-toolkit

### Version 7.0.71
**EXUI-EXUI-2227** error-handling-specific-access-request

### Version 7.0.70
**EXUI-2193** Get rid of mc-menu-items LD flag
**EXUI-2346** Not able to see unavailable dates on check your answers page
**EXUI-2460** Describe your evidence' free text boxes not being

### Version 7.0.69
**EXUI-2354** Flakyness/slow login/Search issue
Expand All @@ -7,6 +49,7 @@
**EXUI-2146** Case file view time is 1 hour behind
**EXUI-2230** Case File View date/time as GMT rather than Local BST


### Version 7.0.66
**EXUI-2148** Additional checks on task completion from session storage
**EXUI-2057** A frozen screen is seen when attempting to complete a current task...
Expand Down
56 changes: 23 additions & 33 deletions bin/run-yarn-audit.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
#!/usr/bin/env bash
set +e
yarn audit
result=$?
set -e
#!/bin/bash

if [[ "$result" != 0 ]]; then
if [[ -f yarn-audit-known-issues ]]; then
set +e
yarn audit --json | grep auditAdvisory > yarn-audit-issues
set -e
new_vulnerabilities=false
while read -r line; do
url=$(node -pe 'JSON.parse(process.argv[1]).data.advisory.url' "$line")
if ! grep -q "$url" yarn-audit-known-issues; then
echo "unknown vulnerability:$url"
new_vulnerabilities=true
fi
done < yarn-audit-issues
upToDateVulnerabilities=$(mktemp)
vulnerabilitiesInRepo="./yarn-audit-known-issues"

if [[ "$new_vulnerabilities" = true ]] ; then
echo
echo Security vulnerabilities were found that were not ignored
echo
echo Check to see if these vulnerabilities apply to production
echo and/or if they have fixes available. If they do not have
echo fixes and they do not apply to production, you may ignore them
echo
echo To ignore these vulnerabilities, please add advisories urls
echo "to yarn-audit-known-issues (eg: https://npmjs.com/advisories/755)"
echo
echo and commit the yarn-audit-known-issues file.
yarn npm audit --recursive --environment production --json > "$upToDateVulnerabilities"

exit "$result"
fi
# Ensure both files exist
if [[ ! -f "$upToDateVulnerabilities" || ! -f "$vulnerabilitiesInRepo" ]]; then
echo "Error: One or both required files do not exist."
rm -f "$upToDateVulnerabilities"
exit 1
fi

fi
# Compare the files and act based on the result
if diff_output=$(diff "$upToDateVulnerabilities" "$vulnerabilitiesInRepo"); then
echo "No differences found in vulnerabilities."
else
echo
echo "Security vulnerability differences were found"
echo
echo "To ignore these vulnerabilities, run:"
echo 'yarn npm audit --recursive --environment production --json > yarn-audit-known-issues'
echo
exit 1
fi

rm -f "$upToDateVulnerabilities"
3 changes: 2 additions & 1 deletion browserslist
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
not op_mini all
not kaios 2.5
9 changes: 8 additions & 1 deletion demo/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export class AppConfig extends AbstractAppConfig {
'access_management_mode': true,
'refunds_url': '/api/refunds',
'payment_return_url': 'https://paymentoutcome-web.demo.platform.hmcts.net/',
'case_flags_refdata_api_url': '/refdata/commondata/caseflags/service-id=:sid'
'case_flags_refdata_api_url': '/refdata/commondata/caseflags/service-id=:sid',
'events_to_hide': [
'queryManagementRespondQuery'
]
};

constructor(private http: HttpClient) {
Expand Down Expand Up @@ -187,4 +190,8 @@ export class AppConfig extends AbstractAppConfig {
public getCaseFlagsRefdataApiUrl(): string {
return this.config.case_flags_refdata_api_url;
}

public getEventsToHide(): string[] {
return this.config.events_to_hide;
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@edium/fsm": "^2.1.2",
"@hmcts/ccpay-web-component": "6.2.1",
"@hmcts/frontend": "0.0.50-alpha",
"@hmcts/media-viewer": "4.0.8",
"@hmcts/media-viewer": "4.0.9",
"@ngrx/effects": "17.2.0",
"@ngrx/store": "^17.2.0",
"@nicky-lenaers/ngx-scroll-to": "^14.0.0",
Expand Down Expand Up @@ -237,5 +237,5 @@
"sourceMap": false,
"instrument": false
},
"packageManager": "yarn@3.6.4"
"packageManager": "yarn@4.5.0"
}
10 changes: 8 additions & 2 deletions projects/ccd-case-ui-toolkit/src/lib/app-config.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,20 +207,26 @@ export class AppMockConfig implements AbstractAppConfig {
return '';
}

public getEventsToHide(): string[] {
return [];
}

public getEnableRestrictedCaseAccessConfig(): boolean {
return true;
}

public getEnableCaseFileViewVersion1_1(): boolean {
return true;
}

public getIcpEnable(): boolean {
return false;
}

public getIcpJurisdictions(): string[] {
return ['', ''];
}
public logMessage(): void {

public logMessage(msg: string): void {
console.log(msg);
}
}
2 changes: 2 additions & 0 deletions projects/ccd-case-ui-toolkit/src/lib/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export abstract class AbstractAppConfig {
public abstract getCaseFlagsRefdataApiUrl(): string;
public abstract getRDCommonDataApiUrl(): string;
public abstract getCaseDataStoreApiUrl(): string;
public abstract getEventsToHide(): string[];
public abstract getEnableRestrictedCaseAccessConfig(): boolean;
public abstract getEnableCaseFileViewVersion1_1(): boolean;
}
Expand Down Expand Up @@ -194,4 +195,5 @@ export class CaseEditorConfig {
public enable_case_file_view_version_1_1: boolean;
public icp_enabled: boolean;
public icp_jurisdictions: string[];
public events_to_hide: string[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h2 class="heading-h2">{{pageTitle | rpxTranslate }}</h2>
<th *ngIf="!isLabel(field) && !caseEdit.isCaseFlagSubmission" class="valign-top case-field-label">
<span class="text-16">{{field.label | rpxTranslate}}</span>
</th>
<td class="form-cell case-field-content" [attr.colspan]="isLabel(field) ? '2' : '1'">
<td class="form-cell case-field-content text-16" [attr.colspan]="isLabel(field) ? '2' : '1'">
<ccd-field-read
[formGroup]="editForm.controls['data']" [topLevelFormGroup]="editForm.controls['data']"
[caseField]="summaryCaseField(field)" [context]="paletteContext" [caseFields]="contextFields"></ccd-field-read>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { CaseEditUtils, convertNonASCIICharacter } from "./case-edit.utils";

describe('CaseEditUtils', () => {
const caseUtils: CaseEditUtils = new CaseEditUtils();
const LONG_ASCII_STRING = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@£$%^&*()-=[];\,./`<>?:"|{}_+';
const LONG_PRE_STRING: string = 'Examples of non-ASCII characters: éこ¥🌍';
const LONG_POST_STRING: string = 'Examples of non-ASCII characters: &#233;&#12371;&#165;&#55356;&#57101;';

describe('editNonASCIICharacters', () => {

it('should not edit undefined', () => {
// Note: Should never happen
const response = caseUtils.convertNonASCIICharacters(undefined);
expect(response).toEqual('');
});

it('should not edit an empty string', () => {
const mockString = '';
const response = caseUtils.convertNonASCIICharacters(mockString);
expect(response).toEqual(mockString);
});

it('should note edit ASCII characters', () => {
// note: string includes £ (non-ASCII) which should not be edited
const response = caseUtils.convertNonASCIICharacters(LONG_ASCII_STRING);
expect(response).toEqual(LONG_ASCII_STRING);
});

it('should not edit £ (non ASCII)', () => {
const mockString = 'Cost: £2.50';
const response = caseUtils.convertNonASCIICharacters(mockString);
expect(response).toEqual(mockString);
});

it('should edit ASCII characters', () => {
// Summarises with copied mock string
const response = caseUtils.convertNonASCIICharacters(LONG_PRE_STRING);
expect(response).toEqual(LONG_POST_STRING);

// Goes deeper into what should be happening just in case
const chineseCharacter = '漢';
const secondMockString = 'Examples of non-ASCII characters: ' + chineseCharacter;
const editedSecondMockString =
`Examples of non-ASCII characters: ${CaseEditUtils.PREFIX + chineseCharacter.charCodeAt(0) + CaseEditUtils.SUFFIX}`;
const secondResponse = caseUtils.convertNonASCIICharacters(secondMockString);
expect(secondResponse).toEqual(editedSecondMockString);
});
});

describe('revertEditNonASCIICharacters', () => {

it('should not revert strings without the prefix and/or suffix', () => {
const mockString = 'Hello World!';
const response = caseUtils.convertHTMLEntities(mockString);
expect(response).toEqual(mockString);
});

it('should revert relevant strings', () => {
const response = caseUtils.convertHTMLEntities(LONG_POST_STRING);
expect(response).toEqual(LONG_PRE_STRING);
});
});

});
Loading

0 comments on commit d964220

Please sign in to comment.