Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.5.3 #1838

Merged
merged 31 commits into from
Jan 18, 2024
Merged

V2.5.3 #1838

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
712b815
Updated translations from Phrase
ASF-Discovery Dec 11, 2023
8724889
feat: add lazy loading to on demand search
williamh890 Dec 29, 2023
0532d4d
feat: add user id param to on demand search
williamh890 Jan 3, 2024
69dfa6f
chore: remove console logs
williamh890 Jan 3, 2024
052a2bd
feat: add on demand user id to info bar
williamh890 Jan 3, 2024
3dbc465
feat: add keys for spanish translation for on demand user id selector
williamh890 Jan 3, 2024
1a569d3
fix: tag dummy products and load them when list changes
williamh890 Jan 4, 2024
68d6370
fix: don't show 'load more products' button when all are loaded
williamh890 Jan 4, 2024
ef63ec1
chore: formatting changes
williamh890 Jan 4, 2024
b0eeda7
feat: keep track of on demand products being loaded to make duplicate…
williamh890 Jan 4, 2024
f8e0a13
feat: add project names from custom user id to selector auto complete
williamh890 Jan 4, 2024
f2cf827
chore: fix codefactor issues
williamh890 Jan 4, 2024
7de396f
Merge branch 'test' into DS-5161-lazy-load-on-demand
williamh890 Jan 4, 2024
c8f94d0
feat: Add notifications when loading metadata for on demand jobs
williamh890 Jan 5, 2024
923ab7c
fix: list in geo search was being paged instead of showing all prods
williamh890 Jan 5, 2024
5111211
Merge branch 'DS-5161-lazy-load-on-demand' of github.com:asfadmin/Dis…
williamh890 Jan 5, 2024
ea8ad5f
Changes operaBurstIDs to operaBurstID in url params
Jan 6, 2024
61dd188
Merge pull request #1837 from asfadmin/bugfix-operaburstID-url-param
SpicyGarlicAlbacoreRoll Jan 6, 2024
f650a68
feat: add job status selector back to on demand header
williamh890 Jan 16, 2024
fc213ae
fix: make on demand 'load more products' button look more buttony
williamh890 Jan 16, 2024
86705c5
Merge branch 'test' into DS-5161-lazy-load-on-demand
williamh890 Jan 16, 2024
afc9afc
Merge pull request #1836 from asfadmin/DS-5161-lazy-load-on-demand
williamh890 Jan 16, 2024
86a2f29
fix: fix merge conflicts with test
williamh890 Jan 16, 2024
a6e5704
fix: on demand userID filter is reset when search is cleared
williamh890 Jan 17, 2024
5a4336a
chore: codefactor fix
williamh890 Jan 17, 2024
d37d2e4
Updated translations from Phrase
ASF-Discovery Jan 17, 2024
dac0691
Merge branch 'test' into phrase-translations
williamh890 Jan 17, 2024
3932b4a
Merge pull request #1840 from asfadmin/phrase-translations
williamh890 Jan 17, 2024
8e16357
fix: specifically add translation files to invalidate-cf
williamh890 Jan 17, 2024
85c3a5a
Merge branch 'test' of github.com:asfadmin/Discovery-SearchUI into test
williamh890 Jan 17, 2024
01949ad
fix: remove duplicate keys from spanish translation files
williamh890 Jan 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions invalidate-cf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ MATURITY=$1

