+
+
+
+
+
+
+
} A promise that resolves when the directory selection and navigation are complete.
+ */
+ async selectRootDirectory(): Promise {
+ const response = await this.electronService.openDirectory();
+ this.logger.debug(response);
+ if (response.length > 0) {
+ localStorage.setItem(APP_CONSTANTS.WORKING_DIR, response[0]);
+ const currentConfig =
+ (await this.electronService.getStoreValue('APP_CONFIG')) || {};
+ const updatedConfig = { ...currentConfig, directoryPath: response[0] };
+ await this.electronService.setStoreValue('APP_CONFIG', updatedConfig);
+
+ this.logger.debug('===>', this.router.url);
+ if (this.router.url === '/apps') {
+ await this.electronService.reloadApp();
+ } else {
+ await this.router.navigate(['/apps']);
+ }
+ }
+ }
+
+ openFolderSelector() {
+ this.selectRootDirectory().then();
+ this.modalRef.close(true);
+ }
ngOnInit(): void {
this.subscriptions.add(
diff --git a/ui/src/app/pages/create-solution/create-solution.component.ts b/ui/src/app/pages/create-solution/create-solution.component.ts
index 84bbbfb..f4f6f6c 100644
--- a/ui/src/app/pages/create-solution/create-solution.component.ts
+++ b/ui/src/app/pages/create-solution/create-solution.component.ts
@@ -15,7 +15,6 @@ import { NGXLogger } from 'ngx-logger';
import { AppSystemService } from '../../services/app-system/app-system.service';
import { ElectronService } from '../../services/electron/electron.service';
import { ToasterService } from '../../services/toaster/toaster.service';
-import { SelectRootDirectoryComponent } from '../../components/select-root-directory/select-root-directory.component';
import { NgIf } from '@angular/common';
import { NgxLoadingModule } from 'ngx-loading';
import { ButtonComponent } from '../../components/core/button/button.component';
@@ -27,6 +26,7 @@ import {
import { InputFieldComponent } from '../../components/core/input-field/input-field.component';
import { TextareaFieldComponent } from '../../components/core/textarea-field/textarea-field.component';
import { ToggleComponent } from '../../components/toggle/toggle.component';
+import { SettingsComponent } from 'src/app/components/settings/settings.component';
@Component({
selector: 'app-create-solution',
@@ -116,14 +116,9 @@ export class CreateSolutionComponent implements OnInit {
}
openSelectRootDirectoryModal() {
- const modalRef = this.dialog.open(SelectRootDirectoryComponent, {
+ this.dialog.open(SettingsComponent, {
disableClose: true,
});
- modalRef.afterClosed().subscribe((res) => {
- if (res === true) {
- this.selectRootDirectory().then();
- }
- });
}
async selectRootDirectory(): Promise {