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

Repeat with different variants #205

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Repeat with different variants #205

wants to merge 9 commits into from

Conversation

jalagari
Copy link

@jalagari jalagari commented Dec 2, 2024

Please always provide the GitHub issue(s) your PR is for, as well as test URLs where your change can be observed (before and after):

Fix #

Test URLs:

Copy link

aem-code-sync bot commented Dec 2, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link

aem-code-sync bot commented Dec 2, 2024

Copy link

aem-code-sync bot commented Dec 2, 2024

component-models.json Outdated Show resolved Hide resolved
"value": "addRemoveAll"
},
{
"name": "Add & Remove Last",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add and Remove actions on last instance

Copy link
Author

Choose a reason for hiding this comment

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

as discussed we are going with same Add & Remove Last

Copy link
Collaborator

Choose a reason for hiding this comment

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

The display names may be quite confusing for the author here..
Add & Remove on all instances
Add & Remove on the last instance only

And does all instances mean that one can insert an instance in between 2 instances as well?

Choose a reason for hiding this comment

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

Post discussions, There will be only two variants, No actions and Add & Remove Buttons

@@ -1,12 +1,15 @@
<form data-action="undefined" novalidate="" data-source="sheet" data-rules="false">
<div data-min="undefined" data-max="undefined" class="repeat-wrapper">
<div data-min="0" data-max="undefined" data-variant="addRemoveAll" class="repeat-wrapper">
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should fix all undefined now.

blocks/form/form.js Outdated Show resolved Hide resolved
"value": "addRemoveAll"
},
{
"name": "Add & Remove Last",
Copy link
Collaborator

Choose a reason for hiding this comment

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

The display names may be quite confusing for the author here..
Add & Remove on all instances
Add & Remove on the last instance only

And does all instances mean that one can insert an instance in between 2 instances as well?

export function insertAddButton(wrapper, form) {
const actions = document.createElement('div');
actions.className = 'repeat-actions';
const addLabel = wrapper?.dataset?.repeatAddButtonLabel || 'Add';
Copy link
Collaborator

Choose a reason for hiding this comment

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

We will have to handle both of these props in the translation layer as well since these are labels. Pls log a ticket for the same.
Also, the recommended way is to prefix these props with fd: as these are OOTB props to avoid their clash with custom props.

Copy link
Collaborator

Choose a reason for hiding this comment

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

And we should have this registered in the sling models also.

Copy link
Author

@jalagari jalagari Dec 5, 2024

Choose a reason for hiding this comment

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

@nit23uec - I wanted to avoid dependency on model as it cause dependency on specific version of CC to have this feature and update CC is again dependency on developer , running pipeline, etc.

CC - @vdua

Copy link
Author

Choose a reason for hiding this comment

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

There are less chances of conflicting as they need to add properties in _panel.json

Copy link
Collaborator

Choose a reason for hiding this comment

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

We'd need it anyways for translation. Let's make sure this does not gets lost.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Conflicting can appear for migration use cases in future. We are talking about jcr persistence here.

Copy link
Author

Choose a reason for hiding this comment

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

@nit23uec - Content will get migrated but they need to updated panel definition in edge delivery repo and also need to rebuild component here so they can take care of it.

Repeating again the main reason I wanted to avoid it part of CC because of following reasons

Customer who are in old build will not get this feature until they upgrade there CC and run pipeline

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.

4 participants