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

Feature/set custom edit exec button #490

Merged

Conversation

georgehristov
Copy link
Collaborator

No description provided.

@georgehristov georgehristov force-pushed the feature-set-custom-edit-exec-button branch from 0941acd to edc8a31 Compare December 1, 2019 15:38
@DarkSide666 DarkSide666 self-requested a review December 5, 2019 22:44
Copy link
Member

@DarkSide666 DarkSide666 left a comment

Choose a reason for hiding this comment

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

I kind of understand what you wanted to implement with this, but please provide more info in PR description.
Also atk4/data should not depend on atk4/ui repo, so ... I don't think this is good idea to have.

@georgehristov
Copy link
Collaborator Author

georgehristov commented Dec 6, 2019

In current develop version the add / edit modal button has the same label as the action so 'edit' action has label 'Edit'. I find this not so intuitive,
Introducing the 'execButton' option would allows devs to assign a custom button for the add/edit modal.
If data should not depend on ui then I will update so that only an array is passed and ui can then create the button from the array.

@DarkSide666
Copy link
Member

I think that would be better, because really, data should not have ui dependency.
Maybe you can pass only array with caption there, and let ui decide which class to use by default?

I will add @romaninsh and @ibelar to help decide how to do this.

@PhilippGrashoff
Copy link
Contributor

I also vote for the array seed, as that wouldnt instanciate the Button object right away but only when needed.

@georgehristov
Copy link
Collaborator Author

I was considering between a seed or only the button label and initially opted for the seed.
Now I believe it would be better if data passes the button label only.
Will update the branch.

@ibelar
Copy link
Contributor

ibelar commented Dec 6, 2019

The actual implementation of UserAction executor allow for changing button label via the $action->caption and $action->description property .

For example, changing execBtn caption and description for add action would be:

$ac = $country->getAction('add');
$ac->caption = 'Click to Add '; // the execBtn label in UserAction executor, i.e. perform the action.
$ac->description = 'Add New';  // The btn label that trigger the action, i.e will show modal.

I think did should be ok for now. Perhaps later on we could implement a better way to support custom button in ActionExecutor\UserAction::class.

Copy link
Member

@romaninsh romaninsh left a comment

Choose a reason for hiding this comment

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

ok

@romaninsh romaninsh merged commit b2e505e into atk4:develop Dec 23, 2019
@georgehristov georgehristov deleted the feature-set-custom-edit-exec-button branch February 11, 2020 16:23
DarkSide666 added a commit that referenced this pull request Feb 11, 2020
* wip

* wip

* fixes

