Skip to content

Commit

Permalink
Removed clear on reset and save one. Added a strikethrough on prev va…
Browse files Browse the repository at this point in the history
  • Loading branch information
tmushayahama committed Jan 13, 2021
1 parent 2e6f0a5 commit 5991af3
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
Undo
</button>
<button class="noc-rounded-button noc-xs noc-action-button" mat-stroked-button
(click)="saveCam(cam); $event.stopPropagation()" color="primary" matTooltip="Save Model Changes"
(click)="submitChange(cam); $event.stopPropagation()" color="primary" matTooltip="Save Model Changes"
[matTooltipPosition]="'below'" [matTooltipShowDelay]="1000">
Save
</button>
Expand Down
24 changes: 15 additions & 9 deletions src/@noctua.search/components/art-basket/art-basket.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
submitChanges() {
const self = this;

this.storeModels(self.camsService.cams)
this.storeModels(self.camsService.cams, true)
}

submitChange(cam: Cam) {
Expand All @@ -179,7 +179,7 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
this.noctuaSearchMenuService.closeLeftDrawer();
}

private storeModels(cams: Cam[]) {
private storeModels(cams: Cam[], reset = false) {
const self = this;
const success = (replace) => {
if (replace) {
Expand All @@ -188,25 +188,28 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
if (element) {
element.scrollTop = 0;
}
self.camsService.storeModels(self.camsService.cams).pipe(takeUntil(this._unsubscribeAll))
self.camsService.storeModels(cams).pipe(takeUntil(this._unsubscribeAll))
.subscribe(cams => {
if (!cams) {
return;
}

self.noctuaSearchMenuService.selectMiddlePanel(MiddlePanel.cams);
self.noctuaSearchMenuService.selectLeftPanel(LeftPanel.filter);
self.noctuaReviewSearchService.clear();
self.camsService.clearCams();
self.noctuaReviewSearchService.clearBasket();
self.noctuaReviewSearchService.onResetReview.next(true);
if (reset) {
self.noctuaSearchMenuService.selectMiddlePanel(MiddlePanel.cams);
self.noctuaSearchMenuService.selectLeftPanel(LeftPanel.filter);
self.noctuaReviewSearchService.clear();
self.camsService.clearCams();
self.noctuaReviewSearchService.clearBasket();
self.noctuaReviewSearchService.onResetReview.next(true);
}
self.zone.run(() => {
self.confirmDialogService.openSuccessfulSaveToast('Changes successfully saved.', 'OK');
});
});
}
};


const options = {
cancelLabel: 'Go Back',
confirmLabel: 'Submit'
Expand All @@ -221,4 +224,7 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
}
}




}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
[matTooltipPosition]="'below'" [matTooltipShowDelay]="1000">
Undo
</button>
<button class="noc-rounded-button noc-xs noc-action-button" mat-stroked-button
(click)="submitChange(cam); $event.stopPropagation()" color="primary" matTooltip="Save Model Changes"
[matTooltipPosition]="'below'" [matTooltipShowDelay]="1000">
Save
</button>
</div>
<div class="noc-item-body w-100-p" fxLayout="row" fxLayoutAlign="start center">
<div class="w-100-p h-100-p" fxLayout="column" fxLayoutAlign="start start">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
fxLayoutAlign="start center" [attr.id]="entity.term?.displayId" [ngClass]="{'noc-highlight-match': entity.term?.highlight,
'noc-highlight-modified': entity.term?.modified,
'noc-highlight-match-current': entity.term?.uuid===camsService.currentMatch?.uuid}">
<p class="noc-old-term" *ngIf="entity.term?.modified && entity.term?.termHistory?.length>0">
{{entity.term?.termHistory[0]?.label}}
<a (click)="$event.stopPropagation()" href="{{entity.term?.termHistory[0]?.url}}" target="_blank">
{{ entity.term?.termHistory[0]?.id }}
</a>
</p>
<p class="">
{{entity.term?.label}} <br>
<a (click)="$event.stopPropagation()" href="{{entity.term?.url}}" target="_blank">
Expand All @@ -55,6 +61,12 @@
fxLayoutAlign="start center" [ngClass]="{'noc-highlight-match': entity.extension?.highlight,
'noc-highlight-modified': entity.extension?.modified,
'noc-highlight-match-current': entity.extension?.uuid===camsService.currentMatch?.uuid}">
<p class="noc-old-term" *ngIf="entity.extension?.modified && entity.extension?.termHistory?.length>0">
{{entity.extension?.termHistory[0]?.label}}
<a (click)="$event.stopPropagation()" href="{{entity.extension?.termHistory[0]?.url}}" target="_blank">
{{ entity.extension?.termHistory[0]?.id }}
</a>
</p>
<p class="">{{entity.extension?.label}} <br>
<a (click)="$event.stopPropagation()" href="{{entity.extension?.url}}" target="_blank">
{{ entity.extension?.id }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,18 @@ $accent: map-get($theme, accent);
}

&.noc-highlight-modified {
background-color: #ffbf00;
background-color: #fdd661;
}

&.noc-highlight-match-current {
border: #ac6219 solid 5px;
}

.noc-old-term {
color: #777;
font-size: 10px;
text-decoration: line-through rgba(#ec6868, 0.5);
}
}

.mat-column-id {
Expand Down

0 comments on commit 5991af3

Please sign in to comment.