From 45167a0afc1a3d1f5f72d311f3ff3020fadac610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Agneray?= <francois.agneray@lam.fr> Date: Wed, 6 Apr 2022 14:33:53 +0200 Subject: [PATCH] Add cone search form (configure dataset) --- .../cone-search-form.component.html | 33 ++++++++++ .../cone-search/cone-search-form.component.ts | 60 +++++++++++++++++++ .../dataset/components/cone-search/index.ts | 5 ++ .../dataset/dataset-form.component.html | 30 ---------- .../dataset/dataset-form.component.ts | 24 +------- .../instance/dataset/components/index.ts | 2 + .../containers/attribute-list.component.html | 4 +- .../configure-cone-search.component.html | 37 ++++++++++++ .../configure-cone-search.component.ts | 48 +++++++++++++++ .../containers/configure-dataset.component.ts | 7 +-- .../containers/edit-dataset.component.html | 7 +-- .../containers/edit-dataset.component.ts | 10 +--- .../dataset/dataset-routing.module.ts | 7 ++- .../app/metamodel/effects/dataset.effects.ts | 6 +- 14 files changed, 199 insertions(+), 81 deletions(-) create mode 100644 client/src/app/admin/instance/dataset/components/cone-search/cone-search-form.component.html create mode 100644 client/src/app/admin/instance/dataset/components/cone-search/cone-search-form.component.ts create mode 100644 client/src/app/admin/instance/dataset/components/cone-search/index.ts create mode 100644 client/src/app/admin/instance/dataset/containers/configure-cone-search.component.html create mode 100644 client/src/app/admin/instance/dataset/containers/configure-cone-search.component.ts diff --git a/client/src/app/admin/instance/dataset/components/cone-search/cone-search-form.component.html b/client/src/app/admin/instance/dataset/components/cone-search/cone-search-form.component.html new file mode 100644 index 00000000..15f1e49c --- /dev/null +++ b/client/src/app/admin/instance/dataset/components/cone-search/cone-search-form.component.html @@ -0,0 +1,33 @@ +<form [formGroup]="form" (ngSubmit)="submit()" novalidate> + <div class="custom-control custom-switch"> + <input class="custom-control-input" type="checkbox" id="cone_search_enabled" name="cone_search_enabled" formControlName="cone_search_enabled" (change)="checkConeSearchDisableOpened()"> + <label class="custom-control-label" for="cone_search_enabled">Enabled</label> + </div> + <div class="custom-control custom-switch"> + <input class="custom-control-input" type="checkbox" id="cone_search_opened" name="cone_search_opened" formControlName="cone_search_opened"> + <label class="custom-control-label" for="cone_search_opened">Opened</label> + </div> + <div class="form-group"> + <div class="form-row"> + <div class="col-md-6"> + <label for="cone_search_column_ra">Column RA</label> + <select class="form-control" id="cone_search_column_ra" name="cone_search_column_ra" formControlName="cone_search_column_ra"> + <option *ngFor="let attribute of attributeList" [ngValue]="attribute.id">{{ attribute.form_label }}</option> + </select> + </div> + <div class="col-md-6"> + <label for="cone_search_column_dec">Column DEC</label> + <select class="form-control" id="cone_search_column_dec" name="cone_search_column_dec" formControlName="cone_search_column_dec"> + <option *ngFor="let attribute of attributeList" [ngValue]="attribute.id">{{ attribute.form_label }}</option> + </select> + </div> + </div> + </div> + <div class="custom-control custom-switch"> + <input class="custom-control-input" type="checkbox" id="cone_search_plot_enabled" name="cone_search_plot_enabled" formControlName="cone_search_plot_enabled"> + <label class="custom-control-label" for="cone_search_plot_enabled">Plot enabled</label> + </div> + <div class="form-group mt-3"> + <ng-content></ng-content> + </div> +</form> diff --git a/client/src/app/admin/instance/dataset/components/cone-search/cone-search-form.component.ts b/client/src/app/admin/instance/dataset/components/cone-search/cone-search-form.component.ts new file mode 100644 index 00000000..92ff8fdd --- /dev/null +++ b/client/src/app/admin/instance/dataset/components/cone-search/cone-search-form.component.ts @@ -0,0 +1,60 @@ +/** + * This file is part of Anis Client. + * + * @copyright Laboratoire d'Astrophysique de Marseille / CNRS + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { Component, OnInit, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core'; +import { FormGroup, FormControl } from '@angular/forms'; + +import { Dataset, Attribute } from 'src/app/metamodel/models'; + +@Component({ + selector: 'app-cone-search-form', + templateUrl: 'cone-search-form.component.html', + changeDetection: ChangeDetectionStrategy.OnPush +}) +export class ConeSearchFormComponent implements OnInit { + @Input() dataset: Dataset; + @Input() attributeList: Attribute[]; + @Output() onSubmit: EventEmitter<Dataset> = new EventEmitter(); + + public form = new FormGroup({ + cone_search_enabled: new FormControl(false), + cone_search_opened: new FormControl({value: false, disabled: true}), + cone_search_column_ra: new FormControl({value: false, disabled: true}), + cone_search_column_dec: new FormControl({value: false, disabled: true}), + cone_search_plot_enabled: new FormControl(false), + }); + + ngOnInit() { + this.form.patchValue(this.dataset); + this.checkConeSearchDisableOpened(); + } + + checkConeSearchDisableOpened() { + if (this.form.controls.cone_search_enabled.value) { + this.form.controls.cone_search_opened.enable(); + this.form.controls.cone_search_column_ra.enable(); + this.form.controls.cone_search_column_dec.enable(); + this.form.controls.cone_search_plot_enabled.enable(); + } else { + this.form.controls.cone_search_opened.setValue(false); + this.form.controls.cone_search_opened.disable(); + this.form.controls.cone_search_column_ra.disable(); + this.form.controls.cone_search_column_dec.disable(); + this.form.controls.cone_search_plot_enabled.disable(); + } + } + + submit() { + this.onSubmit.emit({ + ...this.dataset, + ...this.form.getRawValue() + }); + this.form.markAsPristine(); + } +} diff --git a/client/src/app/admin/instance/dataset/components/cone-search/index.ts b/client/src/app/admin/instance/dataset/components/cone-search/index.ts new file mode 100644 index 00000000..9c8dce2d --- /dev/null +++ b/client/src/app/admin/instance/dataset/components/cone-search/index.ts @@ -0,0 +1,5 @@ +import { ConeSearchFormComponent } from "./cone-search-form.component"; + +export const coneSearchComponents = [ + ConeSearchFormComponent +]; diff --git a/client/src/app/admin/instance/dataset/components/dataset/dataset-form.component.html b/client/src/app/admin/instance/dataset/components/dataset/dataset-form.component.html index 94c24e99..a9fe59f1 100644 --- a/client/src/app/admin/instance/dataset/components/dataset/dataset-form.component.html +++ b/client/src/app/admin/instance/dataset/components/dataset/dataset-form.component.html @@ -73,36 +73,6 @@ <input type="text" class="form-control" id="info_survey_label" name="info_survey_label" formControlName="info_survey_label"> </div> </accordion-group> - <accordion-group heading="Cone-search" [isOpen]="!isNewDataset" [isDisabled]="isNewDataset"> - <div class="custom-control custom-switch"> - <input class="custom-control-input" type="checkbox" id="cone_search_enabled" name="cone_search_enabled" formControlName="cone_search_enabled" (change)="checkConeSearchDisableOpened()"> - <label class="custom-control-label" for="cone_search_enabled">Enabled</label> - </div> - <div class="custom-control custom-switch"> - <input class="custom-control-input" type="checkbox" id="cone_search_opened" name="cone_search_opened" formControlName="cone_search_opened"> - <label class="custom-control-label" for="cone_search_opened">Opened</label> - </div> - <div class="form-group"> - <div class="form-row"> - <div class="col-md-6"> - <label for="cone_search_column_ra">Column RA</label> - <select class="form-control" id="cone_search_column_ra" name="cone_search_column_ra" formControlName="cone_search_column_ra"> - <option *ngFor="let attribute of attributeList" [ngValue]="attribute.id">{{ attribute.form_label }}</option> - </select> - </div> - <div class="col-md-6"> - <label for="cone_search_column_dec">Column DEC</label> - <select class="form-control" id="cone_search_column_dec" name="cone_search_column_dec" formControlName="cone_search_column_dec"> - <option *ngFor="let attribute of attributeList" [ngValue]="attribute.id">{{ attribute.form_label }}</option> - </select> - </div> - </div> - </div> - <div class="custom-control custom-switch"> - <input class="custom-control-input" type="checkbox" id="cone_search_plot_enabled" name="cone_search_plot_enabled" formControlName="cone_search_plot_enabled"> - <label class="custom-control-label" for="cone_search_plot_enabled">Plot enabled</label> - </div> - </accordion-group> <accordion-group heading="Download" [isOpen]="true"> <div class="custom-control custom-switch"> <input class="custom-control-input" type="checkbox" id="download_enabled" name="download_enabled" formControlName="download_enabled" (change)="checkDownloadDisableOpened()"> diff --git a/client/src/app/admin/instance/dataset/components/dataset/dataset-form.component.ts b/client/src/app/admin/instance/dataset/components/dataset/dataset-form.component.ts index ea13faa1..e0acccb8 100644 --- a/client/src/app/admin/instance/dataset/components/dataset/dataset-form.component.ts +++ b/client/src/app/admin/instance/dataset/components/dataset/dataset-form.component.ts @@ -11,7 +11,7 @@ import { Component, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChange import { FormGroup, FormControl, Validators } from '@angular/forms'; import { Instance, Dataset, Survey, DatasetFamily, Attribute, Image } from 'src/app/metamodel/models'; -import { FileInfo, FitsImageLimits } from 'src/app/admin/store/models'; +import { FileInfo } from 'src/app/admin/store/models'; @Component({ selector: 'app-dataset-form', @@ -29,7 +29,6 @@ export class DatasetFormComponent implements OnInit, OnChanges { @Input() files: FileInfo[]; @Input() filesIsLoading: boolean; @Input() filesIsLoaded: boolean; - @Input() attributeList: Attribute[]; @Output() changeSurvey: EventEmitter<number> = new EventEmitter(); @Output() loadRootDirectory: EventEmitter<string> = new EventEmitter(); @Output() onSubmit: EventEmitter<Dataset> = new EventEmitter(); @@ -47,11 +46,6 @@ export class DatasetFormComponent implements OnInit, OnChanges { display: new FormControl('', [Validators.required]), info_survey_enabled: new FormControl(false), info_survey_label: new FormControl('More about this survey', [Validators.required]), - cone_search_enabled: new FormControl(false), - cone_search_opened: new FormControl({value: false, disabled: true}), - cone_search_column_ra: new FormControl({value: false, disabled: true}), - cone_search_column_dec: new FormControl({value: false, disabled: true}), - cone_search_plot_enabled: new FormControl(false), download_enabled: new FormControl(true), download_opened: new FormControl(false), download_json: new FormControl(true), @@ -80,7 +74,6 @@ export class DatasetFormComponent implements OnInit, OnChanges { } this.checkInfoSurveyDisableOpened(); - this.checkConeSearchDisableOpened(); this.checkDownloadDisableOpened(); this.checkSummaryDisableOpened(); this.checkServerLinkDisableOpened(); @@ -128,21 +121,6 @@ export class DatasetFormComponent implements OnInit, OnChanges { } } - checkConeSearchDisableOpened() { - if (this.form.controls.cone_search_enabled.value) { - this.form.controls.cone_search_opened.enable(); - this.form.controls.cone_search_column_ra.enable(); - this.form.controls.cone_search_column_dec.enable(); - this.form.controls.cone_search_plot_enabled.enable(); - } else { - this.form.controls.cone_search_opened.setValue(false); - this.form.controls.cone_search_opened.disable(); - this.form.controls.cone_search_column_ra.disable(); - this.form.controls.cone_search_column_dec.disable(); - this.form.controls.cone_search_plot_enabled.disable(); - } - } - checkDownloadDisableOpened() { if (this.form.controls.download_enabled.value) { this.form.controls.download_opened.enable(); diff --git a/client/src/app/admin/instance/dataset/components/index.ts b/client/src/app/admin/instance/dataset/components/index.ts index 451f8e5a..86eb95ea 100644 --- a/client/src/app/admin/instance/dataset/components/index.ts +++ b/client/src/app/admin/instance/dataset/components/index.ts @@ -12,6 +12,7 @@ import { criteriaFamilyComponents } from './criteria-family'; import { datasetComponents } from './dataset'; import { datasetFamilyComponents } from './dataset-family'; import { imageComponents } from './image'; +import { coneSearchComponents } from './cone-search'; import { outputCategoryComponents } from './output-category'; import { outputFamilyComponents } from './output-family'; import { InstanceButtonsComponent } from './instance-buttons.component'; @@ -22,6 +23,7 @@ export const dummiesComponents = [ datasetComponents, datasetFamilyComponents, imageComponents, + coneSearchComponents, outputCategoryComponents, outputFamilyComponents, InstanceButtonsComponent diff --git a/client/src/app/admin/instance/dataset/containers/attribute-list.component.html b/client/src/app/admin/instance/dataset/containers/attribute-list.component.html index ed23b573..db6e7d37 100644 --- a/client/src/app/admin/instance/dataset/containers/attribute-list.component.html +++ b/client/src/app/admin/instance/dataset/containers/attribute-list.component.html @@ -40,12 +40,12 @@ (add)="addAttribute($event)"> </app-add-attribute> <div class="btn-group mr-2" role="group" aria-label="Second group"> - <button routerLink="/admin/instance/configure-instance/{{ (instance | async).name }}/dataset/configure-dataset/{{ (dataset | async).name }}/image-list" title="Handle groups" class="btn btn-outline-primary"> + <button routerLink="/admin/instance/configure-instance/{{ (instance | async).name }}/dataset/configure-dataset/{{ (dataset | async).name }}/image-list" title="Images" class="btn btn-outline-primary"> <span class="fas fa-image"></span> Images </button> </div> <div class="btn-group mr-2" role="group" aria-label="Third group"> - <button title="Handle groups" class="btn btn-outline-primary"> + <button routerLink="/admin/instance/configure-instance/{{ (instance | async).name }}/dataset/configure-dataset/{{ (dataset | async).name }}/configure-cone-search" title="Configure cone-search" class="btn btn-outline-primary"> <span class="fas fa-search"></span> Configure cone-search </button> </div> diff --git a/client/src/app/admin/instance/dataset/containers/configure-cone-search.component.html b/client/src/app/admin/instance/dataset/containers/configure-cone-search.component.html new file mode 100644 index 00000000..d13d7309 --- /dev/null +++ b/client/src/app/admin/instance/dataset/containers/configure-cone-search.component.html @@ -0,0 +1,37 @@ +<app-spinner *ngIf="(datasetListIsLoading | async) || (attributeListIsLoading | async)"></app-spinner> + +<div *ngIf="(datasetListIsLoaded | async) && (attributeListIsLoaded | async)" class="container-fluid"> + <nav aria-label="breadcrumb"> + <ol class="breadcrumb"> + <li class="breadcrumb-item"><a routerLink="/admin/instance/instance-list">Instances</a></li> + <li class="breadcrumb-item"> + <a routerLink="/admin/instance/configure-instance/{{ (instance | async).name }}/dataset/dataset-list"> + Configure instance {{ (instance | async).label }} + </a> + </li> + <li class="breadcrumb-item"> + <a routerLink="/admin/instance/configure-instance/{{ (instance | async).name }}/dataset/configure-dataset/{{ (dataset | async).name }}" [queryParams]="{tab_selected: 'design'}"> + Configure dataset {{ (dataset | async).label }} + </a> + </li> + <li class="breadcrumb-item active" aria-current="page">Configure cone-search</li> + </ol> + </nav> +</div> + +<div *ngIf="(datasetListIsLoaded | async) && (attributeListIsLoaded | async)" class="container"> + <div class="row"> + <div class="col-12"> + <app-cone-search-form + [dataset]="dataset | async" + [attributeList]="attributeList | async" + (onSubmit)="editDataset($event)" + #formConeSearchConfiguration> + <button [disabled]="!formConeSearchConfiguration.form.valid || formConeSearchConfiguration.form.pristine" type="submit" class="btn btn-primary"> + <span class="fa fa-database"></span> Update cone-search configurations + </button> + + </app-cone-search-form> + </div> + </div> +</div> diff --git a/client/src/app/admin/instance/dataset/containers/configure-cone-search.component.ts b/client/src/app/admin/instance/dataset/containers/configure-cone-search.component.ts new file mode 100644 index 00000000..8b2440c5 --- /dev/null +++ b/client/src/app/admin/instance/dataset/containers/configure-cone-search.component.ts @@ -0,0 +1,48 @@ +/** + * This file is part of Anis Client. + * + * @copyright Laboratoire d'Astrophysique de Marseille / CNRS + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +import { Component } from '@angular/core'; +import { Router } from '@angular/router'; + +import { Observable } from 'rxjs'; +import { Store } from '@ngrx/store'; + +import { Instance, Dataset, Attribute } from 'src/app/metamodel/models'; +import * as instanceSelector from 'src/app/metamodel/selectors/instance.selector'; +import * as datasetActions from 'src/app/metamodel/actions/dataset.actions'; +import * as datasetSelector from 'src/app/metamodel/selectors/dataset.selector'; +import * as attributeSelector from 'src/app/metamodel/selectors/attribute.selector'; + +@Component({ + selector: 'app-configure-cone-search', + templateUrl: 'configure-cone-search.component.html', +}) +export class ConfigureConeSearchComponent { + public instance: Observable<Instance>; + public dataset: Observable<Dataset>; + public datasetListIsLoading: Observable<boolean>; + public datasetListIsLoaded: Observable<boolean>; + public attributeList: Observable<Attribute[]>; + public attributeListIsLoading: Observable<boolean>; + public attributeListIsLoaded: Observable<boolean>; + + constructor(private store: Store<{ }>) { + this.instance = store.select(instanceSelector.selectInstanceByRouteName); + this.dataset = store.select(datasetSelector.selectDatasetByRouteName); + this.datasetListIsLoading = store.select(datasetSelector.selectDatasetListIsLoading); + this.datasetListIsLoaded = store.select(datasetSelector.selectDatasetListIsLoaded); + this.attributeList = store.select(attributeSelector.selectAllAttributes); + this.attributeListIsLoading = store.select(attributeSelector.selectAttributeListIsLoading); + this.attributeListIsLoaded = store.select(attributeSelector.selectAttributeListIsLoaded); + } + + editDataset(dataset: Dataset) { + this.store.dispatch(datasetActions.editDataset({ dataset })); + } +} \ No newline at end of file diff --git a/client/src/app/admin/instance/dataset/containers/configure-dataset.component.ts b/client/src/app/admin/instance/dataset/containers/configure-dataset.component.ts index db85a3d5..77d1ff24 100644 --- a/client/src/app/admin/instance/dataset/containers/configure-dataset.component.ts +++ b/client/src/app/admin/instance/dataset/containers/configure-dataset.component.ts @@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core'; import { Store } from '@ngrx/store'; - import * as attributeActions from 'src/app/metamodel/actions/attribute.actions'; import * as criteriaFamilyActions from 'src/app/metamodel/actions/criteria-family.actions'; import * as outputFamilyActions from 'src/app/metamodel/actions/output-family.actions'; @@ -14,9 +13,7 @@ import * as imageActions from 'src/app/metamodel/actions/image.actions'; templateUrl: 'configure-dataset.component.html' }) export class ConfigureDatasetComponent implements OnInit { - constructor(private store: Store<{ }>) { - - } + constructor(private store: Store<{ }>) { } ngOnInit() { Promise.resolve(null).then(() => this.store.dispatch(attributeActions.loadAttributeList())); @@ -25,4 +22,4 @@ export class ConfigureDatasetComponent implements OnInit { Promise.resolve(null).then(() => this.store.dispatch(outputCategoryActions.loadOutputCategoryList())); Promise.resolve(null).then(() => this.store.dispatch(imageActions.loadImageList())); } -} \ No newline at end of file +} diff --git a/client/src/app/admin/instance/dataset/containers/edit-dataset.component.html b/client/src/app/admin/instance/dataset/containers/edit-dataset.component.html index a1ab6612..91826a28 100644 --- a/client/src/app/admin/instance/dataset/containers/edit-dataset.component.html +++ b/client/src/app/admin/instance/dataset/containers/edit-dataset.component.html @@ -16,13 +16,11 @@ <div class="container"> <app-spinner *ngIf="(surveyListIsLoading | async) - || (datasetListIsLoading | async) - || (attributeListIsLoading | async) + || (datasetListIsLoading | async) || (datasetFamilyListIsLoading | async)"></app-spinner> <div *ngIf="(surveyListIsLoaded | async) - && (datasetListIsLoaded | async) - && (attributeListIsLoaded | async) + && (datasetListIsLoaded | async) && (datasetFamilyListIsLoaded | async)" class="row"> <div class="col-12"> <app-dataset-form @@ -36,7 +34,6 @@ [files]="files | async" [filesIsLoading]="filesIsLoading | async" [filesIsLoaded]="filesIsLoaded | async" - [attributeList]="attributeList | async" (changeSurvey)="loadTableList($event)" (loadRootDirectory)="loadRootDirectory($event)" (onSubmit)="editDataset($event)" diff --git a/client/src/app/admin/instance/dataset/containers/edit-dataset.component.ts b/client/src/app/admin/instance/dataset/containers/edit-dataset.component.ts index ef598be4..a8452918 100644 --- a/client/src/app/admin/instance/dataset/containers/edit-dataset.component.ts +++ b/client/src/app/admin/instance/dataset/containers/edit-dataset.component.ts @@ -12,11 +12,10 @@ import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { Store } from '@ngrx/store'; -import { Instance, Survey, DatasetFamily, Dataset, Attribute, Image } from 'src/app/metamodel/models'; +import { Instance, Survey, DatasetFamily, Dataset } from 'src/app/metamodel/models'; import { FileInfo } from 'src/app/admin/store/models'; import * as datasetSelector from 'src/app/metamodel/selectors/dataset.selector'; import * as datasetActions from 'src/app/metamodel/actions/dataset.actions'; -import * as attributeSelector from 'src/app/metamodel/selectors/attribute.selector'; import * as attributeActions from 'src/app/metamodel/actions/attribute.actions'; import * as surveySelector from 'src/app/metamodel/selectors/survey.selector'; import * as tableActions from 'src/app/admin/store/actions/table.actions'; @@ -37,9 +36,6 @@ export class EditDatasetComponent implements OnInit { public datasetList: Observable<Dataset[]>; public datasetListIsLoading: Observable<boolean>; public datasetListIsLoaded: Observable<boolean>; - public attributeList: Observable<Attribute[]>; - public attributeListIsLoading: Observable<boolean>; - public attributeListIsLoaded: Observable<boolean>; public surveyListIsLoading: Observable<boolean>; public surveyListIsLoaded: Observable<boolean>; public surveyList: Observable<Survey[]>; @@ -59,9 +55,6 @@ export class EditDatasetComponent implements OnInit { this.datasetList = store.select(datasetSelector.selectAllDatasets); this.datasetListIsLoading = store.select(datasetSelector.selectDatasetListIsLoading); this.datasetListIsLoaded = store.select(datasetSelector.selectDatasetListIsLoaded); - this.attributeList = store.select(attributeSelector.selectAllAttributes); - this.attributeListIsLoading = store.select(attributeSelector.selectAttributeListIsLoading); - this.attributeListIsLoaded = store.select(attributeSelector.selectAttributeListIsLoaded); this.surveyListIsLoading = store.select(surveySelector.selectSurveyListIsLoading); this.surveyListIsLoaded = store.select(surveySelector.selectSurveyListIsLoaded); this.surveyList = store.select(surveySelector.selectAllSurveys); @@ -77,7 +70,6 @@ export class EditDatasetComponent implements OnInit { } ngOnInit() { - this.store.dispatch(attributeActions.loadAttributeList()); this.store.dispatch(imageActions.loadImageList()); } diff --git a/client/src/app/admin/instance/dataset/dataset-routing.module.ts b/client/src/app/admin/instance/dataset/dataset-routing.module.ts index 8f3768b4..3ea9a9ac 100644 --- a/client/src/app/admin/instance/dataset/dataset-routing.module.ts +++ b/client/src/app/admin/instance/dataset/dataset-routing.module.ts @@ -18,6 +18,7 @@ import { AttributeListComponent } from './containers/attribute-list.component'; import { ImageListComponent } from './containers/image-list.component'; import { NewImageComponent } from './containers/new-image.component'; import { EditImageComponent } from './containers/edit-image.component'; +import { ConfigureConeSearchComponent } from './containers/configure-cone-search.component'; const routes: Routes = [ { path: 'dataset-list', component: DatasetListComponent }, @@ -28,7 +29,8 @@ const routes: Routes = [ { path: '', component: AttributeListComponent }, { path: 'image-list', component: ImageListComponent }, { path: 'new-image', component: NewImageComponent }, - { path: 'edit-image/:id', component: EditImageComponent } + { path: 'edit-image/:id', component: EditImageComponent }, + { path: 'configure-cone-search', component: ConfigureConeSearchComponent } ] } ]; @@ -51,5 +53,6 @@ export const routedComponents = [ AttributeListComponent, ImageListComponent, NewImageComponent, - EditImageComponent + EditImageComponent, + ConfigureConeSearchComponent ]; diff --git a/client/src/app/metamodel/effects/dataset.effects.ts b/client/src/app/metamodel/effects/dataset.effects.ts index 28894b6f..6ed9c02c 100644 --- a/client/src/app/metamodel/effects/dataset.effects.ts +++ b/client/src/app/metamodel/effects/dataset.effects.ts @@ -103,11 +103,7 @@ export class DatasetEffects { editDatasetSuccess$ = createEffect(() => this.actions$.pipe( ofType(datasetActions.editDatasetSuccess), - concatLatestFrom(() => this.store.select(instanceSelector.selectInstanceNameByRoute)), - tap(([, instanceName]) => { - this.router.navigate([`/admin/instance/configure-instance/${instanceName}`]); - this.toastr.success('Dataset successfully edited', 'The existing dataset has been edited into the database') - }) + tap(() => this.toastr.success('Dataset successfully edited', 'The existing dataset has been edited into the database')) ), { dispatch: false } ); -- GitLab