@localazy/strapi-plugin 0.2.12 → 1.0.0-beta.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/README.md +3 -1
- package/dist/_chunks/App-BSFfgZKU.mjs +5278 -0
- package/dist/_chunks/App-D1QaIMHX.js +5278 -0
- package/dist/_chunks/ContentTransferSetup-DHXJIxAp.js +1552 -0
- package/dist/_chunks/ContentTransferSetup-DtjcF_jM.mjs +1550 -0
- package/dist/_chunks/GlobalSettings-BON3kjHK.js +228 -0
- package/dist/_chunks/GlobalSettings-BcdibqNS.mjs +228 -0
- package/dist/_chunks/LanguagesSelector-BeijBEjg.js +47 -0
- package/dist/_chunks/LanguagesSelector-fyAIUp7M.mjs +48 -0
- package/dist/_chunks/en-BTf8goGM.mjs +8 -0
- package/dist/_chunks/en-CRtsEFtl.js +8 -0
- package/dist/_chunks/fr-C8Qw4iPZ.js +4 -0
- package/dist/_chunks/fr-hkSxFuzl.mjs +4 -0
- package/dist/_chunks/has-model-changed-BMCQX2Dd.js +316 -0
- package/dist/_chunks/has-model-changed-Dvtzpc9v.mjs +317 -0
- package/dist/_chunks/index-BQw2qi2G.js +2679 -0
- package/dist/_chunks/index-CN3Gyh5F.mjs +2678 -0
- package/dist/_chunks/isEqual-B-YVnzrp.js +205 -0
- package/dist/_chunks/isEqual-CEyT97-3.mjs +206 -0
- package/dist/_chunks/set-DUdH3vE5.js +54557 -0
- package/dist/_chunks/set-DulHAQhq.mjs +54542 -0
- package/dist/admin/index.js +4 -0
- package/dist/admin/index.mjs +5 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/config/development/index.d.ts +15 -0
- package/dist/admin/src/config/example/index.example.d.ts +15 -0
- package/dist/admin/src/config/index.d.ts +15 -0
- package/dist/admin/src/config/local/index.d.ts +15 -0
- package/dist/admin/src/config/production/index.d.ts +15 -0
- package/dist/admin/src/i18n.d.ts +2 -0
- package/dist/admin/src/index.d.ts +10 -0
- package/dist/admin/src/modules/@common/api/strapi-api-base.d.ts +6 -0
- package/dist/admin/src/modules/@common/components/Icons/House.d.ts +2 -0
- package/dist/admin/src/modules/@common/components/Icons/Localazy.d.ts +2 -0
- package/dist/admin/src/modules/@common/components/LanguagesSelector.d.ts +11 -0
- package/dist/admin/src/modules/@common/components/PluginPageLoader.d.ts +2 -0
- package/dist/admin/src/modules/@common/components/SideNav.d.ts +2 -0
- package/dist/admin/src/modules/@common/components/TransferReport.d.ts +5 -0
- package/dist/admin/src/modules/@common/functions/flatten-deep.d.ts +2 -0
- package/dist/admin/src/modules/@common/locale/en.d.ts +14 -0
- package/dist/admin/src/modules/@common/models/supported-content-type-fields.d.ts +2 -0
- package/dist/admin/src/modules/@common/models/supported-custom-field-plugins.d.ts +2 -0
- package/dist/admin/src/modules/@common/services/i18n-service.d.ts +3 -0
- package/dist/admin/src/modules/@common/services/plugin.service.d.ts +3 -0
- package/dist/admin/src/modules/@common/services/product-analytics-service.d.ts +14 -0
- package/dist/admin/src/modules/@common/services/project-service.d.ts +4 -0
- package/dist/admin/src/modules/@common/services/user-service.d.ts +5 -0
- package/dist/admin/src/modules/@common/utils/are-locales-compatible.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/format-number.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/get-default-locale.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/history.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/is-plugin-route.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/iso-locales-utils.d.ts +3 -0
- package/dist/admin/src/modules/@common/utils/redirect-to-plugin-route.d.ts +13 -0
- package/dist/admin/src/modules/@common/utils/sort-by-model-name.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/use-header-subtitle.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/use-header-title.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/use-nav.d.ts +11 -0
- package/dist/admin/src/modules/alerts/constants/channels.d.ts +1 -0
- package/dist/admin/src/modules/alerts/constants/events.d.ts +4 -0
- package/dist/admin/src/modules/alerts/services/alerts-service.d.ts +8 -0
- package/dist/admin/src/modules/localazy-download/locale/en.d.ts +24 -0
- package/dist/admin/src/modules/localazy-download/services/download-alerts-service.d.ts +5 -0
- package/dist/admin/src/modules/localazy-download/services/localazy-download-service.d.ts +3 -0
- package/dist/admin/src/modules/localazy-upload/components/ReadDocsButton.d.ts +3 -0
- package/dist/admin/src/modules/localazy-upload/locale/en.d.ts +19 -0
- package/dist/admin/src/modules/localazy-upload/services/localazy-upload-service.d.ts +3 -0
- package/dist/admin/src/modules/localazy-upload/services/upload-alerts-service.d.ts +5 -0
- package/dist/admin/src/modules/login/components/FetchIdentity.d.ts +3 -0
- package/dist/admin/src/modules/login/components/LoginButton.d.ts +12 -0
- package/dist/admin/src/modules/login/components/LogoutButton.d.ts +6 -0
- package/dist/admin/src/modules/login/locale/en.d.ts +8 -0
- package/dist/admin/src/modules/login/services/localazy-login-service.d.ts +4 -0
- package/dist/admin/src/modules/overview/components/OverviewItem.d.ts +7 -0
- package/dist/admin/src/modules/overview/components/OverviewItemLink.d.ts +7 -0
- package/dist/admin/src/modules/overview/components/PrerequisitiesInfo.d.ts +3 -0
- package/dist/admin/src/modules/overview/locale/en.d.ts +14 -0
- package/dist/admin/src/modules/plugin-settings/components/ContentTransferSetupEmpty.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/components/Tree.d.ts +8 -0
- package/dist/admin/src/modules/plugin-settings/components/TreeItem.d.ts +10 -0
- package/dist/admin/src/modules/plugin-settings/functions/build-content-transfer-setup-schema.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/functions/get-content-transfer-setup-keys-sets.d.ts +8 -0
- package/dist/admin/src/modules/plugin-settings/functions/has-model-changed.d.ts +6 -0
- package/dist/admin/src/modules/plugin-settings/locale/en.d.ts +49 -0
- package/dist/admin/src/modules/plugin-settings/services/plugin-settings-service.d.ts +6 -0
- package/dist/admin/src/modules/plugin-settings/services/strapi-model-service.d.ts +4 -0
- package/dist/admin/src/modules/plugin-settings/services/strapi-users-service.d.ts +3 -0
- package/dist/admin/src/modules/plugin-settings/utils/array-of-models-to-object.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/utils/find-model-value-by-key.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/utils/get-filtered-models-schemas.d.ts +7 -0
- package/dist/admin/src/modules/plugin-settings/utils/get-models-tree.d.ts +5 -0
- package/dist/admin/src/modules/strapi/utils/get-default-theme.d.ts +3 -0
- package/dist/admin/src/modules/user/model/localazy-identity.d.ts +15 -0
- package/dist/admin/src/modules/user/services/localazy-user-service.d.ts +6 -0
- package/dist/admin/src/pages/App.d.ts +3 -0
- package/dist/admin/src/pages/ContentTransferSetup.d.ts +4 -0
- package/dist/admin/src/pages/Download.d.ts +7 -0
- package/dist/admin/src/pages/GlobalSettings.d.ts +4 -0
- package/dist/admin/src/pages/HomePage.d.ts +2 -0
- package/dist/admin/src/pages/Login.d.ts +8 -0
- package/dist/admin/src/pages/Overview.d.ts +8 -0
- package/dist/admin/src/pages/Upload.d.ts +7 -0
- package/dist/admin/src/pluginId.d.ts +2 -0
- package/dist/admin/src/plugins/generic-connector-client.d.ts +3 -0
- package/dist/admin/src/state/localazy-identity.d.ts +13 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/server/index.js +26000 -0
- package/dist/server/index.mjs +25989 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/core/config.d.ts +1 -0
- package/dist/server/src/config/development/index.d.ts +15 -0
- package/dist/server/src/config/example/index.example.d.ts +15 -0
- package/dist/server/src/config/index.d.ts +18 -0
- package/dist/server/src/config/local/index.d.ts +15 -0
- package/dist/server/src/config/production/index.d.ts +15 -0
- package/dist/server/src/constants/channels.d.ts +3 -0
- package/dist/server/src/constants/events.d.ts +6 -0
- package/dist/server/src/content-types/index.d.ts +2 -0
- package/dist/server/src/controllers/index.d.ts +43 -0
- package/dist/server/src/controllers/localazy-auth-controller.d.ts +8 -0
- package/dist/server/src/controllers/localazy-project-controller.d.ts +7 -0
- package/dist/server/src/controllers/localazy-transfer-controller.d.ts +8 -0
- package/dist/server/src/controllers/localazy-user-controller.d.ts +9 -0
- package/dist/server/src/controllers/plugin-settings-controller.d.ts +10 -0
- package/dist/server/src/controllers/strapi-controller.d.ts +10 -0
- package/dist/server/src/core/index.d.ts +71 -0
- package/dist/server/src/db/model/content-transfer-setup.d.ts +4 -0
- package/dist/server/src/db/model/localazy-user.d.ts +17 -0
- package/dist/server/src/db/model/plugin-settings.d.ts +5 -0
- package/dist/server/src/db/model/utils/get-strapi-store.d.ts +26 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/functions/should-set-downloaded-property.d.ts +12 -0
- package/dist/server/src/index.d.ts +189 -0
- package/dist/server/src/lifecycles/deep-populate-hook.d.ts +20 -0
- package/dist/server/src/lifecycles/deprecate-event-entry-in-localazy-hook.d.ts +4 -0
- package/dist/server/src/lifecycles/upload-event-entry-to-localazy-hook.d.ts +12 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/models/plugin/content-transfer-setup.d.ts +13 -0
- package/dist/server/src/models/strapi/locale.d.ts +8 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/index.d.ts +25 -0
- package/dist/server/src/routes/localazy-auth-routes.d.ts +9 -0
- package/dist/server/src/routes/localazy-project-routes.d.ts +9 -0
- package/dist/server/src/routes/localazy-transfer-routes.d.ts +9 -0
- package/dist/server/src/routes/localazy-user-routes.d.ts +9 -0
- package/dist/server/src/routes/plugin-settings-routes.d.ts +9 -0
- package/dist/server/src/routes/strapi-routes.d.ts +9 -0
- package/dist/server/src/services/helpers/job-notification-service.d.ts +14 -0
- package/dist/server/src/services/helpers/plugin-settings-service-helper.d.ts +16 -0
- package/dist/server/src/services/index.d.ts +92 -0
- package/dist/server/src/services/localazy-pubapi-service.d.ts +12 -0
- package/dist/server/src/services/localazy-transfer-download-service.d.ts +11 -0
- package/dist/server/src/services/localazy-transfer-upload-service.d.ts +11 -0
- package/dist/server/src/services/localazy-upload-service.d.ts +28 -0
- package/dist/server/src/services/localazy-user-service.d.ts +11 -0
- package/dist/server/src/services/plugin-settings-service.d.ts +16 -0
- package/dist/server/src/services/strapi-i18n-service.d.ts +19 -0
- package/dist/server/src/services/strapi-localazy-i18n-service.d.ts +9 -0
- package/dist/server/src/services/strapi-service.d.ts +10 -0
- package/dist/server/src/utils/delay.d.ts +1 -0
- package/dist/server/src/utils/drop-property-deep.d.ts +1 -0
- package/dist/server/src/utils/flatten-object.d.ts +2 -0
- package/dist/server/src/utils/generate-random-id.d.ts +2 -0
- package/dist/server/src/utils/get-full-populate-localazy-download-object.d.ts +17 -0
- package/dist/server/src/utils/get-full-populate-localazy-upload-object.d.ts +9 -0
- package/dist/server/src/utils/get-full-populate-object.d.ts +17 -0
- package/dist/server/src/utils/get-main-keys-of-nested-array-objects.d.ts +2 -0
- package/dist/server/src/utils/get-picked-flatten-keys-for-hook-entry.d.ts +5 -0
- package/dist/server/src/utils/intl-display-name.d.ts +1 -0
- package/dist/server/src/utils/is-generally-applicable-content-type.d.ts +2 -0
- package/dist/server/src/utils/is-localazy-applicable-content-type.d.ts +2 -0
- package/dist/server/src/utils/iso-locales-utils.d.ts +3 -0
- package/dist/server/src/utils/localazy-api-client-factory.d.ts +3 -0
- package/dist/server/src/utils/localazy-generic-connector-client-factory.d.ts +3 -0
- package/dist/server/src/utils/model-utils.d.ts +7 -0
- package/dist/server/src/utils/omit-deep.d.ts +2 -0
- package/dist/server/src/utils/parsed-localazy-entry-to-create-entry.d.ts +7 -0
- package/dist/server/src/utils/parsed-localazy-entry-to-update-entry.d.ts +1 -0
- package/dist/server/src/utils/pick-entries.d.ts +2 -0
- package/dist/server/src/utils/populate-create-update-entry-with-base-entry.d.ts +1 -0
- package/dist/server/src/utils/request-initiator-helper.d.ts +9 -0
- package/dist/server/src/utils/reset-array-keys-deep.d.ts +1 -0
- package/dist/server/src/utils/transfer-setup-utils.d.ts +7 -0
- package/install/index.mjs +88 -34
- package/install/vite.config.example.js +40 -0
- package/install/vite.config.example.ts +41 -0
- package/install/{webpack.example.js → webpack.config.example.js} +2 -2
- package/install/webpack.config.example.ts +30 -0
- package/package.json +93 -55
- package/.babelrc +0 -7
- package/.eslintrc +0 -13
- package/.github/workflows/qa.yml +0 -25
- package/.github/workflows/release.yml +0 -46
- package/.nvmrc +0 -1
- package/.strapi-updater.json +0 -4
- package/CHANGELOG.md +0 -60
- package/LICENSE +0 -21
- package/admin/src/components/Initializer/index.js +0 -26
- package/admin/src/components/PluginIcon/index.js +0 -14
- package/admin/src/config/development/index.js +0 -14
- package/admin/src/config/example/index.js +0 -14
- package/admin/src/config/index.js +0 -19
- package/admin/src/config/local/index.js +0 -14
- package/admin/src/config/production/index.js +0 -15
- package/admin/src/i18n.js +0 -41
- package/admin/src/index.js +0 -138
- package/admin/src/modules/@common/components/Icons/Localazy/index.js +0 -12
- package/admin/src/modules/@common/components/LanguagesSelector/index.js +0 -67
- package/admin/src/modules/@common/components/PluginPageLoader/index.js +0 -20
- package/admin/src/modules/@common/components/SideNav/index.js +0 -46
- package/admin/src/modules/@common/components/TransferReport/index.js +0 -53
- package/admin/src/modules/@common/locale/en.js +0 -14
- package/admin/src/modules/@common/models/supported-content-type-fields.js +0 -9
- package/admin/src/modules/@common/models/supported-custom-field-plugins.js +0 -6
- package/admin/src/modules/@common/services/i18n-service.js +0 -15
- package/admin/src/modules/@common/services/plugin.service.js +0 -16
- package/admin/src/modules/@common/services/product-analytics-service.js +0 -86
- package/admin/src/modules/@common/services/project-service.js +0 -15
- package/admin/src/modules/@common/services/user-service.js +0 -38
- package/admin/src/modules/@common/utils/__tests__/iso-locales-utils.test.js +0 -102
- package/admin/src/modules/@common/utils/are-locales-compatible.js +0 -42
- package/admin/src/modules/@common/utils/format-number.js +0 -1
- package/admin/src/modules/@common/utils/functions/flatten-deep.js +0 -23
- package/admin/src/modules/@common/utils/get-default-locale.js +0 -32
- package/admin/src/modules/@common/utils/get-header-subtitle.js +0 -21
- package/admin/src/modules/@common/utils/get-header-title.js +0 -24
- package/admin/src/modules/@common/utils/get-nav.js +0 -35
- package/admin/src/modules/@common/utils/history.js +0 -6
- package/admin/src/modules/@common/utils/is-plugin-route.js +0 -15
- package/admin/src/modules/@common/utils/iso-locales-utils.js +0 -58
- package/admin/src/modules/@common/utils/redirect-to-plugin-route.js +0 -22
- package/admin/src/modules/@common/utils/sort-by-model-name.js +0 -10
- package/admin/src/modules/alerts/constants/channels.js +0 -1
- package/admin/src/modules/alerts/constants/events.js +0 -4
- package/admin/src/modules/alerts/services/alerts-service.js +0 -41
- package/admin/src/modules/localazy-download/locale/en.js +0 -25
- package/admin/src/modules/localazy-download/services/download-alerts-service.js +0 -12
- package/admin/src/modules/localazy-download/services/localazy-download-service.js +0 -16
- package/admin/src/modules/localazy-upload/components/ReadDocsButton.js +0 -20
- package/admin/src/modules/localazy-upload/locale/en.js +0 -20
- package/admin/src/modules/localazy-upload/services/localazy-upload-service.js +0 -16
- package/admin/src/modules/localazy-upload/services/upload-alerts-service.js +0 -12
- package/admin/src/modules/login/components/LoginButton/index.js +0 -55
- package/admin/src/modules/login/components/LogoutButton/index.js +0 -49
- package/admin/src/modules/login/locale/en.js +0 -7
- package/admin/src/modules/login/services/localazy-login-service.js +0 -29
- package/admin/src/modules/plugin-settings/components/ContentTransferSetup/index.js +0 -308
- package/admin/src/modules/plugin-settings/components/ContentTransferSetupEmpty/index.js +0 -86
- package/admin/src/modules/plugin-settings/components/GlobalSettings/index.js +0 -269
- package/admin/src/modules/plugin-settings/components/Tree/index.js +0 -145
- package/admin/src/modules/plugin-settings/components/TreeItem/index.js +0 -48
- package/admin/src/modules/plugin-settings/functions/build-content-transfer-setup-schema.js +0 -57
- package/admin/src/modules/plugin-settings/functions/get-content-transfer-setup-keys-sets.js +0 -85
- package/admin/src/modules/plugin-settings/functions/has-model-changed.js +0 -75
- package/admin/src/modules/plugin-settings/locale/en.js +0 -61
- package/admin/src/modules/plugin-settings/services/plugin-settings-service.js +0 -55
- package/admin/src/modules/plugin-settings/services/strapi-model-service.js +0 -26
- package/admin/src/modules/plugin-settings/services/strapi-users-service.js +0 -26
- package/admin/src/modules/plugin-settings/utils/__tests__/get-models-tree.test.js +0 -135
- package/admin/src/modules/plugin-settings/utils/array-of-models-to-object.js +0 -6
- package/admin/src/modules/plugin-settings/utils/find-model-value-by-key.js +0 -8
- package/admin/src/modules/plugin-settings/utils/get-filtered-models-schemas.js +0 -31
- package/admin/src/modules/plugin-settings/utils/get-models-tree.js +0 -94
- package/admin/src/modules/settings/components/OverviewItem/index.js +0 -44
- package/admin/src/modules/settings/components/OverviewItemLink/index.js +0 -34
- package/admin/src/modules/settings/components/PrerequisitiesInfo/index.js +0 -28
- package/admin/src/modules/settings/locale/en.js +0 -13
- package/admin/src/modules/user/model/localazy-identity.js +0 -14
- package/admin/src/modules/user/services/localazy-user-service.js +0 -38
- package/admin/src/pages/App/index.js +0 -154
- package/admin/src/pages/Download/index.js +0 -280
- package/admin/src/pages/Index/index.js +0 -8
- package/admin/src/pages/Login/index.js +0 -109
- package/admin/src/pages/PluginSettings/index.js +0 -56
- package/admin/src/pages/Settings/index.js +0 -132
- package/admin/src/pages/Upload/index.js +0 -241
- package/admin/src/pluginId.js +0 -5
- package/admin/src/plugins/generic-connector-client.js +0 -9
- package/admin/src/state/localazy-identity.js +0 -29
- package/admin/src/tests/fixtures/all-models.js +0 -877
- package/admin/src/tests/fixtures/restaurant-model.js +0 -230
- package/admin/src/translations/en.json +0 -4
- package/admin/src/translations/fr.json +0 -1
- package/admin/src/utils/createAxiosInstance.js +0 -54
- package/admin/src/utils/getTrad.js +0 -5
- package/jest.config.js +0 -0
- package/server/bootstrap.js +0 -63
- package/server/config/development/index.js +0 -16
- package/server/config/example/index.js +0 -16
- package/server/config/index.js +0 -20
- package/server/config/local/index.js +0 -16
- package/server/config/production/index.js +0 -17
- package/server/config/schema.graphql.js +0 -21
- package/server/constants/channels.js +0 -3
- package/server/constants/events.js +0 -6
- package/server/content-types/index.js +0 -3
- package/server/controllers/index.js +0 -17
- package/server/controllers/localazy-auth-controller.js +0 -22
- package/server/controllers/localazy-project-controller.js +0 -21
- package/server/controllers/localazy-transfer-controller.js +0 -62
- package/server/controllers/localazy-user-controller.js +0 -24
- package/server/controllers/plugin-settings-controller.js +0 -31
- package/server/controllers/strapi-controller.js +0 -27
- package/server/db/model/content-transfer-setup.js +0 -13
- package/server/db/model/localazy-user.js +0 -23
- package/server/db/model/plugin-settings.js +0 -13
- package/server/db/model/utils/get-strapi-store.js +0 -9
- package/server/destroy.js +0 -5
- package/server/functions/should-set-downloaded-property.js +0 -94
- package/server/index.js +0 -25
- package/server/lifecycles/deep-populate-hook.js +0 -12
- package/server/lifecycles/deprecate-event-entry-in-localazy-hook.js +0 -73
- package/server/lifecycles/upload-event-entry-to-localazy-hook.js +0 -36
- package/server/middlewares/index.js +0 -7
- package/server/middlewares/verify-webhook.js +0 -77
- package/server/models/supported-content-type-fields.js +0 -9
- package/server/models/supported-custom-field-plugins.js +0 -6
- package/server/policies/index.js +0 -3
- package/server/register.js +0 -5
- package/server/routes/index.js +0 -28
- package/server/routes/localazy-auth.js +0 -22
- package/server/routes/localazy-project.js +0 -14
- package/server/routes/localazy-public-transfer.js +0 -20
- package/server/routes/localazy-transfer.js +0 -22
- package/server/routes/localazy-user.js +0 -30
- package/server/routes/plugin-settings.js +0 -38
- package/server/routes/strapi.js +0 -38
- package/server/services/helpers/job-notification-service.js +0 -30
- package/server/services/helpers/plugin-settings-service-helper.js +0 -52
- package/server/services/index.js +0 -23
- package/server/services/localazy-pubapi-service.js +0 -53
- package/server/services/localazy-transfer-download-service.js +0 -445
- package/server/services/localazy-transfer-upload-service.js +0 -178
- package/server/services/localazy-upload-service.js +0 -52
- package/server/services/localazy-user-service.js +0 -29
- package/server/services/plugin-settings-service.js +0 -53
- package/server/services/strapi-i18n-service.js +0 -151
- package/server/services/strapi-localazy-i18n-service.js +0 -130
- package/server/services/strapi-service.js +0 -26
- package/server/tests/fixtures/all-models.js +0 -869
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-cookbook.js +0 -5761
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-lesson-dz.js +0 -402
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-page-dz.js +0 -658
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-restaurant-simple-menu.js +0 -536
- package/server/tests/fixtures/parsed-localazy-entry-to-update-entry.js +0 -35157
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-cookbook-empty-recipes.js +0 -202
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-cookbook.js +0 -2700
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-lesson-dz.js +0 -309
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-flat-simple.js +0 -47
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-flat-with-media.js +0 -169
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-menu-empty.js +0 -3003
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-menu-with-media.js +0 -2057
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-sample-json-dz.js +0 -884
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-sample-json.js +0 -46
- package/server/tests/fixtures/strapi-plugin-all-models.js +0 -7000
- package/server/utils/__tests__/build-populate.test.js +0 -85
- package/server/utils/__tests__/flatten-object.test.js +0 -171
- package/server/utils/__tests__/get-models-tree.test.js +0 -170
- package/server/utils/__tests__/iso-locales-utils.test.js +0 -104
- package/server/utils/__tests__/parsed-localazy-entry-to-create-entry.test.js +0 -258
- package/server/utils/__tests__/parsed-localazy-entry-to-update-entry.test.js +0 -456
- package/server/utils/__tests__/pick-entries.test.js +0 -963
- package/server/utils/__tests__/populate-create-update-entry-with-base-entry.test.js +0 -1176
- package/server/utils/build-populate.js +0 -48
- package/server/utils/delay.js +0 -6
- package/server/utils/flatten-object.js +0 -61
- package/server/utils/generate-random-id.js +0 -3
- package/server/utils/get-full-populate-object.js +0 -66
- package/server/utils/get-main-keys-of-nested-array-objects.js +0 -5
- package/server/utils/get-models-tree.js +0 -47
- package/server/utils/get-picked-flatten-keys-for-hook-entry.js +0 -270
- package/server/utils/intl-display-name.js +0 -4
- package/server/utils/is-generally-applicable-content-type.js +0 -33
- package/server/utils/is-localazy-applicable-content-type.js +0 -36
- package/server/utils/iso-locales-utils.js +0 -60
- package/server/utils/localazy-api-client-factory.js +0 -22
- package/server/utils/localazy-generic-connector-client-factory.js +0 -15
- package/server/utils/model-utils.js +0 -43
- package/server/utils/objectivise-entry.js +0 -41
- package/server/utils/omit-deep.js +0 -24
- package/server/utils/parsed-localazy-entry-to-create-entry.js +0 -194
- package/server/utils/parsed-localazy-entry-to-update-entry.js +0 -83
- package/server/utils/pick-deep.js +0 -22
- package/server/utils/pick-entries.js +0 -37
- package/server/utils/populate-create-update-entry-with-base-entry.js +0 -264
- package/server/utils/request-initiator-helper.js +0 -36
- package/server/utils/reset-array-keys-deep.js +0 -19
- package/server/utils/transfer-setup-utils.js +0 -93
- package/strapi-admin.js +0 -14
- package/strapi-server.js +0 -5
- package/test/helpers/mocks.js +0 -9
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const set = require("./set-DUdH3vE5.js");
|
|
6
|
+
const admin = require("@strapi/strapi/admin");
|
|
7
|
+
const isEqual = require("./isEqual-B-YVnzrp.js");
|
|
8
|
+
const LanguagesSelector = require("./LanguagesSelector-BeijBEjg.js");
|
|
9
|
+
const index = require("./index-BQw2qi2G.js");
|
|
10
|
+
class PluginSettingsService {
|
|
11
|
+
static async getAdminPanelUsers() {
|
|
12
|
+
try {
|
|
13
|
+
const axiosInstance = index.createStrapiApiAxiosInstance("/admin/users");
|
|
14
|
+
const result = await axiosInstance.get("", {
|
|
15
|
+
params: {
|
|
16
|
+
pageSize: 100,
|
|
17
|
+
page: 1,
|
|
18
|
+
sort: "firstname"
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return result.data.data.results;
|
|
22
|
+
} catch (e) {
|
|
23
|
+
throw e;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const GlobalSettings = () => {
|
|
28
|
+
const { t } = set.useTranslation();
|
|
29
|
+
const [projectLanguages, setProjectLanguages] = React.useState([]);
|
|
30
|
+
const [isLoading, setIsLoading] = React.useState(true);
|
|
31
|
+
const [showSavedAlert, setShowSavedAlert] = React.useState(false);
|
|
32
|
+
const [users, setUsers] = React.useState([]);
|
|
33
|
+
const [originalFormModel, setOriginalFormModel] = React.useState([]);
|
|
34
|
+
const [formModel, setFormModel] = React.useState({});
|
|
35
|
+
const [hasUnsavedChanges, setHasUnsavedChanges] = React.useState(false);
|
|
36
|
+
const onCancelClick = () => {
|
|
37
|
+
setFormModel(set.cloneDeep(originalFormModel));
|
|
38
|
+
setHasUnsavedChanges(false);
|
|
39
|
+
};
|
|
40
|
+
const saveGlobalSettings = async (data) => {
|
|
41
|
+
try {
|
|
42
|
+
await set.PluginSettingsService.updatePluginSettings(data);
|
|
43
|
+
setOriginalFormModel(set.cloneDeep(data));
|
|
44
|
+
setHasUnsavedChanges(false);
|
|
45
|
+
setShowSavedAlert(true);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
throw e.data;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const patchFormModel = (key, value) => {
|
|
51
|
+
const newFormModel = set.cloneDeep(formModel);
|
|
52
|
+
set.set(newFormModel, key, value);
|
|
53
|
+
setFormModel(newFormModel);
|
|
54
|
+
setHasUnsavedChanges(!isEqual.isEqual(originalFormModel, newFormModel));
|
|
55
|
+
};
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
async function fetchData() {
|
|
58
|
+
setIsLoading(true);
|
|
59
|
+
const project = await LanguagesSelector.ProjectService.getConnectedProject();
|
|
60
|
+
const projectLanguagesWithoutDefaultLanguage = project?.languages?.filter((language) => language.id !== project.sourceLanguage) || [];
|
|
61
|
+
setProjectLanguages(projectLanguagesWithoutDefaultLanguage);
|
|
62
|
+
const globalSettings = await set.PluginSettingsService.getPluginSettings();
|
|
63
|
+
setFormModel(globalSettings);
|
|
64
|
+
setOriginalFormModel(set.cloneDeep(globalSettings));
|
|
65
|
+
const users2 = await PluginSettingsService.getAdminPanelUsers();
|
|
66
|
+
setUsers(users2);
|
|
67
|
+
setIsLoading(false);
|
|
68
|
+
}
|
|
69
|
+
fetchData();
|
|
70
|
+
}, []);
|
|
71
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
72
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
73
|
+
admin.Layouts.Header,
|
|
74
|
+
{
|
|
75
|
+
title: t("plugin_settings.global_settings"),
|
|
76
|
+
subtitle: t("plugin_settings.global_settings_description"),
|
|
77
|
+
primaryAction: /* @__PURE__ */ jsxRuntime.jsxs(set.Flex, { gap: 2, children: [
|
|
78
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Button, { variant: "secondary", disabled: !hasUnsavedChanges, onClick: onCancelClick, children: t("plugin_settings.cancel") }),
|
|
79
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
80
|
+
set.Button,
|
|
81
|
+
{
|
|
82
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(set.ForwardRef$4z, {}),
|
|
83
|
+
disabled: !hasUnsavedChanges,
|
|
84
|
+
onClick: () => {
|
|
85
|
+
saveGlobalSettings(formModel);
|
|
86
|
+
},
|
|
87
|
+
children: t("plugin_settings.save")
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] }),
|
|
91
|
+
as: "h2"
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ jsxRuntime.jsxs(set.Box, { marginRight: 10, marginLeft: 10, children: [
|
|
95
|
+
!isLoading && showSavedAlert && /* @__PURE__ */ jsxRuntime.jsx(set.Box, { marginBottom: 8, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
+
set.Alert,
|
|
97
|
+
{
|
|
98
|
+
onClose: () => setShowSavedAlert(false),
|
|
99
|
+
closeLabel: t("plugin_settings.close"),
|
|
100
|
+
title: t("plugin_settings.content_transfer_setup_saved"),
|
|
101
|
+
variant: "success",
|
|
102
|
+
children: t("plugin_settings.global_settings_saved_successfully")
|
|
103
|
+
}
|
|
104
|
+
) }),
|
|
105
|
+
!isLoading && /* @__PURE__ */ jsxRuntime.jsx(set.Box, { background: "neutral0", padding: 7, paddingTop: 6, shadow: "tableShadow", hasRadius: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
106
|
+
set.Box,
|
|
107
|
+
{
|
|
108
|
+
style: {
|
|
109
|
+
maxWidth: "500px"
|
|
110
|
+
},
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Typography, { variant: "delta", textColor: "neutral800", children: t("plugin_settings.upload_settings") }),
|
|
113
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
114
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
115
|
+
/* @__PURE__ */ jsxRuntime.jsxs(set.Field.Root, { hint: t("plugin_settings.allow_automated_upload_to_localazy_info"), children: [
|
|
116
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Field.Label, { children: t("plugin_settings.allow_automated_upload_to_localazy") }),
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
118
|
+
set.Toggle,
|
|
119
|
+
{
|
|
120
|
+
offLabel: t("plugin_settings.off"),
|
|
121
|
+
onLabel: t("plugin_settings.on"),
|
|
122
|
+
checked: typeof formModel?.upload?.allowAutomated === "boolean" ? formModel.upload.allowAutomated : false,
|
|
123
|
+
onChange: (e) => patchFormModel("upload.allowAutomated", e.target.checked)
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Field.Hint, {})
|
|
127
|
+
] }),
|
|
128
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
129
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
130
|
+
/* @__PURE__ */ jsxRuntime.jsxs(set.Field.Root, { hint: t("plugin_settings.automated_upload_triggers_info"), children: [
|
|
131
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Field.Label, { children: t("plugin_settings.automated_upload_triggers") }),
|
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
133
|
+
set.MultiSelect,
|
|
134
|
+
{
|
|
135
|
+
label: t("plugin_settings.automated_upload_triggers"),
|
|
136
|
+
hint: t("plugin_settings.automated_upload_triggers_info"),
|
|
137
|
+
clearLabel: t("plugin_settings.clear"),
|
|
138
|
+
placeholder: t("plugin_settings.automated_upload_triggers_placeholder"),
|
|
139
|
+
onClear: () => patchFormModel("upload.automatedTriggers", []),
|
|
140
|
+
value: formModel?.upload?.automatedTriggers || [],
|
|
141
|
+
onChange: (values) => patchFormModel("upload.automatedTriggers", values),
|
|
142
|
+
disabled: typeof formModel?.upload?.allowAutomated === "boolean" ? !formModel.upload.allowAutomated : true,
|
|
143
|
+
multi: true,
|
|
144
|
+
withTags: true,
|
|
145
|
+
children: [
|
|
146
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.MultiSelectOption, { value: "created", children: t("plugin_settings.creating_new_data_entry") }),
|
|
147
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.MultiSelectOption, { value: "updated", children: t("plugin_settings.editing_data_entry") })
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Field.Hint, {})
|
|
152
|
+
] }),
|
|
153
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
154
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
155
|
+
/* @__PURE__ */ jsxRuntime.jsxs(set.Field.Root, { hint: t("plugin_settings.deprecate_source_keys_on_delete_info"), children: [
|
|
156
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Field.Label, { children: t("plugin_settings.deprecate_source_keys_on_delete") }),
|
|
157
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
158
|
+
set.Toggle,
|
|
159
|
+
{
|
|
160
|
+
hint: t("plugin_settings.deprecate_source_keys_on_delete_info"),
|
|
161
|
+
offLabel: t("plugin_settings.off"),
|
|
162
|
+
onLabel: t("plugin_settings.on"),
|
|
163
|
+
checked: typeof formModel?.upload?.allowDeprecate === "boolean" ? formModel.upload.allowDeprecate : false,
|
|
164
|
+
onChange: (e) => patchFormModel("upload.allowDeprecate", e.target.checked)
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Field.Hint, {})
|
|
168
|
+
] }),
|
|
169
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
170
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
171
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Divider, {}),
|
|
172
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
173
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
174
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Typography, { variant: "delta", textColor: "neutral800", children: t("plugin_settings.download_settings") }),
|
|
175
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
176
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
177
|
+
/* @__PURE__ */ jsxRuntime.jsxs(set.Field.Root, { hint: t("plugin_settings.processing_of_download_webhook_info"), children: [
|
|
178
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Field.Label, { children: t("plugin_settings.processing_of_download_webhook") }),
|
|
179
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
180
|
+
set.Toggle,
|
|
181
|
+
{
|
|
182
|
+
hint: t("plugin_settings.processing_of_download_webhook_info"),
|
|
183
|
+
offLabel: t("plugin_settings.off"),
|
|
184
|
+
onLabel: t("plugin_settings.on"),
|
|
185
|
+
checked: typeof formModel?.download?.processDownloadWebhook === "boolean" ? formModel.download.processDownloadWebhook : true,
|
|
186
|
+
onChange: (e) => patchFormModel("download.processDownloadWebhook", e.target.checked)
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Field.Hint, {})
|
|
190
|
+
] }),
|
|
191
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
192
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
193
|
+
/* @__PURE__ */ jsxRuntime.jsxs(set.Field.Root, { hint: t("plugin_settings.webhook_author_info"), children: [
|
|
194
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Field.Label, { children: t("plugin_settings.webhook_author") }),
|
|
195
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
196
|
+
set.SingleSelect,
|
|
197
|
+
{
|
|
198
|
+
hint: t("plugin_settings.webhook_author_info"),
|
|
199
|
+
clearLabel: t("plugin_settings.clear"),
|
|
200
|
+
placeholder: t("plugin_settings.webhook_author_placeholder"),
|
|
201
|
+
onClear: () => patchFormModel("download.webhookAuthorId", null),
|
|
202
|
+
value: formModel?.download?.webhookAuthorId || null,
|
|
203
|
+
onChange: (value) => patchFormModel("download.webhookAuthorId", value),
|
|
204
|
+
children: users.map((user) => /* @__PURE__ */ jsxRuntime.jsx(set.SingleSelectOption, { value: user.id, children: `${user.firstname} ${user.lastname} (${user.email})` }, user.id))
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Field.Hint, {})
|
|
208
|
+
] }),
|
|
209
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
210
|
+
/* @__PURE__ */ jsxRuntime.jsx("br", {}),
|
|
211
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
212
|
+
LanguagesSelector.LanguagesSelector,
|
|
213
|
+
{
|
|
214
|
+
preselectedLanguages: formModel?.download?.webhookLanguages || [],
|
|
215
|
+
projectLanguages,
|
|
216
|
+
onChange: (languages) => patchFormModel("download.webhookLanguages", languages),
|
|
217
|
+
label: t("plugin_settings.webhook_languages"),
|
|
218
|
+
hint: t("plugin_settings.webhook_languages_info"),
|
|
219
|
+
placeholder: t("plugin_settings.webhook_languages_placeholder")
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
) })
|
|
225
|
+
] })
|
|
226
|
+
] });
|
|
227
|
+
};
|
|
228
|
+
exports.GlobalSettings = GlobalSettings;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { u as useTranslation, c as Flex, B as Button, p as ForwardRef$4z, d as Box, A as Alert, T as Typography, q as Field, r as Toggle, M as MultiSelect, t as MultiSelectOption, D as Divider, v as SingleSelect, w as SingleSelectOption, P as PluginSettingsService$1, n as cloneDeep, s as set } from "./set-DulHAQhq.mjs";
|
|
4
|
+
import { Layouts } from "@strapi/strapi/admin";
|
|
5
|
+
import { i as isEqual } from "./isEqual-CEyT97-3.mjs";
|
|
6
|
+
import { L as LanguagesSelector, P as ProjectService } from "./LanguagesSelector-fyAIUp7M.mjs";
|
|
7
|
+
import { c as createStrapiApiAxiosInstance } from "./index-CN3Gyh5F.mjs";
|
|
8
|
+
class PluginSettingsService {
|
|
9
|
+
static async getAdminPanelUsers() {
|
|
10
|
+
try {
|
|
11
|
+
const axiosInstance = createStrapiApiAxiosInstance("/admin/users");
|
|
12
|
+
const result = await axiosInstance.get("", {
|
|
13
|
+
params: {
|
|
14
|
+
pageSize: 100,
|
|
15
|
+
page: 1,
|
|
16
|
+
sort: "firstname"
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return result.data.data.results;
|
|
20
|
+
} catch (e) {
|
|
21
|
+
throw e;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const GlobalSettings = () => {
|
|
26
|
+
const { t } = useTranslation();
|
|
27
|
+
const [projectLanguages, setProjectLanguages] = useState([]);
|
|
28
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
29
|
+
const [showSavedAlert, setShowSavedAlert] = useState(false);
|
|
30
|
+
const [users, setUsers] = useState([]);
|
|
31
|
+
const [originalFormModel, setOriginalFormModel] = useState([]);
|
|
32
|
+
const [formModel, setFormModel] = useState({});
|
|
33
|
+
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);
|
|
34
|
+
const onCancelClick = () => {
|
|
35
|
+
setFormModel(cloneDeep(originalFormModel));
|
|
36
|
+
setHasUnsavedChanges(false);
|
|
37
|
+
};
|
|
38
|
+
const saveGlobalSettings = async (data) => {
|
|
39
|
+
try {
|
|
40
|
+
await PluginSettingsService$1.updatePluginSettings(data);
|
|
41
|
+
setOriginalFormModel(cloneDeep(data));
|
|
42
|
+
setHasUnsavedChanges(false);
|
|
43
|
+
setShowSavedAlert(true);
|
|
44
|
+
} catch (e) {
|
|
45
|
+
throw e.data;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const patchFormModel = (key, value) => {
|
|
49
|
+
const newFormModel = cloneDeep(formModel);
|
|
50
|
+
set(newFormModel, key, value);
|
|
51
|
+
setFormModel(newFormModel);
|
|
52
|
+
setHasUnsavedChanges(!isEqual(originalFormModel, newFormModel));
|
|
53
|
+
};
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
async function fetchData() {
|
|
56
|
+
setIsLoading(true);
|
|
57
|
+
const project = await ProjectService.getConnectedProject();
|
|
58
|
+
const projectLanguagesWithoutDefaultLanguage = project?.languages?.filter((language) => language.id !== project.sourceLanguage) || [];
|
|
59
|
+
setProjectLanguages(projectLanguagesWithoutDefaultLanguage);
|
|
60
|
+
const globalSettings = await PluginSettingsService$1.getPluginSettings();
|
|
61
|
+
setFormModel(globalSettings);
|
|
62
|
+
setOriginalFormModel(cloneDeep(globalSettings));
|
|
63
|
+
const users2 = await PluginSettingsService.getAdminPanelUsers();
|
|
64
|
+
setUsers(users2);
|
|
65
|
+
setIsLoading(false);
|
|
66
|
+
}
|
|
67
|
+
fetchData();
|
|
68
|
+
}, []);
|
|
69
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
Layouts.Header,
|
|
72
|
+
{
|
|
73
|
+
title: t("plugin_settings.global_settings"),
|
|
74
|
+
subtitle: t("plugin_settings.global_settings_description"),
|
|
75
|
+
primaryAction: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
76
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", disabled: !hasUnsavedChanges, onClick: onCancelClick, children: t("plugin_settings.cancel") }),
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
Button,
|
|
79
|
+
{
|
|
80
|
+
startIcon: /* @__PURE__ */ jsx(ForwardRef$4z, {}),
|
|
81
|
+
disabled: !hasUnsavedChanges,
|
|
82
|
+
onClick: () => {
|
|
83
|
+
saveGlobalSettings(formModel);
|
|
84
|
+
},
|
|
85
|
+
children: t("plugin_settings.save")
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
] }),
|
|
89
|
+
as: "h2"
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
/* @__PURE__ */ jsxs(Box, { marginRight: 10, marginLeft: 10, children: [
|
|
93
|
+
!isLoading && showSavedAlert && /* @__PURE__ */ jsx(Box, { marginBottom: 8, children: /* @__PURE__ */ jsx(
|
|
94
|
+
Alert,
|
|
95
|
+
{
|
|
96
|
+
onClose: () => setShowSavedAlert(false),
|
|
97
|
+
closeLabel: t("plugin_settings.close"),
|
|
98
|
+
title: t("plugin_settings.content_transfer_setup_saved"),
|
|
99
|
+
variant: "success",
|
|
100
|
+
children: t("plugin_settings.global_settings_saved_successfully")
|
|
101
|
+
}
|
|
102
|
+
) }),
|
|
103
|
+
!isLoading && /* @__PURE__ */ jsx(Box, { background: "neutral0", padding: 7, paddingTop: 6, shadow: "tableShadow", hasRadius: true, children: /* @__PURE__ */ jsxs(
|
|
104
|
+
Box,
|
|
105
|
+
{
|
|
106
|
+
style: {
|
|
107
|
+
maxWidth: "500px"
|
|
108
|
+
},
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ jsx(Typography, { variant: "delta", textColor: "neutral800", children: t("plugin_settings.upload_settings") }),
|
|
111
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
112
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
113
|
+
/* @__PURE__ */ jsxs(Field.Root, { hint: t("plugin_settings.allow_automated_upload_to_localazy_info"), children: [
|
|
114
|
+
/* @__PURE__ */ jsx(Field.Label, { children: t("plugin_settings.allow_automated_upload_to_localazy") }),
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
Toggle,
|
|
117
|
+
{
|
|
118
|
+
offLabel: t("plugin_settings.off"),
|
|
119
|
+
onLabel: t("plugin_settings.on"),
|
|
120
|
+
checked: typeof formModel?.upload?.allowAutomated === "boolean" ? formModel.upload.allowAutomated : false,
|
|
121
|
+
onChange: (e) => patchFormModel("upload.allowAutomated", e.target.checked)
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ jsx(Field.Hint, {})
|
|
125
|
+
] }),
|
|
126
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
127
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
128
|
+
/* @__PURE__ */ jsxs(Field.Root, { hint: t("plugin_settings.automated_upload_triggers_info"), children: [
|
|
129
|
+
/* @__PURE__ */ jsx(Field.Label, { children: t("plugin_settings.automated_upload_triggers") }),
|
|
130
|
+
/* @__PURE__ */ jsxs(
|
|
131
|
+
MultiSelect,
|
|
132
|
+
{
|
|
133
|
+
label: t("plugin_settings.automated_upload_triggers"),
|
|
134
|
+
hint: t("plugin_settings.automated_upload_triggers_info"),
|
|
135
|
+
clearLabel: t("plugin_settings.clear"),
|
|
136
|
+
placeholder: t("plugin_settings.automated_upload_triggers_placeholder"),
|
|
137
|
+
onClear: () => patchFormModel("upload.automatedTriggers", []),
|
|
138
|
+
value: formModel?.upload?.automatedTriggers || [],
|
|
139
|
+
onChange: (values) => patchFormModel("upload.automatedTriggers", values),
|
|
140
|
+
disabled: typeof formModel?.upload?.allowAutomated === "boolean" ? !formModel.upload.allowAutomated : true,
|
|
141
|
+
multi: true,
|
|
142
|
+
withTags: true,
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ jsx(MultiSelectOption, { value: "created", children: t("plugin_settings.creating_new_data_entry") }),
|
|
145
|
+
/* @__PURE__ */ jsx(MultiSelectOption, { value: "updated", children: t("plugin_settings.editing_data_entry") })
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ jsx(Field.Hint, {})
|
|
150
|
+
] }),
|
|
151
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
152
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
153
|
+
/* @__PURE__ */ jsxs(Field.Root, { hint: t("plugin_settings.deprecate_source_keys_on_delete_info"), children: [
|
|
154
|
+
/* @__PURE__ */ jsx(Field.Label, { children: t("plugin_settings.deprecate_source_keys_on_delete") }),
|
|
155
|
+
/* @__PURE__ */ jsx(
|
|
156
|
+
Toggle,
|
|
157
|
+
{
|
|
158
|
+
hint: t("plugin_settings.deprecate_source_keys_on_delete_info"),
|
|
159
|
+
offLabel: t("plugin_settings.off"),
|
|
160
|
+
onLabel: t("plugin_settings.on"),
|
|
161
|
+
checked: typeof formModel?.upload?.allowDeprecate === "boolean" ? formModel.upload.allowDeprecate : false,
|
|
162
|
+
onChange: (e) => patchFormModel("upload.allowDeprecate", e.target.checked)
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
/* @__PURE__ */ jsx(Field.Hint, {})
|
|
166
|
+
] }),
|
|
167
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
168
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
169
|
+
/* @__PURE__ */ jsx(Divider, {}),
|
|
170
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
171
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
172
|
+
/* @__PURE__ */ jsx(Typography, { variant: "delta", textColor: "neutral800", children: t("plugin_settings.download_settings") }),
|
|
173
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
174
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
175
|
+
/* @__PURE__ */ jsxs(Field.Root, { hint: t("plugin_settings.processing_of_download_webhook_info"), children: [
|
|
176
|
+
/* @__PURE__ */ jsx(Field.Label, { children: t("plugin_settings.processing_of_download_webhook") }),
|
|
177
|
+
/* @__PURE__ */ jsx(
|
|
178
|
+
Toggle,
|
|
179
|
+
{
|
|
180
|
+
hint: t("plugin_settings.processing_of_download_webhook_info"),
|
|
181
|
+
offLabel: t("plugin_settings.off"),
|
|
182
|
+
onLabel: t("plugin_settings.on"),
|
|
183
|
+
checked: typeof formModel?.download?.processDownloadWebhook === "boolean" ? formModel.download.processDownloadWebhook : true,
|
|
184
|
+
onChange: (e) => patchFormModel("download.processDownloadWebhook", e.target.checked)
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
/* @__PURE__ */ jsx(Field.Hint, {})
|
|
188
|
+
] }),
|
|
189
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
190
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
191
|
+
/* @__PURE__ */ jsxs(Field.Root, { hint: t("plugin_settings.webhook_author_info"), children: [
|
|
192
|
+
/* @__PURE__ */ jsx(Field.Label, { children: t("plugin_settings.webhook_author") }),
|
|
193
|
+
/* @__PURE__ */ jsx(
|
|
194
|
+
SingleSelect,
|
|
195
|
+
{
|
|
196
|
+
hint: t("plugin_settings.webhook_author_info"),
|
|
197
|
+
clearLabel: t("plugin_settings.clear"),
|
|
198
|
+
placeholder: t("plugin_settings.webhook_author_placeholder"),
|
|
199
|
+
onClear: () => patchFormModel("download.webhookAuthorId", null),
|
|
200
|
+
value: formModel?.download?.webhookAuthorId || null,
|
|
201
|
+
onChange: (value) => patchFormModel("download.webhookAuthorId", value),
|
|
202
|
+
children: users.map((user) => /* @__PURE__ */ jsx(SingleSelectOption, { value: user.id, children: `${user.firstname} ${user.lastname} (${user.email})` }, user.id))
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
/* @__PURE__ */ jsx(Field.Hint, {})
|
|
206
|
+
] }),
|
|
207
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
208
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
209
|
+
/* @__PURE__ */ jsx(
|
|
210
|
+
LanguagesSelector,
|
|
211
|
+
{
|
|
212
|
+
preselectedLanguages: formModel?.download?.webhookLanguages || [],
|
|
213
|
+
projectLanguages,
|
|
214
|
+
onChange: (languages) => patchFormModel("download.webhookLanguages", languages),
|
|
215
|
+
label: t("plugin_settings.webhook_languages"),
|
|
216
|
+
hint: t("plugin_settings.webhook_languages_info"),
|
|
217
|
+
placeholder: t("plugin_settings.webhook_languages_placeholder")
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
) })
|
|
223
|
+
] })
|
|
224
|
+
] });
|
|
225
|
+
};
|
|
226
|
+
export {
|
|
227
|
+
GlobalSettings
|
|
228
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const index = require("./index-BQw2qi2G.js");
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const set = require("./set-DUdH3vE5.js");
|
|
6
|
+
const strapiApiInstance = index.createStrapiApiAxiosInstance();
|
|
7
|
+
class ProjectService {
|
|
8
|
+
static async getConnectedProject() {
|
|
9
|
+
try {
|
|
10
|
+
const result = await strapiApiInstance.get(`/project`);
|
|
11
|
+
return result.data;
|
|
12
|
+
} catch (e) {
|
|
13
|
+
throw e;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const LanguagesSelector = (props) => {
|
|
18
|
+
const { t } = set.useTranslation();
|
|
19
|
+
const [selectedLanguages, setSelectedLanguages] = React.useState([]);
|
|
20
|
+
const onChange = (values) => {
|
|
21
|
+
setSelectedLanguages(values);
|
|
22
|
+
props.onChange(set.cloneDeep(values));
|
|
23
|
+
};
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
const existingPreselectedLanguages = props.projectLanguages.filter((lang) => props.preselectedLanguages.includes(lang.code)).map((lang) => lang.code);
|
|
26
|
+
setSelectedLanguages(existingPreselectedLanguages);
|
|
27
|
+
}, [props.projectLanguages, props.preselectedLanguages]);
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(set.Field.Root, { hint: props.hint || t("common.select_languages"), children: [
|
|
29
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Field.Label, { children: props.label || t("common.select_languages") }),
|
|
30
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31
|
+
set.MultiSelect,
|
|
32
|
+
{
|
|
33
|
+
clearLabel: t("plugin_settings.clear"),
|
|
34
|
+
placeholder: props.placeholder || t("common.select_languages"),
|
|
35
|
+
onClear: () => setSelectedLanguages([]),
|
|
36
|
+
value: selectedLanguages || [],
|
|
37
|
+
onChange: (values) => onChange(values),
|
|
38
|
+
multi: true,
|
|
39
|
+
withTags: true,
|
|
40
|
+
children: props.projectLanguages.map((lang) => /* @__PURE__ */ jsxRuntime.jsx(set.MultiSelectOption, { value: lang.code, children: `${lang.name} (${lang.code})` }, lang.id))
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsx(set.Field.Hint, {})
|
|
44
|
+
] });
|
|
45
|
+
};
|
|
46
|
+
exports.LanguagesSelector = LanguagesSelector;
|
|
47
|
+
exports.ProjectService = ProjectService;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { c as createStrapiApiAxiosInstance } from "./index-CN3Gyh5F.mjs";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import { u as useTranslation, q as Field, M as MultiSelect, t as MultiSelectOption, n as cloneDeep } from "./set-DulHAQhq.mjs";
|
|
5
|
+
const strapiApiInstance = createStrapiApiAxiosInstance();
|
|
6
|
+
class ProjectService {
|
|
7
|
+
static async getConnectedProject() {
|
|
8
|
+
try {
|
|
9
|
+
const result = await strapiApiInstance.get(`/project`);
|
|
10
|
+
return result.data;
|
|
11
|
+
} catch (e) {
|
|
12
|
+
throw e;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const LanguagesSelector = (props) => {
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
const [selectedLanguages, setSelectedLanguages] = useState([]);
|
|
19
|
+
const onChange = (values) => {
|
|
20
|
+
setSelectedLanguages(values);
|
|
21
|
+
props.onChange(cloneDeep(values));
|
|
22
|
+
};
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const existingPreselectedLanguages = props.projectLanguages.filter((lang) => props.preselectedLanguages.includes(lang.code)).map((lang) => lang.code);
|
|
25
|
+
setSelectedLanguages(existingPreselectedLanguages);
|
|
26
|
+
}, [props.projectLanguages, props.preselectedLanguages]);
|
|
27
|
+
return /* @__PURE__ */ jsxs(Field.Root, { hint: props.hint || t("common.select_languages"), children: [
|
|
28
|
+
/* @__PURE__ */ jsx(Field.Label, { children: props.label || t("common.select_languages") }),
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
MultiSelect,
|
|
31
|
+
{
|
|
32
|
+
clearLabel: t("plugin_settings.clear"),
|
|
33
|
+
placeholder: props.placeholder || t("common.select_languages"),
|
|
34
|
+
onClear: () => setSelectedLanguages([]),
|
|
35
|
+
value: selectedLanguages || [],
|
|
36
|
+
onChange: (values) => onChange(values),
|
|
37
|
+
multi: true,
|
|
38
|
+
withTags: true,
|
|
39
|
+
children: props.projectLanguages.map((lang) => /* @__PURE__ */ jsx(MultiSelectOption, { value: lang.code, children: `${lang.name} (${lang.code})` }, lang.id))
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ jsx(Field.Hint, {})
|
|
43
|
+
] });
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
LanguagesSelector as L,
|
|
47
|
+
ProjectService as P
|
|
48
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const en = {
|
|
4
|
+
"strapi-plugin-v5.name": "Localazy",
|
|
5
|
+
"strapi-plugin-v5.localazy_settings": "Localazy Settings",
|
|
6
|
+
"strapi-plugin-v5.content_transfer_setup": "Content Transfer Setup"
|
|
7
|
+
};
|
|
8
|
+
exports.default = en;
|