@localazy/strapi-plugin 0.2.13 → 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 -68
- 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 -76
- 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
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* This component is the skeleton around the actual pages, and should only
|
|
4
|
-
* contain code that should be seen on all pages. (e.g. navigation bar)
|
|
5
|
-
*
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import React, { useEffect, useState } from "react";
|
|
9
|
-
import { Switch, Router, Route, useLocation } from "react-router-dom";
|
|
10
|
-
import { NotFound } from "@strapi/helper-plugin";
|
|
11
|
-
import { ThemeProvider } from "@strapi/design-system/ThemeProvider";
|
|
12
|
-
import { lightTheme } from "@strapi/design-system/themes";
|
|
13
|
-
import { Box } from "@strapi/design-system/Box";
|
|
14
|
-
import { Layout } from "@strapi/design-system/Layout";
|
|
15
|
-
import { useTranslation } from "react-i18next";
|
|
16
|
-
import Loader from "../../modules/@common/components/PluginPageLoader";
|
|
17
|
-
import pluginId from "../../pluginId";
|
|
18
|
-
import Download from "../Download";
|
|
19
|
-
import Settings from "../Settings";
|
|
20
|
-
import Upload from "../Upload";
|
|
21
|
-
import Login from "../Login";
|
|
22
|
-
import SideNav from "../../modules/@common/components/SideNav";
|
|
23
|
-
import isPluginRoute from "../../modules/@common/utils/is-plugin-route";
|
|
24
|
-
import redirectToPluginRoute, {
|
|
25
|
-
PLUGIN_ROUTES,
|
|
26
|
-
} from "../../modules/@common/utils/redirect-to-plugin-route";
|
|
27
|
-
import getHeaderTitle from "../../modules/@common/utils/get-header-title";
|
|
28
|
-
import getHeaderSubtitle from "../../modules/@common/utils/get-header-subtitle";
|
|
29
|
-
import LocalazyUserService from "../../modules/user/services/localazy-user-service";
|
|
30
|
-
import {
|
|
31
|
-
setLocalazyIdentity,
|
|
32
|
-
getLocalazyIdentity,
|
|
33
|
-
} from "../../state/localazy-identity";
|
|
34
|
-
import history from "../../modules/@common/utils/history";
|
|
35
|
-
import PluginSettingsService from "../../modules/plugin-settings/services/plugin-settings-service";
|
|
36
|
-
|
|
37
|
-
import "../../i18n";
|
|
38
|
-
|
|
39
|
-
function App() {
|
|
40
|
-
const location = useLocation();
|
|
41
|
-
const { t } = useTranslation();
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* is processing app loading
|
|
45
|
-
*/
|
|
46
|
-
const [isLoadingApp, setIsLoadingApp] = useState(true);
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* is user logged in
|
|
50
|
-
*/
|
|
51
|
-
const [isLoggedIn, setIsLoggedIn] = useState(false);
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* side navigation component apperance and title
|
|
55
|
-
*/
|
|
56
|
-
const [renderSideNav, setRenderSideNav] = useState(false);
|
|
57
|
-
const [headerTitle, setHeaderTitle] = useState(getHeaderTitle(location));
|
|
58
|
-
const [headerSubtitle, setHeaderSubtitle] = useState(getHeaderSubtitle(location));
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* localazy identity / access token
|
|
62
|
-
*/
|
|
63
|
-
const [localazyIdentity] = getLocalazyIdentity();
|
|
64
|
-
const hasLocalazyIdentity = () => !!localazyIdentity.accessToken;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
const unlisten = history.listen((location) => {
|
|
70
|
-
setHeaderTitle(getHeaderTitle(location));
|
|
71
|
-
setHeaderSubtitle(getHeaderSubtitle(location));
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
return unlisten;
|
|
75
|
-
}, []);
|
|
76
|
-
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
async function fetchData() {
|
|
79
|
-
setIsLoadingApp(true);
|
|
80
|
-
|
|
81
|
-
const identity = await LocalazyUserService.getIdentity();
|
|
82
|
-
setLocalazyIdentity(identity);
|
|
83
|
-
setIsLoggedIn(hasLocalazyIdentity());
|
|
84
|
-
setRenderSideNav(hasLocalazyIdentity());
|
|
85
|
-
|
|
86
|
-
setIsLoadingApp(false);
|
|
87
|
-
|
|
88
|
-
// is root route
|
|
89
|
-
if (isPluginRoute(location)) {
|
|
90
|
-
if (!hasLocalazyIdentity()) {
|
|
91
|
-
redirectToPluginRoute(PLUGIN_ROUTES.LOGIN);
|
|
92
|
-
} else {
|
|
93
|
-
const lastRoute = (await PluginSettingsService.getPluginSettings()).defaultRoute || PLUGIN_ROUTES.UPLOAD;
|
|
94
|
-
redirectToPluginRoute(lastRoute);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
fetchData();
|
|
99
|
-
|
|
100
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
101
|
-
}, [localazyIdentity.accessToken]);
|
|
102
|
-
|
|
103
|
-
return (
|
|
104
|
-
<Router history={history}>
|
|
105
|
-
<ThemeProvider theme={lightTheme}>
|
|
106
|
-
<Box background="neutral100">
|
|
107
|
-
<Layout sideNav={renderSideNav && <SideNav />}>
|
|
108
|
-
{isLoadingApp && <Loader>{t("common.loading_content")}</Loader>}
|
|
109
|
-
{!isLoadingApp && (
|
|
110
|
-
<>
|
|
111
|
-
{!isLoggedIn && (
|
|
112
|
-
<Switch>
|
|
113
|
-
<Route path={`${process.env.ADMIN_PATH}plugins/${pluginId}/login`} exact>
|
|
114
|
-
<Login
|
|
115
|
-
title={headerTitle}
|
|
116
|
-
subtitle={headerSubtitle}
|
|
117
|
-
/>
|
|
118
|
-
</Route>
|
|
119
|
-
</Switch>
|
|
120
|
-
)}
|
|
121
|
-
|
|
122
|
-
{isLoggedIn && (
|
|
123
|
-
<Switch>
|
|
124
|
-
<Route path={`${process.env.ADMIN_PATH}plugins/${pluginId}/download`} exact>
|
|
125
|
-
<Download
|
|
126
|
-
title={headerTitle}
|
|
127
|
-
subtitle={headerSubtitle}
|
|
128
|
-
/>
|
|
129
|
-
</Route>
|
|
130
|
-
<Route path={`${process.env.ADMIN_PATH}plugins/${pluginId}/upload`} exact>
|
|
131
|
-
<Upload
|
|
132
|
-
title={headerTitle}
|
|
133
|
-
subtitle={headerSubtitle}
|
|
134
|
-
/>
|
|
135
|
-
</Route>
|
|
136
|
-
<Route path={`${process.env.ADMIN_PATH}plugins/${pluginId}/settings`} exact>
|
|
137
|
-
<Settings
|
|
138
|
-
title={headerTitle}
|
|
139
|
-
subtitle={headerSubtitle}
|
|
140
|
-
/>
|
|
141
|
-
</Route>
|
|
142
|
-
<Route component={NotFound} />
|
|
143
|
-
</Switch>
|
|
144
|
-
)}
|
|
145
|
-
</>
|
|
146
|
-
)}
|
|
147
|
-
</Layout>
|
|
148
|
-
</Box>
|
|
149
|
-
</ThemeProvider>
|
|
150
|
-
</Router>
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export default App;
|
|
@@ -1,280 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import cloneDeep from "lodash-es/cloneDeep";
|
|
4
|
-
import set from "lodash-es/set";
|
|
5
|
-
import { HeaderLayout } from "@strapi/design-system/Layout";
|
|
6
|
-
import { Button } from "@strapi/design-system/Button";
|
|
7
|
-
import DownloadIcon from "@strapi/icons/Download";
|
|
8
|
-
import { Box } from "@strapi/design-system/Box";
|
|
9
|
-
import { Alert } from "@strapi/design-system/Alert";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { Flex } from '@strapi/design-system/Flex';
|
|
12
|
-
import { Divider } from '@strapi/design-system/Divider';
|
|
13
|
-
import { Typography } from "@strapi/design-system/Typography";
|
|
14
|
-
import Loader from "../../modules/@common/components/PluginPageLoader";
|
|
15
|
-
import LocalazyDownloadService from "../../modules/localazy-download/services/localazy-download-service";
|
|
16
|
-
import areLocalesCompatible from "../../modules/@common/utils/are-locales-compatible";
|
|
17
|
-
import hasModelChanged from "../../modules/plugin-settings/functions/has-model-changed";
|
|
18
|
-
import TransferReport from "../../modules/@common/components/TransferReport";
|
|
19
|
-
import ReadDocsButton from "../../modules/localazy-upload/components/ReadDocsButton";
|
|
20
|
-
import { getLocalazyIdentity } from "../../state/localazy-identity";
|
|
21
|
-
import ProductAnalyticsService from "../../modules/@common/services/product-analytics-service";
|
|
22
|
-
import PluginSettingsService from "../../modules/plugin-settings/services/plugin-settings-service";
|
|
23
|
-
import { PLUGIN_ROUTES } from "../../modules/@common/utils/redirect-to-plugin-route";
|
|
24
|
-
import LanguagesSelector from "../../modules/@common/components/LanguagesSelector";
|
|
25
|
-
import ProjectService from "../../modules/@common/services/project-service";
|
|
26
|
-
import DownloadAlertsService from "../../modules/localazy-download/services/download-alerts-service";
|
|
27
|
-
|
|
28
|
-
const downloadAlertsService = new DownloadAlertsService();
|
|
29
|
-
downloadAlertsService.subscribe();
|
|
30
|
-
|
|
31
|
-
function Download(props) {
|
|
32
|
-
const { t } = useTranslation();
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Component state
|
|
36
|
-
*/
|
|
37
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
38
|
-
const [modelChanged, setModelChanged] = useState(false);
|
|
39
|
-
const [localesIncompatible, setLocalesIncompatible] = useState(false);
|
|
40
|
-
const [showDownloadFinishedModal, setshowDownloadFinishedModal] =
|
|
41
|
-
useState(false);
|
|
42
|
-
const [downloadResult, setDownloadResult] = useState({
|
|
43
|
-
success: false,
|
|
44
|
-
report: [],
|
|
45
|
-
});
|
|
46
|
-
const [isDownloading, setIsDownloading] = useState(false);
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Localazy identity / access token
|
|
50
|
-
*/
|
|
51
|
-
const [localazyIdentity] = getLocalazyIdentity();
|
|
52
|
-
const onTranslateInLocalazyClick = () => {
|
|
53
|
-
window.open(localazyIdentity.project.url, "_blank");
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Project Languages without default language
|
|
58
|
-
*/
|
|
59
|
-
const [projectLanguages, setProjectLanguages] = useState([]);
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Global Settings form model
|
|
63
|
-
*/
|
|
64
|
-
const [formModel, setFormModel] = useState([]);
|
|
65
|
-
|
|
66
|
-
const onDownloadLanguagesChange = (languages) => {
|
|
67
|
-
const newFormModel = cloneDeep(formModel);
|
|
68
|
-
set(newFormModel, 'download.uiLanguages', languages);
|
|
69
|
-
setFormModel(newFormModel);
|
|
70
|
-
|
|
71
|
-
try {
|
|
72
|
-
PluginSettingsService.updatePluginSettings(newFormModel);
|
|
73
|
-
} catch (e) {
|
|
74
|
-
console.error(e.message);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const onDownloadClick = async () => {
|
|
80
|
-
setIsDownloading(true);
|
|
81
|
-
setshowDownloadFinishedModal(false);
|
|
82
|
-
setDownloadResult({
|
|
83
|
-
success: false,
|
|
84
|
-
report: [],
|
|
85
|
-
});
|
|
86
|
-
const result = await LocalazyDownloadService.download();
|
|
87
|
-
const { streamIdentifier } = result;
|
|
88
|
-
downloadAlertsService.setStreamIdentifier(streamIdentifier);
|
|
89
|
-
downloadAlertsService.onDownload((data) => {
|
|
90
|
-
setDownloadResult((old) => ({
|
|
91
|
-
success: data.success,
|
|
92
|
-
report: [
|
|
93
|
-
...old.report || [],
|
|
94
|
-
data.message,
|
|
95
|
-
],
|
|
96
|
-
}));
|
|
97
|
-
});
|
|
98
|
-
downloadAlertsService.onDownloadFinished((data) => {
|
|
99
|
-
setDownloadResult((old) => ({
|
|
100
|
-
success: data.success,
|
|
101
|
-
report: [
|
|
102
|
-
...old.report || [],
|
|
103
|
-
data.message,
|
|
104
|
-
],
|
|
105
|
-
}));
|
|
106
|
-
setIsDownloading(false);
|
|
107
|
-
setshowDownloadFinishedModal(true);
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
// track download
|
|
111
|
-
ProductAnalyticsService.trackDownloadToStrapi(
|
|
112
|
-
localazyIdentity.user.id,
|
|
113
|
-
localazyIdentity.project,
|
|
114
|
-
{
|
|
115
|
-
"Target Languages Codes": "all",
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
useEffect(() => {
|
|
121
|
-
async function initComponent() {
|
|
122
|
-
setIsLoading(true);
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Handle alerts onload apperance
|
|
126
|
-
*/
|
|
127
|
-
setModelChanged(await hasModelChanged());
|
|
128
|
-
setLocalesIncompatible(!(await areLocalesCompatible()));
|
|
129
|
-
|
|
130
|
-
const project = await ProjectService.getConnectedProject();
|
|
131
|
-
const projectLanguagesWithoutDefaultLanguage =
|
|
132
|
-
project?.languages?.filter(language => language.id !== project.sourceLanguage) || [];
|
|
133
|
-
setProjectLanguages(projectLanguagesWithoutDefaultLanguage);
|
|
134
|
-
|
|
135
|
-
const globalSettings = await PluginSettingsService.getPluginSettings();
|
|
136
|
-
setFormModel(globalSettings);
|
|
137
|
-
|
|
138
|
-
PluginSettingsService.updatePluginSettings({ defaultRoute: PLUGIN_ROUTES.DOWNLOAD });
|
|
139
|
-
|
|
140
|
-
setIsLoading(false);
|
|
141
|
-
}
|
|
142
|
-
initComponent();
|
|
143
|
-
}, []);
|
|
144
|
-
|
|
145
|
-
return (
|
|
146
|
-
<>
|
|
147
|
-
<HeaderLayout
|
|
148
|
-
title={props.title}
|
|
149
|
-
subtitle={props.subtitle}
|
|
150
|
-
primaryAction={
|
|
151
|
-
<Button
|
|
152
|
-
startIcon={<DownloadIcon />}
|
|
153
|
-
disabled={isLoading || modelChanged || localesIncompatible}
|
|
154
|
-
loading={isDownloading}
|
|
155
|
-
onClick={onDownloadClick}
|
|
156
|
-
>
|
|
157
|
-
{t("download.download_to_strapi")}
|
|
158
|
-
</Button>
|
|
159
|
-
}
|
|
160
|
-
as="h2"
|
|
161
|
-
/>
|
|
162
|
-
{isLoading && <Loader>{t("common.loading_content")}</Loader>}
|
|
163
|
-
{!isLoading && (
|
|
164
|
-
<Box paddingRight={10} paddingLeft={10}>
|
|
165
|
-
<Box
|
|
166
|
-
background="neutral0"
|
|
167
|
-
paddingTop={6}
|
|
168
|
-
paddingRight={7}
|
|
169
|
-
paddingBottom={6}
|
|
170
|
-
paddingLeft={7}
|
|
171
|
-
hasRadius
|
|
172
|
-
shadow="tableShadow"
|
|
173
|
-
>
|
|
174
|
-
<Typography variant="omega">
|
|
175
|
-
{t("download.download_note_a")}
|
|
176
|
-
</Typography>
|
|
177
|
-
<Typography variant="omega" fontWeight="semiBold">
|
|
178
|
-
{t("download.download_note_b")}
|
|
179
|
-
</Typography>
|
|
180
|
-
<br />
|
|
181
|
-
<br />
|
|
182
|
-
<Typography variant="omega">
|
|
183
|
-
{t("download.make_sure_note_a")}
|
|
184
|
-
</Typography>
|
|
185
|
-
<Typography variant="omega" fontWeight="semiBold">
|
|
186
|
-
{t("download.make_sure_note_b")}
|
|
187
|
-
</Typography>
|
|
188
|
-
<Typography variant="omega">
|
|
189
|
-
{t("download.make_sure_note_c")}
|
|
190
|
-
</Typography>
|
|
191
|
-
<Box
|
|
192
|
-
paddingTop={6}
|
|
193
|
-
>
|
|
194
|
-
<LanguagesSelector
|
|
195
|
-
preselectedLanguages={formModel?.download?.uiLanguages || []}
|
|
196
|
-
projectLanguages={projectLanguages}
|
|
197
|
-
onChange={(languages) => onDownloadLanguagesChange(languages)}
|
|
198
|
-
label={t("download.ui_languages")}
|
|
199
|
-
hint={t("download.ui_languages_info")}
|
|
200
|
-
placeholder={t("download.ui_languages_placeholder")}
|
|
201
|
-
/>
|
|
202
|
-
</Box>
|
|
203
|
-
<Box
|
|
204
|
-
paddingTop={4}
|
|
205
|
-
paddingBottom={4}
|
|
206
|
-
>
|
|
207
|
-
<Divider />
|
|
208
|
-
</Box>
|
|
209
|
-
<Box marginTop={2}>
|
|
210
|
-
<Flex gap="2">
|
|
211
|
-
<Button variant="secondary" onClick={onTranslateInLocalazyClick}>
|
|
212
|
-
{t("download.translate_in_localazy")}
|
|
213
|
-
</Button>
|
|
214
|
-
<ReadDocsButton />
|
|
215
|
-
</Flex>
|
|
216
|
-
</Box>
|
|
217
|
-
</Box>
|
|
218
|
-
{showDownloadFinishedModal && (
|
|
219
|
-
<Box marginTop={4} marginBottom={4}>
|
|
220
|
-
<Alert
|
|
221
|
-
onClose={() => setshowDownloadFinishedModal(false)}
|
|
222
|
-
closeLabel={t("download.close")}
|
|
223
|
-
title={t("download.download_result")}
|
|
224
|
-
variant={downloadResult.success ? "success" : "danger"}
|
|
225
|
-
>
|
|
226
|
-
{downloadResult.success
|
|
227
|
-
? t("download.download_success")
|
|
228
|
-
: t("download.download_failed")}
|
|
229
|
-
</Alert>
|
|
230
|
-
</Box>
|
|
231
|
-
)}
|
|
232
|
-
{isDownloading && (
|
|
233
|
-
<Box marginTop={4} marginBottom={4}>
|
|
234
|
-
<Alert
|
|
235
|
-
title={t("download.download_in_progress")}
|
|
236
|
-
variant="warning"
|
|
237
|
-
>
|
|
238
|
-
{t("download.to_see_to_progress")}
|
|
239
|
-
</Alert>
|
|
240
|
-
</Box>
|
|
241
|
-
)}
|
|
242
|
-
{localesIncompatible && (
|
|
243
|
-
<Box marginTop={4} marginBottom={4}>
|
|
244
|
-
<Alert
|
|
245
|
-
onClose={() => setLocalesIncompatible(false)}
|
|
246
|
-
closeLabel={t("download.close")}
|
|
247
|
-
title={t("download.languages_incompatible")}
|
|
248
|
-
variant="danger"
|
|
249
|
-
>
|
|
250
|
-
{t("download.languages_incompatible_message")}
|
|
251
|
-
</Alert>
|
|
252
|
-
</Box>
|
|
253
|
-
)}
|
|
254
|
-
{modelChanged && (
|
|
255
|
-
<Box marginTop={4} marginBottom={4}>
|
|
256
|
-
<Alert
|
|
257
|
-
onClose={() => setModelChanged(false)}
|
|
258
|
-
closeLabel={t("download.close")}
|
|
259
|
-
title={t("download.content_types_model_changed")}
|
|
260
|
-
variant="default"
|
|
261
|
-
>
|
|
262
|
-
{t("download.please_update_your_content")}
|
|
263
|
-
</Alert>
|
|
264
|
-
</Box>
|
|
265
|
-
)}
|
|
266
|
-
{downloadResult.report && downloadResult.report.length > 0 && (
|
|
267
|
-
<TransferReport report={downloadResult.report} />
|
|
268
|
-
)}
|
|
269
|
-
</Box>
|
|
270
|
-
)}
|
|
271
|
-
</>
|
|
272
|
-
);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
Download.propTypes = {
|
|
276
|
-
title: PropTypes.string.isRequired,
|
|
277
|
-
subtitle: PropTypes.string.isRequired,
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
export default Download;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* Login
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from "react";
|
|
8
|
-
import PropTypes from "prop-types";
|
|
9
|
-
import { Link } from "@strapi/design-system/Link";
|
|
10
|
-
import { useHistory } from "react-router-dom";
|
|
11
|
-
import { useTranslation } from "react-i18next";
|
|
12
|
-
import { HeaderLayout } from "@strapi/design-system/Layout";
|
|
13
|
-
import { Box } from "@strapi/design-system/Box";
|
|
14
|
-
import { Typography } from "@strapi/design-system/Typography";
|
|
15
|
-
import Loader from "../../modules/@common/components/PluginPageLoader";
|
|
16
|
-
import { setLocalazyIdentity } from "../../state/localazy-identity";
|
|
17
|
-
import LocalazyUserService from "../../modules/user/services/localazy-user-service";
|
|
18
|
-
import LoginButton from "../../modules/login/components/LoginButton";
|
|
19
|
-
import redirectToPluginRoute, {
|
|
20
|
-
PLUGIN_ROUTES,
|
|
21
|
-
} from "../../modules/@common/utils/redirect-to-plugin-route";
|
|
22
|
-
import ProductAnalyticsService from "../../modules/@common/services/product-analytics-service";
|
|
23
|
-
|
|
24
|
-
function Login(props) {
|
|
25
|
-
const history = useHistory();
|
|
26
|
-
const { t } = useTranslation();
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Localazy Strapi documentation link
|
|
30
|
-
*/
|
|
31
|
-
const localazyStrapiDocsLink = "https://localazy.com/docs/strapi";
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Handle fetched identity on login
|
|
35
|
-
* @param result fetched identity
|
|
36
|
-
*/
|
|
37
|
-
const onLoginResultFetched = async (result) => {
|
|
38
|
-
await LocalazyUserService.updateIdentity(result);
|
|
39
|
-
setLocalazyIdentity(result);
|
|
40
|
-
|
|
41
|
-
if (result.accessToken) {
|
|
42
|
-
// track user login
|
|
43
|
-
ProductAnalyticsService.trackAppConnected(
|
|
44
|
-
result.user.id,
|
|
45
|
-
result.project,
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
redirectToPluginRoute(PLUGIN_ROUTES.DOWNLOAD, history);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<>
|
|
54
|
-
<HeaderLayout
|
|
55
|
-
title={props.title}
|
|
56
|
-
subtitle={props.subtitle}
|
|
57
|
-
as="h1"
|
|
58
|
-
/>
|
|
59
|
-
{props.isLoading && (<Loader>{t("common.loading_content")}</Loader>)}
|
|
60
|
-
{!props.isLoading && (
|
|
61
|
-
<Box
|
|
62
|
-
marginLeft={10}
|
|
63
|
-
marginRight={10}
|
|
64
|
-
background="neutral0"
|
|
65
|
-
paddingTop={6}
|
|
66
|
-
paddingRight={7}
|
|
67
|
-
paddingBottom={6}
|
|
68
|
-
paddingLeft={7}
|
|
69
|
-
hasRadius
|
|
70
|
-
shadow="tableShadow"
|
|
71
|
-
>
|
|
72
|
-
<Box>
|
|
73
|
-
<Typography variant="epsilon" textColor="neutral600">
|
|
74
|
-
{t("common.localazy_plugin_description")}
|
|
75
|
-
<br />
|
|
76
|
-
{t("login.login_and_start_translating_your_project")}
|
|
77
|
-
<br />
|
|
78
|
-
<br />
|
|
79
|
-
{t("login.you_have_to_own_account_for_the_plugin_to_work_properly")}
|
|
80
|
-
</Typography>
|
|
81
|
-
</Box>
|
|
82
|
-
<Box paddingTop={6}>
|
|
83
|
-
<LoginButton onResultFetched={onLoginResultFetched} />
|
|
84
|
-
</Box>
|
|
85
|
-
<Box paddingTop={6}>
|
|
86
|
-
<Link href={localazyStrapiDocsLink} isExternal>
|
|
87
|
-
<Typography variant="sigma" textColor="primary600">
|
|
88
|
-
{t("login.read_the_documentation")}
|
|
89
|
-
</Typography>
|
|
90
|
-
</Link>
|
|
91
|
-
</Box>
|
|
92
|
-
</Box>
|
|
93
|
-
)
|
|
94
|
-
}
|
|
95
|
-
</>
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
Login.propTypes = {
|
|
100
|
-
title: PropTypes.string.isRequired,
|
|
101
|
-
subtitle: PropTypes.string.isRequired,
|
|
102
|
-
isLoading: PropTypes.bool,
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
Login.defaultProps = {
|
|
106
|
-
isLoading: false,
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export default Login;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
import { Box } from "@strapi/design-system/Box";
|
|
3
|
-
import { Switch, Route } from "react-router-dom";
|
|
4
|
-
import { ThemeProvider } from "@strapi/design-system/ThemeProvider";
|
|
5
|
-
import { lightTheme } from "@strapi/design-system/themes";
|
|
6
|
-
import { useTranslation } from "react-i18next";
|
|
7
|
-
import pluginId from "../../pluginId";
|
|
8
|
-
import ContentTransferSetup from "../../modules/plugin-settings/components/ContentTransferSetup";
|
|
9
|
-
import GlobalSettings from "../../modules/plugin-settings/components/GlobalSettings";
|
|
10
|
-
import LocalazyUserService from "../../modules/user/services/localazy-user-service";
|
|
11
|
-
import { setLocalazyIdentity } from "../../state/localazy-identity";
|
|
12
|
-
import Loader from "../../modules/@common/components/PluginPageLoader";
|
|
13
|
-
|
|
14
|
-
function PluginSettings() {
|
|
15
|
-
/**
|
|
16
|
-
* Translation function
|
|
17
|
-
*/
|
|
18
|
-
const { t } = useTranslation();
|
|
19
|
-
|
|
20
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
async function fetchData() {
|
|
24
|
-
setIsLoading(true);
|
|
25
|
-
|
|
26
|
-
const identity = await LocalazyUserService.getIdentity();
|
|
27
|
-
setLocalazyIdentity(identity);
|
|
28
|
-
|
|
29
|
-
setIsLoading(false);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
fetchData();
|
|
33
|
-
}, []);
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<>
|
|
37
|
-
{isLoading && <Loader>{t("common.loading_content")}</Loader>}
|
|
38
|
-
{!isLoading && (
|
|
39
|
-
<ThemeProvider theme={lightTheme}>
|
|
40
|
-
<Box padding={8}>
|
|
41
|
-
<Switch>
|
|
42
|
-
<Route path={`/settings/${pluginId}/content-transfer-setup`} exact>
|
|
43
|
-
<ContentTransferSetup />
|
|
44
|
-
</Route>
|
|
45
|
-
<Route path={`/settings/${pluginId}/global-settings`} exact>
|
|
46
|
-
<GlobalSettings />
|
|
47
|
-
</Route>
|
|
48
|
-
</Switch>
|
|
49
|
-
</Box>
|
|
50
|
-
</ThemeProvider>
|
|
51
|
-
)}
|
|
52
|
-
</>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export default PluginSettings;
|