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

Replace SubFormElement with FieldsetElement #74

Merged
merged 9 commits into from Jan 17, 2023
Merged

Replace SubFormElement with FieldsetElement #74

merged 9 commits into from Jan 17, 2023

Conversation

lippserd
Copy link
Member

@lippserd lippserd commented Sep 5, 2022

No description provided.

@lippserd
Copy link
Member Author

lippserd commented Sep 5, 2022

@TAINCER Please rewrite the tests to verify that the array notation works both in terms of rendering and value processing. Also make sure that it is still possible to get elements with their original names.

@TAINCER TAINCER marked this pull request as ready for review September 23, 2022 14:59
tests/FormElement/FieldsetTest.php Outdated Show resolved Hide resolved
tests/FormElement/FieldsetTest.php Outdated Show resolved Hide resolved
tests/FormElement/FieldsetTest.php Outdated Show resolved Hide resolved
tests/FormElement/FieldsetTest.php Outdated Show resolved Hide resolved
tests/FormElement/FieldsetTest.php Outdated Show resolved Hide resolved
tests/FormElement/FieldsetTest.php Outdated Show resolved Hide resolved
tests/FormElement/FieldsetTest.php Outdated Show resolved Hide resolved
Copy link
Member Author

@lippserd lippserd left a comment

Choose a reason for hiding this comment

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

I don't expect any more changes than the ones just requested, so after that please squash ll your commits belonging to tests/FormElement/FieldsetTest.php into one "Test Fieldset" commit.

tests/FormElement/FieldsetTest.php Outdated Show resolved Hide resolved
tests/FormElement/FieldsetTest.php Outdated Show resolved Hide resolved
tests/FormElement/FieldsetTest.php Outdated Show resolved Hide resolved
tests/FormElement/FieldsetTest.php Outdated Show resolved Hide resolved
tests/FormElement/FieldsetTest.php Outdated Show resolved Hide resolved
@lippserd lippserd changed the title Replace SubFormElement with Fieldset Replace SubFormElement with FieldsetElement Oct 13, 2022
@lippserd lippserd force-pushed the fieldset branch 4 times, most recently from 832c75b to 91a5932 Compare October 17, 2022 09:16
@nilmerg nilmerg added this to the v0.7.0 milestone Oct 18, 2022
@nilmerg nilmerg added the enhancement New feature or request label Nov 8, 2022
Copy link
Member

@yhabteab yhabteab left a comment

Choose a reason for hiding this comment

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

Bildschirm­foto 2022-11-09 um 13 57 18

@lippserd
Copy link
Member Author

lippserd commented Nov 9, 2022

I think it's because cloning just doesn't work. But that's not something that this PR introduces.

@lippserd
Copy link
Member Author

lippserd commented Nov 9, 2022

I think it's because cloning just doesn't work. But that's not something that this PR introduces.

Or did you spot something wrong here in the code @yhabteab?

@yhabteab
Copy link
Member

yhabteab commented Nov 9, 2022

Or did you spot something wrong here in the code @yhabteab?

I would say yes :) Instead of doing so, why couldn't the concrete form set the default decorator of the element?

public function prependWrapper(Wrappable $wrapper)
{
// TODO(lippserd): Revise decorator implementation to properly implement decorator propagation
if (
! $this->hasDefaultElementDecorator()
&& $wrapper instanceof FormElementDecorator
) {
$this->setDefaultElementDecorator($wrapper);
}
return parent::prependWrapper($wrapper);
}

So, I've just removed the prependWrapper() and added this to the job config form and it works.

$crontab>setDefaultElementDecorator(new IcingaFormDecorator());

@lippserd
Copy link
Member Author

Or did you spot something wrong here in the code @yhabteab?

I would say yes :) Instead of doing so, why couldn't the concrete form set the default decorator of the element?

I wouldn't expect a default decorator to have to be set multiple times.

Can you please try this fix please.

@yhabteab
Copy link
Member

I wouldn't expect a default decorator to have to be set multiple times.

Its not about adding the decorator multiple times or not, but with my version we wouldn't have to clone things as we are instantiating our own decorator instance.

Can you please try this fix please.

Bildschirm­foto 2022-11-10 um 10 08 40

@lippserd
Copy link
Member Author

Its not about adding the decorator multiple times or not, but with my version we wouldn't have to clone things as we are instantiating our own decorator instance.

The whole point is that I don't want library users to have to set decorators for fieldsets if the form already provides a decorator.

Can you please try the latest commit with the cloning patch applied?

nilmerg
nilmerg previously approved these changes Dec 14, 2022
nilmerg
nilmerg previously approved these changes Dec 16, 2022
@lippserd
Copy link
Member Author

@TAINCER Please rebase.

nilmerg
nilmerg previously approved these changes Jan 13, 2023
@lippserd
Copy link
Member Author

Wait before merging please. I think some commits can be squashed.

@lippserd
Copy link
Member Author

Wait before merging please. I think some commits can be squashed.

Ready.

@nilmerg nilmerg removed the request for review from yhabteab January 17, 2023 10:49
@nilmerg nilmerg merged commit 7d6fd94 into master Jan 17, 2023
@nilmerg nilmerg deleted the fieldset branch January 17, 2023 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants