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

fix: Allow setting a cardinality in a three tier class hierarchy (DEV-1927) #2542

Conversation

seakayone
Copy link
Collaborator

@seakayone seakayone commented Mar 22, 2023

When traversing the super-classes for a set of given subclasses for each super-class branch we have to stop the search at the branch from which the search begun so that we do not include the class for which the cardinality should be set.

Pull Request Checklist

Task Description/Number

Issue Number: (DEV-1927)

Basic Requirements

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • fix: represents bug fixes
  • refactor: represents production code refactoring
  • feat: represents a new feature
  • docs: documentation changes (no production code change)
  • chore: maintenance tasks (no production code change)
  • test: all about tests: adding, refactoring tests (no production code change)
  • other... Please describe:

Does this PR introduce a breaking change?

  • Yes
  • No
  • Maybe (not 100% sure => check with FE)

Does this PR change client-test-data?

  • Yes (don't forget to update the JS-LIB team about the change)
  • No

@linear
Copy link

linear bot commented Mar 22, 2023

DEV-1927 Change cardinality of a property (which is not part of the superclass) of a subclass does not work correctly

Superclass has the following properties:

Screenshot 2023-03-20 at 15.26.40.png

Subclass which i want to change has the following properties:

Screenshot 2023-03-20 at 15.27.51.png

There is another sub-sub -class where it was possible to set the property to required:

Screenshot 2023-03-20 at 15.28.43.png

Difference of relations:

  • The property text of the Subclass TestThing2Child2 is also part of TestThing2Child1 → Worked
  • The property text is just part of the subclass (an additional class of the child) and it not exists on the superclass → Not able to set the property to required even though all values within the subclass are set

Is it possible that the validation checks whether the value occurs in the superclass even if the property is not part of the superclass?

Side note: In the Data Browser View all resources of the superclass and all subclasses are shown when you filter for the superclass

5a5938db-3e81-4a75-af54-abb70d3d99fd

@seakayone seakayone self-assigned this Mar 22, 2023
@seakayone seakayone changed the title bugfix: Allow setting a cardinality in a three tier class hierarchy (DEV-1927) fix: Allow setting a cardinality in a three tier class hierarchy (DEV-1927) Mar 22, 2023
@seakayone seakayone force-pushed the wip/bugfix-setting-cardinality-for-three-tier-class-hierarchy-DEV-1927 branch from 5ea0310 to 4a4703a Compare March 22, 2023 12:59
When traversing the super-classes for a set of given subclasses for each super-class branch we have to stop the search at the branch from which the search begun so that we do not include the class for which the cardinality should be set.
@seakayone seakayone force-pushed the wip/bugfix-setting-cardinality-for-three-tier-class-hierarchy-DEV-1927 branch from 4a4703a to e95c111 Compare March 22, 2023 13:00
@seakayone seakayone marked this pull request as ready for review March 22, 2023 13:02
@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Patch coverage: 2.33% and project coverage change: -77.41 ⚠️

Comparison is base (230fca5) 86.46% compared to head (e95c111) 9.06%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #2542       +/-   ##
==========================================
- Coverage   86.46%   9.06%   -77.41%     
==========================================
  Files         269     268        -1     
  Lines       29636   29591       -45     
==========================================
- Hits        25625    2682    -22943     
- Misses       4011   26909    +22898     
Impacted Files Coverage Δ
...la/org/knora/webapi/core/actors/RoutingActor.scala 0.00% <ø> (-66.67%) ⬇️
...ain/scala/org/knora/webapi/routing/ApiRoutes.scala 0.00% <0.00%> (-100.00%) ⬇️
...scala/org/knora/webapi/routing/Authenticator.scala 0.00% <0.00%> (-88.75%) ⬇️
...n/scala/org/knora/webapi/routing/HealthRoute.scala 0.00% <ø> (-66.67%) ⬇️
...in/scala/org/knora/webapi/routing/KnoraRoute.scala 0.00% <0.00%> (-91.67%) ⬇️
...cala/org/knora/webapi/routing/RejectingRoute.scala 0.00% <ø> (-55.00%) ⬇️
...n/scala/org/knora/webapi/routing/RouteUtilV2.scala 13.79% <ø> (-54.03%) ⬇️
...ebapi/routing/admin/AuthenticatorServiceLive.scala 91.30% <0.00%> (+16.30%) ⬆️
...org/knora/webapi/routing/admin/FilesRouteADM.scala 0.00% <0.00%> (-92.31%) ⬇️
...rg/knora/webapi/routing/admin/GroupsRouteADM.scala 0.00% <0.00%> (-97.73%) ⬇️
... and 35 more

... and 165 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@seakayone seakayone merged commit 0dc76f0 into main Mar 22, 2023
11 checks passed
@seakayone seakayone deleted the wip/bugfix-setting-cardinality-for-three-tier-class-hierarchy-DEV-1927 branch March 22, 2023 18:51
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.

None yet

2 participants