Skip to content

Commit ec52d5c

Browse files
authored
Merge pull request #1956 from hmcts/exui-3199-upload-file-issue
exui-3199-drag-drop-file-upload-issue
2 parents 62c77dc + 619ee28 commit ec52d5c

File tree

8 files changed

+15
-80
lines changed

8 files changed

+15
-80
lines changed

RELEASE-NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## RELEASE NOTES
22

3+
### Version 7.2.9
4+
**EXUI-3199** drag-drop-file-upload-issue
5+
36
### Version 7.2.8
47
**EXUI-3186** Task Completion Message appears after page refresh for responded query but is no longer valid
58

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hmcts/ccd-case-ui-toolkit",
3-
"version": "7.2.8",
3+
"version": "7.2.9",
44
"engines": {
55
"node": ">=18.19.0"
66
},

projects/ccd-case-ui-toolkit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hmcts/ccd-case-ui-toolkit",
3-
"version": "7.2.8",
3+
"version": "7.2.9",
44
"engines": {
55
"node": ">=18.19.0"
66
},

projects/ccd-case-ui-toolkit/src/karma.conf.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,10 @@ module.exports = function (config) {
4343
autoWatch: true,
4444
browsers: ['ChromeHeadless'],
4545
customLaunchers: {
46-
ChromeHeadless: {
47-
base: 'Chrome',
48-
flags: [
49-
'--headless',
50-
'--disable-gpu',
51-
'--no-sandbox',
52-
],
53-
},
46+
ChromeHeadlessCI: {
47+
base: 'ChromeHeadless',
48+
flags: ['--no-sandbox']
49+
}
5450
},
5551
singleRun: true,
5652
restartOnFileChange: true
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1 @@
1-
.input-upload-file {
2-
width: 100%;
3-
display: none;
4-
}
5-
6-
.upload-file-container {
7-
display: flex;
8-
align-items: baseline;
9-
}
10-
11-
.input-label {
12-
width: 8rem;
13-
}
14-
151
@import "../base-field/grey-bar.scss";

projects/ccd-case-ui-toolkit/src/lib/shared/components/palette/document/write-document-field.component.spec.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { WriteDocumentFieldComponent } from './write-document-field.component';
2020
import createSpyObj = jasmine.createSpyObj;
2121
import any = jasmine.any;
2222
import { HttpErrorResponse } from '@angular/common/http';
23-
import { RpxTranslationService } from 'rpx-xui-translation';
2423

2524
const FIELD_TYPE: FieldType = {
2625
id: 'Document',
@@ -164,10 +163,6 @@ describe('WriteDocumentFieldComponent', () => {
164163
{ provide: JurisdictionService, useValue: jurisdictionService },
165164
{ provide: EventTriggerService, useValue: eventTriggerService },
166165
{ provide: CaseNotifier, useValue: caseNotifier },
167-
{
168-
provide: RpxTranslationService, useValue: createSpyObj('RpxTranslationService',
169-
['getTranslation$', 'translate'])
170-
},
171166
DocumentDialogComponent
172167
]
173168
})
@@ -287,7 +282,6 @@ describe('WriteDocumentFieldComponent', () => {
287282
}
288283
});
289284

290-
expect(component.fileName).toBe('test.pdf')
291285
expect(component.caseField.value.document_filename).toBe('test.pdf');
292286
});
293287

