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 "collapsibleTitle" field to modal config #2155

Closed
wants to merge 31 commits into from

Conversation

MadsBuchmann
Copy link
Contributor

@MadsBuchmann MadsBuchmann commented Mar 31, 2022

Which issue does this PR close?

This PR closes # 843
This PR closes # 2060

What is the new behavior?

The field collapseTitle has been added to the ModalConfig type.
When that is true the title will initially be part of the content. When scrolled out of view it will appear in the toolbar.

While i was in there i took the liberty documenting the inline footer from #958.

Does this PR introduce a breaking change?

  • Yes
  • No

Checklist:

The following tasks should be carried out in sequence in order to follow the process of contributing correctly.

Reminders

  • Make sure you have implemented tests following the guidelines in: "The good: Test".
  • Make sure you have updated the cookbook with examples and showcases (for bug fixes, enhancements & new components).

Review

  • Do a self-review.
  • Request that the changes are code-reviewed
  • Request that the changes are UX reviewed (only necessary if your PR introduces visual changes)

When the pull request has been approved it will be automatically merged to stable via automerge.

I will have to introduce a new child element to the start of 'ion-content'. I've changed the function to search from the last element and then go to the previous sibling instead.
The modal long title feature requires that the title is inserted in both the content & the ion-header element. Therefore extend with ability to use a list and allow it to be cloned to multiple new places.
This applies the setting to every page in the modal. If we need to control it on a per page basis we should allow kirby-page-title to control it.
The previous implementation caused tests to be flakey. This does not do so in my experience.
The testing problem stemmed from the testbuilders config.component field carrying it's value across tests. Causing config.component to sometimes be null other times to be a component.
Due to ModalConfig.component having type 'any' well... Any value is valid causing the function to occasionally return null. This is not explicit in the code or properly handled. The getEmbeddedComponentElement could handle that before as it used 'lastElementSibling' & 'firstElementSibling' causing an element to always be returned as there will always be a single element (router-outlet). This has now been made explicit and is handled by both the tests and the code itself.
@MadsBuchmann MadsBuchmann changed the title Enhancement/843 collapsible title Add "collapsibleTitle" field to modal config Mar 31, 2022
@github-actions github-actions bot temporarily deployed to pr-843-collapsible-title March 31, 2022 11:33 Inactive
@MadsBuchmann MadsBuchmann changed the base branch from main to release/v6.0.0 April 4, 2022 08:30
@github-actions github-actions bot temporarily deployed to pr-843-collapsible-title April 4, 2022 12:54 Inactive
@github-actions github-actions bot temporarily deployed to pr-843-collapsible-title April 4, 2022 13:38 Inactive
@github-actions github-actions bot temporarily deployed to pr-843-collapsible-title April 4, 2022 13:52 Inactive
@MadsBuchmann MadsBuchmann marked this pull request as ready for review April 4, 2022 14:03
--padding-top: 0px;

ion-header ion-toolbar:first-of-type {
padding-top: 0px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note to self: We should merge main into v6, so we get prettier and stylelint update onto this.
0px should be 0 here.

0px is okay for custom props though!

Copy link
Collaborator

@RasmusKjeldgaard RasmusKjeldgaard Apr 4, 2022

Choose a reason for hiding this comment

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

Hmm, it actually looks like this already has those changes because it was rebased at some point.
So maybe the commit happened before that rebase, and we should run npx prettier --write . and npx stylelint "**/*.scss" --fix to be sure everything is formatted correctly.

And still, we should rebase onto v6 once main has been merged into that, for a cleaner diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should i do anything specific here 👀?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you try to run npm run prettier:fix and npm run lint:designsystem:css?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It results in no changes

@MadsBuchmann
Copy link
Contributor Author

Note to self: There's a bunch of branches related to 843. Remember to delete them after this has been merged.

@RasmusKjeldgaard
Copy link
Collaborator

I love it! Seems to work like a charm ❤️

Just writing 'e' makes it seem like some kind of error handling where that notation often is used.
@RasmusKjeldgaard
Copy link
Collaborator

Do you know what happened for the diff to suddenly be this large? Is it related to the merge-commit from yesterday?

@MadsBuchmann
Copy link
Contributor Author

The diff got absolutely ruined for some reason. I've played around with it and the only solution i found was to cherry-pick the changes.

So the review will continue in a new PR: #2174

@MadsBuchmann MadsBuchmann deleted the enhancement/843-collapsible-title branch April 28, 2022 09:24
This was referenced Jun 14, 2022
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.

[Housekeeping] Remove deprecated ModalConfig title [Enhancement] Modal title should support long titles
2 participants