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

fix(dynamic-forms): removed regex for name #1155

Merged
merged 5 commits into from
May 25, 2018

Conversation

JulieMarie
Copy link
Collaborator

Description

Removed regex from name string

Test Steps

  • checkout branch
  • npm run serve

General Tests for Every PR

  • npm run serve:prod still works.
  • npm run tslint passes.
  • npm run stylelint passes.
  • npm test passes and code coverage is not lower.
  • npm run build:lib still works.

Screenshots or link to StackBlitz/Plunker

Stackblitz with regex implemented

https://stackblitz.com/edit/ajc-stackoverflow-48705028?file=app/app.component.ts
covalent-fix

@@ -49,7 +49,7 @@ export interface ITdDynamicElementConfig {
validators?: ITdDynamicElementValidator[];
}

export const DYNAMIC_ELEMENT_NAME_REGEX: RegExp = /^[a-zA-Z]+[a-zA-Z0-9-_]*$/;
export const DYNAMIC_ELEMENT_NAME_REGEX: RegExp = /^[^0-9][^\@]*$/;
Copy link
Contributor

Choose a reason for hiding this comment

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

what are you trying to capture with this regex?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the original unit tests, it's testing for a name starting with a number or a name with an ampersand in it. I do realize that the \ isn't necessary to escape the @.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, so it actually is testing for what you want to be testing for, however. I just thought it was an odd pattern.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed.

@emoralesb05 emoralesb05 merged commit ddf8a6b into develop May 25, 2018
emoralesb05 pushed a commit that referenced this pull request May 25, 2018
* fix(dynamic-forms): removed regex for name

* fix(dynamic-forms): modified regex to allow japanese/chinese chars

* fix(dynamic-forms): got rid of spaces
@emoralesb05 emoralesb05 deleted the fix/dynamic-form-element-regex branch May 25, 2018 17:09
@jeremysmartt jeremysmartt added this to the Release 2.0.0 milestone Jul 16, 2018
kriswinbush pushed a commit to kriswinbush/covalent that referenced this pull request Feb 20, 2020
* fix(dynamic-forms): removed regex for name

* fix(dynamic-forms): modified regex to allow japanese/chinese chars

* fix(dynamic-forms): got rid of spaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants