Skip to content

Commit

Permalink
refactor(mysec): yeoman layout
Browse files Browse the repository at this point in the history
group by filetype first
  • Loading branch information
duncdrum committed Feb 10, 2021
1 parent d3fbbcd commit 8a53b6e
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ module.exports = class extends Generator {
switch (this.props.apptype[0]) {
case 'exist-design':
this.fs.copyTpl(
this.templatePath('exist-design/page.html'),
this.templatePath('pages/exist-design/page.html'),
this.destinationPath('templates/page.html'), {
title: this.props.title,
mysec: this.props.mysec
Expand All @@ -617,7 +617,7 @@ module.exports = class extends Generator {
break
case 'plain':
this.fs.copyTpl(
this.templatePath('exist-plain/page.html'),
this.templatePath('pages/plain/page.html'),
this.destinationPath('templates/page.html'), {
title: this.props.title,
mysec: this.props.mysec
Expand Down Expand Up @@ -688,8 +688,16 @@ module.exports = class extends Generator {
// Secure area (mysec)
if (this.props.mysec) {
this.fs.copy(
this.templatePath('mysec/**'),
this.destinationPath('')
this.templatePath('pages/mysec/admin/*.html'),
this.destinationPath('admin/')
)
this.fs.copy(
this.templatePath('xq/admin/**'),
this.destinationPath('admin/')
)
this.fs.copy(
this.templatePath('pages/mysec/templates/*.html'),
this.destinationPath('templates/')
)
this.fs.copyTpl(
this.templatePath('tests/integration/login-*_spec.js'),
Expand Down
2 changes: 1 addition & 1 deletion test/generated-pkg/app-mysec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('eXide style …', function () {

describe('secure exist design has …', function () {
it('default files and restricted area', function (done) {
assert.file(['admin/controller.xql', 'templates/login-panel.html', 'pre-install.xql', 'test/cypress/integration/login-ok_spec.js'])
assert.file(['admin/controller.xql', 'admin/index.html','templates/login-panel.html', 'pre-install.xql', 'test/cypress/integration/login-ok_spec.js'])
done()
})

Expand Down

0 comments on commit 8a53b6e

Please sign in to comment.