Read tarball into in-memory config provider

This commit is contained in:
Sam Chow 2018-06-18 16:01:30 -04:00
parent 8aa18a29a8
commit bb2b28cd11
5 changed files with 83 additions and 9 deletions

View file

@ -8,7 +8,7 @@ const styleUrl = require('./load-config.css');
styleUrls: [ styleUrl ],
})
export class LoadConfigComponent {
private isReady: boolean = false;
private readyToSubmit: boolean = false;
private uploadFunc: Function;
private state: 'load' | 'validate' = 'load';
@ -16,12 +16,12 @@ export class LoadConfigComponent {
}
private handleTarballSelected(files: File[], callback: Function) {
this.isReady = true;
this.readyToSubmit = true;
callback(true)
}
private handleTarballCleared() {
this.isReady = false;
this.readyToSubmit = false;
}
private uploadTarball() {
@ -30,7 +30,8 @@ export class LoadConfigComponent {
this.state = 'validate';
}
else {
this.apiService.errorDisplay('Could not upload configuration. Please reload the page and try again.\n' +
this.apiService.errorDisplay('Error loading configuration',
'Could not upload configuration. Please reload the page and try again.\n' +
'If this problem persists, please contact support')();
}
});
@ -42,7 +43,7 @@ export class LoadConfigComponent {
* @param files: files to upload
* @param uploadFiles: function to call to upload files
*/
private filesValidated(files, uploadFiles) {
private tarballValidatedByUploadBox(files, uploadFiles) {
this.uploadFunc = uploadFiles;
}
}