-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,71 @@ | ||
import { asCommand } from 'generator-jhipster'; | ||
|
||
export default asCommand({ | ||
configs: {}, | ||
configs: { | ||
auditFramework: { | ||
description: 'Audit framework', | ||
cli: { | ||
type: String, | ||
}, | ||
prompt: { | ||
type: 'list', | ||
message: 'Choose which audit framework you would like to use.', | ||
default: 'custom', | ||
}, | ||
choices: [ | ||
{ | ||
name: 'Custom JHipster auditing (works with SQL)', | ||
value: 'custom', | ||
}, | ||
{ | ||
name: 'Javers auditing framework (works with SQL and MongoDB)', | ||
value: 'javers', | ||
}, | ||
], | ||
scope: 'blueprint', | ||
}, | ||
auditPage: { | ||
description: 'Generate client page', | ||
cli: { | ||
type: Boolean, | ||
}, | ||
prompt: { | ||
type: 'confirm', | ||
message: 'Do you want to add an audit log page for entities?', | ||
default: true, | ||
}, | ||
scope: 'blueprint', | ||
}, | ||
auditUpdateType: { | ||
cli: { | ||
type: String, | ||
}, | ||
prompt: generator => ({ | ||
when: answers => (generator.initialRun || generator.options.askAnswered) && ['javers', 'custom'].includes(answers.auditFramework), | ||
type: 'list', | ||
name: 'auditUpdateType', | ||
message: 'Do you want to enable audit for all existing entities?', | ||
choices: [ | ||
{ name: 'Yes, update all', value: 'all' }, | ||
{ name: 'No, let me choose the entities to update', value: 'selected' }, | ||
], | ||
default: 'all', | ||
}), | ||
scope: 'generator', | ||
}, | ||
auditedEntities: { | ||
description: 'Entities to be audited', | ||
cli: { | ||
type: Array, | ||
}, | ||
prompt: gen => ({ | ||
when: answers => answers.auditUpdateType === 'selected', | ||
type: 'checkbox', | ||
message: 'Please choose the entities to be audited', | ||
choices: gen.getExistingEntities().map(e => e.name), | ||
default: [], | ||
}), | ||
scope: 'generator', | ||
}, | ||
}, | ||
}); |