Skip to content

Commit

Permalink
update to nf-base 1.1.2 added a build #30
Browse files Browse the repository at this point in the history
  • Loading branch information
tmushayahama committed Jan 14, 2021
1 parent d393e7d commit acf35a3
Show file tree
Hide file tree
Showing 34 changed files with 1,478 additions and 403 deletions.
12 changes: 9 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"ngx-color-picker": "8.1.0",
"ngx-contextmenu": "^5.1.1",
"ngx-cookie-service": "2.2.0",
"noctua-form-base": "1.1.1",
"noctua-form-base": "1.1.2",
"noctua-sparql-query-builder": "0.0.41",
"node-bourbon": "^4.2.8",
"perfect-scrollbar": "1.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@
</div>
(<strong class="mr-4">{{cam.modifiedStats?.totalChanges}}</strong> change(s) )
<span fxFlex></span>
<button class="noc-rounded-button noc-xs noc-action-button" mat-stroked-button
<button class="noc-rounded-button noc-xs noc-action-button mr-8" mat-stroked-button
(click)="resetCam(cam); $event.stopPropagation()" color="primary" matTooltip="Undo Model Changes"
[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 Expand Up @@ -88,7 +93,7 @@
<ng-container *ngIf="noctuaSearchMenuService.selectedMiddlePanel === MiddlePanel.camsReview">
<button (click)="clear()" type="button" mat-raised-button>Clear List</button>
<span fxFlex=""></span>
<button (click)='resetAll()' type="button" mat-raised-button color="" class="mr-8">Undo Changes</button>
<button (click)='resetCams()' type="button" mat-raised-button color="" class="mr-8">Undo Changes</button>
<button (click)="reviewChanges()" type="submit" class="" mat-raised-button color="primary">
Review Changes
</button>
Expand Down
68 changes: 44 additions & 24 deletions src/@noctua.search/components/art-basket/art-basket.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { NoctuaReviewSearchService } from './../../services/noctua-review-search
import { NoctuaConfirmDialogService } from '@noctua/components/confirm-dialog/confirm-dialog.service';
import { LeftPanel, MiddlePanel } from './../../models/menu-panels';
import { NoctuaSearchDialogService } from './../../services/dialog.service';
import { SearchCriteria } from '@noctua.search/models/search-criteria';

@Component({
selector: 'noc-art-basket',
Expand Down Expand Up @@ -64,7 +65,11 @@ export class ArtBasketComponent implements OnInit, OnDestroy {

this.summary = summary;
});
}

ngOnDestroy(): void {
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}

selectItem(artBasketItem: ArtBasketItem) {
Expand All @@ -73,11 +78,6 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
this.noctuaSearchMenuService.scrollTo(q);
}

resetCam(cam: Cam) {
this.camService.loadCam(cam);
this.camsService.reviewChanges();
}

remove(cam: Cam) {
this.camsService.removeCamFromReview(cam);
this.noctuaReviewSearchService.removeFromArtBasket(cam.id);
Expand All @@ -89,7 +89,7 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
if (cancel) {

this.noctuaReviewSearchService.clear();
this.camsService.reset();
this.camsService.clearCams();
this.noctuaReviewSearchService.clearBasket();
}
};
Expand Down Expand Up @@ -133,16 +133,28 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
success, options);
}

