-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into EXUI-1227-MP3AndMP4NotOpeningInCaseFileView
- Loading branch information
Showing
107 changed files
with
15,986 additions
and
11,774 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
...-ui-toolkit/src/lib/shared/components/case-editor/case-edit-utils/case-edit.utils.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: éこ¥��'; | ||
|
||
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); | ||
}); | ||
}); | ||
|
||
}); |
Oops, something went wrong.