ui: refactor text file component (#18458)

* wip tests

* Move text-file to addon

* rename fileName to filename, initial cleanup of text-fil

* rename args, rename test selector

* fix eye-con, remove enterAsText from file object

* add tests

* move files back to original location

* rename files via git for git diff

* adjsut test

* Revert "wip tests"

This reverts commit 63716a1e647a0b01236d34322837456ef3e9db43.

* fix policy form input

* cleanup conditional

* add bottom margin

* add element id

* change arg name

* add text area input test

* add upload test to policy form

Co-authored-by: Chelsea Shaw <cshaw@hashicorp.com>
This commit is contained in:
claire bontempo
2022-12-19 15:54:59 -08:00
committed by GitHub
parent 600c1e634b
commit 5ebb6dfb0e
21 changed files with 330 additions and 239 deletions

View File

@@ -23,7 +23,7 @@ export default Component.extend({
fileHelpText: null,
file: null,
fileName: null,
filename: null,
fileSize: null,
fileLastModified: null,
@@ -54,7 +54,7 @@ export default Component.extend({
const { name, size, lastModifiedDate } = fileMeta || {};
const fileSize = size ? filesize(size) : null;
this.set('file', fileAsBytes);
this.set('fileName', name);
this.set('filename', name);
this.set('fileSize', fileSize);
this.set('fileLastModified', lastModifiedDate);
this.onChange(fileAsBytes, name);