Skip to content

feat: adjust content type/s according to the recently introduced content key from the API

schneider210 requested to merge feature/#151-api-content-key into develop

Feature

Summary

This MR provides the adjusted content object according to the API specs for TIDO

It serves as a prerequisite for Enable TIDO to display more (+n) text types as tabs and ensures (so far), that the content resource is fetched and displayed as ususal in the text panel although the (content) data has changed.

What have I done?

  • adjust datatype:

the formerly contenturl which used to be a string now becomes an array of an arbitrary number of objects; each holding a url and a mime-time with an optional sybtype, whereas the latter isn't taken into account yet.

  • provide new method getContent()

since TIDO is supposed to display any type of html resource, the method checks the corresponding mime-types and - in case of matching - extracts the appropriate urls which in turn point to the according html resources

  • provide a (very basic) unit test

it just ensures that the prop in the receiving component is present and is of type array

  • minor:

additionally rename the css class rtl-support to rtl to match explicitely against it's config counterpart of the same name

Pls note:

this is sort of a collaboration between the back- and the frontend. both parties depend on each other. means: the changes haven't been merged in the backend, otherwise the Viewer would certainly break before this MR is merged.

Hence:

to build it, it has been necessary to have some sampledata to see it in action. so I had to use the entrypoint of the karshuni collection on the test-server. Pls see below's instructions on how to verify it.

Does the result of the MR comply to our "definition of done"?

  • Unit tests passed
  • Code reviewed
  • Acceptance criteria met
  • Functional tests passed
  • Non-Functional requirements met
  • Product Owner accepts the User Story

Documentation

  • I updated the README (if applicable)
  • I provided my functions with appropriate documentation
  • I adjusted other parts of the documentation (if applicable)

Tests

Are we able to test this new feature?

  • Yes, everything can be done via unit tests.
  • Yes, you can test by following these steps:
  • check out the branch: git checkout feature/#151-api-content-key
  • change the entrypoint in the index.template.html file to: https://ahikar-test.sub.uni-goettingen.de/api/textapi/ahikar/arabic-karshuni/collection.json
  • watch the content resource still to be displayed inside the text panel as usual
  • No, it is not possible.

Changelog

  • I added a statement to the CHANGELOG.

No, it will be done automatically by npm write-changelog at the end of the actual sprint.

Related Tickets

Add all related issues and especially those to be closed.

Related

Related "${165}"

Closes

Closes #151 (closed)

Logs and Screenshots

/cc Mathias Göbel, Frank Schneider, Michelle Weidling

Edited by schneider210

Merge request reports