aws cloudfront create-invalidation \
--distribution-id $CDN_ID \
--paths /index.html /manifest.json /ngsw.json /favicon.ico /assets/* /docs/*

--paths /index.html /manifest.json /ngsw.json /favicon.ico /assets/i18n/* /assets/* /docs/*
3 changes: 2 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,11 @@ export class AppComponent implements OnInit, OnDestroy, AfterViewInit {
}
return true
}),
debounceTime(200),
filter(_ => this.searchType !== SearchType.SARVIEWS_EVENTS
&& this.searchType !== SearchType.CUSTOM_PRODUCTS
&& this.searchType !== SearchType.BASELINE
&& this.searchType !== SearchType.SBAS),
debounceTime(200),
map(params => ({...params, output: 'COUNT'})),
tap(_ =>
this.store$.dispatch(new searchStore.SearchAmountLoading())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
</mat-expansion-panel-header>

<div style="display: flex; margin-top: 25px;">
<app-search-type-selector style="margin-right: 10px;">
<app-search-type-selector style="margin-right: 25px;">
</app-search-type-selector>

<app-on-demand-user-selector style="margin-top: 11px;"></app-on-demand-user-selector>
</div>
</mat-expansion-panel>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CustomProductsFiltersComponent } from './custom-products-filters.compon
import { JobStatusSelectorModule } from '@components/shared/selectors/job-status-selector';
import { DateSelectorModule } from '@components/shared/selectors/date-selector';
import { JobProductNameSelectorModule } from '@components/shared/selectors/job-product-name-selector';
import { OnDemandUserSelectorModule} from '@components/shared/selectors/on-demand-user-selector';

import { SharedModule } from '@shared';

Expand All @@ -24,6 +25,7 @@ import { SharedModule } from '@shared';
ProjectNameSelectorModule,
JobStatusSelectorModule,
JobProductNameSelectorModule,
OnDemandUserSelectorModule,
SharedModule
],
exports: [
Expand Down
4 changes: 3 additions & 1 deletion src/app/components/header/header.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { ProjectNameSelectorModule } from '@components/shared/selectors/project-
import { JobStatusSelectorModule } from '@components/shared/selectors/job-status-selector';
import { JobProductNameSelectorModule } from '@components/shared/selectors/job-product-name-selector';
import { SarviewsEventSearchSelectorModule } from '@components/shared/selectors/sarviews-event-search-selector';
import { OnDemandUserSelectorModule} from '@components/shared/selectors/on-demand-user-selector';
import { LogoModule } from '@components/header/logo/logo.module';

import { HeaderComponent } from './header.component';
Expand Down Expand Up @@ -96,7 +97,8 @@ import { LanguageSelectorModule } from "@components/shared/selectors/language-se
SarviewsEventTypeSelectorModule,
Hyp3UrlModule,
SharedModule,
LanguageSelectorModule
LanguageSelectorModule,
OnDemandUserSelectorModule,
],
exports: [
HeaderComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@
<app-date-selector></app-date-selector>
</div>

<app-job-product-name-selector [headerView]="true" *ngIf="breakpoint === breakpoints.FULL" class="breadcrumb">
</app-job-product-name-selector>
<app-job-status-selector *ngIf="breakpoint === breakpoints.FULL" class="breadcrumb"></app-job-status-selector>

<app-job-status-selector *ngIf="breakpoint === breakpoints.FULL" class="breadcrumb">
</app-job-status-selector>

<div *ngIf="breakpoint !== breakpoints.FULL"
class="breadcrumb">
<div class="breadcrumb">
<button (click)="onToggleFiltersMenu()"
mat-button class="additional-filters-button">
{{ 'FILTERS' | translate }} <br> <mat-icon>more_horiz</mat-icon>
Expand Down
9 changes: 8 additions & 1 deletion src/app/components/header/info-bar/info-bar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
<div class="first-info">
<span *ngIf="(searchType$ | async) === searchTypes.CUSTOM_PRODUCTS">
<app-hyp3-url></app-hyp3-url>
<span>
<span *ngIf="!!userID">
<b>{{ 'USER_ID_INFO_BAR' | translate }}:</b> {{ userID }}
</span>
</span>
</span>

<span *ngIf="(searchType$ | async) === searchTypes.SARVIEWS_EVENTS && !!eventProductTypes">
<b>{{'PRODUCT_TYPES' | translate }}:</b> {{eventProductTypes}}
</span>

<span *ngIf="(breakpoint < breakpoints.FULL) && !!startDate">
<b>{{ 'START' | translate }}:</b> {{ startDate | shortDate }}
</span>
Expand Down Expand Up @@ -62,7 +69,7 @@
</span>
<span>
<span *ngIf="!!groupID">
<b>Group ID:</b> {{groupID}}
<b> {{ 'GROUP_ID_INFO_BAR' | translate }}:</b> {{ groupID }}
</span>
</span>
</div>
Expand Down
11 changes: 9 additions & 2 deletions src/app/components/header/info-bar/info-bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Store } from '@ngrx/store';
import { SubSink } from 'subsink';

import { AppState } from '@store';
import * as hyp3Store from '@store/hyp3';
import * as filtersStore from '@store/filters';
import * as searchStore from '@store/search';

Expand Down Expand Up @@ -48,6 +49,7 @@ export class InfoBarComponent implements OnInit, OnDestroy {
public fullBurstIDs: string[] = [];
public operaBurstIDs: string[] = [];
public groupID: string;
public userID: string;

private subs = new SubSink();

Expand Down Expand Up @@ -131,11 +133,15 @@ export class InfoBarComponent implements OnInit, OnDestroy {
const operaBurstIDSub = this.store$.select(filtersStore.getOperaBurstIDs).subscribe(
burstIDs => this.operaBurstIDs = burstIDs
);

const groupIDSub = this.store$.select(filtersStore.getGroupID).subscribe(
groupID => this.groupID = groupID
);

const userIDSub = this.store$.select(hyp3Store.getOnDemandUserId).subscribe(
userID => this.userID = userID
);

[
startSub, endSub,
pathSub, frameSub,
Expand All @@ -152,7 +158,8 @@ export class InfoBarComponent implements OnInit, OnDestroy {
eventProductType,
fullBurstIDSub,
operaBurstIDSub,
groupIDSub
groupIDSub,
userIDSub
].forEach(sub => this.subs.add(sub));

this.subs.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class SceneDetailComponent implements OnInit, OnDestroy {
);

const scene$ = this.store$.select(scenesStore.getSelectedScene).pipe(
distinctUntilChanged((previous, current) => previous?.id === current?.id),
distinctUntilChanged(),
tap(_ => this.isImageLoading = true)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ export class SceneFilesComponent implements OnInit, OnDestroy, AfterContentInit
dataset: 'Sentinel-1',
groupId: 'SARViews',
isUnzippedFile: false,
isDummyProduct: false,

metadata: {
date: moment(product.processing_date),
Expand Down Expand Up @@ -407,6 +408,7 @@ export class SceneFilesComponent implements OnInit, OnDestroy, AfterContentInit
dataset: 'Sentinel-1',
groupId: 'SARViews',
isUnzippedFile: false,
isDummyProduct: false,

metadata: {
date: moment(product.processing_date),
Expand Down Expand Up @@ -437,7 +439,7 @@ export class SceneFilesComponent implements OnInit, OnDestroy, AfterContentInit
);
} else {
return of([]);

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
import { saveAs } from 'file-saver';

import { combineLatest } from 'rxjs';
import { debounceTime, filter, map, tap } from 'rxjs/operators';
import { debounceTime, filter, map, tap, withLatestFrom } from 'rxjs/operators';
import { Store } from '@ngrx/store';

import { AppState } from '@store';
Expand Down Expand Up @@ -86,22 +86,21 @@ export class ScenesListHeaderComponent implements OnInit, OnDestroy {

public isBurstStack$ = combineLatest([
this.products$,
this.pairService.pairs$,
this.store$.select(searchStore.getSearchType),
]
).pipe(
map(([scenes, pairs, currentSearchType]) => (currentSearchType ===
map(([scenes, currentSearchType]) => (currentSearchType ===
this.SearchTypes.BASELINE && scenes?.length > 0 ? scenes[0].metadata.productType === 'BURST': false)
|| (currentSearchType === this.SearchTypes.SBAS &&
(
(pairs.pairs?.length > 0 ? pairs.pairs[0][0].metadata.productType === 'BURST' : false)
|| (pairs.custom?.length > 0 ? pairs.custom[0][0].metadata.productType === 'BURST' : false)
)
|| (currentSearchType === this.SearchTypes.SBAS
)
)
)

public numPairs$ = this.pairService.pairs$.pipe(
public numPairs$ =
this.store$.select(searchStore.getSearchType).pipe(
filter(searchType => searchType !== models.SearchType.CUSTOM_PRODUCTS),
withLatestFrom(this.pairs$),
map(([_, pairs]) => pairs),
filter(pairs => !!pairs),
map(pairs => pairs.pairs.length + pairs.custom.length)
);
Expand All @@ -125,8 +124,8 @@ export class ScenesListHeaderComponent implements OnInit, OnDestroy {

public SBASburstDataProducts$ = combineLatest([
this.burstDataProducts$,
this.pairProducts$]
).pipe(
this.pairProducts$
]).pipe(
map(([products, pairs]) => {
const pairNames = pairs.map(p => p.name);
const output = products.filter(p => pairNames.find(name => name === p.name));
Expand All @@ -140,8 +139,8 @@ export class ScenesListHeaderComponent implements OnInit, OnDestroy {

public SBASburstMetadataProducts$ = combineLatest([
this.burstMetadataProducts$,
this.pairProducts$]
).pipe(
this.pairProducts$
]).pipe(
map(([products, pairs]) => {
const pairNames = pairs.map(p => p.name);
const output = products.filter(p => pairNames.find(name => name === p.name));
Expand Down Expand Up @@ -206,7 +205,7 @@ export class ScenesListHeaderComponent implements OnInit, OnDestroy {

this.subs.add(
this.possibleHyp3JobsService.possibleJobs$
.subscribe(
.subscribe(
possibleJobs => {
this.hyp3able = this.hyp3.getHyp3ableProducts(possibleJobs);
}
Expand All @@ -215,13 +214,17 @@ export class ScenesListHeaderComponent implements OnInit, OnDestroy {

this.subs.add(
this.products$.subscribe(products => {
this.products = products;
this.downloadableProds = this.hyp3.downloadable(products);
this.products = products;
this.downloadableProds = this.hyp3.downloadable(products);
})
);

this.subs.add(
this.pairs$.subscribe(({pairs, custom}) => this.pairs = [...pairs, ...custom])
this.store$.select(searchStore.getSearchType).pipe(
filter(searchType => searchType !== models.SearchType.CUSTOM_PRODUCTS),
withLatestFrom(this.pairs$)
).subscribe(
([_, {pairs, custom}]) => this.pairs = [...pairs, ...custom])
);

this.subs.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,34 @@

<div class="div-flex date-time" matLine>
<span *ngIf="scene.metadata.job">
{{ scene.metadata.job.job_type }} <br *ngIf="breakpoint === breakpoints.MOBILE && searchType === SearchTypes.CUSTOM_PRODUCTS"> -
{{ scene.metadata.job.job_type }}
<br *ngIf="breakpoint === breakpoints.MOBILE && searchType === SearchTypes.CUSTOM_PRODUCTS"> -
</span>
<span *ngIf="breakpoint > breakpoints.MOBILE && searchType !== SearchTypes.BASELINE && !!scene.metadata?.opera?.validityStartDate"
matTooltip="Validity Start Date">
{{ scene.metadata.opera.validityStartDate| fullDate }}
</span>
<span *ngIf="breakpoint > breakpoints.MOBILE && searchType !== SearchTypes.BASELINE && !scene.metadata?.opera?.validityStartDate"
matTooltip="{{'SCENE_START_TIME' | translate}}">
{{ scene.metadata.date | fullDate }}
</span>
<span *ngIf="breakpoint === breakpoints.MOBILE || searchType === SearchTypes.BASELINE"
matTooltip="{{'SCENE_START_TIME' | translate}}">
{{ scene.metadata.date| shortDate }}
<span *ngIf="!scene.isDummyProduct">
<span *ngIf="
breakpoint > breakpoints.MOBILE &&
searchType !== SearchTypes.BASELINE &&
!!scene.metadata?.opera?.validityStartDate"
matTooltip="Validity Start Date">
{{ scene.metadata.opera.validityStartDate | fullDate }}
</span>

<span *ngIf="
breakpoint > breakpoints.MOBILE &&
searchType !== SearchTypes.BASELINE &&
!scene.metadata?.opera?.validityStartDate"
matTooltip="{{'SCENE_START_TIME' | translate}}">
{{ scene.metadata.date | fullDate }}
</span>

<span *ngIf="
breakpoint === breakpoints.MOBILE ||
searchType === SearchTypes.BASELINE"
matTooltip="{{'SCENE_START_TIME' | translate}}">
{{ scene.metadata.date| shortDate }}
</span>
</span>
<span *ngIf="scene.isDummyProduct">Loading...</span>
</div>
</div>

Expand All @@ -87,4 +101,3 @@
</app-baseline-scene-controls>
</ng-container>
</button>

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
searchType === SearchTypes.BASELINE ||
searchType === SearchTypes.LIST ||
searchType === SearchTypes.CUSTOM_PRODUCTS">
<div *cdkVirtualFor="let scene of scenes">
<div *cdkVirtualFor="let scene of scenes | slice:0:numberProductsInList">
<app-scene
(click)="onSceneSelected(scene.id)"
(toggleScene)="onToggleScene(getGroupCriteria(scene))"
Expand All @@ -31,6 +31,15 @@
[isSelected]="scene.id === selected">
</app-scene>
</div>

<button *ngIf="searchType === SearchTypes.CUSTOM_PRODUCTS && numberProductsInList < scenes?.length"
(click)="onLoadMoreCustomProducts()"
class="center-button"
mat-list-item>
<button mat-stroked-button>
Load more products
</button>
</button>
</ng-container>

<ng-container *ngIf="searchType === SearchTypes.SARVIEWS_EVENTS">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,9 @@
.baseline-list-view-small {
height: calc(100% - 5px) !important;
}

.center-button {
display: flex !important;
align-items: center;
justify-content: center;
}
Loading
Loading