Skip to content

Commit

Permalink
removed some unecesary services, summary service,
Browse files Browse the repository at this point in the history
  • Loading branch information
tmushayahama committed Mar 5, 2019
1 parent 10af633 commit 78a583e
Show file tree
Hide file tree
Showing 46 changed files with 177 additions and 400 deletions.
4 changes: 3 additions & 1 deletion src/@noctua.common/scss/noctua.common.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
$noc-toolbar-color: #e7ecf4;
$noc-primary-color: #3b5998;
$noc-primary-color-accent: #8b9dc3;
$noc-primary-color-light: #dfe3ee;
$noc-primary-color-lighter: #dfe3ee;
$noc-primary-color-light: rgba(#798fb8, 0.5);
$noc-primary-color-text: #4a8bfc;

.mat-expansion-panel-body {
padding: 0 !important;
Expand Down
81 changes: 67 additions & 14 deletions src/@noctua.form/models/annoton/annoton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { Evidence } from './evidence';

export class Annoton extends SaeGraph {
gp;
annotonPresentation;
_presentation;
annotonRows;
nodes;
annotonType;
Expand All @@ -26,8 +26,7 @@ export class Annoton extends SaeGraph {
edgeOption;
parser;
expanded = false;
private _grid: any[] = []
private _summary: any = {}
private _grid: any[] = [];

constructor() {
super();
Expand Down Expand Up @@ -71,16 +70,6 @@ export class Annoton extends SaeGraph {
return this._grid;
}

get summary() {
const self = this;

if (self._grid.length === 0) {
this.generateGrid();
}
return this._grid;

}

getGPNode() {
const self = this;

Expand Down Expand Up @@ -173,11 +162,75 @@ export class Annoton extends SaeGraph {
});
}

get presentation() {
const self = this;

if (this._presentation) {
return this._presentation;
}

let result = {
geneProduct: self.getNode('gp'),
mcNode: self.getNode('mc'),
gp: {},
fd: {},
extra: []
}

each(self.nodes, function (node: AnnotonNode) {
if (node.displaySection && node.displayGroup) {
if (!result[node.displaySection.id][node.displayGroup.id]) {
result[node.displaySection.id][node.displayGroup.id] = {
shorthand: node.displayGroup.shorthand,
label: node.displayGroup.label,
nodes: []
};
}
result[node.displaySection.id][node.displayGroup.id].nodes.push(node);
node.nodeGroup = result[node.displaySection.id][node.displayGroup.id];
if (node.isComplement) {
node.nodeGroup.isComplement = true;
}
}
});

this._presentation = result;

return this._presentation
}

addAnnotonPresentation(displaySectionId) {
const self = this;
let result = {};
result[displaySectionId] = {};

each(self.nodes, function (node: AnnotonNode) {
if (node.displaySection === displaySectionId && node.displayGroup) {
if (!result[displaySectionId][node.displayGroup.id]) {
result[displaySectionId][node.displayGroup.id] = {
shorthand: node.displayGroup.shorthand,
label: node.displayGroup.label,
nodes: []
};
}
result[displaySectionId][node.displayGroup.id].nodes.push(node);
node.nodeGroup = result[displaySectionId][node.displayGroup.id];
if (node.isComplement) {
node.nodeGroup.isComplement = true;
}
}
});

this._presentation.extra.push(result);

return result[displaySectionId];
}

generateGrid() {
const self = this;
self._grid = [];

each(self.annotonPresentation.fd, function (nodeGroup) {
each(self._presentation.fd, function (nodeGroup) {
each(nodeGroup.nodes, function (node: AnnotonNode) {
let term = node.getTerm();

Expand Down
1 change: 0 additions & 1 deletion src/@noctua.form/services/annoton-connector.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class NoctuaAnnotonConnectorService {
public objectMFNode: AnnotonNode;
public subjectAnnoton: Annoton;
public objectAnnoton: Annoton;
public annotonPresentation;
private connectorForm: AnnotonConnectorForm;
private connectorFormGroup: BehaviorSubject<FormGroup | undefined>;
public connectorFormGroup$: Observable<FormGroup>;
Expand Down
3 changes: 1 addition & 2 deletions src/@noctua.form/services/cam.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { NoctuaGraphService } from '@noctua.form/services/graph.service';

import { AnnotonNode } from '@noctua.form/models/annoton/annoton-node';
import { NoctuaFormConfigService } from '@noctua.form/services/config/noctua-form-config.service';
import { SummaryGridService } from '@noctua.form/services/summary-grid.service';

//import { Cam } from '../models/cam';
import { CamRow } from '../models/cam-row';
import { Curator } from '../models/curator';
Expand All @@ -36,7 +36,6 @@ export class CamService {
searchSummary: any = {}

constructor(public noctuaFormConfigService: NoctuaFormConfigService,
private summaryGridService: SummaryGridService,
private httpClient: HttpClient,
private noctuaGraphService: NoctuaGraphService,
private curieService: CurieService) {
Expand Down
62 changes: 4 additions & 58 deletions src/@noctua.form/services/form-grid.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { CamFormMetadata } from './../models/forms/cam-form-metadata';
export class NoctuaFormGridService {
public mfLocation;
public annoton: Annoton;
public annotonPresentation;
// public annotonPresentation;
private camForm: CamForm;
private camFormGroup: BehaviorSubject<FormGroup | undefined>;
public camFormGroup$: Observable<FormGroup>;
Expand Down Expand Up @@ -56,7 +56,6 @@ export class NoctuaFormGridService {
mfNode.location = self.mfLocation;
}
}
this.annotonPresentation = this.getAnnotonPresentation(this.annoton);
this.camForm = this.createCamForm()
this.camFormGroup.next(this._fb.group(this.camForm));
}
Expand All @@ -70,10 +69,10 @@ export class NoctuaFormGridService {
const self = this;

let camFormMetadata = new CamFormMetadata(self.noctuaLookupService.golrLookup.bind(self.noctuaLookupService));
let camForm = new CamForm(camFormMetadata, self.annotonPresentation.geneProduct);
let camForm = new CamForm(camFormMetadata, self.annoton.presentation.geneProduct);

camForm.createFunctionDescriptionForm(self.annotonPresentation.fd);
camForm.onValueChanges(self.annotonPresentation.geneProduct.term.lookup);
camForm.createFunctionDescriptionForm(self.annoton.presentation.fd);
camForm.onValueChanges(self.annoton.presentation.geneProduct.term.lookup);

//self.camFormData = self.noctuaFormConfigService.createReviewSearchFormData();

Expand Down Expand Up @@ -107,60 +106,7 @@ export class NoctuaFormGridService {
this.initalizeForm();
}

getAnnotonPresentation(annoton) {
let result = {
geneProduct: annoton.getNode('gp'),
mcNode: annoton.getNode('mc'),
gp: {},
fd: {},
extra: []
}

each(annoton.nodes, function (node) {
if (node.displaySection && node.displayGroup) {
if (!result[node.displaySection.id][node.displayGroup.id]) {
result[node.displaySection.id][node.displayGroup.id] = {
shorthand: node.displayGroup.shorthand,
label: node.displayGroup.label,
nodes: []
};
}
result[node.displaySection.id][node.displayGroup.id].nodes.push(node);
node.nodeGroup = result[node.displaySection.id][node.displayGroup.id];
if (node.isComplement) {
node.nodeGroup.isComplement = true;
}
}
});

return result;
}

addAnnotonPresentation(annoton, displaySectionId) {
let result = {};
result[displaySectionId] = {};

each(annoton.nodes, function (node) {
if (node.displaySection === displaySectionId && node.displayGroup) {
if (!result[displaySectionId][node.displayGroup.id]) {
result[displaySectionId][node.displayGroup.id] = {
shorthand: node.displayGroup.shorthand,
label: node.displayGroup.label,
nodes: []
};
}
result[displaySectionId][node.displayGroup.id].nodes.push(node);
node.nodeGroup = result[displaySectionId][node.displayGroup.id];
if (node.isComplement) {
node.nodeGroup.isComplement = true;
}
}
});

this.annotonPresentation.extra.push(result);

return result[displaySectionId];
}



Expand Down
4 changes: 2 additions & 2 deletions src/@noctua.form/services/graph.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,9 @@ export class NoctuaGraphService {
annotonToTableRows(graph, annoton: Annoton) {
const self = this;

let gpNode = annoton.getGPNode();
// let gpNode = annoton.getGPNode();
//annoton.gpTerm = gpNode.term.control.value.label;
annoton.annotonPresentation = self.formGridService.getAnnotonPresentation(annoton);
// annoton._presentation = self.formGridService.getAnnotonPresentation(annoton);
}

ccComponentsToTable(graph, annotons) {
Expand Down
116 changes: 0 additions & 116 deletions src/@noctua.form/services/summary-grid.service.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
width: 35px;
height: 35px;

md-icon {
mat-icon {
@include noc-icon-size(14px);
color: #AAA;
line-height: 18px;
Expand All @@ -96,7 +96,7 @@
&:hover {
background-color: #999;

md-icon {
mat-icon {
color: #222;
}
}
Expand Down
Loading

0 comments on commit 78a583e

Please sign in to comment.