Skip to content

Commit 9fff7be

Browse files
artisticlightwilliamh890Copilot
authored
Andy/radio button toggle (#2380)
* Add ability to update a jobs project name * fix: formatting * Add ability to nuke all loaded jobs * Make Help more easily seen on Filter's panel. * DS-6336 Text modified to be translatable. * Lint space * feat: Update to use jobs patch endpoint * Update src/app/components/filters-dropdown/dataset-filters/dataset-filters.component.scss Co-authored-by: Copilot <[email protected]> * Round 1 of revamping the UI * Fix console error related to translation. * Bulk rename uses new dialog * npm run lint -- --fix * On Demand search reloads after bulk rename * npm run lint -- --fix * Resolving issues from merging with test * Snackbar message for renaming jobs * Adding multi-lingual support to rename dialog And a few other UI tweaks. * Edit Validation Added checks for empty project name entry or only spaces. Also validate that the jobs were successfully renamed and provided error handling. Will provide error notification with toast. * Update src/app/services/hyp3/hyp3-api.service.ts Co-authored-by: Copilot <[email protected]> * Update src/app/store/scenes/scenes.action.ts Co-authored-by: Copilot <[email protected]> * Fix for flight direction graphics not appearing in Displacement I think this is an unreported bug resulting from the recent Angular upgrade. * Show projects that are going to be renamed with the bulk operation. * Update uniqueProjectNames filtering * Fix: update job count in dialog * Fix single job rename * Many Changes * Added list of projects and associated job counts in a sortable table * Limited project name input to 100 characters * Prevent user from changing names of projects for other users * Progress Bar I've implemented a two-phase dialog that handles the rename operation internally with a determinate progress bar. * Deterministic Progress Bar The Project Rename dialog box now is augmented with a couple more screens indicating renaming progress and completion. * UI Improvements * Auto-focus the input field * Show the new name in the confirmation message * Show specific project names if failed I've implemented the feature to show which specific project names failed to rename in the completion phase. * Show Time Estimate for Bulk Rename Completion I've implemented the estimated time remaining feature for large batch rename operations. Here's what was added: How it works: The estimated time is calculated based on the elapsed time and number of completed batches It only displays for operations with 1000+ jobs (to avoid showing for small, quick operations) The time is displayed in a user-friendly format (e.g., "< 1 min", "~1 min", "~5 min") * Project Rename Title Updated Updated the table to William's suggestions. * npm run lint -- --fix * Update src/app/store/scenes/scenes.action.ts Co-authored-by: William Horn <[email protected]> * Update src/app/services/hyp3/hyp3-api.service.ts Co-authored-by: William Horn <[email protected]> * Created three named interfaces at the top of hyp3-api.service.ts * RenameProgressInfo - Progress info with percent and estimated time remaining * RenameResult - Final result with success/failed counts and failed project names *RenameWithProgressResult - The composite return type containing both observables I also changed a 'sneaky' 3 into a constant * Update src/app/components/shared/project-name-dialog/project-name-dialog.component.ts Co-authored-by: William Horn <[email protected]> * Tyler Suggestions Fixed - Red toast regression Fixed - Missing unnamed projects * Tyler Suggestions #2 Fixed - Empty string validation feedback Fixed - Checkbox disclaimer with empty string * Tyler Suggestions #3 Fixed - Remove dialog service abstraction Fixed - Convert getter to signal/computed * Tyler Suggestions #4 Fixed - Use SubSink pattern consistently Fixed - Moved constructor logic to ngOnInit * Tyler Suggestions #5 Fixed - Material Table with Sorting in-place Reviewing the idea of using the Material Stepper consideration, I don't think it is a good fit. The phases are not user-navigated steps, they're system-driven and there is no option for backward navigation. * npm run lint -- --fix * Conformity & Best Practices #2 - Removed stale SCSS styles: Cleaned up .sortable, .sort-indicator, .projects-table-body-container, and custom table styling that was no longer needed after switching to Material table * Made dialog injects private: Changed dialogRef and data from public to private to match codebase pattern * Added readonly to displayedColumns: Added readonly modifier since the array never changes * Fixed track function: Changed track name to track $index to handle potential duplicate project names in the failed list * Made "(unnamed)" multilingual * Tweaks Made the Project Rename table sorted by Project Name by default and eliminated the use of ::ng-deep in the Project Rename scss files. * Conformity & Best Practices * Removed stale SCSS styles: Cleaned up .sortable, .sort-indicator, .projects-table-body-container, and custom table styling that was no longer needed after switching to Material table * Made dialog injects private: Changed dialogRef and data from public to private to match codebase pattern * Added readonly to displayedColumns: Added readonly modifier since the array never changes * Fixed track function: Changed track name to track $index to handle potential duplicate project names in the failed list * Made "(unnamed)" multilingual * Tweaks Made the Project Rename table sorted by Project Name by default and eliminated the use of ::ng-deep in the Project Rename scss files. * npm run lint -- --fix * Made the table header 'sticky' * Fixed Table Header for Dark-Theme * Show estimated time for 5+ jobs It was 1000+ before but Tools wants to see it always. * Warn about Abort I added a @HostListener for the window:beforeunload event that triggers only when the dialog is in the processing phase. This will: - Show the browser's native "Leave site?" confirmation dialog when the user tries to close the tab/window or navigate away - Only trigger during the processing phase - users can freely close during input, complete, or error phases - Let the browser handle the UI (modern browsers don't allow custom messages for security reasons) * Add toggle for removing project names in update dialog * feat(project-name-dialog): replace button toggle with radio buttons - Replace mat-button-toggle-group with mat-radio-group for cleaner UX - Input field now visually nested under "Rename" radio option - Add singular/plural translation keys for radio labels (en, es, de) - Add accessible aria-label to radio group - Update styles for radio group layout and disabled state - Add docs/ to .gitignore * Update src/assets/i18n/es.json Co-authored-by: Copilot <[email protected]> * Update src/app/components/shared/project-name-dialog/project-name-dialog.component.scss Co-authored-by: Copilot <[email protected]> * Bug Fix A single job rename didn't reflect the count of '1' in the dialog for renaming a job. It now does. * Project Name Extras Logic was added to show the Project Name in the right metadata column to jobs without Project names and to give the user the ability to add a name. Several other lint and code cleanup tasks were done as well. --------- Co-authored-by: William Horn <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent f3ab183 commit 9fff7be

6 files changed

Lines changed: 39 additions & 58 deletions

File tree

src/app/components/results-menu/scene-files/scene-file/scene-file.component.html

Lines changed: 19 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,4 @@
11
<mat-list-item (mouseenter)="isHovered = true" (mouseleave)="isHovered = false">
2-
@if (false) {
3-
<ng-container matListItemIcon>
4-
@if (!isUnzipLoading && !isOpen) {
5-
<mat-icon
6-
(click)="onLoadUnzippedProduct()"
7-
[matTooltip]="unzipTooltip(isUserLoggedIn, hasAccessToRestrictedData)"
8-
[class.clickable]="
9-
!isUnzipDisabled(isUserLoggedIn, hasAccessToRestrictedData)
10-
"
11-
[class.fainter-text]="
12-
isUnzipDisabled(isUserLoggedIn, hasAccessToRestrictedData)
13-
"
14-
[class.disabled-cursor]="
15-
isUnzipDisabled(isUserLoggedIn, hasAccessToRestrictedData)
16-
"
17-
>
18-
keyboard_arrow_right
19-
</mat-icon>
20-
}
21-
@if (isOpen) {
22-
<mat-icon
23-
(click)="onCloseProduct()"
24-
matTooltip="Close contents"
25-
class="clickable"
26-
>
27-
keyboard_arrow_down
28-
</mat-icon>
29-
}
30-
@if (isUnzipLoading) {
31-
<div>
32-
<fa-icon icon="spinner" [pulse]="true"></fa-icon>
33-
</div>
34-
}
35-
</ng-container>
36-
}
37-
382
<ng-container matListItemIcon>
393
<mat-icon mat-icon-button disabled></mat-icon>
404
</ng-container>
@@ -88,7 +52,6 @@
8852
prompt="{{ 'COPY_FILE_ID' | translate }}"
8953
>
9054
</app-copy-to-clipboard>
91-
<span></span>
9255
<app-copy-to-clipboard
9356
prompt="copy S3 URL"
9457
class="clipboard-icon"
@@ -147,18 +110,22 @@
147110

148111
@if (product.metadata.job) {
149112
<ng-container>
150-
@if (product.metadata.job.name) {
151-
<div matListItemLine>
152-
<b>{{ 'PROJECT_NAME' | translate }}:</b>
113+
<div class="job-metadata-first" matListItemLine>
114+
<b>{{ 'PROJECT_NAME' | translate }}:</b>
115+
@if (product.metadata.job.name) {
153116
{{ product.metadata.job.name }}
154-
<button
155-
mat-icon-button
156-
(click)="onEditProjectName(product.metadata.job.name)"
157-
>
158-
<mat-icon>edit</mat-icon>
159-
</button>
160-
</div>
161-
}
117+
} @else {
118+
&nbsp;<span class="unnamed-project">{{
119+
'PROJECT_NAME_UNNAMED' | translate
120+
}}</span>
121+
}
122+
<button
123+
mat-icon-button
124+
(click)="onEditProjectName(product.metadata.job.name || '')"
125+
>
126+
<mat-icon>edit</mat-icon>
127+
</button>
128+
</div>
162129

163130
<div matListItemLine>
164131
<b>{{ 'JOB_SUBMITTED' | translate }}:</b>
@@ -185,8 +152,8 @@
185152
</ng-container>
186153
}
187154

188-
@for (param of paramsList; track param) {
189-
<div matListItemLine>
155+
@for (param of paramsList; track param; let first = $first) {
156+
<div [class.params-first]="first" matListItemLine>
190157
<b>{{ param.name }}:</b> {{ param.val }}
191158
</div>
192159
}
@@ -215,12 +182,13 @@
215182
}
216183

217184
@if ((searchType$ | async) === searchTypes.CUSTOM_PRODUCTS) {
218-
<ng-container style="margin-right: 10px" matListItemMeta>
185+
<ng-container matListItemMeta>
219186
@if (isExpired(product.metadata.job)) {
220187
<button
221188
[matMenuTriggerFor]="expiredJobs"
222189
mat-icon-button
223190
matListItemMeta
191+
style="margin-right: 10px"
224192
>
225193
<mat-icon
226194
class="hype-icon-button clickable"

src/app/components/results-menu/scene-files/scene-file/scene-file.component.scss

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
.icon-margin {
44
margin-left: 5px;
5+
56
span {
67
margin: 0 5px;
7-
}
8+
}
89
}
910

1011
.disabled-cursor {
@@ -34,3 +35,16 @@
3435
color: themed('light-black');
3536
}
3637
}
38+
39+
.unnamed-project {
40+
font-style: italic;
41+
opacity: 0.7;
42+
}
43+
44+
.job-metadata-first {
45+
margin-top: -18px;
46+
}
47+
48+
.params-first {
49+
margin-top: -8px;
50+
}

src/app/components/results-menu/scene-files/scene-file/scene-file.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,9 @@ export class SceneFileComponent implements OnInit, OnDestroy {
255255
return false;
256256
}
257257

258-
public prodDownloaded(_product) {
259-
// Do nothing
258+
// Event handler required by template but no action needed
259+
public prodDownloaded(_product: models.CMRProduct): void {
260+
// Intentionally empty - event binding required but no action needed
260261
}
261262

262263
public onSearchProduct() {

src/app/components/results-menu/scene-files/scene-files.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $prod-row-height: 58px;
44
$thumb-size: 50px;
55

66
.products-list {
7-
padding-top: 0;
7+
padding-top: 8px;
88
padding-bottom: 0;
99
overflow-y: auto;
1010
}

src/app/components/shared/selectors/search-type-selector/search-type-selector.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@ export class SearchTypeSelectorComponent implements OnInit, OnDestroy {
242242
event.stopPropagation();
243243
}
244244

245-
public onSearchTypeMenuOpen() {}
246-
247245
ngOnDestroy() {
248246
this.subs.unsubscribe();
249247
}

src/app/models/cmr-product.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export interface CMRProductMetadata {
7878
additionalUrls?: string[] | null;
7979
s3URI?: string;
8080
s3Urls?: string[] | null;
81-
fileSizes?: {} | null;
81+
fileSizes?: Record<string, { bytes: number }> | null;
8282
parentID: string;
8383

8484
// ARIA S1 GUNW

0 commit comments

Comments
 (0)