Skip to content

Commit bd42719

Browse files
committed
feat: add ariaVersion filter
1 parent 5777db2 commit bd42719

10 files changed

Lines changed: 122 additions & 25 deletions

File tree

src/app/components/header/info-bar/info-bar.component.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,13 @@
213213
</span>
214214
}
215215
</span>
216+
<span>
217+
@if (!!ariaVersion) {
218+
<span>
219+
<b> {{ 'ARIA_VERSION' | translate }}:</b> {{ ariaVersion }}
220+
</span>
221+
}
222+
</span>
216223
</div>
217224
<div class="last-info">
218225
<app-ci-search></app-ci-search>

src/app/components/header/info-bar/info-bar.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export class InfoBarComponent implements OnInit, OnDestroy {
8282
public jobIds: string[];
8383
public selectedDataset: string;
8484
public selectedDatasetIsNISARFormat = false;
85+
public ariaVersion: string;
8586

8687
private subs = new SubSink();
8788

@@ -240,6 +241,9 @@ export class InfoBarComponent implements OnInit, OnDestroy {
240241
.subscribe(
241242
(productionConfig) => (this.productionConfig = productionConfig),
242243
);
244+
const ariaVersionSub = this.store$
245+
.select(filtersStore.getAriaVersion)
246+
.subscribe((version) => (this.ariaVersion = version));
243247
[
244248
startSub,
245249
endSub,
@@ -272,6 +276,7 @@ export class InfoBarComponent implements OnInit, OnDestroy {
272276
productionConfigSub,
273277
scienceProductsSub,
274278
jobIdsSub,
279+
ariaVersionSub,
275280
].forEach((sub) => this.subs.add(sub));
276281

277282
this.subs.add(

src/app/components/shared/scene-metadata/scene-metadata.component.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,19 @@
476476
<li>
477477
<b> {{ 'ARIA_VERSION' | translate }} </b>
478478
{{ scene.metadata.ariaVersion }}
479+
@if (isGeoSearch()) {
480+
<mat-icon
481+
[matMenuTriggerFor]="addAriaVersionMenu"
482+
class="v-mid clickable"
483+
>
484+
settings
485+
</mat-icon>
486+
}
487+
<mat-menu #addAriaVersionMenu="matMenu">
488+
<button (click)="setAriaVersion()" mat-menu-item>
489+
{{ 'SET_ARIA_VERSION' | translate }}
490+
</button>
491+
</mat-menu>
479492
</li>
480493
}
481494
@if (dataset.source; as source) {

src/app/components/shared/scene-metadata/scene-metadata.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@ export class SceneMetadataComponent implements OnInit, OnDestroy {
211211
);
212212
}
213213

214+
public setAriaVersion(): void {
215+
this.store$.dispatch(
216+
new filtersStore.setAriaVersion(this.scene.metadata.ariaVersion),
217+
);
218+
}
219+
214220
private capitalizeFirstLetter(str) {
215221
return str.charAt(0).toUpperCase() + str.slice(1);
216222
}

src/app/components/shared/selectors/other-selector/other-selector.component.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@
139139
</mat-hint> -->
140140
</mat-form-field>
141141
}
142+
@if (dataset.apiValue.dataset === 'ARIA S1 GUNW') {
143+
<mat-form-field>
144+
<mat-label> Version Number </mat-label>
145+
<input
146+
matInput
147+
type="text"
148+
placeholder="3.0.1"
149+
(input)="onNewAriaVersionSelected($event.target.value)"
150+
[(ngModel)]="ariaVersion"
151+
/>
152+
</mat-form-field>
153+
}
142154

143155
@if (dataset.id === 'NISAR') {
144156
<app-short-name-selector

src/app/components/shared/selectors/other-selector/other-selector.component.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ import { PropertyService } from '@services';
99
import { SubSink } from 'subsink';
1010
import * as models from '@models';
1111
import { ProductTypeSelectorComponent } from '../product-type-selector/product-type-selector.component';
12-
import { MatFormField, MatHint, MatInput } from '@angular/material/input';
12+
import {
13+
MatFormField,
14+
MatHint,
15+
MatInput,
16+
MatLabel,
17+
} from '@angular/material/input';
1318
import { MatSelect, MatOption } from '@angular/material/select';
1419
import { FormsModule } from '@angular/forms';
1520
import { ShortNameSelectorComponent } from '../short-name-selector/short-name-selector.component';
@@ -27,6 +32,7 @@ import { TranslateModule } from '@ngx-translate/core';
2732

2833
MatOption,
2934
MatHint,
35+
MatLabel,
3036
MatInput,
3137
ShortNameSelectorComponent,
3238
TranslateModule,
@@ -43,6 +49,7 @@ export class OtherSelectorComponent implements OnInit, OnDestroy {
4349
polarizations: models.DatasetPolarizations;
4450
subtypes: models.DatasetSubtypes;
4551
groupID: string;
52+
ariaVersion: string;
4653

4754
public datasetProductTypes$ = this.store$.select(
4855
filtersStore.getProductTypes,
@@ -55,7 +62,6 @@ export class OtherSelectorComponent implements OnInit, OnDestroy {
5562
public selectedDataset$ = this.store$.select(filtersStore.getSelectedDataset);
5663
public subtypes$ = this.store$.select(filtersStore.getSubtypes);
5764
public groupID$ = this.store$.select(filtersStore.getGroupID);
58-
5965
public flightDirectionTypes = models.flightDirections;
6066
public p = models.Props;
6167
private subs = new SubSink();
@@ -96,6 +102,11 @@ export class OtherSelectorComponent implements OnInit, OnDestroy {
96102
this.subs.add(
97103
this.groupID$.subscribe((groupID) => (this.groupID = groupID)),
98104
);
105+
this.subs.add(
106+
this.store$
107+
.select(filtersStore.getAriaVersion)
108+
.subscribe((version) => (this.ariaVersion = version)),
109+
);
99110
}
100111

101112
public onNewDatasetBeamModes(beamModes: string[]): void {
@@ -127,6 +138,9 @@ export class OtherSelectorComponent implements OnInit, OnDestroy {
127138
public onNewSubtypeSelected(subtypes): void {
128139
this.store$.dispatch(new filtersStore.SetSubtypes(subtypes));
129140
}
141+
public onNewAriaVersionSelected(version): void {
142+
this.store$.dispatch(new filtersStore.setAriaVersion(version));
143+
}
130144

131145
public onNewGroupID(): void {
132146
if (this.groupID.length > 29) {
Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,46 @@
11
@if (!isAriaS1Gunw) {
2-
<mat-form-field>
3-
<mat-select [(value)]="productTypesList" (selectionChange)="onNewProductTypes($event)"
4-
[disabled]="selectableProductTypes.length < 1 || burstSelected" panelClass="product-type-selector"
5-
placeholder="{{ 'FILE_TYPE' | translate }}" multiple #productTypeSelector>
6-
@for (type of selectableProductTypes; track type) {
2+
<mat-form-field>
3+
<mat-select
4+
[(value)]="productTypesList"
5+
(selectionChange)="onNewProductTypes($event)"
6+
[disabled]="selectableProductTypes.length < 1 || burstSelected"
7+
panelClass="product-type-selector"
8+
placeholder="{{ 'FILE_TYPE' | translate }}"
9+
multiple
10+
#productTypeSelector
11+
>
12+
@for (type of selectableProductTypes; track type) {
713
<mat-option [value]="type.apiValue" [matTooltip]="type.displayName">
8-
{{ type.displayName }}
14+
{{ type.displayName }}
915
</mat-option>
10-
}
16+
}
1117

12-
@if (dataset.id === 'OPERA-S1') {
13-
<div class='tropo-redirect' matTooltip="{{ 'OPERA_TROPO_ZENITH_REDIRECT' | translate }}"><mat-icon
14-
[inline]="true" class='tropo-redirect-icon warn-color'>dataset_linked</mat-icon>
15-
<a (click)="queryTropoZenith()" class='warn-color'>
16-
L4 Troposphere Zenith Radar Delays (TROPO-ZENITH)
17-
</a>
18+
@if (dataset.id === 'OPERA-S1') {
19+
<div
20+
class="tropo-redirect"
21+
matTooltip="{{ 'OPERA_TROPO_ZENITH_REDIRECT' | translate }}"
22+
>
23+
<mat-icon [inline]="true" class="tropo-redirect-icon warn-color"
24+
>dataset_linked</mat-icon
25+
>
26+
<a (click)="queryTropoZenith()" class="warn-color">
27+
L4 Troposphere Zenith Radar Delays (TROPO-ZENITH)
28+
</a>
1829
</div>
19-
20-
}
30+
}
2131
</mat-select>
2232

2333
@if (selectableProductTypes.length >= 1) {
24-
<mat-hint align="start">
34+
<mat-hint align="start">
2535
{{ productTypesList?.length || 0 }}/{{ selectableProductTypes.length }}
2636
{{ 'FILE_TYPES_SELECTED' | translate }}
27-
</mat-hint>
37+
</mat-hint>
2838
}
2939

30-
@if (selectableProductTypes.length < 1) { <mat-hint align="start">
40+
@if (selectableProductTypes.length < 1) {
41+
<mat-hint align="start">
3142
{{ 'NO_FILE_TYPES_TO_SELECT' | translate }}
32-
</mat-hint>
33-
}
34-
35-
</mat-form-field>
36-
}
43+
</mat-hint>
44+
}
45+
</mat-form-field>
46+
}

src/app/services/search-params.service.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ export class SearchParamsService {
8989
})),
9090
);
9191

92+
private ariaVersion$ = this.store$.select(filterStore.getAriaVersion).pipe(
93+
map((ariaVersion) => ({
94+
ariaVersion,
95+
})),
96+
);
97+
9298
private searchPolygon$ = combineLatest([
9399
this.mapService.searchPolygon$.pipe(startWith(null)),
94100
this.store$.select(filterStore.getShouldOmitSearchPolygon),
@@ -307,6 +313,7 @@ export class SearchParamsService {
307313
// this.operaCalibrationParam$,
308314
this.sciProducts$,
309315
this.groupID$,
316+
this.ariaVersion$,
310317
]).pipe(
311318
map((params: any[]) =>
312319
params.reduce((total, param) => ({ ...total, ...param }), {}),

src/app/store/filters/filters.action.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ export enum FiltersActionType {
108108
SET_SCIENCE_PRODUCT = '[Filters] Set Science Product',
109109
SET_PRODUCTION_CONFIG = '[Filters] Set Production Config',
110110

111+
SET_ARIA_VERSION = '[Filters] Set ARIA Version',
112+
111113
SET_USER_FRAME_FOR_BASELINE = '[Filters] Set if frame(s) used for baseline/sbas searches as reference scene',
112114
}
113115

@@ -516,6 +518,12 @@ export class setProductionConfig implements Action {
516518
constructor(public payload: string[]) {}
517519
}
518520

521+
export class setAriaVersion implements Action {
522+
public readonly type = FiltersActionType.SET_ARIA_VERSION;
523+
524+
constructor(public payload: string) {}
525+
}
526+
519527
export class SetUseFrameForBaseline implements Action {
520528
public readonly type = FiltersActionType.SET_USER_FRAME_FOR_BASELINE;
521529

@@ -596,4 +604,5 @@ export type FiltersActions =
596604
| setIntstrument
597605
| setScienceProduct
598606
| setProductionConfig
607+
| setAriaVersion
599608
| SetUseFrameForBaseline;

src/app/store/filters/filters.reducer.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export interface FiltersState {
7272
groupID: null | string;
7373

7474
useFramesForReference: boolean;
75+
ariaVersion: string;
7576
}
7677

7778
export type DateRangeState = models.Range<null | Date>;
@@ -157,6 +158,7 @@ export const initState: FiltersState = {
157158
shortNames: [],
158159

159160
useFramesForReference: false,
161+
ariaVersion: null,
160162
};
161163

162164
export function filtersReducer(
@@ -194,6 +196,7 @@ export function filtersReducer(
194196
shortNames: [],
195197
useCalibrationData: false,
196198
selectedMission: null,
199+
ariaVersion: null,
197200
};
198201
}
199202

@@ -470,6 +473,7 @@ export function filtersReducer(
470473
rangeBandwidth: [],
471474
scienceProduct: [],
472475
productionConfig: [],
476+
ariaVersion: null,
473477
};
474478
}
475479

@@ -954,6 +958,12 @@ export function filtersReducer(
954958
useFramesForReference: action.payload,
955959
};
956960
}
961+
case FiltersActionType.SET_ARIA_VERSION: {
962+
return {
963+
...state,
964+
ariaVersion: action.payload,
965+
};
966+
}
957967
default: {
958968
return state;
959969
}
@@ -1306,3 +1316,7 @@ export const getShouldUseFramesForReference = createSelector(
13061316
getFiltersState,
13071317
(state: FiltersState) => state.useFramesForReference,
13081318
);
1319+
export const getAriaVersion = createSelector(
1320+
getFiltersState,
1321+
(state: FiltersState) => state.ariaVersion,
1322+
);

0 commit comments

Comments
 (0)