Skip to content

Commit

Permalink
added the review change when removing cam geneontology/noctua-annotat…
Browse files Browse the repository at this point in the history
  • Loading branch information
tmushayahama committed Jan 22, 2021
1 parent c6c05a7 commit 4dd3eb0
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/@noctua.common/scss/noctua.common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ $accent: map-get($theme, accent);
}

.noc-dialog-body {
min-height: calc(100% - 90px);
@include deep-height(calc(100% - 90px));
}

.noc-dialog-footer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@
<div *ngIf="cam.modified" class="noc-modified-header w-100-p" fxLayout="row" fxLayoutAlign="start center">
<div class="noc-title">Modified Model:
</div>
(<strong class="mr-4">{{cam.modifiedStats?.totalChanges}}</strong> change(s) )
<span fxFlex></span>
<button class="noc-rounded-button noc-xs noc-action-button mr-8" mat-stroked-button
<button class="noc-rounded-button noc-half-button noc-r noc-xs noc-action-button mr-4" mat-stroked-button
(click)="reviewCamChanges(cam); $event.stopPropagation()" color="primary" matTooltip="View Model Changes"
[matTooltipPosition]="'below'" [matTooltipShowDelay]="1000">
{{cam.modifiedStats?.totalChanges}} change(s)
</button>
<button class="noc-rounded-button noc-half-button noc-m noc-xs noc-action-button mr-4" 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
<button class="noc-rounded-button noc-half-button noc-l noc-xs noc-action-button mr-4" mat-stroked-button
(click)="submitChange(cam); $event.stopPropagation()" color="primary" matTooltip="Save Model Changes"
[matTooltipPosition]="'below'" [matTooltipShowDelay]="1000">
Save
Expand Down
24 changes: 20 additions & 4 deletions src/@noctua.search/components/art-basket/art-basket.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,14 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
}

remove(cam: Cam) {
this.camsService.removeCamFromReview(cam);
this.noctuaReviewSearchService.removeFromArtBasket(cam.id);
const self = this;

const success = (done) => {
}

this.confirmDialogService.openConfirmDialog('Model Unsaved Changes',
'Please Save Changes or Undo Changes before removing it.',
success);
}

clear() {
Expand Down Expand Up @@ -164,6 +170,16 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
self.noctuaSearchMenuService.selectMiddlePanel(MiddlePanel.reviewChanges);
}

reviewCamChanges(cam: Cam) {
const self = this;

const success = (done) => {
}

const summary = self.camsService.reviewCamChanges(cam)
self.noctuaSearchDialogService.openCamReviewChangesDialog(success, summary)

}

submitChanges() {
const self = this;
Expand All @@ -175,6 +191,8 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
this.storeModels([cam])
}



close() {
this.noctuaSearchMenuService.closeLeftDrawer();
}
Expand Down Expand Up @@ -209,7 +227,6 @@ export class ArtBasketComponent implements OnInit, OnDestroy {
}
};


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


}
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<div class="dialog-content-wrapper">
<div class="dialog-content-wrapper noc-dialog">
<mat-toolbar class="mat-primary m-0">
<mat-toolbar-row fxFlex fxLayout="row" fxLayoutAlign="start center">
<span class="title dialog-title">
Review Changes </span> (Under Construction)
Review Changes </span>
<span fxFlex></span>
<button mat-stroked-button (click)="close()" class="noc-rounded-button noc-sm" aria-label="Close dialog">
<mat-icon>close</mat-icon> Close
</button>
</mat-toolbar-row>
</mat-toolbar>
<div class="noc-dialog-body noc-form-section">
<div class="noc-dialog-body noc-form-section" noctuaPerfectScrollbar>
<div class="noc-stats-results" fxLayout="column" fxLayoutAlign="start center">
<div class="noc-stat-summary">
<span class="noc-number">
Expand Down Expand Up @@ -62,8 +66,6 @@
</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>
<button (click)='close()' type="button" mat-raised-button color="" class="mr-8">Close</button>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,11 @@ export class CamsReviewChangesDialogComponent implements OnInit, OnDestroy {

this._unsubscribeAll = new Subject();

this.camsService.onCamsCheckoutChanged
.pipe(takeUntil(this._unsubscribeAll))
.subscribe(summary => {
if (!summary) {
return;
}
this.summary = this._data.summary

this.summary = summary;
this.stats = this.generateStats(this.summary.stats);

this.stats = this.generateStats(summary.stats);

console.log(this.summary);
});
console.log(this.summary);
}

ngOnInit(): void {
Expand Down Expand Up @@ -120,6 +112,4 @@ export class CamsReviewChangesDialogComponent implements OnInit, OnDestroy {
close() {
this._matDialogRef.close();
}


}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="dialog-content-wrapper">
<div class="dialog-content-wrapper noc-dialog">
<mat-toolbar class="mat-primary m-0">
<mat-toolbar-row fxFlex fxLayout="row" fxLayoutAlign="start center">
<span class="title dialog-title">
Expand All @@ -9,7 +9,7 @@
</button>
</mat-toolbar-row>
</mat-toolbar>
<div class="noc-dialog-body">
<div class="noc-dialog-body" noctuaPerfectScrollbar>
<div *ngIf="summary?.stats.totalChanges>0" class="alert alert-danger w-100-p">
It looks like you have pending changes for Annotation Review Tool.
.If you leave before saving, your basket changes will be lost.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ $accent: map-get($theme, accent);
margin: 0;
padding: 0;
@include deep-width(100%);
max-height: 65vh;
overflow: auto;
}

.mat-dialog-container {
Expand Down
2 changes: 2 additions & 0 deletions src/@noctua.search/models/search-criteria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ export class SearchCriteria {
query.push('expand');
}

query.push('debug')

return query;
}

Expand Down
4 changes: 2 additions & 2 deletions src/@noctua.search/services/dialog.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ export class NoctuaSearchDialogService {
});
}

openCamReviewChangesDialog(success): void {
openCamReviewChangesDialog(success, summary): void {
this.dialogRef = this._matDialog.open(CamsReviewChangesDialogComponent, {
panelClass: 'noc-cams-review-changes-dialog',
data: {
// searchCriteria: searchCriteria
summary: summary
},
});
this.dialogRef.afterClosed()
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ declare var global_workbenches_model_beta_test: any;
declare var global_workbenches_universal_beta_test: any;
declare var global_known_relations: any;

const baristaLocation = typeof global_barista_location !== 'undefined' ? global_barista_location : 'http://barista-dev.berkeleybop.org';
const baristaLocation = typeof global_barista_location !== 'undefined' ? global_barista_location : 'http://localhost:3400';
const minervaDefinitionName = typeof global_minerva_definition_name !== 'undefined' ? global_minerva_definition_name : 'minerva_public_dev';
const golrNeoServer = typeof global_golr_neo_server !== 'undefined'
? global_golr_neo_server
Expand Down

0 comments on commit 4dd3eb0

Please sign in to comment.