resetAll() {
resetCam(cam: Cam) {
const self = this;

self.camsService.resetModels().subscribe((cams) => {
self.camsService.resetCam(cam).subscribe((cams) => {
if (cams) {
self.camsService.loadCams();
self.noctuaReviewSearchService.onReplaceChanged.next(true);
self.camsService.reviewChanges();
}
});
}

resetCams() {
const self = this;

self.camsService.resetCams().subscribe((cams) => {
if (cams) {
self.camsService.loadCams();
self.noctuaReviewSearchService.onReplaceChanged.next(true);
self.camsService.reviewChanges();
}
});
self.camsService.reviewChanges();
}

reviewChanges() {
Expand All @@ -152,28 +164,44 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
self.noctuaSearchMenuService.selectMiddlePanel(MiddlePanel.reviewChanges);
}


submitChanges() {
const self = this;

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

submitChange(cam: Cam) {
this.storeModels([cam])
}

close() {
this.noctuaSearchMenuService.closeLeftDrawer();
}

private storeModels(cams: Cam[], reset = false) {
const self = this;
const success = (replace) => {
if (replace) {
const element = document.querySelector('#noc-review-results');

if (element) {
element.scrollTop = 0;
}
self.noctuaReviewSearchService.bulkEdit(true).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.reset();
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');
});
Expand All @@ -182,7 +210,6 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
};



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

close() {
this.noctuaSearchMenuService.closeLeftDrawer();
}

ngOnDestroy(): void {
this._unsubscribeAll.next();
this._unsubscribeAll.complete();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,64 @@
</mat-toolbar-row>
</mat-toolbar>
<div class="noc-dialog-body noc-form-section">
<div fxLayout="row" fxLayoutAlign="start center">
<div fxFlex="200px">
Summary
<div class="noc-stats-results" fxLayout="column" fxLayoutAlign="start center">
<div class="noc-stat-summary">
<span class="noc-number">
{{summary?.stats.totalChanges }}
</span>
changes across
<span class="noc-number">
{{summary?.stats.camsCount }} models
</span>
</div>
<div fxFlex>
Details
</div>
</div>
<div fxLayout="row" fxLayoutAlign="start center">
<div fxFlex="200px">
Models
</div>
<div fxFlex>
{{summary?.stats.camss}}
</div>
</div>
<div fxLayout="row" fxLayoutAlign="start center">
<div fxFlex="200px">
Terms
<table fxFlex="1 1 auto" mat-table class="noc-summary-table" [dataSource]="stats"
[@animateStagger]="{value:'50'}">
<ng-container matColumnDef="category">
<th mat-header-cell *matHeaderCellDef fxFlex="250px" fxLayout="row" fxLayoutAlign="start center">
Category
</th>
<td mat-cell *matCellDef="let stat" fxFlex="250px" class="noc-title" fxLayout="row"
fxLayoutAlign="start center">
{{stat.category }}
</td>
</ng-container>
<ng-container matColumnDef="count">
<th mat-header-cell *matHeaderCellDef fxFlex="" fxLayout="row" fxLayoutAlign="start center">Changes</th>
<td mat-cell *matCellDef="let stat" fxFlex="" fxLayout="row" fxLayoutAlign="start center">
{{stat.count}}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row (click)="$event.stopPropagation()" *matRowDef="let stat; columns: displayedColumns;">
</tr>
</table>
<!-- <div fxLayout="row" fxLayoutAlign="start center">
<div fxFlex="200px">
Summary
</div>
<div fxFlex>
Details
</div>
</div>
<div fxFlex>
<div *ngFor="let modelSummary of summary.details">
<div *ngFor="let term of modelSummary.changes?.terms">
<div *ngFor="let termHistory of term.termHistory">
{{term.label}} -> {{termHistory.label}}
<div fxLayout="row" fxLayoutAlign="start center">
<div fxFlex="200px">
Terms
</div>
<div fxFlex>
<div *ngFor="let modelSummary of summary">
<div *ngFor="let term of modelSummary.changes?.terms">
<div *ngFor="let termHistory of term.termHistory">
{{term.label}} -> {{termHistory.label}}
</div>
</div>
</div>
</div>
</div>
</div> -->
</div>
</div>
<div class="m-0 p-16 noc-dialog-footer" fxLayout="row" fxLayoutAlign="space-between center">
<span fxFlex></span>
<button (click)='close()' type="button" mat-raised-button color="" class="mr-8">Go Back</button>
<button (click)="save()" type="button" mat-raised-button color="warn">Save</button>
</div>
</div>
</div>
Loading

0 comments on commit acf35a3

Please sign in to comment.