Skip to content

Commit

Permalink
adding stored model logistics geneontology/noctua-annotation-review#30
Browse files Browse the repository at this point in the history
  • Loading branch information
tmushayahama committed Dec 28, 2020
1 parent 6877a2c commit dfc2a1f
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 10 deletions.
7 changes: 6 additions & 1 deletion package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "noctua-form-base",
"version": "1.0.11",
"version": "1.1.1",
"license": "MIT",
"scripts": {
"ng": "ng",
Expand Down Expand Up @@ -84,6 +84,7 @@
"ngx-color-picker": "8.1.0",
"ngx-contextmenu": "^5.1.1",
"ngx-cookie-service": "2.2.0",
"ngx-joyride": "^2.3.1",
"noctua-sparql-query-builder": "0.0.41",
"node-bourbon": "^4.2.8",
"perfect-scrollbar": "1.5.0",
Expand Down
1 change: 1 addition & 0 deletions src/@noctua.form/models/annoton/cam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class Cam {
engine;
onGraphChanged;
manager;
artManager;
individualManager;
groupManager;
graph;
Expand Down
6 changes: 6 additions & 0 deletions src/@noctua.form/services/cam.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ export class CamService {
return self._noctuaGraphService.storedModel(cam);
}

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

return self._noctuaGraphService.resetModel(cam);
}


bulkEdit(cam: Cam) {
const self = this;
Expand Down
11 changes: 7 additions & 4 deletions src/@noctua.form/services/graph.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class NoctuaGraphService {
cam.onGraphChanged = new BehaviorSubject(null);
cam.id = modelId;
cam.manager = this.registerManager();
cam.artManager = this.registerManager();
cam.individualManager = this.registerManager();
cam.groupManager = this.registerManager();

Expand Down Expand Up @@ -572,7 +573,9 @@ export class NoctuaGraphService {
const self = this;
const reqs = new minerva_requests.request_set(self.noctuaUserService.baristaToken, cam.id);

reqs.reset_model(cam.id);
const req = new minerva_requests.request('model', 'reset');
req.model(cam.id);
reqs.add(req, 'query');
return cam.manager.request_with(reqs);
}

Expand All @@ -583,17 +586,17 @@ export class NoctuaGraphService {
req.model(cam.id);
reqs.add(req, 'query');

return cam.manager.request_with(reqs);
return cam.artManager.request_with(reqs);
}

storedModel(cam: Cam) {
const self = this;
const reqs = new minerva_requests.request_set(self.noctuaUserService.baristaToken, cam.id);
const req = new minerva_requests.request('model', 'stored-model');
const req = new minerva_requests.request('model', 'get-stored-model');
req.model(cam.id);
reqs.add(req, 'query');

return cam.manager.request_with(reqs);
return cam.artManager.request_with(reqs);
}

saveCamAnnotations(cam: Cam, annotations) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ $primary: map-get($theme, primary);
@include deep-width(30px);
@include deep-height(30px);
line-height: 28px;
font-size: 18px;
//border: map-get($accent, default) solid 1px;
//border-radius: 0 !important;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="w-100-p p-0 cam-table">
<div *ngIf="!options.reviewMode" class="noc-summary-bar" fxLayout="row" fxLayoutAlign="start center">
<div class="noc-summary-bar" fxLayout="row" fxLayoutAlign="start center">
<span class='noc-title mr-12'>
ACTIVITIES
</span>
Expand All @@ -14,6 +14,9 @@
</mat-chip>
</div>
<span fxFlex></span>
<button mat-button class="" color="primary" (click)="resetModel(cam)">
Reset Me
</button>
<button mat-button class="" color="primary" (click)="storedModel(cam)">
Stored
</button>
Expand Down Expand Up @@ -57,8 +60,6 @@ <h3>
<div class="text-truncate">
<strong> {{annoton?.presentation.qualifier}} </strong>
{{annoton?.presentation.title}}

{{annoton.id}}, {{camService.annoton?.id}}
</div>
</div>
<mat-chip class="noc-chip-xs" [ngClass]="annoton.annotonType">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ export class CamTableComponent implements OnInit, OnDestroy {
this.camService.diffModel(cam);
}

resetModel(cam: Cam) {
this.camService.resetModel(cam);
}
storedModel(cam: Cam) {
this.camService.storedModel(cam);
}
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ declare var global_golr_server: any;
declare var global_workbenches_universal: any;
declare var global_workbenches_model: 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 dfc2a1f

Please sign in to comment.