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

Render system card #188

Merged
merged 1 commit into from
Sep 17, 2024
Merged

Conversation

ChristopherSpelt
Copy link
Contributor

@ChristopherSpelt ChristopherSpelt commented Sep 6, 2024

Description

Implements rendering of

  • system card
  • assessment card

There is also a rendering of a model card, but because there was no example and this does not have priority the styling is far from optimal.

Implementation notes

There seem to be missing style elements. These are not implemented.

  1. A hide details / show more button
  2. Lists with objects now have bottom padding also on the last element. This might be omitted by making a custom list class preventing this.

The ticket specified URL's as Projects/{project_id}/system_card/{assesment_card_name}/ and Projects/{project_id}/system_card/{model_card_name}/. I have changed this to Projects/{project_id}/system_card/assessments/{assesment_card_name}/ and Projects/{project_id}/system_card/models/{model_card_name}/ resp.

The system card path is now hardcoded in the endpoint. This needs to be changed when the system card flow in the AMT app is working, also the tests need to be refactored.

How to see the rendering?

Make sure at least 1 project exists. Pick one project with id project_id. Go to:
Projects/{project_id}/system_card

Resolves #104

Checklist

Please check all the boxes that apply to this pull request using "x":

  • I have tested the changes locally and verified that they work as expected.
  • I have followed the project's coding conventions and style guidelines.
  • I have rebased my branch onto the latest commit of the main branch.
  • I have squashed or reorganized my commits into logical units.
  • I have read, understood and agree to the Developer Certificate of Origin, which this project utilizes.

@ChristopherSpelt ChristopherSpelt linked an issue Sep 6, 2024 that may be closed by this pull request
@ChristopherSpelt ChristopherSpelt self-assigned this Sep 6, 2024
)

if not assessment_card_data:
logger.warning(f"assessment card with name {assessment_card} not found")

Check notice

Code scanning / SonarCloud

Logging should not be vulnerable to injection attacks

<!--SONAR_ISSUE_KEY:AZHb5DywQuIyfL7Fo4jT-->Change this code to not log user-controlled data. <p>See more on <a href="https://sonarcloud.io/project/issues?id=MinBZK_amt&issues=AZHb5DywQuIyfL7Fo4jT&open=AZHb5DywQuIyfL7Fo4jT&pullRequest=188">SonarCloud</a></p>
model_card_data = get_include_contents(Path("example_system_card/"), "system_card.yaml", "models", model_card)

if not model_card_data:
logger.warning(f"model card with name {model_card} not found")

Check notice

Code scanning / SonarCloud

Logging should not be vulnerable to injection attacks

<!--SONAR_ISSUE_KEY:AZHb5DywQuIyfL7Fo4jU-->Change this code to not log user-controlled data. <p>See more on <a href="https://sonarcloud.io/project/issues?id=MinBZK_amt&issues=AZHb5DywQuIyfL7Fo4jU&open=AZHb5DywQuIyfL7Fo4jU&pullRequest=188">SonarCloud</a></p>
logger.info(f"fetching {search_key} contents from {include_path}")
return file_system_storage_service.read()

logger.warning(f"could not fetching {search_key} contents")

Check notice

Code scanning / SonarCloud

Logging should not be vulnerable to injection attacks

<!--SONAR_ISSUE_KEY:AZHb5DywQuIyfL7Fo4jV-->Change this code to not log user-controlled data. <p>See more on <a href="https://sonarcloud.io/project/issues?id=MinBZK_amt&issues=AZHb5DywQuIyfL7Fo4jV&open=AZHb5DywQuIyfL7Fo4jV&pullRequest=188">SonarCloud</a></p>
@MinBZK MinBZK deleted a comment from sonarcloud bot Sep 11, 2024
@ChristopherSpelt ChristopherSpelt force-pushed the 104-system-card-viewer-in-frontend branch 3 times, most recently from a571833 to 0a077eb Compare September 11, 2024 13:26
@MinBZK MinBZK deleted a comment from github-advanced-security bot Sep 11, 2024
@rubenrouwhof
Copy link
Contributor

LGTM!

@ChristopherSpelt ChristopherSpelt marked this pull request as ready for review September 11, 2024 14:36
@ChristopherSpelt ChristopherSpelt requested a review from a team as a code owner September 11, 2024 14:36
@anneschuth
Copy link
Member

Could we make

  • uri clickable links?
  • oin clickable by linking here https://oinregister.logius.nl/oin-register/<OIN>
  • email clickable by linking mailto:<EMAIL>
  • instruments clickable by linking https://minbzk.github.io/instrument-registry/instruments/urn/<URN> (or whatever the url will be)
  • git commit hash clickable by linking <URI>/commit/<HASH>

@ChristopherSpelt
Copy link
Contributor Author

Could we make

  • uri clickable links?
  • oin clickable by linking here https://oinregister.logius.nl/oin-register/<OIN>
  • email clickable by linking mailto:<EMAIL>
  • instruments clickable by linking https://minbzk.github.io/instrument-registry/instruments/urn/<URN> (or whatever the url will be)
  • git commit hash clickable by linking <URI>/commit/<HASH>

@anneschuth : processed your comments

anneschuth
anneschuth previously approved these changes Sep 12, 2024
Copy link
Member

@anneschuth anneschuth left a comment

Choose a reason for hiding this comment

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

lgtm

@ChristopherSpelt ChristopherSpelt force-pushed the 104-system-card-viewer-in-frontend branch 2 times, most recently from ce2fe7a to 8a8df8b Compare September 16, 2024 11:17
@ChristopherSpelt ChristopherSpelt force-pushed the 104-system-card-viewer-in-frontend branch 2 times, most recently from 9cae1c3 to 7cac945 Compare September 17, 2024 07:31
Copy link

sonarcloud bot commented Sep 17, 2024

Copy link
Contributor

@uittenbroekrobbert uittenbroekrobbert left a comment

Choose a reason for hiding this comment

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

LGTM!

@ChristopherSpelt ChristopherSpelt merged commit d0fdc58 into main Sep 17, 2024
16 checks passed
@ChristopherSpelt ChristopherSpelt deleted the 104-system-card-viewer-in-frontend branch September 17, 2024 10:12
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.

System card viewer in frontend
5 participants