Skip to content

Commit

Permalink
stepping though find scrolls to activity geneontology/noctua-annotati…
Browse files Browse the repository at this point in the history
  • Loading branch information
tmushayahama committed Dec 8, 2020
1 parent 5b70950 commit 042220f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/@noctua.form/models/annoton/annoton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class Annoton extends SaeGraph<AnnotonNode> {

set id(id: string) {
this._id = id;
this.displayId = NoctuaFormUtils.cleanID(id);
this.displayId = NoctuaFormUtils.cleanID(id) + 'annoton';
}

get annotonConnections() {
Expand Down
2 changes: 2 additions & 0 deletions src/@noctua.form/models/annoton/cam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ export class Cam {

if (node.term.uuid === term.uuid) {
node.term.highlight = true;
node.term.annotonDisplayId = term.annotonDisplayId = annoton.displayId;

self.matchedCount += 1;
match = true;
}
Expand Down
17 changes: 7 additions & 10 deletions src/@noctua.form/models/annoton/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,21 @@ export interface EntityBase {

export class Entity implements EntityBase {

id: string;
label: string;
url: string;
modelId: string;
classExpression: any;
highlight: boolean;
modified: boolean;
termHistory: Entity[] = [];
displayId: string;
annotonDisplayId: string;

private _uuid: string;

constructor(_id: string, _label: string, _url?: string, _uuid?: string, _modelId?: string) {
this.id = _id;
this.label = _label;
this.url = _url;
this.uuid = _uuid;
this.modelId = _modelId;
constructor(public id: string,
public label: string,
public url?: string,
uuid?: string,
public modelId?: string) {
this.uuid = uuid;
}

static createEntity(value: Partial<EntityBase>) {
Expand Down
11 changes: 2 additions & 9 deletions src/@noctua.search/services/noctua-review-search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,6 @@ export class NoctuaReviewSearchService {
}
}

scroll(id) {
const el = document.getElementById(id);
if (el) {
el.scrollIntoView();
}
}

search(searchCriteria) {
this.searchCriteria = new SearchCriteria();

Expand All @@ -151,7 +144,7 @@ export class NoctuaReviewSearchService {
this.camsService.selectedNodeUuid = this.currentMatchedEnity.uuid;
this.camsService.selectedCamUuid = this.currentMatchedEnity.modelId;

this.noctuaSearchMenuService.scrollTo('#' + this.currentMatchedEnity.displayId);
this.noctuaSearchMenuService.scrollTo('#' + this.currentMatchedEnity.annotonDisplayId);

return this.currentMatchedEnity;
}
Expand All @@ -169,7 +162,7 @@ export class NoctuaReviewSearchService {
this.camsService.selectedNodeUuid = this.currentMatchedEnity.uuid;
this.camsService.selectedCamUuid = this.currentMatchedEnity.modelId;

this.noctuaSearchMenuService.scrollTo('#' + this.currentMatchedEnity.displayId);
this.noctuaSearchMenuService.scrollTo('#' + this.currentMatchedEnity.annotonDisplayId);
return this.currentMatchedEnity;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h3>
{{cam?.loading.message}}
</h3>
</div>
<div *ngFor="let annoton of cam.annotons" class="w-100-p"
<div *ngFor="let annoton of cam.annotons" [attr.id]="annoton.displayId" class="w-100-p"
[ngClass]="{'noc-annoton-selected': annoton.id=== camService.annoton?.id}">
<div class="noc-annoton-table-heading" fxLayout="row" fxLayoutAlign="start center">
<div fxFlex="25px" (click)="$event.stopPropagation()">
Expand Down

0 comments on commit 042220f

Please sign in to comment.