Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

feat: EC Search Form #28

Merged
merged 10 commits into from
Feb 21, 2019
Merged

feat: EC Search Form #28

merged 10 commits into from
Feb 21, 2019

Conversation

nimek2
Copy link
Contributor

@nimek2 nimek2 commented Feb 20, 2019

No description provided.

@hapertown
Copy link

hapertown commented Feb 20, 2019

@emeryro
Look at the tests (https://drone.fpfis.eu/ec-europa/ecl-twig/164/5) - I think this is the same problem as in here (#21). Lost dependency.
If we can solve this problem there, we will solve it and here the component will be ready for review.
Please for your help.

@emeryro
Copy link
Contributor

emeryro commented Feb 21, 2019

The message in Drone says Your git status is not clean. Please update yarn.lock. Aborting.
Did you try to run yarn to update it?

@hapertown
Copy link

hapertown commented Feb 21, 2019

The message in Drone says Your git status is not clean. Please update yarn.lock. Aborting.
Did you try to run yarn to update it?

As you have seen many times, I updated the yarn and yarn.lock file but without success. I will analyze the changes to have knowledge for the future. You can now perform a component review.
Thanks for your help

@emeryro emeryro self-assigned this Feb 21, 2019
Copy link
Contributor

@emeryro emeryro left a comment

Choose a reason for hiding this comment

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

Visually the component is fine.
Just a few minor things to be updated

import searchFormDocs from './docs/search-form.md';
import searchForm from './search-form.html.twig';

storiesOf('Components/SearchForm', module)
Copy link
Contributor

Choose a reason for hiding this comment

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

that's a small thing, but display in storybook will be better if you add a space between Search and Form here (that's how the item is displayed in the menu)

Choose a reason for hiding this comment

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

Fixed in 72483ba

### Example:

```twig
{% include 'path/to/icon.html.twig' with {
Copy link
Contributor

Choose a reason for hiding this comment

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

by adding two spaces at the end of the line, you should be able to force a new line. It would make the code more readable (currently it is a single very long line)

Choose a reason for hiding this comment

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

I would like to understand better what you mean - I understand that there is a lack of breaking the line, but what is the exact line(s) in this case?

Copy link
Contributor Author

@nimek2 nimek2 Feb 21, 2019

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

by adding two spaces at the end of the line, you should be able to force a new line. It would make the code more readable (currently it is a single very long line)

Ok I understand - you mean displaying in the Storybook (Notes section). Fixed in 0d2dc7f


### Parameters

- "textInput" (associative array) default: A predefined structure for EC Text Input
Copy link
Contributor

Choose a reason for hiding this comment

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

as we are using underscores (snake case) for all other twig variable names, we should use it there too.
(note that it only for twig variables, javascript variables are still in camel case)

Choose a reason for hiding this comment

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

Fixed in 72483ba. Please check it.

"access": "public"
},
"devDependencies": {
"@ecl/ec-specs-search-form": "~2.1.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

please add a devDependency to vanilla EC component too

Choose a reason for hiding this comment

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

Added in 72483ba

"description": "ECL Twig - EC Search Form",
"publishConfig": {
"access": "public"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

as ec-component-text-input and ec-component-button are used directly in the template, they should be added to dependencies

Choose a reason for hiding this comment

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

Added in 72483ba

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, I meant a dependency to the twig component @ecl-twig/ec-component-text-input and @ecl-twig/ec-component-button
As they are included in the twig template, if they are not present it will crash. So the dependency is to prevent that.
Also these two should probably be in dependenciesinstead of devDependencies

{% include '../ec-component-text-input/text-input.html.twig' with textInput %}
{% endif %}

{% if textInput is defined %}
Copy link
Contributor

Choose a reason for hiding this comment

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

should be button instead of textInput

Choose a reason for hiding this comment

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

Yes my mistake. Fixed in 72483ba

textInput: {
id: 'input-search',
name: 'search',
extra_classes: 'ecl-search-form__text-input',
Copy link
Contributor

Choose a reason for hiding this comment

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

there should be a (hidden) label for the text input. Even if it is not displayed to the users, it offers better accessibility (for screen reader for instance)

Choose a reason for hiding this comment

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

Please check if I added it well in 72483ba

Copy link
Contributor

Choose a reason for hiding this comment

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

You should add a label key in your text_input object:

text_input: {
...
  label: 'Search',
...
}

@nimek2 nimek2 added pr: review needed Use this label to show that your PR needs to be review and removed pr: modification needed labels Feb 21, 2019
@emeryro emeryro added pr: under review and removed pr: review needed Use this label to show that your PR needs to be review labels Feb 21, 2019
@emeryro emeryro self-assigned this Feb 21, 2019
Copy link
Contributor

@emeryro emeryro left a comment

Choose a reason for hiding this comment

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

Almost there, please check the comments

textInput: {
id: 'input-search',
name: 'search',
extra_classes: 'ecl-search-form__text-input',
Copy link
Contributor

Choose a reason for hiding this comment

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

You should add a label key in your text_input object:

text_input: {
...
  label: 'Search',
...
}

"description": "ECL Twig - EC Search Form",
"publishConfig": {
"access": "public"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, I meant a dependency to the twig component @ecl-twig/ec-component-text-input and @ecl-twig/ec-component-button
As they are included in the twig template, if they are not present it will crash. So the dependency is to prevent that.
Also these two should probably be in dependenciesinstead of devDependencies

@hapertown
Copy link

hapertown commented Feb 21, 2019

When I try to add the dependencies given by you, I get an error:
Could not find package "@ ecl-twig / ec-component-text-input @ ^ 2.1.0" and I can not generate the correct yarn.lock file. Are you sure this is the correct package name?

The label added in 79ea3aa.

@hapertown hapertown mentioned this pull request Feb 21, 2019
@emeryro
Copy link
Contributor

emeryro commented Feb 21, 2019

the package name is good, but not the version.
Check in the package.json for these components:

{
  "name": "@ecl-twig/ec-component-text-input",
  "author": "European Commission",
  "license": "EUPL-1.1",
  "version": "0.0.1-alpha",
  ...
}

So that's perfectly normal if it doesn't find version 2.1.0 of this component

@hapertown
Copy link

the package name is good, but not the version.
Check in the package.json for these components:

{
  "name": "@ecl-twig/ec-component-text-input",
  "author": "European Commission",
  "license": "EUPL-1.1",
  "version": "0.0.1-alpha",
  ...
}

So that's perfectly normal if it doesn't find version 2.1.0 of this component

Ok, check if now will be ok 4edf092

@emeryro emeryro merged commit e6ebcca into master Feb 21, 2019
@emeryro emeryro deleted the ec-component-search-form branch February 21, 2019 13:58
@yhuard yhuard removed pr: review needed Use this label to show that your PR needs to be review labels Feb 27, 2019
@yhuard yhuard removed pr: under review pr: modification needed pr: review needed Use this label to show that your PR needs to be review labels Feb 28, 2019
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.

4 participants