Repository navigation
feat: expose editor buttons with slots - #2377
Merged
Merged
Conversation
This is an internal API to be used by the Flow counterpart. Expose the editor buttons (save, cancel and delete) with slots in a similar way as done with form. This is to enable the Flow counterpart to pass its own buttons instances and attach them to the Crud WC. Part of vaadin/flow-components#1112 Co-authored-by: Hadi Amiri <hdamr@users.noreply.github.com>
web-padawan
requested changes
Aug 26, 2021
Comment on lines
-136
to
-137
|
|
||
| describe('items', () => { |
Member
There was a problem hiding this comment.
Let's avoid large diff by using this approach. Here is how I would do it.
['default', 'slotted buttons'].forEach((mode) => {
describe(`[${mode}] items`, () => {
beforeEach(async () => {
if (mode === 'default') {
crud = fixtureSync('<vaadin-crud style="width: 300px;"></vaadin-crud>');
} else {
crud = fixtureSync(
`<vaadin-crud style="width: 300px;">
<vaadin-button slot="save-button"></vaadin-button>
<vaadin-button slot="cancel-button"></vaadin-button>
<vaadin-button slot="delete-button"></vaadin-button>
</vaadin-crud>`
);
}
crud.items = [{ foo: 'bar' }];
await nextRender(crud._grid);
});
describeItems();
});
});
function describeItems() {
// all the existing nested `describe` here
}Note, the function is intended so we can define it after the invocation and leverage hoisting.
Contributor
Author
There was a problem hiding this comment.
Makes sense. Changed.
DiegoCardoso
force-pushed
the
feat/expose-editor-buttons
branch
from
August 26, 2021 15:02
3764ab6 to
36abc1e
Compare
Member
|
Kudos, SonarCloud Quality Gate passed!
|
web-padawan
approved these changes
Aug 26, 2021
Collaborator
|
This ticket/PR has been released with platform 22.0.0.alpha2 and is also targeting the upcoming stable 22.0.0 version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.









Description
This is an internal API to be used by the Flow counterpat.
Create slots on the editor buttons (save, cancel and delete) to enable the Flow counterpart to pass its own button instances to the Crud WC.
Part of vaadin/flow-components#1112
Type of change
Checklist
Additional for
Featuretype of change