Create transient config provider, temp dir logic

Allows us to have a new config provider for each setup, with no overlap
of the directories used, and automatic cleanup of those directories.
This commit is contained in:
Sam Chow 2018-06-28 13:45:26 -04:00
parent 2d0a599aab
commit db757edcd2
9 changed files with 70 additions and 37 deletions

View file

@ -1,4 +1,4 @@
import { Component } from 'ng-metadata/core';
import { Component, Inject } from 'ng-metadata/core';
const templateUrl = require('./config-setup-app.component.html');
/**
@ -17,12 +17,18 @@ export class ConfigSetupAppComponent {
private loadedConfig = false;
constructor() {
constructor(@Inject('ApiService') private apiService) {
this.state = 'choice';
}
private chooseSetup(): void {
this.state = 'setup';
this.apiService.scStartNewConfig()
.then(() => {
this.state = 'setup';
})
.catch(this.apiService.errorDisplay(
'Could not initialize new setup. Please report this error'
));
}
private chooseLoad(): void {