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

help text and link for form labels #138 #143

Merged
merged 9 commits into from
Jun 21, 2018
Merged

help text and link for form labels #138 #143

merged 9 commits into from
Jun 21, 2018

Conversation

kevinpapst
Copy link
Member

@kevinpapst kevinpapst commented Feb 20, 2018

Description

Fixes #138 by adding methods to:

  • add a help icon with a link to a docu chapter for a form
  • add a help icon with a link to a docu chapter for a single form label

Added docu about formats that can be entered in the duration field - the link is in the edit timesheet form next to the title (the ? icon).

Symfony supports "help" text out-of-the-box with the recently executed upgrade to 4.1 for single fields and I checked it => will be displayed.

@kevinpapst kevinpapst changed the title Form help 138 help text and link for form labels #138 Feb 20, 2018
Copy link
Contributor

@simonschaufi simonschaufi left a comment

Choose a reason for hiding this comment

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

Where are the tooltips? I didn't find them.

@kevinpapst
Copy link
Member Author

I can‘t remember the status of the branch. But I won‘t merge it anyways, as I am working on updating to Symfony 4.1 in #160 which will bring „help“ labels out of the box.

$view->vars['documentation'] = $options['documentation'] ?? '';
}

public function configureOptions(OptionsResolver $resolver)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want to include docheader everywhere or not?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, the documentation link will only be displayed where it has an value.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you misunderstood me. I mean the code documentation above the method.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I did indeed ;-) I'll update the PR later, thanks for the check!
We need to improve the Scrutinizer and phpcs style checks, see #158 to find such stuff automatically.

Copy link
Member Author

Choose a reason for hiding this comment

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

added the phpdoc

@kevinpapst
Copy link
Member Author

Okay, the branch is done. You can test if you want.
Right now there is no field that has a "help text", so simply edit e.g. the file src/Form/TimesheetEditForm.php and replace

            ->add('description', TextareaType::class, [
                'label' => 'label.description',
                'required' => false,
            ])

with

            ->add('description', TextareaType::class, [
                'help' => 'some random information',
                'label' => 'label.description',
                'required' => false,
            ])

to see it.

This form has also the new "link to docu icon" besides the form title.

@kevinpapst kevinpapst merged commit 3dc054b into master Jun 21, 2018
@kevinpapst kevinpapst deleted the form-help-138 branch June 21, 2018 16:25
@kevinpapst kevinpapst added this to the 0.2 milestone Jun 23, 2018
@lock
Copy link

lock bot commented Nov 18, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Nov 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants