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 ImageLicense to SubjectPageVisualElement #567

Merged
merged 5 commits into from
Mar 17, 2025
Merged

Conversation

amatho
Copy link
Contributor

@amatho amatho commented Mar 12, 2025

Necessary for NDLANO/Issues#4313

@amatho amatho force-pushed the subject-image-copyright branch from 222dc66 to 93e2d2c Compare March 12, 2025 11:34
@amatho amatho force-pushed the subject-image-copyright branch from 93e2d2c to 2ed6345 Compare March 12, 2025 11:35
@amatho amatho requested review from a team March 12, 2025 11:47
Copy link
Contributor

@MaPoKen MaPoKen left a comment

Choose a reason for hiding this comment

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

Litt små pirk

context: ContextWithLoaders,
): Promise<GQLImageLicense | undefined> {
const imageId = parseInt(visualElement.url.split("/").pop() ?? "");
if (isNaN(imageId)) return undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

Trenger vell strengt tatt ikke å sjekke om det er number? fetchImageV3 tar også imot string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fjerna nu

Copy link
Member

Choose a reason for hiding this comment

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

Visuelt element kan være en video, og då er url https://players.brightcove.net/4806596774001/BkLm8fT_default/index.html?videoId=6300755876001
Tenker det er greit å ha den sjekken likevel.

Copy link
Contributor

Choose a reason for hiding this comment

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

Det vil jo ikke påvirke resultatet/callet til fetchImageV3? Den sjekken eller parsingen er jo ikke nødvendig for bruken av metoden da vi henter bildet likegyldig om det er streng eller nummer.

Copy link
Member

Choose a reason for hiding this comment

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

Det er sant, men eg vil anta at isNaN er kjappere enn et http-kall som feiler. Ingen grunn til å bruke meir tid enn nødvendig tenker eg.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Da legger jeg det tilbake 😄

@amatho amatho force-pushed the subject-image-copyright branch from 47c00a1 to 2bda83a Compare March 12, 2025 15:21
@amatho amatho merged commit a802bb4 into master Mar 17, 2025
3 checks passed
@amatho amatho deleted the subject-image-copyright branch March 17, 2025 09:25
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.

4 participants