Skip to content

Commit

Permalink
Protected access by default
Browse files Browse the repository at this point in the history
  • Loading branch information
krajla committed Feb 22, 2024
1 parent 55f5493 commit 222c271
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export class CodeFormComponent implements OnInit {

ngOnInit() {
this.getVocabularies();

// Protected access by default.
this.privateCode.access = ["protected"]
}

@Input()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</app-cv-input>

<div>
<app-access-manager (accessOut)="updateAccess($event)" [access]="name.access">
<app-access-manager (accessOut)="updateAccess($event)" [access]="name.access">
</app-access-manager>
</div>
</div>
Expand Down
29 changes: 16 additions & 13 deletions src/app/core/substance-form/simplified-names/name-form.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { Component, OnInit, Input, Output, EventEmitter, OnDestroy } from '@angular/core';
import { SubstanceName, SubstanceNameOrg } from '../../substance/substance.model';
import { ControlledVocabularyService } from '../../controlled-vocabulary/controlled-vocabulary.service';
import { FormControl } from '@angular/forms';
import { MatRadioChange } from '@angular/material/radio';
import { UtilsService } from '../../utils/utils.service';
import { Subscription } from 'rxjs';
import {Component, OnInit, Input, Output, EventEmitter, OnDestroy} from '@angular/core';
import {SubstanceName, SubstanceNameOrg} from '../../substance/substance.model';
import {ControlledVocabularyService} from '../../controlled-vocabulary/controlled-vocabulary.service';
import {FormControl} from '@angular/forms';
import {MatRadioChange} from '@angular/material/radio';
import {UtilsService} from '../../utils/utils.service';
import {Subscription} from 'rxjs';
import {NameResolverDialogComponent} from '@gsrs-core/name-resolver/name-resolver-dialog.component';
import {OverlayContainer} from '@angular/cdk/overlay';
import {MatDialog} from '@angular/material/dialog';
import {SubstanceFormService} from '@gsrs-core/substance-form/substance-form.service';
import { SubstanceFormNamesService } from '@gsrs-core/substance-form/names/substance-form-names.service';
import {SubstanceFormNamesService} from '@gsrs-core/substance-form/names/substance-form-names.service';

@Component({
selector: 'app-name-form',
Expand All @@ -36,7 +36,8 @@ export class NameFormComponent implements OnInit, OnDestroy {
private substanceFormService: SubstanceFormService,
private overlayContainerService: OverlayContainer,
private nameFormService: SubstanceFormNamesService
) { }
) {
}

ngOnInit() {
this.overlayContainer = this.overlayContainerService.getContainerElement();
Expand All @@ -45,7 +46,8 @@ export class NameFormComponent implements OnInit, OnDestroy {
});
definition.unsubscribe();


// Protected access by default.
this.privateName.access = ["protected"]
}

ngOnDestroy() {
Expand All @@ -57,7 +59,7 @@ export class NameFormComponent implements OnInit, OnDestroy {
@Input()
set show(val: boolean) {
if (val != null) {
this.viewFull = val;
this.viewFull = val;
}
}

Expand All @@ -68,7 +70,7 @@ export class NameFormComponent implements OnInit, OnDestroy {
@Input()
set standardized(val: boolean) {
if (val != null) {
this.showStd = val;
this.showStd = val;
}
}

Expand Down Expand Up @@ -143,7 +145,8 @@ export class NameFormComponent implements OnInit, OnDestroy {
if (molfile != null && molfile !== '') {
this.substanceFormService.resolvedName(molfile);
}
}, () => {});
}, () => {
});
}

getNameOrgs(name: SubstanceName): Array<SubstanceNameOrg> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export class ReferenceFormComponent implements OnInit, AfterViewInit, OnDestroy
error = false;
private subscriptions: Array<Subscription> = [];
constructor(
private cvService: ControlledVocabularyService,
private utilsService: UtilsService,
private substanceFormReferencesService: SubstanceFormReferencesService,
private dialog: MatDialog,
Expand All @@ -38,6 +37,9 @@ export class ReferenceFormComponent implements OnInit, AfterViewInit, OnDestroy

// Private domain by default.
this.reference.publicDomain = false;

// Protected access by default.
this.reference.access = ["protected"]
}

ngAfterViewInit() {
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/substance-form/substance-form.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ export class SubstanceFormService implements OnDestroy {
{
substanceClass: 'chemical',
references: [],
names: [{name: ""}],
names: [{name: "", access:["protected"]}],
structure: {
molfile: '\n\n\n 0 0 0 0 0 0 999 V2000\nM END'
},
codes: [{codeSystem: "CAS"}],
codes: [{codeSystem: "CAS", access:["protected"]}],
relationships: [],
properties: []
} :
Expand Down

0 comments on commit 222c271

Please sign in to comment.