-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Importing The Same JDL File Multiple Times Will Lead to Duplicated Menus Items #15819
Conversation
Hi all, First PR for this project. Just wondering if I have ticked all the right boxes as far as the PR submission is concerned? thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In angular framework, this is the test that check needles duplication:
generator-jhipster/test/needle-api/needle-client-angular.spec.js
Lines 69 to 75 in 4fec426
it('should bail on any file change adding same needles again', async () => { | |
await runResult | |
.create('jhipster-myblueprint:client') | |
.withGenerators([[mockBlueprintSubGen, 'jhipster-myblueprint:client']]) | |
.withOptions({ fromCli: true, force: false, bail: true, skipChecks: true, skipInstall: true }) | |
.run(); | |
}); |
Would be nice to add to vue, but not required.
utils/field.js
Outdated
// check if regex is valid. If not, issue warning and we skip fake data generation. | ||
try { | ||
// eslint-disable-next-line no-new | ||
new RegExp(field.fieldValidateRulesPattern); | ||
} catch (e) { | ||
console.log( | ||
`${chalk.yellowBright('WARNING!')} ${field.fieldName} pattern is not valid: ${ | ||
field.fieldValidateRulesPattern | ||
}. Skipping generating fake data. ` | ||
); | ||
return undefined; | ||
} | ||
|
||
const generated = field.createRandexp().gen(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// check if regex is valid. If not, issue warning and we skip fake data generation. | |
try { | |
// eslint-disable-next-line no-new | |
new RegExp(field.fieldValidateRulesPattern); | |
} catch (e) { | |
console.log( | |
`${chalk.yellowBright('WARNING!')} ${field.fieldName} pattern is not valid: ${ | |
field.fieldValidateRulesPattern | |
}. Skipping generating fake data. ` | |
); | |
return undefined; | |
} | |
const generated = field.createRandexp().gen(); | |
const dataGenerator = field.createRandexp(); | |
if (!dataGenerator) { | |
return undefined; | |
} | |
const generated = dataGenerator.gen(); |
- Move the regex check to:
generator-jhipster/utils/field.js
Line 374 in cbd88e4
field.createRandexp = () => faker.createRandexp(field.fieldValidateRulesPattern);
like
field.createRandexp = () => {
// check field.fieldValidateRulesPattern and return undefined.
return faker.createRandexp(field.fieldValidateRulesPattern);
}
- Replace console.log with this.warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
I used the wrong email when pushing the codes and now the "license/cla" agreement is unsigned. @mshima is there a workaround to get this task ticked off? |
@akang You should use only the one with the email you signed the cla, otherwise it won’t become green. |
dbfcef6
to
5e612b4
Compare
Refactored codes according to suggestion
removed unused import
Bumps [webpack](https://github.com/webpack/webpack) from 5.48.0 to 5.49.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](webpack/webpack@v5.48.0...v5.49.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [concurrently](https://github.com/open-cli-tools/concurrently) from 6.2.0 to 6.2.1. - [Release notes](https://github.com/open-cli-tools/concurrently/releases) - [Commits](open-cli-tools/concurrently@v6.2.0...v6.2.1) --- updated-dependencies: - dependency-name: concurrently dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin) from 6.3.1 to 6.3.2. - [Release notes](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/releases) - [Changelog](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/main/CHANGELOG.md) - [Commits](TypeStrong/fork-ts-checker-webpack-plugin@v6.3.1...v6.3.2) --- updated-dependencies: - dependency-name: fork-ts-checker-webpack-plugin dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [fork-ts-checker-webpack-plugin](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin) from 6.3.1 to 6.3.2. - [Release notes](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/releases) - [Changelog](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/main/CHANGELOG.md) - [Commits](TypeStrong/fork-ts-checker-webpack-plugin@v6.3.1...v6.3.2) --- updated-dependencies: - dependency-name: fork-ts-checker-webpack-plugin dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [webpack](https://github.com/webpack/webpack) from 5.48.0 to 5.49.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](webpack/webpack@v5.48.0...v5.49.0) --- updated-dependencies: - dependency-name: webpack dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [workbox-webpack-plugin](https://github.com/googlechrome/workbox) from 6.2.0 to 6.2.2. - [Release notes](https://github.com/googlechrome/workbox/releases) - [Commits](GoogleChrome/workbox@v6.2.0...v6.2.2) --- updated-dependencies: - dependency-name: workbox-webpack-plugin dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [core-js](https://github.com/zloirock/core-js) from 3.16.0 to 3.16.1. - [Release notes](https://github.com/zloirock/core-js/releases) - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md) - [Commits](zloirock/core-js@v3.16.0...v3.16.1) --- updated-dependencies: - dependency-name: core-js dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [conf](https://github.com/sindresorhus/conf) from 10.0.1 to 10.0.2. - [Release notes](https://github.com/sindresorhus/conf/releases) - [Commits](sindresorhus/conf@v10.0.1...v10.0.2) --- updated-dependencies: - dependency-name: conf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.23.4 to 2.24.0. - [Release notes](https://github.com/import-js/eslint-plugin-import/releases) - [Changelog](https://github.com/import-js/eslint-plugin-import/blob/master/CHANGELOG.md) - [Commits](import-js/eslint-plugin-import@v2.23.4...v2.24.0) --- updated-dependencies: - dependency-name: eslint-plugin-import dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2.3.2 to 2.4.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@v2.3.2...v2.4.0) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.962.0 to 2.963.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](aws/aws-sdk-js@v2.962.0...v2.963.0) --- updated-dependencies: - dependency-name: aws-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 11.1.1 to 11.1.2. - [Release notes](https://github.com/okonet/lint-staged/releases) - [Commits](lint-staged/lint-staged@v11.1.1...v11.1.2) --- updated-dependencies: - dependency-name: lint-staged dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [workbox-webpack-plugin](https://github.com/googlechrome/workbox) from 6.2.0 to 6.2.2. - [Release notes](https://github.com/googlechrome/workbox/releases) - [Commits](GoogleChrome/workbox@v6.2.0...v6.2.2) --- updated-dependencies: - dependency-name: workbox-webpack-plugin dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
# Conflicts: # generators/java/index.cjs # lib/support/mixin.cjs # test/support/index.cjs
Importing The Same JDL File Multiple Times Will Lead to Duplicated Menus Items
Fix #15745