@localazy/strapi-plugin 0.2.13 → 1.0.0-beta.1
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,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* Initializer
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { useEffect, useRef } from "react";
|
|
8
|
-
import PropTypes from "prop-types";
|
|
9
|
-
import pluginId from "../../pluginId";
|
|
10
|
-
|
|
11
|
-
function Initializer({ setPlugin }) {
|
|
12
|
-
const ref = useRef();
|
|
13
|
-
ref.current = setPlugin;
|
|
14
|
-
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
ref.current(pluginId);
|
|
17
|
-
}, []);
|
|
18
|
-
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
Initializer.propTypes = {
|
|
23
|
-
setPlugin: PropTypes.func.isRequired,
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default Initializer;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
LOCALAZY_OAUTH_URL: "https://testing.localazy.com/oauth/authorize",
|
|
3
|
-
LOCALAZY_OAUTH_APP_CLIENT_ID: "18503917571895066466",
|
|
4
|
-
LOCALAZY_PLUGIN_CONNECTOR_API_URL: "https://testing.localazy.com/plugin-connector",
|
|
5
|
-
LOCALAZY_PUBLIC_API_URL: "https://testing.localazy.com/pubapi",
|
|
6
|
-
LOCALAZY_PLUGIN_ID: "1",
|
|
7
|
-
LOCALAZY_DEFAULT_FILE_NAME: "strapi.json",
|
|
8
|
-
LOCALAZY_DEFAULT_FILE_PATH: "",
|
|
9
|
-
LOCALAZY_DEFAULT_FILE_EXTENSION: "json",
|
|
10
|
-
LOCALAZY_DEFAULT_LOCALE: "en",
|
|
11
|
-
LOCALAZY_API_USER_JWT_COOKIE_NAME: "LOCALAZY-API-USER-JWT",
|
|
12
|
-
LOCALAZY_API_USER_COOKIE_EXPIRATION: 7,
|
|
13
|
-
LOCALAZY_PUBLIC_API_LIFTED_LIMITS: true,
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
LOCALAZY_OAUTH_URL: "",
|
|
3
|
-
LOCALAZY_OAUTH_APP_CLIENT_ID: "",
|
|
4
|
-
LOCALAZY_PLUGIN_CONNECTOR_API_URL: "",
|
|
5
|
-
LOCALAZY_PUBLIC_API_URL: "",
|
|
6
|
-
LOCALAZY_PLUGIN_ID: "",
|
|
7
|
-
LOCALAZY_DEFAULT_FILE_NAME: "",
|
|
8
|
-
LOCALAZY_DEFAULT_FILE_PATH: "",
|
|
9
|
-
LOCALAZY_DEFAULT_FILE_EXTENSION: "",
|
|
10
|
-
LOCALAZY_DEFAULT_LOCALE: "",
|
|
11
|
-
LOCALAZY_API_USER_JWT_COOKIE_NAME: "",
|
|
12
|
-
LOCALAZY_API_USER_COOKIE_EXPIRATION: -1,
|
|
13
|
-
LOCALAZY_PUBLIC_API_LIFTED_LIMITS: false,
|
|
14
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import production from "./production/index";
|
|
2
|
-
import local from "./local/index";
|
|
3
|
-
import development from "./development/index";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// depending on the STRAPI_ADMIN_LOCALAZY_ENV, use the correct config
|
|
7
|
-
let config = production;
|
|
8
|
-
|
|
9
|
-
if (process.env.STRAPI_ADMIN_LOCALAZY_ENV === "local") {
|
|
10
|
-
config = local;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (process.env.STRAPI_ADMIN_LOCALAZY_ENV === "development") {
|
|
14
|
-
config = development;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export default {
|
|
18
|
-
...config,
|
|
19
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
LOCALAZY_OAUTH_URL: "https://testing.localazy.com/oauth/authorize",
|
|
3
|
-
LOCALAZY_OAUTH_APP_CLIENT_ID: "18503917571895066465",
|
|
4
|
-
LOCALAZY_PLUGIN_CONNECTOR_API_URL: "http://localhost:3000",
|
|
5
|
-
LOCALAZY_PUBLIC_API_URL: "https://testing.localazy.com/pubapi",
|
|
6
|
-
LOCALAZY_PLUGIN_ID: "1",
|
|
7
|
-
LOCALAZY_DEFAULT_FILE_NAME: "strapi.json",
|
|
8
|
-
LOCALAZY_DEFAULT_FILE_PATH: "",
|
|
9
|
-
LOCALAZY_DEFAULT_FILE_EXTENSION: "json",
|
|
10
|
-
LOCALAZY_DEFAULT_LOCALE: "en",
|
|
11
|
-
LOCALAZY_API_USER_JWT_COOKIE_NAME: "LOCALAZY-API-USER-JWT",
|
|
12
|
-
LOCALAZY_API_USER_COOKIE_EXPIRATION: 7,
|
|
13
|
-
LOCALAZY_PUBLIC_API_LIFTED_LIMITS: false,
|
|
14
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
LOCALAZY_OAUTH_URL: "https://localazy.com/oauth/authorize",
|
|
3
|
-
LOCALAZY_OAUTH_APP_CLIENT_ID: "18395772851999073783",
|
|
4
|
-
LOCALAZY_PLUGIN_CONNECTOR_API_URL:
|
|
5
|
-
"https://plugins.localazy.com/generic-connector",
|
|
6
|
-
LOCALAZY_PUBLIC_API_URL: "https://api.localazy.com",
|
|
7
|
-
LOCALAZY_PLUGIN_ID: "1",
|
|
8
|
-
LOCALAZY_DEFAULT_FILE_NAME: "strapi.json",
|
|
9
|
-
LOCALAZY_DEFAULT_FILE_PATH: "",
|
|
10
|
-
LOCALAZY_DEFAULT_FILE_EXTENSION: "json",
|
|
11
|
-
LOCALAZY_DEFAULT_LOCALE: "en",
|
|
12
|
-
LOCALAZY_API_USER_JWT_COOKIE_NAME: "LOCALAZY-API-USER-JWT",
|
|
13
|
-
LOCALAZY_API_USER_COOKIE_EXPIRATION: 7,
|
|
14
|
-
LOCALAZY_PUBLIC_API_LIFTED_LIMITS: true,
|
|
15
|
-
};
|
package/admin/src/i18n.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import i18n from "i18next";
|
|
2
|
-
import { initReactI18next } from "react-i18next";
|
|
3
|
-
|
|
4
|
-
import en_common from "./modules/@common/locale/en";
|
|
5
|
-
import en_login from "./modules/login/locale/en";
|
|
6
|
-
import en_settings from "./modules/settings/locale/en";
|
|
7
|
-
import en_download from "./modules/localazy-download/locale/en";
|
|
8
|
-
import en_upload from "./modules/localazy-upload/locale/en";
|
|
9
|
-
import en_plugin_settings from "./modules/plugin-settings/locale/en";
|
|
10
|
-
|
|
11
|
-
const initI18nParams = () => {
|
|
12
|
-
return {
|
|
13
|
-
debug: false, // set `true` to see more logs
|
|
14
|
-
fallbackLng: "en",
|
|
15
|
-
interpolation: {
|
|
16
|
-
escapeValue: false, // not needed for react as it escapes by default
|
|
17
|
-
},
|
|
18
|
-
resources: {
|
|
19
|
-
en: {
|
|
20
|
-
translation: {
|
|
21
|
-
common: en_common,
|
|
22
|
-
login: en_login,
|
|
23
|
-
settings: en_settings,
|
|
24
|
-
download: en_download,
|
|
25
|
-
upload: en_upload,
|
|
26
|
-
plugin_settings: en_plugin_settings,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
i18n
|
|
34
|
-
// detect user language
|
|
35
|
-
// pass the i18n instance to react-i18next.
|
|
36
|
-
.use(initReactI18next)
|
|
37
|
-
// init i18next
|
|
38
|
-
// for all options read: https://www.i18next.com/overview/configuration-options
|
|
39
|
-
.init(initI18nParams());
|
|
40
|
-
|
|
41
|
-
export default i18n;
|
package/admin/src/index.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { prefixPluginTranslations } from "@strapi/helper-plugin";
|
|
2
|
-
import pluginPkg from "../../package.json";
|
|
3
|
-
import pluginId from "./pluginId";
|
|
4
|
-
import Initializer from "./components/Initializer";
|
|
5
|
-
import PluginIcon from "./components/PluginIcon";
|
|
6
|
-
|
|
7
|
-
const name = pluginPkg.strapi.name;
|
|
8
|
-
const upperCaseName = name.charAt(0).toUpperCase() + name.slice(1);
|
|
9
|
-
const SETTINGS_SETUP = [
|
|
10
|
-
{
|
|
11
|
-
sectionId: `${pluginId}-settings`,
|
|
12
|
-
intlId: `localazy_settings`,
|
|
13
|
-
sectionDefaultLabel: "Localazy Settings",
|
|
14
|
-
links: [
|
|
15
|
-
{
|
|
16
|
-
linkId: `${pluginId}-settings-global`,
|
|
17
|
-
intlId: `general`,
|
|
18
|
-
defaultLabel: "Global Settings",
|
|
19
|
-
to: `/settings/${pluginId}/global-settings`,
|
|
20
|
-
Component: async () => {
|
|
21
|
-
const component = await import("./pages/PluginSettings");
|
|
22
|
-
|
|
23
|
-
return component;
|
|
24
|
-
},
|
|
25
|
-
permissions: [
|
|
26
|
-
// TODO: only allow access to this page if the user has the right permissions
|
|
27
|
-
],
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
linkId: `${pluginId}-settings-content-transfer-setup`,
|
|
31
|
-
intlId: `content_transfer_setup`,
|
|
32
|
-
defaultLabel: "Content Transfer Setup",
|
|
33
|
-
to: `/settings/${pluginId}/content-transfer-setup`,
|
|
34
|
-
Component: async () => {
|
|
35
|
-
const component = await import("./pages/PluginSettings");
|
|
36
|
-
|
|
37
|
-
return component;
|
|
38
|
-
},
|
|
39
|
-
permissions: [
|
|
40
|
-
// TODO: only allow access to this page if the user has the right permissions
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
},
|
|
45
|
-
];
|
|
46
|
-
|
|
47
|
-
export default {
|
|
48
|
-
register(app) {
|
|
49
|
-
app.addMenuLink({
|
|
50
|
-
to: `/plugins/${pluginId}`,
|
|
51
|
-
icon: PluginIcon,
|
|
52
|
-
intlLabel: {
|
|
53
|
-
id: `${pluginId}.plugin.name`,
|
|
54
|
-
defaultMessage: upperCaseName,
|
|
55
|
-
},
|
|
56
|
-
Component: async () => {
|
|
57
|
-
try {
|
|
58
|
-
const component = await import("./pages/Index");
|
|
59
|
-
|
|
60
|
-
return component;
|
|
61
|
-
} catch (e) {
|
|
62
|
-
console.error(e);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return null;
|
|
66
|
-
},
|
|
67
|
-
permissions: [
|
|
68
|
-
// Uncomment to set the permissions of the plugin here
|
|
69
|
-
// {
|
|
70
|
-
// action: '', // the action name should be plugin::plugin-name.actionType
|
|
71
|
-
// subject: null,
|
|
72
|
-
// },
|
|
73
|
-
],
|
|
74
|
-
});
|
|
75
|
-
app.createSettingSection(
|
|
76
|
-
{
|
|
77
|
-
id: SETTINGS_SETUP[0].sectionId,
|
|
78
|
-
intlLabel: {
|
|
79
|
-
id: SETTINGS_SETUP[0].intlId,
|
|
80
|
-
defaultMessage: SETTINGS_SETUP[0].sectionDefaultLabel,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
[
|
|
84
|
-
// General
|
|
85
|
-
{
|
|
86
|
-
id: SETTINGS_SETUP[0].links[0].linkId,
|
|
87
|
-
intlLabel: {
|
|
88
|
-
id: SETTINGS_SETUP[0].links[0].intlId,
|
|
89
|
-
defaultMessage: SETTINGS_SETUP[0].links[0].defaultLabel,
|
|
90
|
-
},
|
|
91
|
-
to: SETTINGS_SETUP[0].links[0].to,
|
|
92
|
-
Component: SETTINGS_SETUP[0].links[0].Component,
|
|
93
|
-
permissions: SETTINGS_SETUP[0].links[0].permissions,
|
|
94
|
-
},
|
|
95
|
-
// Content Transfer Setup
|
|
96
|
-
{
|
|
97
|
-
id: SETTINGS_SETUP[0].links[1].linkId,
|
|
98
|
-
intlLabel: {
|
|
99
|
-
id: SETTINGS_SETUP[0].links[1].intlId,
|
|
100
|
-
defaultMessage: SETTINGS_SETUP[0].links[1].defaultLabel,
|
|
101
|
-
},
|
|
102
|
-
to: SETTINGS_SETUP[0].links[1].to,
|
|
103
|
-
Component: SETTINGS_SETUP[0].links[1].Component,
|
|
104
|
-
permissions: SETTINGS_SETUP[0].links[1].permissions,
|
|
105
|
-
},
|
|
106
|
-
]
|
|
107
|
-
);
|
|
108
|
-
app.registerPlugin({
|
|
109
|
-
id: pluginId,
|
|
110
|
-
initializer: Initializer,
|
|
111
|
-
isReady: false,
|
|
112
|
-
name,
|
|
113
|
-
});
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
bootstrap() { },
|
|
117
|
-
async registerTrads({ locales }) {
|
|
118
|
-
const importedTrads = await Promise.all(
|
|
119
|
-
locales.map((locale) => {
|
|
120
|
-
return import(`./translations/${locale}.json`)
|
|
121
|
-
.then(({ default: data }) => {
|
|
122
|
-
return {
|
|
123
|
-
data: prefixPluginTranslations(data, pluginId),
|
|
124
|
-
locale,
|
|
125
|
-
};
|
|
126
|
-
})
|
|
127
|
-
.catch(() => {
|
|
128
|
-
return {
|
|
129
|
-
data: {},
|
|
130
|
-
locale,
|
|
131
|
-
};
|
|
132
|
-
});
|
|
133
|
-
})
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
return Promise.resolve(importedTrads);
|
|
137
|
-
},
|
|
138
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
function Localazy() {
|
|
4
|
-
return (
|
|
5
|
-
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
-
<path d="M16.4517 2.56643L16.3247 2.87501L15.5632 4.67576H7.49071C7.18595 4.67576 6.98278 4.98434 7.1013 5.26333L9.05259 9.91314C9.12031 10.0695 9.27269 10.171 9.442 10.171H12.6211C12.9216 10.171 13.1247 10.4753 13.0147 10.7501L12.8919 11.046L12.1353 12.8468H10.9192C10.6187 12.8468 10.4113 13.1553 10.5298 13.4343L13.8229 21.2925C13.9626 21.6265 13.7171 21.9942 13.353 21.9942H11.3256C11.1224 21.9942 10.9362 21.8716 10.8557 21.6814L3.1056 3.17091C2.8728 2.61293 3.27915 2 3.88443 2H16.0538C16.3501 2 16.5533 2.29167 16.4517 2.56643Z" />
|
|
7
|
-
<path d="M17.2937 13.5315L21.0354 4.63345C21.2724 4.07548 20.8619 3.45832 20.2566 3.46255L17.2267 3.46255L16.4794 5.23793C16.4794 5.24638 16.4752 5.25484 16.4709 5.26329L16.4709 5.26329L16.3482 5.55074C16.2297 5.82973 16.4371 6.1383 16.7376 6.1383H16.8069C17.1074 6.1383 17.3148 6.44688 17.1963 6.72587L15.2408 11.3757C15.1773 11.5321 15.0207 11.6335 14.8514 11.6335H13.7902L12.9112 13.7217C12.7927 14.0007 13.0001 14.3093 13.3006 14.3093H16.1212C16.6334 14.3093 17.0947 14.0007 17.2937 13.5315Z" />
|
|
8
|
-
</svg>
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default Localazy;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/* eslint-disable react/require-default-props */
|
|
2
|
-
import React, { useEffect, useState } from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import cloneDeep from "lodash-es/cloneDeep";
|
|
6
|
-
import { Select, Option } from '@strapi/design-system/Select';
|
|
7
|
-
|
|
8
|
-
function LanguagesSelector(props) {
|
|
9
|
-
/**
|
|
10
|
-
* Translation function
|
|
11
|
-
*/
|
|
12
|
-
const { t } = useTranslation();
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Selected languages
|
|
16
|
-
*/
|
|
17
|
-
const [selectedLanguages, setSelectedLanguages] = useState([]);
|
|
18
|
-
|
|
19
|
-
const onChange = (values) => {
|
|
20
|
-
setSelectedLanguages(values);
|
|
21
|
-
props.onChange(cloneDeep(values));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
const existingPreselectedLanguages =
|
|
26
|
-
props.projectLanguages
|
|
27
|
-
.filter(lang => props.preselectedLanguages.includes(lang.code))
|
|
28
|
-
.map(lang => lang.code);
|
|
29
|
-
|
|
30
|
-
setSelectedLanguages(existingPreselectedLanguages);
|
|
31
|
-
}, [props.projectLanguages, props.preselectedLanguages]);
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<Select
|
|
35
|
-
label={props.label || t("common.select_languages")}
|
|
36
|
-
hint={props.hint || t("common.select_languages")}
|
|
37
|
-
clearLabel={t("plugin_settings.clear")}
|
|
38
|
-
placeholder={props.placeholder || t("common.select_languages")}
|
|
39
|
-
onClear={() => setSelectedLanguages([])}
|
|
40
|
-
value={selectedLanguages || []}
|
|
41
|
-
onChange={(values) => onChange(values)}
|
|
42
|
-
multi
|
|
43
|
-
withTags
|
|
44
|
-
>
|
|
45
|
-
{props.projectLanguages.map(lang => (
|
|
46
|
-
<Option
|
|
47
|
-
key={lang.id}
|
|
48
|
-
value={lang.code}
|
|
49
|
-
>
|
|
50
|
-
{`${lang.name} (${lang.code})`}
|
|
51
|
-
</Option>
|
|
52
|
-
))}
|
|
53
|
-
</Select>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
LanguagesSelector.propTypes = {
|
|
58
|
-
label: PropTypes.string,
|
|
59
|
-
hint: PropTypes.string,
|
|
60
|
-
placeholder: PropTypes.string,
|
|
61
|
-
projectLanguages: PropTypes.array.isRequired,
|
|
62
|
-
preselectedLanguages: PropTypes.array.isRequired,
|
|
63
|
-
onChange: PropTypes.func.isRequired,
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export default LanguagesSelector;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Flex } from '@strapi/design-system/Flex';
|
|
3
|
-
import { Loader } from "@strapi/design-system/Loader";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
|
|
6
|
-
function PluginPageLoader() {
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<Flex
|
|
11
|
-
marginTop={10}
|
|
12
|
-
alignItems="center"
|
|
13
|
-
justifyContent="center"
|
|
14
|
-
>
|
|
15
|
-
<Loader>{t("common.loading_content")}</Loader>
|
|
16
|
-
</Flex>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export default PluginPageLoader;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* SideNav
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from "react";
|
|
8
|
-
import {
|
|
9
|
-
SubNav,
|
|
10
|
-
SubNavHeader,
|
|
11
|
-
SubNavSection,
|
|
12
|
-
SubNavSections,
|
|
13
|
-
SubNavLink,
|
|
14
|
-
} from "@strapi/design-system/SubNav";
|
|
15
|
-
import { useTranslation } from "react-i18next";
|
|
16
|
-
import { NavLink } from "react-router-dom";
|
|
17
|
-
import getNav from "../../utils/get-nav";
|
|
18
|
-
|
|
19
|
-
function SideNav() {
|
|
20
|
-
const { t } = useTranslation();
|
|
21
|
-
|
|
22
|
-
const navigation = getNav();
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<SubNav ariaLabel={t("common.localazy_plugin")}>
|
|
26
|
-
<SubNavHeader label={t("common.localazy_plugin")} />
|
|
27
|
-
<SubNavSections>
|
|
28
|
-
<SubNavSection label={t("common.navigation")}>
|
|
29
|
-
{navigation.map((navItem) => (
|
|
30
|
-
<SubNavLink
|
|
31
|
-
as={NavLink}
|
|
32
|
-
to={navItem.to}
|
|
33
|
-
active={navItem.active}
|
|
34
|
-
icon={navItem.icon || ""}
|
|
35
|
-
key={navItem.id}
|
|
36
|
-
>
|
|
37
|
-
{navItem.label}
|
|
38
|
-
</SubNavLink>
|
|
39
|
-
))}
|
|
40
|
-
</SubNavSection>
|
|
41
|
-
</SubNavSections>
|
|
42
|
-
</SubNav>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default SideNav;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import { Alert } from "@strapi/design-system/Alert";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { Box } from "@strapi/design-system/Box";
|
|
6
|
-
|
|
7
|
-
function TransferReport(props) {
|
|
8
|
-
const { t } = useTranslation();
|
|
9
|
-
|
|
10
|
-
const [reportLocal, setReportLocal] = useState(props.report);
|
|
11
|
-
|
|
12
|
-
const onCloseItem = (index) => {
|
|
13
|
-
const newReportLocal = reportLocal;
|
|
14
|
-
newReportLocal.splice(index, 1);
|
|
15
|
-
|
|
16
|
-
setReportLocal([...newReportLocal]);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
setReportLocal(props.report);
|
|
21
|
-
}, [props.report]);
|
|
22
|
-
|
|
23
|
-
if (!reportLocal) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
reportLocal.map((item, index) => {
|
|
29
|
-
return (
|
|
30
|
-
<Box
|
|
31
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
32
|
-
key={item}
|
|
33
|
-
marginTop={4}
|
|
34
|
-
marginBottom={4}
|
|
35
|
-
>
|
|
36
|
-
<Alert
|
|
37
|
-
key={item}
|
|
38
|
-
onClose={() => onCloseItem(index)}
|
|
39
|
-
closeLabel={t("upload.close")}
|
|
40
|
-
variant="default"
|
|
41
|
-
>
|
|
42
|
-
{item}
|
|
43
|
-
</Alert>
|
|
44
|
-
</Box>)
|
|
45
|
-
})
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
TransferReport.propTypes = {
|
|
50
|
-
report: PropTypes.array.isRequired,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export default TransferReport;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
localazy_plugin: "Localazy",
|
|
3
|
-
localazy_plugin_hand: "Localazy 👋",
|
|
4
|
-
localazy_plugin_description: "An official Strapi plugin by Localazy.",
|
|
5
|
-
navigation: "Navigation",
|
|
6
|
-
upload_to_localazy: "Upload to Localazy",
|
|
7
|
-
download_to_strapi: "Download to Strapi",
|
|
8
|
-
settings: "Overview",
|
|
9
|
-
loading_content: "Loading content...",
|
|
10
|
-
report_will_be_available_after_an_action:
|
|
11
|
-
"Report will be available after performing an action...",
|
|
12
|
-
report: "Report",
|
|
13
|
-
select_languages: "Select languages",
|
|
14
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-useless-catch */
|
|
2
|
-
import createAxiosInstance from "../../../utils/createAxiosInstance";
|
|
3
|
-
|
|
4
|
-
const axiosInstance = createAxiosInstance("/i18n");
|
|
5
|
-
export default class I18nService {
|
|
6
|
-
static async getLocales() {
|
|
7
|
-
try {
|
|
8
|
-
const result = await axiosInstance.get(`/locales`);
|
|
9
|
-
|
|
10
|
-
return result.data;
|
|
11
|
-
} catch (e) {
|
|
12
|
-
throw e;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-useless-catch */
|
|
2
|
-
import createAxiosInstance from "../../../utils/createAxiosInstance";
|
|
3
|
-
|
|
4
|
-
const axiosInstance = createAxiosInstance();
|
|
5
|
-
|
|
6
|
-
export default class PluginService {
|
|
7
|
-
static async getPluginVersion() {
|
|
8
|
-
try {
|
|
9
|
-
const result = await axiosInstance.get("/strapi/version");
|
|
10
|
-
|
|
11
|
-
return result.data;
|
|
12
|
-
} catch (e) {
|
|
13
|
-
throw e;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import GenericConnectorClient from "../../../plugins/generic-connector-client";
|
|
2
|
-
import PluginService from "./plugin.service";
|
|
3
|
-
|
|
4
|
-
export default class ProductAnalyticsService {
|
|
5
|
-
static async trackAppConnected(userId, project, params = {}) {
|
|
6
|
-
try {
|
|
7
|
-
const data = await this.buildData("Strapi Connected", project, params);
|
|
8
|
-
await GenericConnectorClient.analytics.track({
|
|
9
|
-
event: data.event,
|
|
10
|
-
data: {
|
|
11
|
-
...data.data,
|
|
12
|
-
userId,
|
|
13
|
-
orgId: project.orgId,
|
|
14
|
-
category: "Project",
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
} catch (e) {
|
|
18
|
-
console.warn(e);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static async trackAppDisconnected(userId, project, params = {}) {
|
|
23
|
-
try {
|
|
24
|
-
const data = await this.buildData("Strapi Disconnected", project, params);
|
|
25
|
-
await GenericConnectorClient.analytics.track({
|
|
26
|
-
event: data.event,
|
|
27
|
-
data: {
|
|
28
|
-
...data.data,
|
|
29
|
-
userId,
|
|
30
|
-
orgId: project.orgId,
|
|
31
|
-
category: "Project",
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
} catch (e) {
|
|
35
|
-
console.warn(e);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static async trackUploadToLocalazy(userId, project, params = {}) {
|
|
40
|
-
try {
|
|
41
|
-
const data = await this.buildData("Strapi Upload", project, params);
|
|
42
|
-
await GenericConnectorClient.analytics.track({
|
|
43
|
-
event: data.event,
|
|
44
|
-
data: {
|
|
45
|
-
...data.data,
|
|
46
|
-
userId,
|
|
47
|
-
orgId: project.orgId,
|
|
48
|
-
category: "Project",
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
} catch (e) {
|
|
52
|
-
console.warn(e);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
static async trackDownloadToStrapi(userId, project, params = {}) {
|
|
57
|
-
try {
|
|
58
|
-
const data = await this.buildData("Strapi Download", project, params);
|
|
59
|
-
await GenericConnectorClient.analytics.track({
|
|
60
|
-
event: data.event,
|
|
61
|
-
data: {
|
|
62
|
-
...data.data,
|
|
63
|
-
userId,
|
|
64
|
-
orgId: project.orgId,
|
|
65
|
-
category: "Project",
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
} catch (e) {
|
|
69
|
-
console.warn(e);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
static async buildData(event, project, params) {
|
|
74
|
-
const { version } = await PluginService.getPluginVersion();
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
event,
|
|
78
|
-
data: {
|
|
79
|
-
"Project Id": project.id,
|
|
80
|
-
"Project Name": project.name,
|
|
81
|
-
version,
|
|
82
|
-
...params,
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-useless-catch */
|
|
2
|
-
import createAxiosInstance from "../../../utils/createAxiosInstance";
|
|
3
|
-
|
|
4
|
-
const axiosInstance = createAxiosInstance();
|
|
5
|
-
export default class ProjectService {
|
|
6
|
-
static async getConnectedProject() {
|
|
7
|
-
try {
|
|
8
|
-
const result = await axiosInstance.get(`/project`);
|
|
9
|
-
|
|
10
|
-
return result.data;
|
|
11
|
-
} catch (e) {
|
|
12
|
-
throw e;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|