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 missing list view usages to data type references (#14485) #14617

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

ustadstar
Copy link
Contributor

Prerequisites

  • I have added steps to test this contribution in the description below

If there's an existing issue for this PR then this fixes #14485

Please see the issue for the description of the bug including the steps to reproduce.

My changes do show the content types which use a list view as a container under references on the info tab of a datatype. However my changes are not the ideal solution to the problem. A better solution for the future would be a change in the database schema to add a relation between the list view (the isContainer field on contentType is now a boolean, without any relation).

My solution finds the relation between the datatype and list views as a container as follows:

  • We check if the current data type is a list view, if it is we continue
  • Next we check if the name of the datatype matches the custom list view name. The logic behind this is the same as in: ListViewContentAppFactory.cs. If it is not a custom list view we continue
  • Next we check if the datatype name matches the default content type list view name. if not we return an empty array.

To test this PR please follow the steps below.

Test with a default list view

  1. Navigate to settings
  2. Choose a document type
  3. Open the list view tab
  4. Enable list view and save
  5. Navigate to settings -> data types -> List View - Content
  6. Open the info panel
  7. Check if List View - Content is listed under references

image

Test with a custom list view

  1. Navigate to settings
  2. Create a new document type, e.g. "Content Page"
  3. Open the list view tab
  4. Enable list view and choose "Create a custom list view"
  5. Save the new document type
  6. Navigate to settings -> data types -> List View - contentPage
  7. Open the info panel
  8. Check if Content Page is listed under references

image

@github-actions
Copy link

github-actions bot commented Jul 31, 2023

Hi there @ustadstar, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

Copy link
Member

@nul800sebastiaan nul800sebastiaan left a comment

Choose a reason for hiding this comment

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

Thanks @ustadstar - we'll have a better look soon, but to begin with I've left you a comment to update the interface so it's not a breaking change.

@ustadstar
Copy link
Contributor Author

@nul800sebastiaan I have added a default implementation for both methods in the interfaces.

@ustadstar
Copy link
Contributor Author

Hi @nul800sebastiaan, did you have time to review the changes?

@georgebid georgebid self-assigned this Feb 6, 2024
@georgebid georgebid merged commit 5d0486f into umbraco:contrib Feb 6, 2024
12 of 13 checks passed
@georgebid
Copy link
Contributor

Hey, @ustadstar! I thought I'd jump in here and review this PR 😄 Thanks a lot for making those change requests, I have tested this PR and everything looks good to me, therefore I have merged this one in! Thanks for fixing #14485 🚀 You'll see this in the next release.

@emmagarland
Copy link
Contributor

Great stuff all!

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.

List Views aren't included in the data type references
5 participants