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

Bugfix: Relation types #1474

Merged
merged 60 commits into from
Mar 27, 2024
Merged

Bugfix: Relation types #1474

merged 60 commits into from
Mar 27, 2024

Conversation

madsrasmussen
Copy link
Contributor

@madsrasmussen madsrasmussen commented Mar 22, 2024

Important

Merges together with PR: umbraco/Umbraco-CMS#15910

Description

This PR reimplements the relation types and relations UI. The UI has been implemented as Read Only because it doesn't make sense to create relation types in the UI, as they also need a server implementation. We have also removed the tree for relation types as they can't be nested or support folders.

The UI is now simplified as a list of relation types. When you navigate to a relation type you can see all relations for that type including the details for the relation type.

Relations on a relation-type detail workspace are paginated and will show 50 relations per page.

Demo:

Kapture.2024-03-23.at.19.42.37.mp4

With the UI updates, we have also aligned the repositories so they follow the same naming as the rest of our repositories.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, do not impact compiled assets)

Caution

Breaking Changes:

Changes to Relation Types

  • Renamed UmbRelationTypeRepository to UmbRelationTypeDetailRepository
  • Renamed requestById to requestByUnique
  • Removed requestRelationsById method
  • Removed save method
// Current version
const repo = new UmbRelationTypeRepository();
const { data } = await repo.requestById('1234-1234');

// New version
const repo = new UmbRelationTypeDetailRepository();
const { data } = await repo.requestByUnique('1234-1234');

Changes to Relations

  • Renamed UmbRelationRepository to UmbRelationCollectionRepository
  • Renamed method requestChildRelationById to requestCollection
// Current version
const repo = new UmbRelationRepository();
const { data } = await repo.requestChildRelationById( '1234-123')

// New version
const repo = new UmbRelationCollectionRepository();
const { data } = await repo.requestCollection({ relationTypeUnique: '1234-123' })

Known issues

  • Menu item loses active state when navigating to relation type details

@madsrasmussen madsrasmussen marked this pull request as ready for review March 23, 2024 18:45
@leekelleher leekelleher self-requested a review March 25, 2024 12:26
Copy link
Member

@leekelleher leekelleher left a comment

Choose a reason for hiding this comment

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

Functionality this works well, all as expected. I did notice a few cosmetic issues, which could be picked up on later.

On Relations overview...

  • Large gap above the table, (due to the empty <umb-collection-toolbar>)

On Relation Type detail view...

  • Missing breadcrumbs
  • Missing a back button, (or if we have a UI pattern for going back to a Collection view?)
  • Whilst relations are loading, the UI says "No relations found" for a moment. We could have a <uui-loading>?
  • For "Related Document" and "Related Media", in the info box, the "Parent Type" and "Child Type" are both empty. I believe this is a server/data concern, (as it's missing from the API response), but it's whether we do anything about this in the UI?
  • Wondering if the Relation's Parent and Child should be able to open the corresponding item editor? (although, this may open a can of worms)

@iOvergaard iOvergaard merged commit 8b94618 into main Mar 27, 2024
7 checks passed
@iOvergaard iOvergaard deleted the bugfix/relation-types branch March 27, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants