Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
noatgnu committed Nov 25, 2024
1 parent aac1659 commit da0a2c1
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 59 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
<body>
<app-root></app-root>
<noscript>Please enable JavaScript to continue using this application.</noscript>
<link rel="modulepreload" href="chunk-6DCVN2GH.js"><script src="polyfills-LQM4VRV3.js" type="module"></script><script src="scripts-TSGU23AO.js" defer></script><script src="main-VSNWETEJ.js" type="module"></script></body>
<link rel="modulepreload" href="chunk-6DCVN2GH.js"><script src="polyfills-LQM4VRV3.js" type="module"></script><script src="scripts-TSGU23AO.js" defer></script><script src="main-MBGDB4ER.js" type="module"></script></body>
</html>
94 changes: 47 additions & 47 deletions docs/main-VSNWETEJ.js → docs/main-MBGDB4ER.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/ngsw.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"configVersion": 1,
"timestamp": 1732545856540,
"timestamp": 1732559958054,
"index": "/index.html",
"assetGroups": [
{
Expand All @@ -15,7 +15,7 @@
"/chunk-KT2VBPDM.js",
"/favicon.ico",
"/index.html",
"/main-VSNWETEJ.js",
"/main-MBGDB4ER.js",
"/manifest.webmanifest",
"/polyfills-LQM4VRV3.js",
"/scripts-TSGU23AO.js",
Expand Down Expand Up @@ -123,8 +123,8 @@
"/chunk-6DCVN2GH.js": "066732cf764f113fdd1354b5d694386dde1aa957",
"/chunk-KT2VBPDM.js": "513f86e4667b74dc3cbfe0b7141fe6921312b216",
"/favicon.ico": "22f6a4a3bcaafafb0254e0f2fa4ceb89e505e8b2",
"/index.html": "61a663122eb94584facc2082a926a3c3b83853f1",
"/main-VSNWETEJ.js": "ad84b67c7d19b92b7a03054076e579a5024d719f",
"/index.html": "3f07795fb0277c60d312d3d597ae896433d1f960",
"/main-MBGDB4ER.js": "12bb954eba9a0f1b1670d88839cbb1a62a43cdda",
"/manifest.webmanifest": "0f6d8f1c753e9f503daf4cd303ebecc6b0b0a04b",
"/polyfills-LQM4VRV3.js": "86507a9fae516c507974df2133f98fd48b561462",
"/scripts-TSGU23AO.js": "e172440274ca0257fbf1b7e414f5bd41b03b202f",
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"bootstrap": "^5.3.2",
"bootstrap-icons": "^1.11.2",
"chroma-js": "^2.4.2",
"curtain-web-api": "^1.0.56",
"curtain-web-api": "^1.0.57",
"cytoscape": "^3.21.1",
"cytoscape-cxtmenu": "^3.5.0",
"cytoscape-fcose": "^2.2.0",
Expand Down
8 changes: 7 additions & 1 deletion src/app/components/datacite/datacite.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
<h5 class="modal-title">DOI Registration</h5>
</div>
<div class="modal-body">
@if (this.accountsService.isOwner) {

} @else {
You are not the owner of this Curtain Session. You cannot register a DOI for it.
}
Your account has {{dataCiteMaxQuota-dataCiteQuota}} new DOI(s) registration remaining today. (refresh every 24 hours)
<form [formGroup]="dataCiteForm" class="container d-flex flex-column gap-2 justify-content-center">
<h5>
<b>
Expand Down Expand Up @@ -89,7 +95,7 @@ <h5>
<div class="d-flex gap-2">
<div>
<label>
Affiliation {{affIndex+1}}
Affiliation {{affIndex+1}} Search
</label>
<input type="search" class="form-control" [ngbTypeahead]="searchAffiliations"
[resultFormatter]="resultFormatter" [inputFormatter]="inputFormatter"
Expand Down
12 changes: 11 additions & 1 deletion src/app/components/datacite/datacite.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,23 @@ export class DataciteComponent {
permissionToken: string = ""
permissionTokenLastUpdated: Date = new Date()

dataCiteQuota: number = 0
dataCiteMaxQuota: number = 0

get affiliations(): string[] {
const creators = this.dataCiteForm.controls.creators.controls.flatMap(c => c.controls.affiliation.controls.map(a => a.controls.name.value)).filter(aff => aff !== null);
const contributors = this.dataCiteForm.controls.contributors.controls.flatMap(c => c.controls.affiliation.controls.map(a => a.controls.name.value)).filter(aff => aff !== null);
return [...new Set([...creators, ...contributors])];
}

constructor(private toastService: ToastService, private modal: NgbActiveModal, private fb: FormBuilder, private accountsService: AccountsService, private web: WebService, private dataciteService: DataciteService) {
constructor(private toastService: ToastService, private modal: NgbActiveModal, private fb: FormBuilder, public accountsService: AccountsService, private web: WebService, private dataciteService: DataciteService) {
if (!this.accountsService.isOwner) {
this.dataCiteForm.disable()
}
this.accountsService.curtainAPI.getDataCiteQuota().then((value) => {
this.dataCiteQuota = value.data.quota
this.dataCiteMaxQuota = value.data.max_quota
})
for (const c of this.dataCiteForm.controls.creators.controls) {
for (const n of c.controls.nameIdentifiers.controls) {
n.controls.nameIdentifier.valueChanges.subscribe((value) => {
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class HomeComponent implements OnInit {
this.route.params.subscribe(params => {
this.isDOI = false
this.loadingDataCite = false
this.accounts.isOwner = false
console.log(params)
if (params) {
if (params["settings"] && params["settings"].startsWith("access_token")){
Expand Down Expand Up @@ -486,6 +487,7 @@ export class HomeComponent implements OnInit {
console.log(this.data.session)
this.uniqueLink = location.origin + "/#/" + this.settings.settings.currentID
this.permanent = data.data.permanent
this.accounts.isOwner = true
this.uniprot.uniprotProgressBar.next({value: 100, text: "Session data saved"})
}
}).catch(err => {
Expand Down

0 comments on commit da0a2c1

Please sign in to comment.