Skip to content

Commit 6d39ae5

Browse files
committed
Merge tag '25.4.3' into develop
CEDAR Metadata fixes
2 parents 9108826 + 307d825 commit 6d39ae5

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

angular.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"styles": [
5151
"src/styles/styles.scss",
5252
"node_modules/primeflex/primeflex.css",
53+
"node_modules/@fortawesome/fontawesome-free/css/all.min.css",
5354
"node_modules/ngx-markdown-editor/assets/highlight.js/agate.min.css"
5455
],
5556
"stylePreprocessorOptions": {

src/app/features/metadata/components/cedar-template-form/cedar-template-form.component.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ import { ActivatedRoute } from '@angular/router';
2525

2626
import { ENVIRONMENT } from '@core/provider/environment.provider';
2727

28-
import 'cedar-artifact-viewer';
29-
import 'cedar-embeddable-editor';
30-
3128
import { CEDAR_CONFIG, CEDAR_VIEWER_CONFIG } from '../../constants';
3229
import { CedarMetadataHelper } from '../../helpers';
3330
import {
@@ -71,6 +68,8 @@ export class CedarTemplateFormComponent {
7168
readonly downloadUrl = signal<string>('');
7269
readonly schemaName = signal<string>('');
7370

71+
readonly fileGuid = toSignal(this.route.params.pipe(map((params) => params['fileGuid'])) ?? of(undefined));
72+
7473
shareItems = [
7574
{
7675
label: 'files.detail.actions.share.email',
@@ -123,7 +122,17 @@ export class CedarTemplateFormComponent {
123122
this.validateCedarMetadata();
124123
}
125124

126-
readonly fileGuid = toSignal(this.route.params.pipe(map((params) => params['fileGuid'])) ?? of(undefined));
125+
private initializeFormData(): void {
126+
const template = this.template()?.attributes?.template;
127+
if (!template) return;
128+
const metadata = this.existingRecord()?.attributes?.metadata;
129+
if (this.existingRecord()) {
130+
const structuredMetadata = CedarMetadataHelper.buildStructuredMetadata(metadata);
131+
this.formData.set(structuredMetadata);
132+
} else {
133+
this.formData.set(CedarMetadataHelper.buildEmptyMetadata());
134+
}
135+
}
127136

128137
downloadMetadadaRecord() {
129138
if (this.fileGuid()) {
@@ -174,18 +183,6 @@ export class CedarTemplateFormComponent {
174183
}
175184
}
176185

177-
private initializeFormData(): void {
178-
const template = this.template()?.attributes?.template;
179-
if (!template) return;
180-
const metadata = this.existingRecord()?.attributes?.metadata;
181-
if (this.existingRecord()) {
182-
const structuredMetadata = CedarMetadataHelper.buildStructuredMetadata(metadata);
183-
this.formData.set(structuredMetadata);
184-
} else {
185-
this.formData.set(CedarMetadataHelper.buildEmptyMetadata());
186-
}
187-
}
188-
189186
handleEmailShare(): void {
190187
const url = window.location.href;
191188
window.location.href = `mailto:?subject=${this.schemaName()}&body=${url}`;

src/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { bootstrapApplication } from '@angular/platform-browser';
33
import { AppComponent } from '@osf/app.component';
44
import { appConfig } from '@osf/app.config';
55

6+
import 'cedar-embeddable-editor';
7+
import 'cedar-artifact-viewer';
8+
69
bootstrapApplication(AppComponent, {
710
providers: [...appConfig.providers],
811
}).catch((err) =>

src/styles/styles.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
@use "base";
88
@use "icons";
99

10-
@use "@fortawesome/fontawesome-free/scss/fontawesome.scss";
11-
@use "@fortawesome/fontawesome-free/scss/solid.scss";
12-
@use "@fortawesome/fontawesome-free/scss/brands.scss";
13-
@use "@fortawesome/fontawesome-free/scss/regular.scss";
14-
1510
@use "./components/md-editor";
1611
@use "./components/preprints";
1712
@use "./components/collections";

0 commit comments

Comments
 (0)