* Feature/test1 (#483)

* fixes

* testtisg

* wip

* test

* backmerge master

* normalize everything

* added locale test (#485)

* added locale test

* Apply fixes from StyleCI

* wip

* wip

* Apply fixes from StyleCI

* Update CHANGELOG.md

* Implement #386 (#477)

* Implement #386

* Apply fixes from StyleCI

* Update Field.php

* Update Model.php

* Update Helper.php

* Apply fixes from StyleCI

* move functionality to atk4/core

* Apply fixes from StyleCI

* fix traits

* Apply fixes from StyleCI

* fix typo

* Feature/pgsql test (#486)

* fix one test

* Setting current dependencies

* wip

* wip

* Add matrix testing (#492)

* Test using matrix

* wip

* wip

* wip

* clean up bundler

* clean up bundler (#493)

* wip

* Fix/delete callback (#488)

* fix one test

* Setting current dependencies

* fix/delete callback

* Update composer.json

* Fix/persistence sql condition (#487)

* fix one test

* Setting current dependencies

* fix wrong assignment of value as condition

* Update composer.json

* Update SQL.php

* Feature remove specified action (#489)

* fix one test

* Setting current dependencies

* add method to remove specified action(s) from model

* Update Model.php

* spaces

* Feature/add confirmation callback argument (#491)

* fix one test

* Setting current dependencies

* pass the action object as argument to confirmation callback

* badge

* Feature/set custom edit exec button (#490)

* fix one test

* Setting current dependencies

* use custom exec button on edit action

* Update Model.php

* remove class, use seed

Co-authored-by: Imants Horsts <[email protected]>

* model default add field property (#454)

* use the object default add field property

* no need for double brackets.

* force tests

Co-authored-by: Romans Malinovskis <[email protected]>
Co-authored-by: Imants Horsts <[email protected]>

* Fix empty array condition (#498)

* more tests

* Apply fixes from StyleCI

* better implementation for addFields() and test cases (#499)

* better implementation for addFields() and test cases

* Apply fixes from StyleCI

* use shorthand method

* simplify code

* implement `exprNow()` method. Rely on dsql PR.

* Apply fixes from StyleCI

* pass

* add docs

Co-authored-by: Romans Malinovskis <[email protected]>

* Fix/ Small Action related fix (#502)

* Fix/ Small Action related fix

- Set Edit action exec button labe lto 'Save' by default
 - Set Edit action exec button colot to blue by default
- Set default description for Add action in model
- Add method to retreive model from Action

* Apply fixes from StyleCI

* fix comment

Co-authored-by: Imants Horsts <[email protected]>

* update multiple delete example (#503)

* now supports multiple filter options in getFields()

* Apply fixes from StyleCI

* Accept any DateTimeInterface impl. for datetime (#505)

* Accept any DateTimeInterface impl. for datetime

* Fix DateTime::getTimezone method name

* Fix setTimezone for any instance of DateTimeInterface

* Add microseconds persistence support for datetime/time types + fix normalization/cloning issue (#504)

* Fix datetime normalization cloning

* Add microseconds persistence support for datetime/time types

Co-authored-by: Imants Horsts <[email protected]>

* include comment about hooks and example how to execute them (#510)

* update composer

* Update release-drafter.yml

* Update bundler.yml

* Setting release dependencies

Co-authored-by: Romans Malinovskis <[email protected]>
Co-authored-by: Imants Horsts <[email protected]>
Co-authored-by: Georgi Hristov <[email protected]>
Co-authored-by: Mimo <[email protected]>
Co-authored-by: Alain Belair <[email protected]>
Co-authored-by: Michael Voříšek <[email protected]>
Co-authored-by: GitHub Web Flow <[email protected]>
romaninsh added a commit that referenced this pull request Feb 24, 2020
* badge

* Feature/set custom edit exec button (#490)

* fix one test

* Setting current dependencies

* use custom exec button on edit action

* Update Model.php

* remove class, use seed

Co-authored-by: Imants Horsts <[email protected]>

* model default add field property (#454)

* use the object default add field property

* no need for double brackets.

* force tests

Co-authored-by: Romans Malinovskis <[email protected]>
Co-authored-by: Imants Horsts <[email protected]>

* Fix empty array condition (#498)

* more tests

* Apply fixes from StyleCI

* better implementation for addFields() and test cases (#499)

* better implementation for addFields() and test cases

* Apply fixes from StyleCI

* use shorthand method

* simplify code

* implement `exprNow()` method. Rely on dsql PR.

* Apply fixes from StyleCI

* pass

* add docs

Co-authored-by: Romans Malinovskis <[email protected]>

* Fix/ Small Action related fix (#502)

* Fix/ Small Action related fix

- Set Edit action exec button labe lto 'Save' by default
 - Set Edit action exec button colot to blue by default
- Set default description for Add action in model
- Add method to retreive model from Action

* Apply fixes from StyleCI

* fix comment

Co-authored-by: Imants Horsts <[email protected]>

* use property to define field seed properties

* update field test

* introduce expandable field type registry

* update test to new properties

* revert type setting

* add shorthand int type declaration

* refactor variable names for clarity and consistency

* introduce Field::getTypecaster and Field::getSerializer methods

* introduce registering field seeds from array

* chore: refactor variable names for consistency

Co-authored-by: Imants Horsts <[email protected]>
Co-authored-by: Mimo <[email protected]>
Co-authored-by: Romans Malinovskis <[email protected]>
Co-authored-by: Alain Belair <[email protected]>
romaninsh added a commit that referenced this pull request Mar 28, 2020
* badge

* Feature/set custom edit exec button (#490)

* fix one test

* Setting current dependencies

* use custom exec button on edit action

* Update Model.php

* remove class, use seed

Co-authored-by: Imants Horsts <[email protected]>

* model default add field property (#454)

* use the object default add field property

* no need for double brackets.

* force tests

Co-authored-by: Romans Malinovskis <[email protected]>
Co-authored-by: Imants Horsts <[email protected]>

* Fix empty array condition (#498)

* more tests

* Apply fixes from StyleCI

* better implementation for addFields() and test cases (#499)

* better implementation for addFields() and test cases

* Apply fixes from StyleCI

* use shorthand method

* simplify code

* implement `exprNow()` method. Rely on dsql PR.

* Apply fixes from StyleCI

* pass

* add docs

Co-authored-by: Romans Malinovskis <[email protected]>

* Fix/ Small Action related fix (#502)

* Fix/ Small Action related fix

- Set Edit action exec button labe lto 'Save' by default
 - Set Edit action exec button colot to blue by default
- Set default description for Add action in model
- Add method to retreive model from Action

* Apply fixes from StyleCI

* fix comment

Co-authored-by: Imants Horsts <[email protected]>

* update multiple delete example (#503)

* now supports multiple filter options in getFields()

* Apply fixes from StyleCI

* Accept any DateTimeInterface impl. for datetime (#505)

* Accept any DateTimeInterface impl. for datetime

* Fix DateTime::getTimezone method name

* Fix setTimezone for any instance of DateTimeInterface

* Add microseconds persistence support for datetime/time types + fix normalization/cloning issue (#504)

* Fix datetime normalization cloning

* Add microseconds persistence support for datetime/time types

Co-authored-by: Imants Horsts <[email protected]>

* include comment about hooks and example how to execute them (#510)

* update composer

* Update release-drafter.yml

* Update bundler.yml

* Fix hasOne relation seed processing. It should replace not merge. (#512)

* New method $model->getTitles() (#513)

* Implement `getTitles()` method

* Apply fixes from StyleCI

* Update unit-tests.yml

* migration to migrator

* rename addHook to onHook (#514)

* fix #944 (#516)

* allow dots in table names, fix #515, fix #517

* Apply fixes from StyleCI

* Do not fail-fast PHP test matrix (#522)

* Simplify code (#519)

* Update release-drafter.yml

* Update release-drafter.yml

* Fix hook trait usage (#525)

* Hook args must be an array

* Fix hook onHook() usage

* Apply fixes from StyleCI

* initialization of fields and handling of expressions

* Apply fixes from StyleCI

* introduce hasPersistence and retrieval of setting

* Apply fixes from StyleCI

Co-authored-by: Imants Horsts <[email protected]>
Co-authored-by: Mimo <[email protected]>
Co-authored-by: Romans Malinovskis <[email protected]>
Co-authored-by: Alain Belair <[email protected]>
Co-authored-by: DarkSide <[email protected]>
Co-authored-by: Michael Voříšek <[email protected]>
DarkSide666 added a commit that referenced this pull request Apr 8, 2020
* wip

* wip

* fixes

* Feature/test1 (#483)

* fixes

* testtisg

* wip

* test

* backmerge master

* normalize everything

* added locale test (#485)

* added locale test

* Apply fixes from StyleCI

* wip

* wip

* Apply fixes from StyleCI

* Update CHANGELOG.md

* Implement #386 (#477)

* Implement #386

* Apply fixes from StyleCI

* Update Field.php

* Update Model.php

* Update Helper.php

* Apply fixes from StyleCI

* move functionality to atk4/core

* Apply fixes from StyleCI

* fix traits

* Apply fixes from StyleCI

* fix typo

* Feature/pgsql test (#486)

* fix one test

* Setting current dependencies

* wip

* wip

* Add matrix testing (#492)

* Test using matrix

* wip

* wip

* wip

* clean up bundler

* clean up bundler (#493)

* wip

* Fix/delete callback (#488)

* fix one test

* Setting current dependencies

* fix/delete callback

* Update composer.json

* Fix/persistence sql condition (#487)

* fix one test

* Setting current dependencies

* fix wrong assignment of value as condition

* Update composer.json

* Update SQL.php

* Feature remove specified action (#489)

* fix one test

* Setting current dependencies

* add method to remove specified action(s) from model

* Update Model.php

* spaces

* Feature/add confirmation callback argument (#491)

* fix one test

* Setting current dependencies

* pass the action object as argument to confirmation callback

* badge

* Feature/set custom edit exec button (#490)

* fix one test

* Setting current dependencies

* use custom exec button on edit action

* Update Model.php

* remove class, use seed

Co-authored-by: Imants Horsts <[email protected]>

* model default add field property (#454)

* use the object default add field property

* no need for double brackets.

* force tests

Co-authored-by: Romans Malinovskis <[email protected]>
Co-authored-by: Imants Horsts <[email protected]>

* Fix empty array condition (#498)

* more tests

* Apply fixes from StyleCI

* better implementation for addFields() and test cases (#499)

* better implementation for addFields() and test cases

* Apply fixes from StyleCI

* use shorthand method

* simplify code

* implement `exprNow()` method. Rely on dsql PR.

* Apply fixes from StyleCI

* pass

* add docs

Co-authored-by: Romans Malinovskis <[email protected]>

* Fix/ Small Action related fix (#502)

* Fix/ Small Action related fix

- Set Edit action exec button labe lto 'Save' by default
 - Set Edit action exec button colot to blue by default
- Set default description for Add action in model
- Add method to retreive model from Action

* Apply fixes from StyleCI

* fix comment

Co-authored-by: Imants Horsts <[email protected]>

* update multiple delete example (#503)

* now supports multiple filter options in getFields()

* Apply fixes from StyleCI

* Accept any DateTimeInterface impl. for datetime (#505)

* Accept any DateTimeInterface impl. for datetime

* Fix DateTime::getTimezone method name

* Fix setTimezone for any instance of DateTimeInterface

* Add microseconds persistence support for datetime/time types + fix normalization/cloning issue (#504)

* Fix datetime normalization cloning

* Add microseconds persistence support for datetime/time types

Co-authored-by: Imants Horsts <[email protected]>

* include comment about hooks and example how to execute them (#510)

* update composer

* Update release-drafter.yml

* Update bundler.yml

* Fix hasOne relation seed processing. It should replace not merge. (#512)

* New method $model->getTitles() (#513)

* Implement `getTitles()` method

* Apply fixes from StyleCI

* Update unit-tests.yml

* migration to migrator

* rename addHook to onHook (#514)

* fix #944 (#516)

* allow dots in table names, fix #515, fix #517

* Apply fixes from StyleCI

* Do not fail-fast PHP test matrix (#522)

* Simplify code (#519)

* Update release-drafter.yml

* Update release-drafter.yml

* Fix hook trait usage (#525)

* Hook args must be an array

* Fix hook onHook() usage

* Implement addWith() (#527)

* Implement addWith()

* Apply fixes from StyleCI

* implement `addWith`

* add docs

* add note

* Update unit-tests.yml

* Update unit-tests.yml

* Update unit-tests.yml

* Update unit-tests.yml

* Update unit-tests.yml

* Update unit-tests.yml

* Update unit-tests.yml

* Update unit-tests.yml

* Update unit-tests.yml

* Update unit-tests.yml

* Update unit-tests.yml

* Action should also support `fields===true` value (#531)

* Fix LIKE conditions for Array and SQL persistences (#532)

* Fix LIKE conditions - fix fix (#535)

* fix #533 (#537)

* Fix value trim (#538)

* introduce sql null condition test (#540)

* introduce test on condition with null value

* include mesage in SQL exception details

* Fix typo

* Convert scalar class names to ::class (#544)

* Fix CS - do not import classes without namespace

* Use null coalescing operator instead of isset (#545)

* Use null coalescing operator instead of isset

* Fix tests

* Fix refactorability for "owner" (#543)

* Fix refactorability for "owner"

* Typehint for elements

* Narrow phpdoc for SQL subtypes

* Fix typos

* Setting release dependencies

Co-authored-by: Romans Malinovskis <[email protected]>
Co-authored-by: Romans Malinovskis <[email protected]>
Co-authored-by: Imants Horsts <[email protected]>
Co-authored-by: Georgi Hristov <[email protected]>
Co-authored-by: Mimo <[email protected]>
Co-authored-by: Alain Belair <[email protected]>
Co-authored-by: DarkSide <[email protected]>
Co-authored-by: Michael Voříšek <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

6 participants