@@ -615,7 +609,6 @@ describe('WriteDocumentFieldComponent with Mandatory casefield', () => {
615609
let casesService: any;
616610
const jurisdictionService: any = {};
617611
const eventTriggerService: any = {};
618-
let rpxTranslationService: jasmine.SpyObj<RpxTranslationService>;
619612

620613
beforeEach(waitForAsync(() => {
621614

@@ -656,10 +649,6 @@ describe('WriteDocumentFieldComponent with Mandatory casefield', () => {
656649
{ provide: CasesService, useValue: casesService },
657650
{ provide: JurisdictionService, useValue: jurisdictionService },
658651
{ provide: EventTriggerService, useValue: eventTriggerService },
659-
{
660-
provide: RpxTranslationService, useValue: createSpyObj('RpxTranslationService',
661-
['getTranslation$', 'translate'])
662-
},
663652
DocumentDialogComponent,
664653
CaseNotifier
665654
]

projects/ccd-case-ui-toolkit/src/lib/shared/components/palette/document/write-document-field.component.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@ import { DocumentDialogComponent } from '../../dialogs/document-dialog/document-
1515
import { initDialog } from '../../helpers/init-dialog-helper';
1616
import { AbstractFieldWriteComponent } from '../base-field/abstract-field-write.component';
1717
import { FileUploadStateService } from './file-upload-state.service';
18-
import { RpxTranslationService } from 'rpx-xui-translation';
1918

2019
@Component({
2120
selector: 'ccd-write-document-field',
22-
templateUrl: './write-document-field.html',
23-
styleUrls: ['./../base-field/field-write.component.scss']
21+
templateUrl: './write-document-field.html'
2422
})
2523
export class WriteDocumentFieldComponent extends AbstractFieldWriteComponent implements OnInit, OnDestroy {
2624
public static readonly DOCUMENT_URL = 'document_url';
@@ -33,7 +31,6 @@ export class WriteDocumentFieldComponent extends AbstractFieldWriteComponent imp
3331
public static readonly UPLOAD_ERROR_INVALID_FORMAT = 'Document format is not supported';
3432
public static readonly UPLOAD_WAITING_FILE_STATUS = 'Uploading...';
3533
public static readonly ERROR_UPLOADING_FILE = 'Error Uploading File';
36-
public static readonly NO_FILE_CHOSED = 'No file chosen';
3734

3835
@ViewChild('fileInput', { static: false }) public fileInput: ElementRef;
3936

@@ -48,7 +45,6 @@ export class WriteDocumentFieldComponent extends AbstractFieldWriteComponent imp
4845
public dialogSubscription: Subscription;
4946
public caseNotifierSubscription: Subscription;
5047
public jurisdictionSubs: Subscription;
51-
public fileName = WriteDocumentFieldComponent.NO_FILE_CHOSED;
5248

5349
private uploadedDocument: FormGroup;
5450
private dialogConfig: MatDialogConfig;
@@ -64,18 +60,12 @@ export class WriteDocumentFieldComponent extends AbstractFieldWriteComponent imp
6460
public dialog: MatDialog,
6561
private readonly fileUploadStateService: FileUploadStateService,
6662
private readonly jurisdictionService: JurisdictionService,
67-
private readonly rpxTranslationService : RpxTranslationService
6863
) {
6964
super();
7065
}
7166

7267
public ngOnInit(): void {
7368
this.secureModeOn = this.appConfig.getDocumentSecureMode();
74-
if (this.rpxTranslationService.language === 'cy'){
75-
this.rpxTranslationService.getTranslation$(WriteDocumentFieldComponent.NO_FILE_CHOSED).subscribe((translation) => {
76-
this.fileName = translation;
77-
});
78-
}
7969
if (this.secureModeOn) {
8070
this.subscribeToCaseDetails();
8171
}
@@ -138,7 +128,6 @@ export class WriteDocumentFieldComponent extends AbstractFieldWriteComponent imp
138128
this.invalidFileFormat();
139129
} else if (fileInput.target.files[0]) {
140130
this.selectedFile = fileInput.target.files[0];
141-
this.fileName = fileInput.target.files[0].name;
142131
this.displayFileUploadMessages(WriteDocumentFieldComponent.UPLOAD_WAITING_FILE_STATUS);
143132
const documentUpload: FormData = this.buildDocumentUploadData(this.selectedFile);
144133
this.fileUploadStateService.setUploadInProgress(true);

projects/ccd-case-ui-toolkit/src/lib/shared/components/palette/document/write-document-field.html

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,12 @@
1616
<ccd-read-document-field *ngIf="caseField" [caseField]="caseField"></ccd-read-document-field>
1717
</div>
1818

19-
<div style="position:relative">
20-
<div
21-
[id]="createElementId('fileInputWrapper')"
22-
(click)="fileSelectEvent()"
23-
(keyup)="fileSelectEvent()"
24-
></div>
25-
<div class="upload-file-container">
26-
<label
27-
[for]="id()"
28-
class="button button-secondary input-label"
29-
aria-label="Choose file">
30-
{{'Choose file' | rpxTranslate}}
31-
</label>
32-
<span class="form-control bottom-30">
33-
<span>{{fileName}}</span>
34-
</span>
35-
</div>
36-
<input
37-
[id]="id()"
38-
type="file"
39-
class="input-upload-file"
40-
(keydown.Tab)="fileValidationsOnTab()"
41-
(change)="fileChangeEvent($event, caseField.field_type.regular_expression)"
42-
accept="{{caseField.field_type.regular_expression}}"
43-
#fileInput/>
19+
<div style='position:relative'>
20+
<div [id]="createElementId('fileInputWrapper')" (click)="fileSelectEvent()" (keyup)="fileSelectEvent()"></div>
21+
<input class="form-control bottom-30" [id]="id()" type="file" (keydown.Tab)="fileValidationsOnTab()" (change)="fileChangeEvent($event, caseField.field_type.regular_expression)"
22+
accept="{{caseField.field_type.regular_expression}}" #fileInput/>
4423
</div>
4524
</div>
4625
<div class="form-group bottom-30">
47-
<button
48-
class="button button-secondary"
49-
type="button"
50-
aria-label="Cancel upload"
51-
(click)="cancelUpload()"
52-
[disabled]="!isUploadInProgress()">
53-
{{'Cancel upload' | rpxTranslate}}
54-
</button>
26+
<button class="button button-secondary" type="button" aria-label="Cancel upload" (click)="cancelUpload()" [disabled]="!isUploadInProgress()">{{'Cancel upload' | rpxTranslate}}</button>
5527
</div>

0 commit comments

Comments
 (0)