generator-pninja 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generators/app/index.js +1 -19
- package/generators/client/react.inc.js +39 -10
- package/generators/client/templates/react/index.html.ejs +4 -1
- package/generators/client/templates/react/package-lock.json.ejs +373 -12
- package/generators/client/templates/react/package.json.ejs +1 -1
- package/generators/client/templates/react/public/fonts/material-symbols-outlined.woff2 +0 -0
- package/generators/client/templates/react/public/fonts/material-symbols-rounded.woff2 +0 -0
- package/generators/client/templates/react/public/fonts/material-symbols-sharp.woff2 +0 -0
- package/generators/client/templates/react/public/locales/audit/am.json +109 -0
- package/generators/client/templates/react/public/locales/audit/ar.json +109 -0
- package/generators/client/templates/react/public/locales/audit/az.json +109 -0
- package/generators/client/templates/react/public/locales/audit/bg.json +109 -0
- package/generators/client/templates/react/public/locales/audit/bn.json +109 -0
- package/generators/client/templates/react/public/locales/audit/ca.json +109 -0
- package/generators/client/templates/react/public/locales/audit/cs.json +109 -0
- package/generators/client/templates/react/public/locales/audit/cy.json +109 -0
- package/generators/client/templates/react/public/locales/audit/da.json +109 -0
- package/generators/client/templates/react/public/locales/audit/de.json +109 -0
- package/generators/client/templates/react/public/locales/audit/el.json +109 -0
- package/generators/client/templates/react/public/locales/audit/en.json +109 -0
- package/generators/client/templates/react/public/locales/audit/es.json +109 -0
- package/generators/client/templates/react/public/locales/audit/et.json +109 -0
- package/generators/client/templates/react/public/locales/audit/eu.json +109 -0
- package/generators/client/templates/react/public/locales/audit/fa.json +109 -0
- package/generators/client/templates/react/public/locales/audit/fi.json +109 -0
- package/generators/client/templates/react/public/locales/audit/fr.json +109 -0
- package/generators/client/templates/react/public/locales/audit/fy.json +109 -0
- package/generators/client/templates/react/public/locales/audit/ga.json +109 -0
- package/generators/client/templates/react/public/locales/audit/gl.json +109 -0
- package/generators/client/templates/react/public/locales/audit/gu.json +109 -0
- package/generators/client/templates/react/public/locales/audit/ha.json +109 -0
- package/generators/client/templates/react/public/locales/audit/he.json +109 -0
- package/generators/client/templates/react/public/locales/audit/hi.json +109 -0
- package/generators/client/templates/react/public/locales/audit/hr.json +109 -0
- package/generators/client/templates/react/public/locales/audit/ht.json +109 -0
- package/generators/client/templates/react/public/locales/audit/hu.json +109 -0
- package/generators/client/templates/react/public/locales/audit/hy.json +109 -0
- package/generators/client/templates/react/public/locales/audit/id.json +109 -0
- package/generators/client/templates/react/public/locales/audit/is.json +109 -0
- package/generators/client/templates/react/public/locales/audit/it.json +109 -0
- package/generators/client/templates/react/public/locales/audit/ja.json +109 -0
- package/generators/client/templates/react/public/locales/audit/kk.json +109 -0
- package/generators/client/templates/react/public/locales/audit/ko.json +109 -0
- package/generators/client/templates/react/public/locales/audit/lt.json +109 -0
- package/generators/client/templates/react/public/locales/audit/lv.json +109 -0
- package/generators/client/templates/react/public/locales/audit/mi.json +109 -0
- package/generators/client/templates/react/public/locales/audit/ms.json +109 -0
- package/generators/client/templates/react/public/locales/audit/mt.json +109 -0
- package/generators/client/templates/react/public/locales/audit/nl.json +109 -0
- package/generators/client/templates/react/public/locales/audit/no.json +109 -0
- package/generators/client/templates/react/public/locales/audit/om.json +109 -0
- package/generators/client/templates/react/public/locales/audit/pl.json +109 -0
- package/generators/client/templates/react/public/locales/audit/pt.json +109 -0
- package/generators/client/templates/react/public/locales/audit/ro.json +109 -0
- package/generators/client/templates/react/public/locales/audit/ru.json +109 -0
- package/generators/client/templates/react/public/locales/audit/rw.json +109 -0
- package/generators/client/templates/react/public/locales/audit/sk.json +109 -0
- package/generators/client/templates/react/public/locales/audit/sl.json +109 -0
- package/generators/client/templates/react/public/locales/audit/sq.json +109 -0
- package/generators/client/templates/react/public/locales/audit/sr.json +109 -0
- package/generators/client/templates/react/public/locales/audit/sv.json +109 -0
- package/generators/client/templates/react/public/locales/audit/sw.json +109 -0
- package/generators/client/templates/react/public/locales/audit/ta.json +109 -0
- package/generators/client/templates/react/public/locales/audit/tr.json +109 -0
- package/generators/client/templates/react/public/locales/audit/uk.json +109 -0
- package/generators/client/templates/react/public/locales/audit/ur.json +109 -0
- package/generators/client/templates/react/public/locales/audit/uz.json +109 -0
- package/generators/client/templates/react/public/locales/audit/vi.json +109 -0
- package/generators/client/templates/react/public/locales/audit/yo.json +109 -0
- package/generators/client/templates/react/public/locales/audit/zh.json +109 -0
- package/generators/client/templates/react/public/locales/audit/zu.json +109 -0
- package/generators/client/templates/react/public/locales/{am.json.ejs → common/am.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{ar.json.ejs → common/ar.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{az.json.ejs → common/az.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{bg.json.ejs → common/bg.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{bn.json.ejs → common/bn.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{ca.json.ejs → common/ca.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{cs.json.ejs → common/cs.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{cy.json.ejs → common/cy.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{da.json.ejs → common/da.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{de.json.ejs → common/de.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{el.json.ejs → common/el.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{en.json.ejs → common/en.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{es.json.ejs → common/es.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{et.json.ejs → common/et.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{eu.json.ejs → common/eu.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{fa.json.ejs → common/fa.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{fi.json.ejs → common/fi.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{fr.json.ejs → common/fr.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{fy.json.ejs → common/fy.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{ga.json.ejs → common/ga.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{gl.json.ejs → common/gl.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{gu.json.ejs → common/gu.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{ha.json.ejs → common/ha.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{he.json.ejs → common/he.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{hi.json.ejs → common/hi.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{hr.json.ejs → common/hr.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{ht.json.ejs → common/ht.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{hu.json.ejs → common/hu.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{hy.json.ejs → common/hy.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{id.json.ejs → common/id.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{is.json.ejs → common/is.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{it.json.ejs → common/it.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{ja.json.ejs → common/ja.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{kk.json.ejs → common/kk.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{ko.json.ejs → common/ko.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{lt.json.ejs → common/lt.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{lv.json.ejs → common/lv.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{mi.json.ejs → common/mi.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{ms.json.ejs → common/ms.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{mt.json.ejs → common/mt.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{nl.json.ejs → common/nl.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{no.json.ejs → common/no.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{om.json.ejs → common/om.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{pl.json.ejs → common/pl.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{pt.json.ejs → common/pt.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{ro.json.ejs → common/ro.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{ru.json.ejs → common/ru.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{rw.json.ejs → common/rw.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{sk.json.ejs → common/sk.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{sl.json.ejs → common/sl.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{sq.json.ejs → common/sq.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{sr.json.ejs → common/sr.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{sv.json.ejs → common/sv.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{sw.json.ejs → common/sw.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{ta.json.ejs → common/ta.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{tr.json.ejs → common/tr.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{uk.json.ejs → common/uk.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{ur.json.ejs → common/ur.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{uz.json.ejs → common/uz.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{vi.json.ejs → common/vi.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{yo.json.ejs → common/yo.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{zh.json.ejs → common/zh.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{zu.json.ejs → common/zu.json.ejs} +25 -4
- package/generators/client/templates/react/public/locales/{entities.json.ejs → entities/entities.json.ejs} +0 -12
- package/generators/client/templates/react/public/locales/log/am.json +28 -0
- package/generators/client/templates/react/public/locales/log/ar.json +28 -0
- package/generators/client/templates/react/public/locales/log/az.json +28 -0
- package/generators/client/templates/react/public/locales/log/bg.json +28 -0
- package/generators/client/templates/react/public/locales/log/bn.json +28 -0
- package/generators/client/templates/react/public/locales/log/ca.json +28 -0
- package/generators/client/templates/react/public/locales/log/cs.json +28 -0
- package/generators/client/templates/react/public/locales/log/cy.json +28 -0
- package/generators/client/templates/react/public/locales/log/da.json +28 -0
- package/generators/client/templates/react/public/locales/log/de.json +28 -0
- package/generators/client/templates/react/public/locales/log/el.json +28 -0
- package/generators/client/templates/react/public/locales/log/en.json +28 -0
- package/generators/client/templates/react/public/locales/log/es.json +28 -0
- package/generators/client/templates/react/public/locales/log/et.json +28 -0
- package/generators/client/templates/react/public/locales/log/eu.json +28 -0
- package/generators/client/templates/react/public/locales/log/fa.json +28 -0
- package/generators/client/templates/react/public/locales/log/fi.json +28 -0
- package/generators/client/templates/react/public/locales/log/fr.json +28 -0
- package/generators/client/templates/react/public/locales/log/fy.json +28 -0
- package/generators/client/templates/react/public/locales/log/ga.json +28 -0
- package/generators/client/templates/react/public/locales/log/gl.json +28 -0
- package/generators/client/templates/react/public/locales/log/gu.json +28 -0
- package/generators/client/templates/react/public/locales/log/ha.json +28 -0
- package/generators/client/templates/react/public/locales/log/he.json +28 -0
- package/generators/client/templates/react/public/locales/log/hi.json +28 -0
- package/generators/client/templates/react/public/locales/log/hr.json +28 -0
- package/generators/client/templates/react/public/locales/log/ht.json +28 -0
- package/generators/client/templates/react/public/locales/log/hu.json +28 -0
- package/generators/client/templates/react/public/locales/log/hy.json +28 -0
- package/generators/client/templates/react/public/locales/log/id.json +28 -0
- package/generators/client/templates/react/public/locales/log/is.json +28 -0
- package/generators/client/templates/react/public/locales/log/it.json +28 -0
- package/generators/client/templates/react/public/locales/log/ja.json +28 -0
- package/generators/client/templates/react/public/locales/log/kk.json +28 -0
- package/generators/client/templates/react/public/locales/log/ko.json +28 -0
- package/generators/client/templates/react/public/locales/log/lt.json +28 -0
- package/generators/client/templates/react/public/locales/log/lv.json +28 -0
- package/generators/client/templates/react/public/locales/log/mi.json +28 -0
- package/generators/client/templates/react/public/locales/log/ms.json +28 -0
- package/generators/client/templates/react/public/locales/log/mt.json +28 -0
- package/generators/client/templates/react/public/locales/log/nl.json +28 -0
- package/generators/client/templates/react/public/locales/log/no.json +28 -0
- package/generators/client/templates/react/public/locales/log/om.json +28 -0
- package/generators/client/templates/react/public/locales/log/pl.json +28 -0
- package/generators/client/templates/react/public/locales/log/pt.json +28 -0
- package/generators/client/templates/react/public/locales/log/ro.json +28 -0
- package/generators/client/templates/react/public/locales/log/ru.json +28 -0
- package/generators/client/templates/react/public/locales/log/rw.json +28 -0
- package/generators/client/templates/react/public/locales/log/sk.json +28 -0
- package/generators/client/templates/react/public/locales/log/sl.json +28 -0
- package/generators/client/templates/react/public/locales/log/sq.json +28 -0
- package/generators/client/templates/react/public/locales/log/sr.json +28 -0
- package/generators/client/templates/react/public/locales/log/sv.json +28 -0
- package/generators/client/templates/react/public/locales/log/sw.json +28 -0
- package/generators/client/templates/react/public/locales/log/ta.json +28 -0
- package/generators/client/templates/react/public/locales/log/tr.json +28 -0
- package/generators/client/templates/react/public/locales/log/uk.json +28 -0
- package/generators/client/templates/react/public/locales/log/ur.json +28 -0
- package/generators/client/templates/react/public/locales/log/uz.json +28 -0
- package/generators/client/templates/react/public/locales/log/vi.json +28 -0
- package/generators/client/templates/react/public/locales/log/yo.json +28 -0
- package/generators/client/templates/react/public/locales/log/zh.json +28 -0
- package/generators/client/templates/react/public/locales/log/zu.json +28 -0
- package/generators/client/templates/react/src/App.tsx.ejs +46 -17
- package/generators/client/templates/react/src/components/ApiResponsePagination.tsx.ejs +3 -3
- package/generators/client/templates/react/src/components/ConfirmButton.tsx.ejs +43 -8
- package/generators/client/templates/react/src/components/DarkModeToggle.tsx.ejs +16 -3
- package/generators/client/templates/react/src/components/Footer.tsx.ejs +1 -1
- package/generators/client/templates/react/src/components/HtmlViewer.tsx.ejs +15 -13
- package/generators/client/templates/react/src/components/Icon.tsx.ejs +104 -0
- package/generators/client/templates/react/src/components/LangSelect.tsx.ejs +8 -4
- package/generators/client/templates/react/src/components/LoginButton.tsx.ejs +4 -4
- package/generators/client/templates/react/src/components/LogoutButton.tsx.ejs +11 -3
- package/generators/client/templates/react/src/components/Menu.tsx.ejs +104 -42
- package/generators/client/templates/react/src/components/SearchInput.tsx.ejs +5 -5
- package/generators/client/templates/react/src/components/SimpleLoader.tsx.ejs +4 -3
- package/generators/client/templates/react/src/components/Toast.tsx.ejs +30 -32
- package/generators/client/templates/react/src/components/entities/EntityDeleteButton.tsx.ejs +12 -2
- package/generators/client/templates/react/src/components/entities/EntityForm.tsx.ejs +15 -5
- package/generators/client/templates/react/src/components/formElements/Checkbox.tsx.ejs +5 -8
- package/generators/client/templates/react/src/components/formElements/ColorField.tsx.ejs +2 -2
- package/generators/client/templates/react/src/components/formElements/DurationField.tsx.ejs +1 -1
- package/generators/client/templates/react/src/components/formElements/FileField.tsx.ejs +32 -20
- package/generators/client/templates/react/src/components/formElements/FormLabel.tsx.ejs +2 -4
- package/generators/client/templates/react/src/components/formElements/InfoValidations.tsx.ejs +0 -98
- package/generators/client/templates/react/src/components/formElements/PasswordField.tsx.ejs +104 -34
- package/generators/client/templates/react/src/components/formElements/RadioGroup.tsx.ejs +5 -19
- package/generators/client/templates/react/src/components/formElements/RangeField.tsx.ejs +1 -1
- package/generators/client/templates/react/src/components/formElements/SelectField.tsx.ejs +22 -12
- package/generators/client/templates/react/src/components/formElements/UuidField.tsx.ejs +3 -3
- package/generators/client/templates/react/src/i18n.js.ejs +1 -1
- package/generators/client/templates/react/src/index.css.ejs +46 -7
- package/generators/client/templates/react/src/pages/audit/AuditHistory.tsx.ejs +147 -0
- package/generators/client/templates/react/src/pages/audit/AuditList.tsx.ejs +396 -0
- package/generators/client/templates/react/src/pages/audit/AuditStatistics.tsx.ejs +508 -0
- package/generators/client/templates/react/src/pages/audit/AuditUserActivity.tsx.ejs +585 -0
- package/generators/client/templates/react/src/pages/audit/AuditView.tsx.ejs +300 -0
- package/generators/client/templates/react/src/pages/audit/Audits.tsx.ejs +53 -0
- package/generators/client/templates/react/src/pages/entities/EntityList.tsx.ejs +8 -18
- package/generators/client/templates/react/src/pages/entities/EntityTrash.tsx.ejs +446 -0
- package/generators/client/templates/react/src/pages/entities/EntityView.tsx.ejs +2 -2
- package/generators/client/templates/react/src/pages/server-logs/LogViewer.tsx.ejs +282 -0
- package/generators/client/templates/react/src/shared/entitiesIcons.tsx.ejs +14 -0
- package/generators/entities/index.js +11 -1
- package/generators/entities/templates/DatabaseSeeder.php.ejs +53 -6
- package/generators/entities/templates/app/Http/Controllers/AuditController.php.ejs +702 -0
- package/generators/entities/templates/app/Http/Controllers/LogController.php.ejs +119 -0
- package/generators/entities/templates/app/Http/Controllers/TrashedEntityController.php.ejs +63 -0
- package/generators/entities/templates/app/Models/Entity.php.ejs +9 -1
- package/generators/entities/templates/app/Resolvers/Keycloak__UserResolver.php.ejs +34 -0
- package/generators/entities/templates/config/audit.php.ejs +202 -0
- package/generators/entities/templates/database/migrations/create_audits_table.php.ejs +52 -0
- package/generators/entities/templates/migration_create_table.php.ejs +3 -0
- package/generators/entities/templates/routes/api.php.ejs +21 -2
- package/generators/entities/templates/routes/console.php.ejs +6 -0
- package/generators/entities/utils/controllers-generator.js +27 -2
- package/generators/entities/utils/factories-generator.js +2 -1
- package/generators/entities/utils/migrations-generator.js +9 -2
- package/generators/entities/utils/models-generator.js +9 -2
- package/generators/entities/utils/routers-generator.js +19 -3
- package/generators/final/index.js +5 -3
- package/generators/{app → final}/templates/README.md.ejs +57 -1
- package/generators/search/index.js +5 -5
- package/generators/utils/AcRule.js +47 -0
- package/package.json +1 -1
- package/generators/client/templates/react/src/pages/entities/AcRuleEdit.tsx.ejs +0 -87
- package/generators/client/templates/react/src/pages/entities/AcRuleList.tsx.ejs +0 -222
- package/generators/client/templates/react/src/pages/entities/AcRuleView.tsx.ejs +0 -127
package/generators/app/index.js
CHANGED
|
@@ -145,23 +145,6 @@ export default class extends Generator {
|
|
|
145
145
|
disabled: "Not implemented yet"
|
|
146
146
|
}
|
|
147
147
|
]
|
|
148
|
-
}, {
|
|
149
|
-
store: true,
|
|
150
|
-
type: "list",
|
|
151
|
-
name: "packageManager",
|
|
152
|
-
message: "Your package manager",
|
|
153
|
-
default: "npm",
|
|
154
|
-
choices: [
|
|
155
|
-
{
|
|
156
|
-
name: "Npm",
|
|
157
|
-
value: "npm"
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
name: "Yarn",
|
|
161
|
-
value: "yarn",
|
|
162
|
-
disabled: "Not implemented yet"
|
|
163
|
-
}
|
|
164
|
-
]
|
|
165
148
|
},
|
|
166
149
|
]);
|
|
167
150
|
}
|
|
@@ -174,12 +157,11 @@ export default class extends Generator {
|
|
|
174
157
|
}
|
|
175
158
|
|
|
176
159
|
async writing() {
|
|
177
|
-
const { entities, relationships } = this.fs.readJSON(this.destinationPath(`.pninja/Entities.json`));
|
|
178
|
-
this.fs.copyTpl(this.templatePath(`README.md.ejs`), this.destinationPath(`README.md`), { appName: this.config.get('name'), entities, relationships, searchEngine: this.config.get('searchEngine') });
|
|
179
160
|
await this.spawn('composer', ['create-project', '--prefer-dist', 'laravel/laravel=~11.6.1', 'server']);
|
|
180
161
|
await this.spawn('composer', ['require', '--dev', 'beyondcode/laravel-dump-server'], { cwd: 'server' });
|
|
181
162
|
await this.spawn('php', ['artisan', 'install:api', '--without-migration-prompt'], { cwd: 'server' });
|
|
182
163
|
await this.spawn('composer', ['require', 'casbin/laravel-authz'], { cwd: 'server' });
|
|
164
|
+
await this.spawn('composer', ['require', 'owen-it/laravel-auditing'], { cwd: 'server' });
|
|
183
165
|
let envFileContents = fs.readFileSync(`${this.destinationPath('server')}/.env`, { encoding: 'utf8', flag: 'r' });
|
|
184
166
|
envFileContents = envFileContents.replace(/^APP_NAME=.*$/m, `APP_NAME=${to.constant(this.answers.name)}`);
|
|
185
167
|
envFileContents = envFileContents.replace(/^APP_KEY=.*$/m, `APP_KEY=${randomstring.generate()}`);
|
|
@@ -3,7 +3,7 @@ import pluralize from 'pluralize';
|
|
|
3
3
|
import { getModelRelatedEntities } from './utils/getModelRelatedEntities.js';
|
|
4
4
|
import { getModelForeignIds } from './utils/getModelForeignIds.js';
|
|
5
5
|
import { getLanguageData } from './config/languages.js';
|
|
6
|
-
|
|
6
|
+
import { AcRule } from '../utils/AcRule.js';
|
|
7
7
|
const colors = [
|
|
8
8
|
"lime",
|
|
9
9
|
"green",
|
|
@@ -43,15 +43,20 @@ export async function createReactClient(that, parsedJDL) {
|
|
|
43
43
|
that.fs.copyTpl(that.templatePath('react/vite.config.ts.ejs'), that.destinationPath('client/vite.config.ts'), {});
|
|
44
44
|
|
|
45
45
|
for (const lang of languages) {
|
|
46
|
-
that.fs.copyTpl(that.templatePath(`react/public/locales/${lang}.json
|
|
47
|
-
that.fs.copyTpl(that.templatePath(`react/public/locales/
|
|
46
|
+
that.fs.copyTpl(that.templatePath(`react/public/locales/log/${lang}.json`), that.destinationPath(`client/public/locales/${lang}/log.json`), { appName });
|
|
47
|
+
that.fs.copyTpl(that.templatePath(`react/public/locales/audit/${lang}.json`), that.destinationPath(`client/public/locales/${lang}/audit.json`), { appName });
|
|
48
|
+
that.fs.copyTpl(that.templatePath(`react/public/locales/common/${lang}.json.ejs`), that.destinationPath(`client/public/locales/${lang}/common.json`), { appName });
|
|
49
|
+
that.fs.copyTpl(that.templatePath(`react/public/locales/entities/entities.json.ejs`), that.destinationPath(`client/public/locales/${lang}/entities.json`), { entities: [AcRule, ...entities], relationships, to, pluralize, getModelForeignIds, getModelRelatedEntities });
|
|
48
50
|
};
|
|
51
|
+
that.fs.copyTpl(that.templatePath("react/public/fonts/material-symbols-outlined.woff2"), that.destinationPath(`client/public/fonts/material-symbols-outlined.woff2`));
|
|
52
|
+
that.fs.copyTpl(that.templatePath("react/public/fonts/material-symbols-rounded.woff2"), that.destinationPath(`client/public/fonts/material-symbols-rounded.woff2`));
|
|
53
|
+
that.fs.copyTpl(that.templatePath("react/public/fonts/material-symbols-sharp.woff2"), that.destinationPath(`client/public/fonts/material-symbols-sharp.woff2`));
|
|
49
54
|
that.fs.copyTpl(that.templatePath("react/public/fonts/IBMPlexMono-Regular.ttf"), that.destinationPath(`client/public/fonts/IBMPlexMono-Regular.ttf`));
|
|
50
55
|
that.fs.copyTpl(that.templatePath("react/public/fonts/InterVariable-Italic.woff2"), that.destinationPath(`client/public/fonts/InterVariable-Italic.woff2`));
|
|
51
56
|
that.fs.copyTpl(that.templatePath("react/public/fonts/InterVariable.woff2"), that.destinationPath(`client/public/fonts/InterVariable.woff2`));
|
|
52
57
|
|
|
53
58
|
that.fs.copyTpl(that.templatePath("react/src/App.css.ejs"), that.destinationPath(`client/src/App.css`), {});
|
|
54
|
-
that.fs.copyTpl(that.templatePath("react/src/App.tsx.ejs"), that.destinationPath(`client/src/App.tsx`), { entities, to, pluralize });
|
|
59
|
+
that.fs.copyTpl(that.templatePath("react/src/App.tsx.ejs"), that.destinationPath(`client/src/App.tsx`), { entities: [...entities, AcRule], to, pluralize });
|
|
55
60
|
that.fs.copyTpl(that.templatePath("react/src/i18n.js.ejs"), that.destinationPath(`client/src/i18n.js`), {
|
|
56
61
|
supportedLngs: JSON.stringify(languages).replaceAll(`"`, `'`),
|
|
57
62
|
fallbackLng: nativeLanguage
|
|
@@ -108,6 +113,7 @@ export async function createReactClient(that, parsedJDL) {
|
|
|
108
113
|
that.fs.copyTpl(that.templatePath("react/src/components/formElements/UrlField.tsx.ejs"), that.destinationPath(`client/src/components/formElements/UrlField.tsx`), {});
|
|
109
114
|
that.fs.copyTpl(that.templatePath("react/src/components/formElements/UuidField.tsx.ejs"), that.destinationPath(`client/src/components/formElements/UuidField.tsx`), {});
|
|
110
115
|
that.fs.copyTpl(that.templatePath("react/src/components/HtmlViewer.tsx.ejs"), that.destinationPath(`client/src/components/HtmlViewer.tsx`), {});
|
|
116
|
+
that.fs.copyTpl(that.templatePath("react/src/components/Icon.tsx.ejs"), that.destinationPath(`client/src/components/Icon.tsx`), {});
|
|
111
117
|
that.fs.copyTpl(that.templatePath("react/src/components/JsonPrint.tsx.ejs"), that.destinationPath(`client/src/components/JsonPrint.tsx`), {});
|
|
112
118
|
that.fs.copyTpl(that.templatePath("react/src/components/LangSelect.tsx.ejs"), that.destinationPath(`client/src/components/LangSelect.tsx`), { to });
|
|
113
119
|
that.fs.copyTpl(that.templatePath("react/src/components/LoginButton.tsx.ejs"), that.destinationPath(`client/src/components/LoginButton.tsx`), {});
|
|
@@ -140,12 +146,15 @@ export async function createReactClient(that, parsedJDL) {
|
|
|
140
146
|
that.fs.copyTpl(that.templatePath("react/src/pages/errors/Err403.tsx.ejs"), that.destinationPath(`client/src/pages/errors/Err403.tsx`), {});
|
|
141
147
|
that.fs.copyTpl(that.templatePath("react/src/pages/errors/Err404.tsx.ejs"), that.destinationPath(`client/src/pages/errors/Err404.tsx`), {});
|
|
142
148
|
|
|
149
|
+
that.fs.copyTpl(that.templatePath("react/src/pages/server-logs/LogViewer.tsx.ejs"), that.destinationPath(`client/src/pages/server-logs/LogViewer.tsx`), {});
|
|
150
|
+
|
|
143
151
|
that.fs.copyTpl(that.templatePath("react/src/hooks/useAuthState.ts.ejs"), that.destinationPath(`client/src/hooks/useAuthState.ts`), {});
|
|
144
152
|
that.fs.copyTpl(that.templatePath("react/src/hooks/useAutoShortcuts.tsx.ejs"), that.destinationPath(`client/src/hooks/useAutoShortcuts.tsx`), {});
|
|
145
153
|
that.fs.copyTpl(that.templatePath("react/src/hooks/useRoles.ts.ejs"), that.destinationPath(`client/src/hooks/useRoles.ts`), {});
|
|
146
154
|
|
|
147
155
|
that.fs.copyTpl(that.templatePath("react/src/shared/axiosInstance.ts.ejs"), that.destinationPath(`client/src/shared/axiosInstance.ts`));
|
|
148
156
|
that.fs.copyTpl(that.templatePath("react/src/shared/axiosInterceptors.ts.ejs"), that.destinationPath(`client/src/shared/axiosInterceptors.ts`));
|
|
157
|
+
that.fs.copyTpl(that.templatePath("react/src/shared/entitiesIcons.tsx.ejs"), that.destinationPath(`client/src/shared/entitiesIcons.tsx`), { entities });
|
|
149
158
|
that.fs.copyTpl(that.templatePath("react/src/shared/model/ac-rule.model.ts.ejs"), that.destinationPath(`client/src/shared/model/ac-rule.model.ts`));
|
|
150
159
|
|
|
151
160
|
for (const entity of entities) {
|
|
@@ -166,13 +175,17 @@ export async function createReactClient(that, parsedJDL) {
|
|
|
166
175
|
that.fs.copyTpl(that.templatePath("react/src/shared/model/enumerations/enumeration.model.ts.ejs"), that.destinationPath(`client/src/shared/model/enumerations/${to.slug(enumeration.name)}.model.ts`), { enumeration });
|
|
167
176
|
}
|
|
168
177
|
|
|
169
|
-
that.fs.copyTpl(that.templatePath("react/src/pages/
|
|
170
|
-
that.fs.copyTpl(that.templatePath("react/src/pages/
|
|
171
|
-
that.fs.copyTpl(that.templatePath("react/src/pages/
|
|
172
|
-
that.fs.copyTpl(that.templatePath("react/src/
|
|
173
|
-
that.fs.copyTpl(that.templatePath("react/src/
|
|
178
|
+
that.fs.copyTpl(that.templatePath("react/src/pages/audit/Audits.tsx.ejs"), that.destinationPath(`client/src/pages/audit/Audits.tsx`));
|
|
179
|
+
that.fs.copyTpl(that.templatePath("react/src/pages/audit/AuditHistory.tsx.ejs"), that.destinationPath(`client/src/pages/audit/AuditHistory.tsx`));
|
|
180
|
+
that.fs.copyTpl(that.templatePath("react/src/pages/audit/AuditList.tsx.ejs"), that.destinationPath(`client/src/pages/audit/AuditList.tsx`));
|
|
181
|
+
that.fs.copyTpl(that.templatePath("react/src/pages/audit/AuditStatistics.tsx.ejs"), that.destinationPath(`client/src/pages/audit/AuditStatistics.tsx`));
|
|
182
|
+
that.fs.copyTpl(that.templatePath("react/src/pages/audit/AuditUserActivity.tsx.ejs"), that.destinationPath(`client/src/pages/audit/AuditUserActivity.tsx`));
|
|
183
|
+
that.fs.copyTpl(that.templatePath("react/src/pages/audit/AuditView.tsx.ejs"), that.destinationPath(`client/src/pages/audit/AuditView.tsx`));
|
|
174
184
|
|
|
175
|
-
for (const entity of entities) {
|
|
185
|
+
for (const entity of [AcRule, ...entities]) {
|
|
186
|
+
const hasSoftDelete = entity.annotations?.some(
|
|
187
|
+
ann => ann.optionName === 'softDelete' && ann.type === 'UNARY'
|
|
188
|
+
);
|
|
176
189
|
that.fs.copyTpl(
|
|
177
190
|
that.templatePath("react/src/pages/entities/EntityList.tsx.ejs"),
|
|
178
191
|
that.destinationPath(`client/src/pages/entities/${entity.name}List.tsx`),
|
|
@@ -187,6 +200,22 @@ export async function createReactClient(that, parsedJDL) {
|
|
|
187
200
|
relatedEntities: getModelRelatedEntities(entity, relationships),
|
|
188
201
|
searchEngine,
|
|
189
202
|
});
|
|
203
|
+
if (hasSoftDelete) {
|
|
204
|
+
that.fs.copyTpl(
|
|
205
|
+
that.templatePath("react/src/pages/entities/EntityTrash.tsx.ejs"),
|
|
206
|
+
that.destinationPath(`client/src/pages/entities/${entity.name}Trash.tsx`),
|
|
207
|
+
{
|
|
208
|
+
entity,
|
|
209
|
+
to,
|
|
210
|
+
pluralize,
|
|
211
|
+
columns: entity.body.map(c => to.snake(c.name)),
|
|
212
|
+
durationColumns: entity.body.filter(c => c.type === 'Duration').map(c => to.snake(c.name)),
|
|
213
|
+
fileColumns: entity.body.filter(c => c.type === 'Blob' || c.type === 'AnyBlob' || c.type === 'ImageBlob').map(c => to.snake(c.name)),
|
|
214
|
+
foreignIds: getModelForeignIds(entity, relationships),
|
|
215
|
+
relatedEntities: getModelRelatedEntities(entity, relationships),
|
|
216
|
+
searchEngine,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
190
219
|
that.fs.copyTpl(
|
|
191
220
|
that.templatePath("react/src/pages/entities/EntityView.tsx.ejs"),
|
|
192
221
|
that.destinationPath(`client/src/pages/entities/${entity.name}View.tsx`),
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
5
6
|
<link rel="icon" type="image/svg+xml" href="/icon.svg">
|
|
6
7
|
<link rel="icon" type="image/png" href="/icon.png">
|
|
7
|
-
<
|
|
8
|
+
<link rel="preload" href="/fonts/material-symbols-outlined.woff2" as="font" type="font/woff2" crossorigin="anonymous" />
|
|
9
|
+
<link rel="preload" href="/fonts/material-symbols-rounded.woff2" as="font" type="font/woff2" crossorigin="anonymous" />
|
|
10
|
+
<link rel="preload" href="/fonts/material-symbols-sharp.woff2" as="font" type="font/woff2" crossorigin="anonymous" />
|
|
8
11
|
<title><%= appName %></title>
|
|
9
12
|
<script>
|
|
10
13
|
if (!localStorage.getItem('dark-mode')) {
|