Skip to content

Commit

Permalink
Merge branch 'master' into fix/exui-1994
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-HMCTS committed Feb 12, 2025
2 parents e8ef291 + aaa82a6 commit 6fd715c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,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@v4
uses: actions/upload-artifact@v4.6.0
with:
name: code-coverage-report
path: coverage
Expand Down Expand Up @@ -61,12 +61,12 @@ jobs:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Download code coverage results
uses: actions/download-artifact@v4
uses: actions/download-artifact@v4.1.8
with:
name: code-coverage-report
path: coverage
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@v4.0.0
uses: SonarSource/sonarqube-scan-action@v4.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
6 changes: 6 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## RELEASE NOTES

### Version 7.1.37
**EXUI-2766** User getting error when upload valid file

### Version 7.1.36
**EXUI-1562** accessibility issue

### Version 7.1.35
**EXUI-2711** Review font and grammer in the query management screens

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.1.35-doc-upload-clear-message",
"version": "7.1.37-doc-upload-clear-message",
"engines": {
"node": ">=18.19.0"
},
Expand Down
2 changes: 1 addition & 1 deletion projects/ccd-case-ui-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.1.35-doc-upload-clear-message",
"version": "7.1.37-doc-upload-clear-message",
"engines": {
"node": ">=18.19.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<pagination-template #p="paginationApi" [id]="id" [maxSize]="maxSize" (pageChange)="pageChange.emit($event)"
(pageBoundsCorrection)="pageBoundsCorrection.emit($event)">
<nav role="navigation" [attr.aria-label]="'Pagination' | rpxTranslate">
<ul class="ngx-pagination" role="navigation" [attr.aria-label]="screenReaderPaginationLabel | rpxTranslate"
<ul class="ngx-pagination" [attr.aria-label]="screenReaderPaginationLabel | rpxTranslate"
[class.responsive]="responsive" *ngIf="!(autoHide && p.pages.length <= 1)">
<li class="pagination-previous" [class.disabled]="p.isFirstPage()" *ngIf="directionLinks">
<a tabindex="0" *ngIf="1 < p.getCurrent()" (keyup.enter)="p.previous()" (click)="p.previous()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,21 @@ describe('WriteDocumentFieldComponent', () => {
expect(component.fileUploadMessages).toEqual('Document format is not supported');
});

it('should allow user to upload file ignoring file extension case', () => {
const allowedFileTypes = '.pdf,.txt,.doc,.dot,.docx,.rtf,.xls,.xlt,.xla,.xlsx,.xltx,.xlsb,.ppt,.pot,.pps,.ppa,.pptx,.potx,.ppsx,.jpg,.jpeg,.bmp,.tif,.tiff,.png,.csv';
const blobParts: BlobPart[] = ['some contents for blob'];
const file: File = new File(blobParts, 'test.PDF');
const dummyEvent = {
target: {
files: [
file
]
}
};
component.fileChangeEvent(dummyEvent, allowedFileTypes);
expect(component.fileUploadMessages).toEqual('Uploading...');
});

it('should allow user to upload if there is no file types specified', () => {
spyOn(component, 'invalidFileFormat');
const allowedFileTypes = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ export class WriteDocumentFieldComponent extends AbstractFieldWriteComponent imp

public fileChangeEvent(fileInput: any, allowedRegex?: string): void {
let fileTypeRegex;
if (allowedRegex){
fileTypeRegex = new RegExp(`(${allowedRegex.replace(/,/g, '|')})`);
if (allowedRegex) {
fileTypeRegex = new RegExp(`(${allowedRegex.replace(/,/g, '|')})`, 'i');
}
if (fileInput.target?.files[0] && !fileInput.target?.files[0]?.name?.match(fileTypeRegex)){
this.invalidFileFormat();
Expand Down

0 comments on commit 6fd715c

Please sign in to comment.