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

Doc about create a custom choices list #516

Merged
merged 2 commits into from Mar 13, 2017
Merged

Doc about create a custom choices list #516

merged 2 commits into from Mar 13, 2017

Conversation

anaelChardan
Copy link
Contributor

No description provided.

@anaelChardan anaelChardan force-pushed the custom-job-field branch 5 times, most recently from abe04ec to 654e944 Compare March 12, 2017 15:51
Copy link
Contributor

@mickaelandrieu mickaelandrieu left a comment

Choose a reason for hiding this comment

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

The build need to be green :)


Then configure a fetcher

.. literalinclude:: ../../src/Acme/Bundle/DummyConnectorBundle/Resources/config/requirejs.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

Your YAML file is invalid and create an error in the build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this that create an error ? ok thanks :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup, the Python validator for YAML files is "stricter" than Symfony 2 one: note that in Symfony 3 this syntax is also invalid:

foo: %foo% # valid in Symfony2, invalid in Symfony3 and in YAML reference
foo: "%foo%" # valid everywhere

# Resources/config/form_extensions/acme_job_instance_csv_base_import.yml

acme-job-instance-csv-base-import-show-properties-my-custom-list:
module: %THE_NAME_OF_YOUR_FECTHER%
Copy link
Contributor

Choose a reason for hiding this comment

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

- %foo%
+ "%foo%"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah :)

config:
fieldCode: configuration.myCustomList
readOnly: false
label: %your_label_translation_key%
Copy link
Contributor

Choose a reason for hiding this comment

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

- %foo%
+ "%foo%"

fieldCode: configuration.myCustomList
readOnly: false
label: %your_label_translation_key%
tooltip: %your_tooltip_translation_key%
Copy link
Contributor

Choose a reason for hiding this comment

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

same here


config:
paths:
%THE_NAME_OF_YOUR_FECTHER% : %the_path_of_your_fetcher% #For example -> mycustomfetcher: mycustombundle/js/my-custom-choices-list
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

config:
pim/fetcher-registry:
fetchers:
%THE_NAME_OF_YOUR_FECTHER% :
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

module: pim/base-fetcher
options:
urls:
list: %the_route_name_of_your_controller_action%
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@@ -151,11 +151,12 @@ We need to provide a form name to the frontend to be able to render it properly.
:linenos:
:lines: 1-6

If you want to go further, you can create your own form and re-use common parts provided by default. Here is an example of a full form configuration:
If you want to go further, you can create your own form and re-use common parts provided by default. Here is an example of a full form configuration (config/form_extensions/acme_job_instance_csv_base_import.yml):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you create a link, or put the content?

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's just to tell the path to the user, I don't know how to do that :)

}
}

Then configure a fetcher
Copy link
Contributor

Choose a reason for hiding this comment

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

a fetcher ?

Also:

- a fetcher
+ a fetcher:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok :)

@anaelChardan anaelChardan force-pushed the custom-job-field branch 2 times, most recently from 551b6b7 to 1e52510 Compare March 13, 2017 09:27
@mickaelandrieu
Copy link
Contributor

Thank you @anaelChardan 👍

@anaelChardan
Copy link
Contributor Author

Thanks to you @mickaelandrieu :)

@anaelChardan anaelChardan merged commit 090c163 into 1.7 Mar 13, 2017
@anaelChardan anaelChardan deleted the custom-job-field branch March 13, 2017 09:37
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.

None yet

2 participants