Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add URL, image count, and data source fields to viewer #239 #754

Open
wants to merge 6 commits into
base: development
Choose a base branch
from

Conversation

mikkohei13
Copy link
Member

@mikkohei13 mikkohei13 commented Feb 27, 2025

luomus/meta#239 Adds three fields to observation viewer. Can be tested with e.g. these documents:

Translations to be done.

My first pull request here, done with help from AI.

@mikkohei13 mikkohei13 requested a review from aorin February 27, 2025 22:09
Copy link
Contributor

@aorin aorin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly ok, found some issues that should be checked, especially if any of these new fields are needed for the local vihko document viewer

<laji-row title="URL" *ngIf="document.referenceURL" ngPreserveWhitespaces>
<a [href]="document.referenceURL" target="_blank" rel="noopener">{{ document.referenceURL }}</a>
</laji-row>
<laji-row *ngIf="document?.gatherings?.[0]?.units?.[0]?.externalMediaCount"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Units model file (projects/laji/src/app/shared/models/Units.ts) is missing the externalMediaCount. But looking at our schema at schema.laji.fi, I can't see the externalMediaCount or the document's referenceURL field either. If they are fields that exist only for warehouse documents, then they should be removed from this file and the Document model file because these refer to the lajistore/vihko documents.

Also the other thing to keep in mind when making changes this document-local viewer is that it fetches most of the fields automatically from it's vihko form. Only the "meta fields" (like creator, dateCreated) that are not included in the form fields need to be added here manually.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed referenceURL from Document.ts. It and externalMediaCount are only used in DW, not Lajistore.

Haven't touched Units.ts in this PR.

Copy link
Contributor

@aorin aorin Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok good but can you also remove all the changes in this file (document-local-viewer-view.component.html) since it's only for local vihko documents (dataSource is not needed either since it will show it automatically if the document's form has that field)

@mikkohei13 mikkohei13 requested a review from aorin February 28, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants