cozy-ui-plus 1.1.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/CHANGELOG.md +10 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/babel.config.js +24 -0
- package/dist/AppIcon/index.js +265 -0
- package/dist/AppLinker/index.js +159 -0
- package/dist/AppLinker/native.config.js +8 -0
- package/dist/AppLinker/native.js +81 -0
- package/dist/AppSections/Sections.js +461 -0
- package/dist/AppSections/_mockApps.js +210 -0
- package/dist/AppSections/_testApps.js +162 -0
- package/dist/AppSections/categories.js +183 -0
- package/dist/AppSections/components/AppsSection.js +112 -0
- package/dist/AppSections/components/DropdownFilter.js +101 -0
- package/dist/AppSections/constants.js +16 -0
- package/dist/AppSections/generateI18nConfig.js +37 -0
- package/dist/AppSections/helpers.js +28 -0
- package/dist/AppSections/index.js +24 -0
- package/dist/AppSections/search.js +161 -0
- package/dist/AppTile/helpers.js +41 -0
- package/dist/AppTile/index.js +171 -0
- package/dist/CipherIcon/index.js +102 -0
- package/dist/CollectionField/index.js +166 -0
- package/dist/ContactPicker/index.js +129 -0
- package/dist/Contacts/AddModal/ContactAddressDialog/helpers.js +31 -0
- package/dist/Contacts/AddModal/ContactAddressDialog/index.js +106 -0
- package/dist/Contacts/AddModal/ContactAddressDialog/locales/index.js +113 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInput.js +164 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInputAccordion.js +91 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInputArray.js +105 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInputLayout.js +98 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInputWrapper.js +51 -0
- package/dist/Contacts/AddModal/ContactForm/HasValueCondition.js +44 -0
- package/dist/Contacts/AddModal/ContactForm/RelatedContactList.js +55 -0
- package/dist/Contacts/AddModal/ContactForm/TextFieldCustomLabelSelect.js +104 -0
- package/dist/Contacts/AddModal/ContactForm/TextFieldSelect.js +59 -0
- package/dist/Contacts/AddModal/ContactForm/contactToFormValues.js +119 -0
- package/dist/Contacts/AddModal/ContactForm/fieldsConfig.js +314 -0
- package/dist/Contacts/AddModal/ContactForm/formValuesToContact.js +110 -0
- package/dist/Contacts/AddModal/ContactForm/helpers.js +466 -0
- package/dist/Contacts/AddModal/ContactForm/index.js +184 -0
- package/dist/Contacts/AddModal/ContactForm/locales/index.js +313 -0
- package/dist/Contacts/AddModal/CustomLabelDialog/index.js +138 -0
- package/dist/Contacts/AddModal/CustomLabelDialog/locales/index.js +73 -0
- package/dist/Contacts/AddModal/index.js +134 -0
- package/dist/Contacts/AddModal/locales/index.js +65 -0
- package/dist/Contacts/AddModal/mocks.js +265 -0
- package/dist/Contacts/AddModal/types.js +110 -0
- package/dist/Contacts/GroupsSelect/GroupCreation.js +157 -0
- package/dist/Contacts/GroupsSelect/GroupsSelect.js +207 -0
- package/dist/Contacts/GroupsSelect/GroupsSelectProvider.js +60 -0
- package/dist/Contacts/GroupsSelect/SelectBox/Control.js +54 -0
- package/dist/Contacts/GroupsSelect/SelectBox/EditGroupName.js +89 -0
- package/dist/Contacts/GroupsSelect/SelectBox/Menu.js +49 -0
- package/dist/Contacts/GroupsSelect/SelectBox/Option.js +80 -0
- package/dist/Contacts/GroupsSelect/SelectBox/SelectContainer.js +25 -0
- package/dist/Contacts/GroupsSelect/helpers.js +45 -0
- package/dist/Contacts/GroupsSelect/locales/index.js +97 -0
- package/dist/Contacts/GroupsSelect/useGroupSelect.js +196 -0
- package/dist/Contacts/Header/GroupsSelection.js +101 -0
- package/dist/Contacts/Header/ImportDropdown.js +115 -0
- package/dist/Contacts/Header/SearchInput.js +40 -0
- package/dist/Contacts/Header/index.js +93 -0
- package/dist/Contacts/Header/locales/index.js +73 -0
- package/dist/ContactsList/ContactCell.js +45 -0
- package/dist/ContactsList/ContactRow.js +84 -0
- package/dist/ContactsList/Contacts/ContactCozy.js +44 -0
- package/dist/ContactsList/Contacts/ContactEmail.js +44 -0
- package/dist/ContactsList/Contacts/ContactIdentity.js +86 -0
- package/dist/ContactsList/Contacts/ContactName.js +48 -0
- package/dist/ContactsList/Contacts/ContactPhone.js +44 -0
- package/dist/ContactsList/ContactsList.js +74 -0
- package/dist/ContactsList/helpers.js +156 -0
- package/dist/ContactsList/index.js +13 -0
- package/dist/ContactsList/locales/withContactsListLocales.js +42 -0
- package/dist/ContactsListModal/AddContact/AddContactActions.js +32 -0
- package/dist/ContactsListModal/AddContact/AddContactContent.js +85 -0
- package/dist/ContactsListModal/AddContact/AddContactDialog.js +63 -0
- package/dist/ContactsListModal/AddContact/AddContactTitle.js +21 -0
- package/dist/ContactsListModal/AddContact/helpers.js +61 -0
- package/dist/ContactsListModal/ContactsListContent.js +88 -0
- package/dist/ContactsListModal/ContactsListModal.js +178 -0
- package/dist/ContactsListModal/ContactsListModalWithQuery.js +44 -0
- package/dist/ContactsListModal/EmptyMessage.js +33 -0
- package/dist/ContactsListModal/MobileHeader.js +67 -0
- package/dist/ContactsListModal/index.js +58 -0
- package/dist/ContactsListModal/mockClient.js +2009 -0
- package/dist/ContactsListModal/queries.js +26 -0
- package/dist/ContactsListModal/withContactsListLocales.js +40 -0
- package/dist/Dialogs/AuthenticationDialogs/index.js +139 -0
- package/dist/Field/index.js +297 -0
- package/dist/FileImageLoader/checkImageSource.js +61 -0
- package/dist/FileImageLoader/index.js +394 -0
- package/dist/FilePicker/FilePickerBody.js +108 -0
- package/dist/FilePicker/FilePickerBodyItem.js +132 -0
- package/dist/FilePicker/FilePickerBreadcrumb.js +74 -0
- package/dist/FilePicker/FilePickerFooter.js +91 -0
- package/dist/FilePicker/FilePickerHeader.js +110 -0
- package/dist/FilePicker/docs/DemoProvider.js +280 -0
- package/dist/FilePicker/helpers.js +57 -0
- package/dist/FilePicker/index.js +125 -0
- package/dist/FilePicker/queries.js +61 -0
- package/dist/Intent/IntentDialogOpener/index.js +142 -0
- package/dist/Intent/IntentIframe/index.js +182 -0
- package/dist/ListItem/ExpandedAttributes/ExpandedAttribute.js +64 -0
- package/dist/ListItem/ExpandedAttributes/helpers.js +263 -0
- package/dist/ListItem/ExpandedAttributes/index.js +90 -0
- package/dist/ListItem/ListItemBase/Renaming/RenameDialog.js +52 -0
- package/dist/ListItem/ListItemBase/Renaming/RenameInput.js +319 -0
- package/dist/ListItem/ListItemBase/Renaming/helpers.js +73 -0
- package/dist/ListItem/ListItemBase/index.js +153 -0
- package/dist/ListItem/ListItemByDoc/index.js +109 -0
- package/dist/ListItem/ListItemContact/helpers.js +39 -0
- package/dist/ListItem/ListItemContact/index.js +87 -0
- package/dist/ListItem/ListItemContact/useActions.js +28 -0
- package/dist/ListItem/ListItemFile/ExpirationAnnotation.js +54 -0
- package/dist/ListItem/ListItemFile/ItemIcon.js +61 -0
- package/dist/ListItem/ListItemFile/PrimaryText.js +47 -0
- package/dist/ListItem/ListItemFile/SecondaryText.js +41 -0
- package/dist/ListItem/ListItemFile/index.js +96 -0
- package/dist/ListItem/hoc/withListItemLocales.js +322 -0
- package/dist/Paywall/MaxAccountsByKonnectorPaywall.js +48 -0
- package/dist/Paywall/MaxAccountsPaywall.js +43 -0
- package/dist/Paywall/MaxDaysToCapturePaywall.js +43 -0
- package/dist/Paywall/MaxPapersPaywall.js +44 -0
- package/dist/Paywall/OnlyOfficePaywall.js +41 -0
- package/dist/Paywall/PasswordSharingPaywall.js +34 -0
- package/dist/Paywall/Paywall.js +205 -0
- package/dist/Paywall/QuotaPaywall.js +32 -0
- package/dist/Paywall/helpers.js +31 -0
- package/dist/Paywall/index.js +63 -0
- package/dist/Paywall/locales/withPaywallLocales.js +401 -0
- package/dist/Qualification/QualificationGrid/helpers.js +16 -0
- package/dist/Qualification/QualificationGrid/index.js +136 -0
- package/dist/Qualification/QualificationGrid/locales/withLocales.js +82 -0
- package/dist/Qualification/QualificationIcon/index.js +156 -0
- package/dist/Qualification/QualificationItem/index.js +87 -0
- package/dist/Qualification/QualificationModal/helpers.js +95 -0
- package/dist/Qualification/QualificationModal/index.js +121 -0
- package/dist/Qualification/QualificationModal/locales/index.js +37 -0
- package/dist/ShortcutTile/index.js +68 -0
- package/dist/SquareAppIcon/index.js +262 -0
- package/dist/Storage/StorageButton.js +54 -0
- package/dist/Storage/StorageProgress.js +68 -0
- package/dist/Storage/index.js +49 -0
- package/dist/Storage/locales/index.js +41 -0
- package/dist/UploadQueue/FileUploadProgress.js +86 -0
- package/dist/UploadQueue/Item.js +132 -0
- package/dist/UploadQueue/Pending.js +23 -0
- package/dist/UploadQueue/RemainingTime.js +59 -0
- package/dist/UploadQueue/helpers.js +13 -0
- package/dist/UploadQueue/index.js +277 -0
- package/dist/UploadQueue/useStatusIcon.js +60 -0
- package/dist/hooks/useClientErrors.js +185 -0
- package/dist/proptypes.js +33 -0
- package/dist/providers/CozyTheme/CozyThemeWithQuery.js +41 -0
- package/dist/providers/CozyTheme/index.js +58 -0
- package/dist/providers/CozyTheme/queries.js +25 -0
- package/dist/providers/DemoProvider.js +49 -0
- package/dist/providers/Intent/index.js +130 -0
- package/dist/src/AppIcon/index.d.ts +50 -0
- package/dist/src/AppIcon/index.spec.d.ts +1 -0
- package/dist/src/AppLinker/index.d.ts +35 -0
- package/dist/src/AppLinker/index.spec.d.ts +1 -0
- package/dist/src/AppLinker/native.config.d.ts +1 -0
- package/dist/src/AppLinker/native.d.ts +6 -0
- package/dist/src/AppLinker/native.spec.d.ts +1 -0
- package/dist/src/AppSections/Sections.d.ts +49 -0
- package/dist/src/AppSections/_mockApps.d.ts +242 -0
- package/dist/src/AppSections/_testApps.d.ts +203 -0
- package/dist/src/AppSections/categories.d.ts +7 -0
- package/dist/src/AppSections/categories.spec.d.ts +1 -0
- package/dist/src/AppSections/components/AppsSection.d.ts +20 -0
- package/dist/src/AppSections/components/AppsSection.spec.d.ts +1 -0
- package/dist/src/AppSections/components/DropdownFilter.d.ts +17 -0
- package/dist/src/AppSections/constants.d.ts +8 -0
- package/dist/src/AppSections/generateI18nConfig.d.ts +4 -0
- package/dist/src/AppSections/helpers.d.ts +2 -0
- package/dist/src/AppSections/helpers.spec.d.ts +1 -0
- package/dist/src/AppSections/index.d.ts +3 -0
- package/dist/src/AppSections/index.spec.d.ts +1 -0
- package/dist/src/AppSections/search.d.ts +3 -0
- package/dist/src/AppSections/search.spec.d.ts +1 -0
- package/dist/src/AppTile/AppTile.spec.d.ts +1 -0
- package/dist/src/AppTile/helpers.d.ts +9 -0
- package/dist/src/AppTile/index.d.ts +33 -0
- package/dist/src/CipherIcon/index.d.ts +2 -0
- package/dist/src/CipherIcon/index.spec.d.ts +1 -0
- package/dist/src/CollectionField/index.d.ts +23 -0
- package/dist/src/ContactPicker/index.d.ts +21 -0
- package/dist/src/Contacts/AddModal/ContactAddressDialog/helpers.d.ts +4 -0
- package/dist/src/Contacts/AddModal/ContactAddressDialog/helpers.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactAddressDialog/index.d.ts +39 -0
- package/dist/src/Contacts/AddModal/ContactAddressDialog/locales/index.d.ts +10 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInput.d.ts +39 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputAccordion.d.ts +12 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputArray.d.ts +14 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputLayout.d.ts +22 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputWrapper.d.ts +19 -0
- package/dist/src/Contacts/AddModal/ContactForm/HasValueCondition.d.ts +18 -0
- package/dist/src/Contacts/AddModal/ContactForm/HasValueCondition.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/RelatedContactList.d.ts +15 -0
- package/dist/src/Contacts/AddModal/ContactForm/TextFieldCustomLabelSelect.d.ts +9 -0
- package/dist/src/Contacts/AddModal/ContactForm/TextFieldSelect.d.ts +5 -0
- package/dist/src/Contacts/AddModal/ContactForm/contactToFormValues.d.ts +6 -0
- package/dist/src/Contacts/AddModal/ContactForm/contactToFormValues.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/fieldsConfig.d.ts +4 -0
- package/dist/src/Contacts/AddModal/ContactForm/formValuesToContact.d.ts +7 -0
- package/dist/src/Contacts/AddModal/ContactForm/formValuesToContact.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/helpers.d.ts +35 -0
- package/dist/src/Contacts/AddModal/ContactForm/helpers.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/index.d.ts +17 -0
- package/dist/src/Contacts/AddModal/ContactForm/index.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/locales/index.d.ts +10 -0
- package/dist/src/Contacts/AddModal/CustomLabelDialog/index.d.ts +22 -0
- package/dist/src/Contacts/AddModal/CustomLabelDialog/locales/index.d.ts +10 -0
- package/dist/src/Contacts/AddModal/index.d.ts +8 -0
- package/dist/src/Contacts/AddModal/locales/index.d.ts +10 -0
- package/dist/src/Contacts/AddModal/mocks.d.ts +276 -0
- package/dist/src/Contacts/AddModal/types.d.ts +188 -0
- package/dist/src/Contacts/GroupsSelect/GroupCreation.d.ts +3 -0
- package/dist/src/Contacts/GroupsSelect/GroupsSelect.d.ts +56 -0
- package/dist/src/Contacts/GroupsSelect/GroupsSelect.spec.d.ts +22 -0
- package/dist/src/Contacts/GroupsSelect/GroupsSelectProvider.d.ts +5 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/Control.d.ts +14 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/EditGroupName.d.ts +7 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/Menu.d.ts +7 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/Option.d.ts +18 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/SelectContainer.d.ts +2 -0
- package/dist/src/Contacts/GroupsSelect/helpers.d.ts +9 -0
- package/dist/src/Contacts/GroupsSelect/locales/index.d.ts +10 -0
- package/dist/src/Contacts/GroupsSelect/useGroupSelect.d.ts +11 -0
- package/dist/src/Contacts/Header/GroupsSelection.d.ts +7 -0
- package/dist/src/Contacts/Header/ImportDropdown.d.ts +4 -0
- package/dist/src/Contacts/Header/SearchInput.d.ts +4 -0
- package/dist/src/Contacts/Header/index.d.ts +26 -0
- package/dist/src/Contacts/Header/locales/index.d.ts +10 -0
- package/dist/src/ContactsList/ContactCell.d.ts +8 -0
- package/dist/src/ContactsList/ContactRow.d.ts +16 -0
- package/dist/src/ContactsList/ContactRow.spec.d.ts +1 -0
- package/dist/src/ContactsList/Contacts/ContactCozy.d.ts +14 -0
- package/dist/src/ContactsList/Contacts/ContactEmail.d.ts +14 -0
- package/dist/src/ContactsList/Contacts/ContactIdentity.d.ts +10 -0
- package/dist/src/ContactsList/Contacts/ContactName.d.ts +10 -0
- package/dist/src/ContactsList/Contacts/ContactPhone.d.ts +14 -0
- package/dist/src/ContactsList/ContactsList.d.ts +2 -0
- package/dist/src/ContactsList/helpers.d.ts +9 -0
- package/dist/src/ContactsList/helpers.spec.d.ts +1 -0
- package/dist/src/ContactsList/index.d.ts +2 -0
- package/dist/src/ContactsList/locales/withContactsListLocales.d.ts +12 -0
- package/dist/src/ContactsListModal/AddContact/AddContactActions.d.ts +2 -0
- package/dist/src/ContactsListModal/AddContact/AddContactContent.d.ts +2 -0
- package/dist/src/ContactsListModal/AddContact/AddContactDialog.d.ts +6 -0
- package/dist/src/ContactsListModal/AddContact/AddContactTitle.d.ts +2 -0
- package/dist/src/ContactsListModal/AddContact/helpers.d.ts +6 -0
- package/dist/src/ContactsListModal/AddContact/helpers.spec.d.ts +1 -0
- package/dist/src/ContactsListModal/ContactsListContent.d.ts +2 -0
- package/dist/src/ContactsListModal/ContactsListModal.d.ts +20 -0
- package/dist/src/ContactsListModal/ContactsListModalWithQuery.d.ts +12 -0
- package/dist/src/ContactsListModal/EmptyMessage.d.ts +2 -0
- package/dist/src/ContactsListModal/MobileHeader.d.ts +16 -0
- package/dist/src/ContactsListModal/index.d.ts +2 -0
- package/dist/src/ContactsListModal/mockClient.d.ts +3 -0
- package/dist/src/ContactsListModal/queries.d.ts +7 -0
- package/dist/src/ContactsListModal/withContactsListLocales.d.ts +7 -0
- package/dist/src/Dialogs/AuthenticationDialogs/index.d.ts +2 -0
- package/dist/src/Field/index.d.ts +53 -0
- package/dist/src/Field/index.spec.d.ts +1 -0
- package/dist/src/FileImageLoader/checkImageSource.d.ts +1 -0
- package/dist/src/FileImageLoader/index.d.ts +45 -0
- package/dist/src/FileImageLoader/index.spec.d.ts +1 -0
- package/dist/src/FilePicker/FilePickerBody.d.ts +19 -0
- package/dist/src/FilePicker/FilePickerBodyItem.d.ts +22 -0
- package/dist/src/FilePicker/FilePickerBodyItem.spec.d.ts +1 -0
- package/dist/src/FilePicker/FilePickerBreadcrumb.d.ts +13 -0
- package/dist/src/FilePicker/FilePickerFooter.d.ts +15 -0
- package/dist/src/FilePicker/FilePickerFooter.spec.d.ts +1 -0
- package/dist/src/FilePicker/FilePickerHeader.d.ts +14 -0
- package/dist/src/FilePicker/docs/DemoProvider.d.ts +23 -0
- package/dist/src/FilePicker/helpers.d.ts +3 -0
- package/dist/src/FilePicker/helpers.spec.d.ts +1 -0
- package/dist/src/FilePicker/index.d.ts +22 -0
- package/dist/src/FilePicker/queries.d.ts +14 -0
- package/dist/src/Intent/IntentDialogOpener/index.d.ts +32 -0
- package/dist/src/Intent/IntentIframe/index.d.ts +8 -0
- package/dist/src/ListItem/ExpandedAttributes/ExpandedAttribute.d.ts +14 -0
- package/dist/src/ListItem/ExpandedAttributes/helpers.d.ts +43 -0
- package/dist/src/ListItem/ExpandedAttributes/helpers.spec.d.ts +1 -0
- package/dist/src/ListItem/ExpandedAttributes/index.d.ts +2 -0
- package/dist/src/ListItem/ListItemBase/Renaming/RenameDialog.d.ts +2 -0
- package/dist/src/ListItem/ListItemBase/Renaming/RenameInput.d.ts +12 -0
- package/dist/src/ListItem/ListItemBase/Renaming/helpers.d.ts +1 -0
- package/dist/src/ListItem/ListItemBase/index.d.ts +2 -0
- package/dist/src/ListItem/ListItemByDoc/index.d.ts +46 -0
- package/dist/src/ListItem/ListItemContact/helpers.d.ts +1 -0
- package/dist/src/ListItem/ListItemContact/helpers.spec.d.ts +1 -0
- package/dist/src/ListItem/ListItemContact/index.d.ts +35 -0
- package/dist/src/ListItem/ListItemContact/useActions.d.ts +2 -0
- package/dist/src/ListItem/ListItemFile/ExpirationAnnotation.d.ts +2 -0
- package/dist/src/ListItem/ListItemFile/ItemIcon.d.ts +12 -0
- package/dist/src/ListItem/ListItemFile/PrimaryText.d.ts +12 -0
- package/dist/src/ListItem/ListItemFile/SecondaryText.d.ts +12 -0
- package/dist/src/ListItem/ListItemFile/index.d.ts +37 -0
- package/dist/src/ListItem/hoc/withListItemLocales.d.ts +12 -0
- package/dist/src/Paywall/MaxAccountsByKonnectorPaywall.d.ts +2 -0
- package/dist/src/Paywall/MaxAccountsPaywall.d.ts +2 -0
- package/dist/src/Paywall/MaxDaysToCapturePaywall.d.ts +2 -0
- package/dist/src/Paywall/MaxPapersPaywall.d.ts +2 -0
- package/dist/src/Paywall/OnlyOfficePaywall.d.ts +16 -0
- package/dist/src/Paywall/PasswordSharingPaywall.d.ts +10 -0
- package/dist/src/Paywall/Paywall.d.ts +2 -0
- package/dist/src/Paywall/Paywall.spec.d.ts +1 -0
- package/dist/src/Paywall/QuotaPaywall.d.ts +13 -0
- package/dist/src/Paywall/helpers.d.ts +1 -0
- package/dist/src/Paywall/index.d.ts +7 -0
- package/dist/src/Paywall/locales/withPaywallLocales.d.ts +2 -0
- package/dist/src/Qualification/QualificationGrid/helpers.d.ts +1 -0
- package/dist/src/Qualification/QualificationGrid/index.d.ts +2 -0
- package/dist/src/Qualification/QualificationGrid/locales/withLocales.d.ts +12 -0
- package/dist/src/Qualification/QualificationIcon/index.d.ts +13 -0
- package/dist/src/Qualification/QualificationItem/index.d.ts +17 -0
- package/dist/src/Qualification/QualificationModal/helpers.d.ts +14 -0
- package/dist/src/Qualification/QualificationModal/helpers.spec.d.ts +1 -0
- package/dist/src/Qualification/QualificationModal/index.d.ts +16 -0
- package/dist/src/Qualification/QualificationModal/locales/index.d.ts +10 -0
- package/dist/src/ShortcutTile/index.d.ts +13 -0
- package/dist/src/SquareAppIcon/SquareAppIcon.spec.d.ts +1 -0
- package/dist/src/SquareAppIcon/index.d.ts +26 -0
- package/dist/src/Storage/StorageButton.d.ts +4 -0
- package/dist/src/Storage/StorageProgress.d.ts +5 -0
- package/dist/src/Storage/index.d.ts +14 -0
- package/dist/src/Storage/locales/index.d.ts +10 -0
- package/dist/src/UploadQueue/FileUploadProgress.d.ts +4 -0
- package/dist/src/UploadQueue/Item.d.ts +3 -0
- package/dist/src/UploadQueue/Pending.d.ts +3 -0
- package/dist/src/UploadQueue/RemainingTime.d.ts +4 -0
- package/dist/src/UploadQueue/helpers.d.ts +1 -0
- package/dist/src/UploadQueue/index.d.ts +42 -0
- package/dist/src/UploadQueue/index.spec.d.ts +1 -0
- package/dist/src/UploadQueue/useStatusIcon.d.ts +1 -0
- package/dist/src/hooks/useClientErrors.d.ts +29 -0
- package/dist/src/hooks/useClientErrors.spec.d.ts +1 -0
- package/dist/src/proptypes.d.ts +18 -0
- package/dist/src/providers/CozyTheme/CozyThemeWithQuery.d.ts +2 -0
- package/dist/src/providers/CozyTheme/index.d.ts +24 -0
- package/dist/src/providers/CozyTheme/queries.d.ts +8 -0
- package/dist/src/providers/DemoProvider.d.ts +6 -0
- package/dist/src/providers/Intent/index.d.ts +9 -0
- package/dist/stylesheet.css +898 -0
- package/dist/test/I18n.d.ts +6 -0
- package/dist/types.d.js +1 -0
- package/jest.config.js +20 -0
- package/package.json +76 -0
- package/preprocess.js +16 -0
- package/src/AppIcon/Readme.md +96 -0
- package/src/AppIcon/index.jsx +168 -0
- package/src/AppIcon/index.spec.js +145 -0
- package/src/AppIcon/styles.styl +37 -0
- package/src/AppLinker/Readme.md +32 -0
- package/src/AppLinker/__snapshots__/index.spec.jsx.snap +13 -0
- package/src/AppLinker/index.jsx +107 -0
- package/src/AppLinker/index.spec.jsx +60 -0
- package/src/AppLinker/native.config.js +1 -0
- package/src/AppLinker/native.js +57 -0
- package/src/AppLinker/native.spec.js +120 -0
- package/src/AppSections/Readme.md +35 -0
- package/src/AppSections/Sections.jsx +285 -0
- package/src/AppSections/Sections.styl +4 -0
- package/src/AppSections/__snapshots__/search.spec.js.snap +972 -0
- package/src/AppSections/_mockApps.js +197 -0
- package/src/AppSections/_testApps.js +151 -0
- package/src/AppSections/categories.js +138 -0
- package/src/AppSections/categories.spec.js +289 -0
- package/src/AppSections/components/AppsSection.jsx +82 -0
- package/src/AppSections/components/AppsSection.spec.jsx +50 -0
- package/src/AppSections/components/AppsSection.styl +7 -0
- package/src/AppSections/components/DropdownFilter.jsx +50 -0
- package/src/AppSections/components/DropdownFilter.styl +14 -0
- package/src/AppSections/constants.js +9 -0
- package/src/AppSections/generateI18nConfig.ts +23 -0
- package/src/AppSections/helpers.js +16 -0
- package/src/AppSections/helpers.spec.js +40 -0
- package/src/AppSections/index.jsx +3 -0
- package/src/AppSections/index.spec.jsx +137 -0
- package/src/AppSections/locales/en.json +37 -0
- package/src/AppSections/locales/fr.json +37 -0
- package/src/AppSections/locales/ru.json +37 -0
- package/src/AppSections/locales/vi.json +37 -0
- package/src/AppSections/search.js +104 -0
- package/src/AppSections/search.spec.js +158 -0
- package/src/AppTile/AppTile.spec.jsx +117 -0
- package/src/AppTile/Readme.md +24 -0
- package/src/AppTile/helpers.js +25 -0
- package/src/AppTile/index.jsx +139 -0
- package/src/AppTile/locales/en.json +9 -0
- package/src/AppTile/locales/fr.json +9 -0
- package/src/AppTile/locales/ru.json +9 -0
- package/src/AppTile/locales/vi.json +9 -0
- package/src/AppTile/styles.styl +27 -0
- package/src/CipherIcon/Readme.md +14 -0
- package/src/CipherIcon/index.jsx +46 -0
- package/src/CipherIcon/index.spec.jsx +53 -0
- package/src/CollectionField/Readme.md +41 -0
- package/src/CollectionField/index.jsx +141 -0
- package/src/CollectionField/styles.styl +15 -0
- package/src/ContactPicker/Readme.md +26 -0
- package/src/ContactPicker/index.jsx +86 -0
- package/src/ContactPicker/styles.styl +5 -0
- package/src/Contacts/AddModal/ContactAddressDialog/helpers.js +22 -0
- package/src/Contacts/AddModal/ContactAddressDialog/helpers.spec.js +64 -0
- package/src/Contacts/AddModal/ContactAddressDialog/index.jsx +85 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/en.json +25 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/fr.json +25 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/index.jsx +11 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/ru.json +25 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/vi.json +25 -0
- package/src/Contacts/AddModal/ContactForm/FieldInput.jsx +124 -0
- package/src/Contacts/AddModal/ContactForm/FieldInputAccordion.jsx +58 -0
- package/src/Contacts/AddModal/ContactForm/FieldInputArray.jsx +81 -0
- package/src/Contacts/AddModal/ContactForm/FieldInputLayout.jsx +77 -0
- package/src/Contacts/AddModal/ContactForm/FieldInputWrapper.jsx +44 -0
- package/src/Contacts/AddModal/ContactForm/HasValueCondition.jsx +31 -0
- package/src/Contacts/AddModal/ContactForm/HasValueCondition.spec.jsx +79 -0
- package/src/Contacts/AddModal/ContactForm/RelatedContactList.jsx +37 -0
- package/src/Contacts/AddModal/ContactForm/TextFieldCustomLabelSelect.jsx +79 -0
- package/src/Contacts/AddModal/ContactForm/TextFieldSelect.jsx +40 -0
- package/src/Contacts/AddModal/ContactForm/__snapshots__/HasValueCondition.spec.jsx.snap +33 -0
- package/src/Contacts/AddModal/ContactForm/contactToFormValues.js +109 -0
- package/src/Contacts/AddModal/ContactForm/contactToFormValues.spec.js +133 -0
- package/src/Contacts/AddModal/ContactForm/fieldsConfig.jsx +357 -0
- package/src/Contacts/AddModal/ContactForm/formValuesToContact.js +111 -0
- package/src/Contacts/AddModal/ContactForm/formValuesToContact.spec.js +557 -0
- package/src/Contacts/AddModal/ContactForm/helpers.js +393 -0
- package/src/Contacts/AddModal/ContactForm/helpers.spec.js +391 -0
- package/src/Contacts/AddModal/ContactForm/index.jsx +138 -0
- package/src/Contacts/AddModal/ContactForm/index.spec.jsx +301 -0
- package/src/Contacts/AddModal/ContactForm/locales/en.json +75 -0
- package/src/Contacts/AddModal/ContactForm/locales/fr.json +75 -0
- package/src/Contacts/AddModal/ContactForm/locales/index.jsx +11 -0
- package/src/Contacts/AddModal/ContactForm/locales/ru.json +75 -0
- package/src/Contacts/AddModal/ContactForm/locales/vi.json +75 -0
- package/src/Contacts/AddModal/ContactForm/styles.styl +2 -0
- package/src/Contacts/AddModal/CustomLabelDialog/index.jsx +109 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/en.json +15 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/fr.json +15 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/index.jsx +11 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/ru.json +15 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/vi.json +15 -0
- package/src/Contacts/AddModal/Readme.md +55 -0
- package/src/Contacts/AddModal/index.jsx +86 -0
- package/src/Contacts/AddModal/locales/en.json +13 -0
- package/src/Contacts/AddModal/locales/fr.json +13 -0
- package/src/Contacts/AddModal/locales/index.jsx +11 -0
- package/src/Contacts/AddModal/locales/ru.json +13 -0
- package/src/Contacts/AddModal/locales/vi.json +13 -0
- package/src/Contacts/AddModal/mocks.js +299 -0
- package/src/Contacts/AddModal/types.js +102 -0
- package/src/Contacts/GroupsSelect/GroupCreation.jsx +96 -0
- package/src/Contacts/GroupsSelect/GroupsSelect.jsx +159 -0
- package/src/Contacts/GroupsSelect/GroupsSelect.spec.jsx +249 -0
- package/src/Contacts/GroupsSelect/GroupsSelectProvider.jsx +40 -0
- package/src/Contacts/GroupsSelect/Readme.md +1 -0
- package/src/Contacts/GroupsSelect/SelectBox/Control.jsx +37 -0
- package/src/Contacts/GroupsSelect/SelectBox/EditGroupName.jsx +52 -0
- package/src/Contacts/GroupsSelect/SelectBox/Menu.jsx +27 -0
- package/src/Contacts/GroupsSelect/SelectBox/Option.jsx +71 -0
- package/src/Contacts/GroupsSelect/SelectBox/SelectContainer.jsx +15 -0
- package/src/Contacts/GroupsSelect/SelectBox/styles.styl +2 -0
- package/src/Contacts/GroupsSelect/helpers.js +25 -0
- package/src/Contacts/GroupsSelect/locales/en.json +21 -0
- package/src/Contacts/GroupsSelect/locales/fr.json +21 -0
- package/src/Contacts/GroupsSelect/locales/index.jsx +11 -0
- package/src/Contacts/GroupsSelect/locales/ru.json +21 -0
- package/src/Contacts/GroupsSelect/locales/vi.json +21 -0
- package/src/Contacts/GroupsSelect/styles.styl +48 -0
- package/src/Contacts/GroupsSelect/useGroupSelect.jsx +89 -0
- package/src/Contacts/Header/GroupsSelection.jsx +75 -0
- package/src/Contacts/Header/ImportDropdown.jsx +80 -0
- package/src/Contacts/Header/Readme.md +38 -0
- package/src/Contacts/Header/SearchInput.jsx +19 -0
- package/src/Contacts/Header/index.jsx +80 -0
- package/src/Contacts/Header/locales/en.json +15 -0
- package/src/Contacts/Header/locales/fr.json +15 -0
- package/src/Contacts/Header/locales/index.jsx +11 -0
- package/src/Contacts/Header/locales/ru.json +15 -0
- package/src/Contacts/Header/locales/vi.json +15 -0
- package/src/Contacts/Readme.md +1 -0
- package/src/ContactsList/ContactCell.jsx +23 -0
- package/src/ContactsList/ContactRow.jsx +46 -0
- package/src/ContactsList/ContactRow.spec.js +75 -0
- package/src/ContactsList/Contacts/ContactCozy.jsx +23 -0
- package/src/ContactsList/Contacts/ContactEmail.jsx +23 -0
- package/src/ContactsList/Contacts/ContactIdentity.jsx +57 -0
- package/src/ContactsList/Contacts/ContactName.jsx +43 -0
- package/src/ContactsList/Contacts/ContactPhone.jsx +24 -0
- package/src/ContactsList/ContactsList.jsx +52 -0
- package/src/ContactsList/Readme.md +47 -0
- package/src/ContactsList/_mockContacts.json +2494 -0
- package/src/ContactsList/helpers.js +132 -0
- package/src/ContactsList/helpers.spec.js +150 -0
- package/src/ContactsList/index.js +3 -0
- package/src/ContactsList/locales/en.json +5 -0
- package/src/ContactsList/locales/fr.json +5 -0
- package/src/ContactsList/locales/ru.json +5 -0
- package/src/ContactsList/locales/vi.json +5 -0
- package/src/ContactsList/locales/withContactsListLocales.jsx +15 -0
- package/src/ContactsList/styles.styl +35 -0
- package/src/ContactsListModal/AddContact/AddContactActions.jsx +16 -0
- package/src/ContactsListModal/AddContact/AddContactContent.jsx +60 -0
- package/src/ContactsListModal/AddContact/AddContactDialog.jsx +38 -0
- package/src/ContactsListModal/AddContact/AddContactTitle.jsx +9 -0
- package/src/ContactsListModal/AddContact/helpers.js +18 -0
- package/src/ContactsListModal/AddContact/helpers.spec.js +74 -0
- package/src/ContactsListModal/AddContact/styles.styl +2 -0
- package/src/ContactsListModal/ContactsListContent.jsx +74 -0
- package/src/ContactsListModal/ContactsListModal.jsx +143 -0
- package/src/ContactsListModal/ContactsListModalWithQuery.jsx +27 -0
- package/src/ContactsListModal/EmptyMessage.jsx +18 -0
- package/src/ContactsListModal/MobileHeader.jsx +50 -0
- package/src/ContactsListModal/Readme.md +45 -0
- package/src/ContactsListModal/index.jsx +28 -0
- package/src/ContactsListModal/locales/en.json +11 -0
- package/src/ContactsListModal/locales/fr.json +11 -0
- package/src/ContactsListModal/locales/ru.json +11 -0
- package/src/ContactsListModal/locales/vi.json +11 -0
- package/src/ContactsListModal/mockClient.jsx +47 -0
- package/src/ContactsListModal/queries.js +12 -0
- package/src/ContactsListModal/styles.styl +12 -0
- package/src/ContactsListModal/withContactsListLocales.jsx +11 -0
- package/src/Dialogs/AuthenticationDialogs/index.jsx +115 -0
- package/src/Field/Readme.md +357 -0
- package/src/Field/index.jsx +317 -0
- package/src/Field/index.spec.js +59 -0
- package/src/Field/styles.styl +41 -0
- package/src/FileImageLoader/Readme.md +112 -0
- package/src/FileImageLoader/checkImageSource.js +29 -0
- package/src/FileImageLoader/index.jsx +186 -0
- package/src/FileImageLoader/index.spec.jsx +176 -0
- package/src/FilePicker/FilePickerBody.jsx +111 -0
- package/src/FilePicker/FilePickerBodyItem.jsx +126 -0
- package/src/FilePicker/FilePickerBodyItem.spec.jsx +164 -0
- package/src/FilePicker/FilePickerBreadcrumb.jsx +55 -0
- package/src/FilePicker/FilePickerFooter.jsx +42 -0
- package/src/FilePicker/FilePickerFooter.spec.jsx +41 -0
- package/src/FilePicker/FilePickerHeader.jsx +89 -0
- package/src/FilePicker/Readme.md +50 -0
- package/src/FilePicker/docs/DemoProvider.jsx +273 -0
- package/src/FilePicker/helpers.js +46 -0
- package/src/FilePicker/helpers.spec.js +84 -0
- package/src/FilePicker/index.jsx +94 -0
- package/src/FilePicker/locales/en.json +8 -0
- package/src/FilePicker/locales/fr.json +8 -0
- package/src/FilePicker/locales/ru.json +8 -0
- package/src/FilePicker/locales/vi.json +8 -0
- package/src/FilePicker/queries.js +37 -0
- package/src/FilePicker/styles.styl +18 -0
- package/src/Intent/IntentDialogOpener/Readme.md +25 -0
- package/src/Intent/IntentDialogOpener/index.jsx +110 -0
- package/src/Intent/IntentIframe/Readme.md +80 -0
- package/src/Intent/IntentIframe/index.jsx +112 -0
- package/src/Intent/IntentIframe/styles.styl +21 -0
- package/src/ListItem/ExpandedAttributes/ExpandedAttribute.jsx +40 -0
- package/src/ListItem/ExpandedAttributes/helpers.js +214 -0
- package/src/ListItem/ExpandedAttributes/helpers.spec.js +175 -0
- package/src/ListItem/ExpandedAttributes/index.jsx +62 -0
- package/src/ListItem/ListItemBase/Renaming/RenameDialog.jsx +38 -0
- package/src/ListItem/ListItemBase/Renaming/RenameInput.jsx +134 -0
- package/src/ListItem/ListItemBase/Renaming/helpers.js +35 -0
- package/src/ListItem/ListItemBase/index.jsx +116 -0
- package/src/ListItem/ListItemByDoc/index.jsx +103 -0
- package/src/ListItem/ListItemContact/helpers.js +28 -0
- package/src/ListItem/ListItemContact/helpers.spec.js +41 -0
- package/src/ListItem/ListItemContact/index.jsx +68 -0
- package/src/ListItem/ListItemContact/useActions.jsx +22 -0
- package/src/ListItem/ListItemFile/ExpirationAnnotation.jsx +39 -0
- package/src/ListItem/ListItemFile/ItemIcon.jsx +49 -0
- package/src/ListItem/ListItemFile/PrimaryText.jsx +38 -0
- package/src/ListItem/ListItemFile/SecondaryText.jsx +36 -0
- package/src/ListItem/ListItemFile/index.jsx +75 -0
- package/src/ListItem/Readme.md +211 -0
- package/src/ListItem/hoc/withListItemLocales.jsx +15 -0
- package/src/ListItem/locales/en.json +75 -0
- package/src/ListItem/locales/fr.json +75 -0
- package/src/ListItem/locales/ru.json +75 -0
- package/src/ListItem/locales/vi.json +75 -0
- package/src/Paywall/MaxAccountsByKonnectorPaywall.jsx +32 -0
- package/src/Paywall/MaxAccountsPaywall.jsx +27 -0
- package/src/Paywall/MaxDaysToCapturePaywall.jsx +27 -0
- package/src/Paywall/MaxPapersPaywall.jsx +29 -0
- package/src/Paywall/OnlyOfficePaywall.jsx +24 -0
- package/src/Paywall/PasswordSharingPaywall.jsx +20 -0
- package/src/Paywall/Paywall.jsx +130 -0
- package/src/Paywall/Paywall.spec.jsx +228 -0
- package/src/Paywall/QuotaPaywall.jsx +18 -0
- package/src/Paywall/Readme.md +139 -0
- package/src/Paywall/helpers.js +22 -0
- package/src/Paywall/howto.md +28 -0
- package/src/Paywall/index.jsx +7 -0
- package/src/Paywall/locales/en.json +95 -0
- package/src/Paywall/locales/fr.json +95 -0
- package/src/Paywall/locales/ru.json +95 -0
- package/src/Paywall/locales/vi.json +95 -0
- package/src/Paywall/locales/withPaywallLocales.jsx +15 -0
- package/src/Qualification/QualificationGrid/Readme.md +26 -0
- package/src/Qualification/QualificationGrid/helpers.js +4 -0
- package/src/Qualification/QualificationGrid/index.jsx +91 -0
- package/src/Qualification/QualificationGrid/locales/en.json +15 -0
- package/src/Qualification/QualificationGrid/locales/fr.json +15 -0
- package/src/Qualification/QualificationGrid/locales/ru.json +15 -0
- package/src/Qualification/QualificationGrid/locales/vi.json +15 -0
- package/src/Qualification/QualificationGrid/locales/withLocales.jsx +15 -0
- package/src/Qualification/QualificationIcon/Readme.md +14 -0
- package/src/Qualification/QualificationIcon/index.jsx +104 -0
- package/src/Qualification/QualificationItem/Readme.md +8 -0
- package/src/Qualification/QualificationItem/index.jsx +64 -0
- package/src/Qualification/QualificationModal/Readme.md +28 -0
- package/src/Qualification/QualificationModal/helpers.js +63 -0
- package/src/Qualification/QualificationModal/helpers.spec.js +61 -0
- package/src/Qualification/QualificationModal/index.jsx +71 -0
- package/src/Qualification/QualificationModal/locales/en.json +6 -0
- package/src/Qualification/QualificationModal/locales/fr.json +6 -0
- package/src/Qualification/QualificationModal/locales/index.jsx +11 -0
- package/src/Qualification/QualificationModal/locales/ru.json +6 -0
- package/src/Qualification/QualificationModal/locales/vi.json +6 -0
- package/src/ShortcutTile/index.tsx +60 -0
- package/src/SquareAppIcon/Readme.md +185 -0
- package/src/SquareAppIcon/SquareAppIcon.spec.js +86 -0
- package/src/SquareAppIcon/__snapshots__/SquareAppIcon.spec.js.snap +474 -0
- package/src/SquareAppIcon/constants.json +6 -0
- package/src/SquareAppIcon/index.jsx +289 -0
- package/src/SquareAppIcon/styles.styl +141 -0
- package/src/Storage/Readme.md +45 -0
- package/src/Storage/StorageButton.jsx +34 -0
- package/src/Storage/StorageProgress.jsx +52 -0
- package/src/Storage/index.jsx +41 -0
- package/src/Storage/locales/en.json +7 -0
- package/src/Storage/locales/fr.json +7 -0
- package/src/Storage/locales/index.jsx +11 -0
- package/src/Storage/locales/ru.json +7 -0
- package/src/Storage/locales/vi.json +7 -0
- package/src/UploadQueue/FileUploadProgress.jsx +50 -0
- package/src/UploadQueue/Item.jsx +99 -0
- package/src/UploadQueue/Pending.jsx +12 -0
- package/src/UploadQueue/Readme.md +95 -0
- package/src/UploadQueue/RemainingTime.jsx +27 -0
- package/src/UploadQueue/helpers.js +3 -0
- package/src/UploadQueue/index.jsx +161 -0
- package/src/UploadQueue/index.spec.jsx +163 -0
- package/src/UploadQueue/locales/en.json +10 -0
- package/src/UploadQueue/locales/es.json +10 -0
- package/src/UploadQueue/locales/fr.json +10 -0
- package/src/UploadQueue/locales/ru.json +10 -0
- package/src/UploadQueue/locales/vi.json +10 -0
- package/src/UploadQueue/styles.styl +155 -0
- package/src/UploadQueue/useStatusIcon.js +32 -0
- package/src/hooks/useClientErrors.jsx +140 -0
- package/src/hooks/useClientErrors.spec.jsx +94 -0
- package/src/proptypes.js +20 -0
- package/src/providers/CozyTheme/CozyThemeWithQuery.jsx +25 -0
- package/src/providers/CozyTheme/Readme.md +88 -0
- package/src/providers/CozyTheme/index.jsx +35 -0
- package/src/providers/CozyTheme/queries.js +14 -0
- package/src/providers/DemoProvider.jsx +30 -0
- package/src/providers/Intent/index.jsx +83 -0
- package/src/types.d.ts +4 -0
- package/test/I18n.js +13 -0
- package/test/fileMock.js +3 -0
- package/test/jestsetup.js +1 -0
- package/tsconfig-build.json +16 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/* eslint-env jest */
|
|
4
|
+
|
|
5
|
+
import { render, screen } from '@testing-library/react'
|
|
6
|
+
import React from 'react'
|
|
7
|
+
|
|
8
|
+
import { Sections } from './Sections'
|
|
9
|
+
import mockApps from './_testApps'
|
|
10
|
+
import en from './locales/en.json'
|
|
11
|
+
import { I18nContext } from '../../test/I18n'
|
|
12
|
+
import DemoProvider from '../providers/DemoProvider'
|
|
13
|
+
|
|
14
|
+
const i18nContext = I18nContext({ locale: en })
|
|
15
|
+
const tMock = i18nContext.t
|
|
16
|
+
|
|
17
|
+
describe('AppsSection component', () => {
|
|
18
|
+
it('should be rendered correctly with apps list, subtitle and onAppClick', () => {
|
|
19
|
+
const mockOnAppClick = jest.fn()
|
|
20
|
+
render(
|
|
21
|
+
<DemoProvider>
|
|
22
|
+
<Sections
|
|
23
|
+
t={tMock}
|
|
24
|
+
lang="en"
|
|
25
|
+
subtitle="Test Apps"
|
|
26
|
+
apps={mockApps}
|
|
27
|
+
allApps={mockApps}
|
|
28
|
+
onAppClick={mockOnAppClick}
|
|
29
|
+
error={null}
|
|
30
|
+
location={{ search: '' }}
|
|
31
|
+
/>
|
|
32
|
+
</DemoProvider>
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
expect(screen.queryByText('Cozy Collect')).toBeInTheDocument()
|
|
36
|
+
expect(screen.queryByText('Cozy Drive')).toBeInTheDocument()
|
|
37
|
+
expect(screen.queryByText('DevOnly')).toBeInTheDocument()
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
it('should render correctly render message if error provided', () => {
|
|
41
|
+
const mockOnAppClick = jest.fn()
|
|
42
|
+
render(
|
|
43
|
+
<DemoProvider>
|
|
44
|
+
<Sections
|
|
45
|
+
t={tMock}
|
|
46
|
+
lang="en"
|
|
47
|
+
subtitle="Test Apps"
|
|
48
|
+
apps={mockApps}
|
|
49
|
+
allApps={mockApps}
|
|
50
|
+
onAppClick={mockOnAppClick}
|
|
51
|
+
error={new Error('This is a test error')}
|
|
52
|
+
location={{ search: '' }}
|
|
53
|
+
/>
|
|
54
|
+
</DemoProvider>
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
expect(screen.queryByText('This is a test error')).toBeInTheDocument()
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it('should not render dropdown filter on mobile if nav=false flag provided', () => {
|
|
61
|
+
const mockOnAppClick = jest.fn()
|
|
62
|
+
render(
|
|
63
|
+
<DemoProvider>
|
|
64
|
+
<Sections
|
|
65
|
+
t={tMock}
|
|
66
|
+
lang="en"
|
|
67
|
+
subtitle="Test Apps"
|
|
68
|
+
apps={mockApps}
|
|
69
|
+
allApps={mockApps}
|
|
70
|
+
onAppClick={mockOnAppClick}
|
|
71
|
+
breakpoints={{ isMobile: true }}
|
|
72
|
+
hasNav={false}
|
|
73
|
+
/>
|
|
74
|
+
</DemoProvider>
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
expect(screen.queryByText('All categories')).not.toBeInTheDocument()
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
it('should not render dropdown filter on tablet if nav=false flag provided', () => {
|
|
81
|
+
const mockOnAppClick = jest.fn()
|
|
82
|
+
render(
|
|
83
|
+
<DemoProvider>
|
|
84
|
+
<Sections
|
|
85
|
+
t={tMock}
|
|
86
|
+
lang="en"
|
|
87
|
+
subtitle="Test Apps"
|
|
88
|
+
apps={mockApps}
|
|
89
|
+
allApps={mockApps}
|
|
90
|
+
onAppClick={mockOnAppClick}
|
|
91
|
+
breakpoints={{ isTablet: true }}
|
|
92
|
+
hasNav={false}
|
|
93
|
+
/>
|
|
94
|
+
</DemoProvider>
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
expect(screen.queryByText('All categories')).not.toBeInTheDocument()
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
it('should render dropdown filter on mobile if no nav=false flag provided', () => {
|
|
101
|
+
const mockOnAppClick = jest.fn()
|
|
102
|
+
render(
|
|
103
|
+
<DemoProvider>
|
|
104
|
+
<Sections
|
|
105
|
+
t={tMock}
|
|
106
|
+
lang="en"
|
|
107
|
+
subtitle="Test Apps"
|
|
108
|
+
apps={mockApps}
|
|
109
|
+
allApps={mockApps}
|
|
110
|
+
onAppClick={mockOnAppClick}
|
|
111
|
+
breakpoints={{ isMobile: true }}
|
|
112
|
+
/>
|
|
113
|
+
</DemoProvider>
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
expect(screen.queryByText('All categories')).toBeInTheDocument()
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
it('should render dropdown filter on tablet if no nav=false flag provided', () => {
|
|
120
|
+
const mockOnAppClick = jest.fn()
|
|
121
|
+
render(
|
|
122
|
+
<DemoProvider>
|
|
123
|
+
<Sections
|
|
124
|
+
t={tMock}
|
|
125
|
+
lang="en"
|
|
126
|
+
subtitle="Test Apps"
|
|
127
|
+
apps={mockApps}
|
|
128
|
+
allApps={mockApps}
|
|
129
|
+
onAppClick={mockOnAppClick}
|
|
130
|
+
breakpoints={{ isTablet: true }}
|
|
131
|
+
/>
|
|
132
|
+
</DemoProvider>
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
expect(screen.queryByText('All categories')).toBeInTheDocument()
|
|
136
|
+
})
|
|
137
|
+
})
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app_categories": {
|
|
3
|
+
"all": "All categories",
|
|
4
|
+
"banking": "Banking",
|
|
5
|
+
"clouds": "Clouds and vaults",
|
|
6
|
+
"cozy": "The essentials",
|
|
7
|
+
"education": "Education",
|
|
8
|
+
"energy": "Energy",
|
|
9
|
+
"finance": "Employment and finance",
|
|
10
|
+
"health": "Health",
|
|
11
|
+
"host_provider": "Host",
|
|
12
|
+
"insurance": "Insurance",
|
|
13
|
+
"isp": "Mobile and Internet",
|
|
14
|
+
"konnectors": "Services",
|
|
15
|
+
"list_separator": ", ",
|
|
16
|
+
"mes_infos": "MesInfos experimentation",
|
|
17
|
+
"online_services": "Online services",
|
|
18
|
+
"others": "Others",
|
|
19
|
+
"partners": "Partners",
|
|
20
|
+
"press": "Press",
|
|
21
|
+
"productivity": "Productivity",
|
|
22
|
+
"ptnb": "PTNB experimentation",
|
|
23
|
+
"public_service": "Public services",
|
|
24
|
+
"shopping": "Shopping",
|
|
25
|
+
"social": "Social",
|
|
26
|
+
"tech": "Tech",
|
|
27
|
+
"telecom": "Telecom",
|
|
28
|
+
"transport": "Transportation",
|
|
29
|
+
"pro": "Work",
|
|
30
|
+
"shortcuts": "Additional apps"
|
|
31
|
+
},
|
|
32
|
+
"sections": {
|
|
33
|
+
"applications": "Applications",
|
|
34
|
+
"konnectors": "Services",
|
|
35
|
+
"shortcuts": "Additional apps"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app_categories": {
|
|
3
|
+
"all": "Toutes les catégories",
|
|
4
|
+
"banking": "Banques",
|
|
5
|
+
"clouds": "Clouds et coffres",
|
|
6
|
+
"cozy": "Les essentielles",
|
|
7
|
+
"education": "Éducation",
|
|
8
|
+
"energy": "Energie",
|
|
9
|
+
"finance": "Emploi et finance",
|
|
10
|
+
"health": "Santé",
|
|
11
|
+
"host_provider": "Hébergeur",
|
|
12
|
+
"insurance": "Assurance",
|
|
13
|
+
"isp": "Mobile et Internet",
|
|
14
|
+
"konnectors": "Services",
|
|
15
|
+
"list_separator": ", ",
|
|
16
|
+
"mes_infos": "Expérimentation MesInfos",
|
|
17
|
+
"online_services": "Services en ligne",
|
|
18
|
+
"others": "Autres",
|
|
19
|
+
"partners": "Partenaires",
|
|
20
|
+
"press": "Presse",
|
|
21
|
+
"productivity": "Productivité",
|
|
22
|
+
"ptnb": "Expérimentation Carnet du Logement",
|
|
23
|
+
"public_service": "Services publics",
|
|
24
|
+
"shopping": "Shopping",
|
|
25
|
+
"social": "Social",
|
|
26
|
+
"tech": "Tech",
|
|
27
|
+
"telecom": "Mobile",
|
|
28
|
+
"transport": "Voyage et transport",
|
|
29
|
+
"pro": "Travail",
|
|
30
|
+
"shortcuts": "App supplémentaires"
|
|
31
|
+
},
|
|
32
|
+
"sections": {
|
|
33
|
+
"applications": "Applications",
|
|
34
|
+
"konnectors": "Services",
|
|
35
|
+
"shortcuts": "App supplémentaires"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app_categories": {
|
|
3
|
+
"all": "Все категории",
|
|
4
|
+
"banking": "Банковское дело",
|
|
5
|
+
"clouds": "Облака и хранилища",
|
|
6
|
+
"cozy": "Основное",
|
|
7
|
+
"education": "Образование",
|
|
8
|
+
"energy": "Энергетика",
|
|
9
|
+
"finance": "Занятость и финансы",
|
|
10
|
+
"health": "Здоровье",
|
|
11
|
+
"host_provider": "Хостинг",
|
|
12
|
+
"insurance": "Страхование",
|
|
13
|
+
"isp": "Мобильная связь и Интернет",
|
|
14
|
+
"konnectors": "Сервисы",
|
|
15
|
+
"list_separator": ", ",
|
|
16
|
+
"mes_infos": "Эксперимент MesInfos",
|
|
17
|
+
"online_services": "Онлайн-сервисы",
|
|
18
|
+
"others": "Прочее",
|
|
19
|
+
"partners": "Партнеры",
|
|
20
|
+
"press": "Пресса",
|
|
21
|
+
"productivity": "Продуктивность",
|
|
22
|
+
"ptnb": "Эксперимент PTNB",
|
|
23
|
+
"public_service": "Государственные услуги",
|
|
24
|
+
"shopping": "Покупки",
|
|
25
|
+
"social": "Социальные сети",
|
|
26
|
+
"tech": "Технологии",
|
|
27
|
+
"telecom": "Телекоммуникации",
|
|
28
|
+
"transport": "Транспорт",
|
|
29
|
+
"pro": "Работа",
|
|
30
|
+
"shortcuts": "Дополнительные приложения"
|
|
31
|
+
},
|
|
32
|
+
"sections": {
|
|
33
|
+
"applications": "Приложения",
|
|
34
|
+
"konnectors": "Сервисы",
|
|
35
|
+
"shortcuts": "Дополнительные приложения"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app_categories": {
|
|
3
|
+
"all": "Tất cả danh mục",
|
|
4
|
+
"banking": "Ngân hàng",
|
|
5
|
+
"clouds": "Đám mây và kho lưu trữ",
|
|
6
|
+
"cozy": "Thiết yếu",
|
|
7
|
+
"education": "Giáo dục",
|
|
8
|
+
"energy": "Năng lượng",
|
|
9
|
+
"finance": "Việc làm và tài chính",
|
|
10
|
+
"health": "Sức khỏe",
|
|
11
|
+
"host_provider": "Máy chủ",
|
|
12
|
+
"insurance": "Bảo hiểm",
|
|
13
|
+
"isp": "Di động và Internet",
|
|
14
|
+
"konnectors": "Dịch vụ",
|
|
15
|
+
"list_separator": ", ",
|
|
16
|
+
"mes_infos": "Thí nghiệm MesInfos",
|
|
17
|
+
"online_services": "Dịch vụ trực tuyến",
|
|
18
|
+
"others": "Khác",
|
|
19
|
+
"partners": "Đối tác",
|
|
20
|
+
"press": "Báo chí",
|
|
21
|
+
"productivity": "Năng suất",
|
|
22
|
+
"ptnb": "Thí nghiệm PTNB",
|
|
23
|
+
"public_service": "Dịch vụ công",
|
|
24
|
+
"shopping": "Mua sắm",
|
|
25
|
+
"social": "Mạng xã hội",
|
|
26
|
+
"tech": "Công nghệ",
|
|
27
|
+
"telecom": "Viễn thông",
|
|
28
|
+
"transport": "Giao thông",
|
|
29
|
+
"pro": "Công việc",
|
|
30
|
+
"shortcuts": "Ứng dụng bổ sung"
|
|
31
|
+
},
|
|
32
|
+
"sections": {
|
|
33
|
+
"applications": "Ứng dụng",
|
|
34
|
+
"konnectors": "Dịch vụ",
|
|
35
|
+
"shortcuts": "Ứng dụng bổ sung"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import mapValues from 'lodash/mapValues'
|
|
2
|
+
import matches from 'lodash/matches'
|
|
3
|
+
import overEvery from 'lodash/overEvery'
|
|
4
|
+
|
|
5
|
+
import { APP_TYPE } from './constants'
|
|
6
|
+
|
|
7
|
+
const getDoctypesList = permsObj => {
|
|
8
|
+
const doctypes = []
|
|
9
|
+
for (let p in permsObj) {
|
|
10
|
+
if (permsObj[p].type) doctypes.push(permsObj[p].type)
|
|
11
|
+
}
|
|
12
|
+
return doctypes
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const typeMatcher = type => app => app.type === type
|
|
16
|
+
const categoryMatcher = category => app => {
|
|
17
|
+
if (!Array.isArray(app.categories)) return false
|
|
18
|
+
return app.categories.includes(category)
|
|
19
|
+
}
|
|
20
|
+
const tagMatcher = tag => app => {
|
|
21
|
+
if (!Array.isArray(app.tags)) return false
|
|
22
|
+
return app.tags.includes(tag)
|
|
23
|
+
}
|
|
24
|
+
const doctypeMatcher = doctype => app => {
|
|
25
|
+
if (!app.permissions) return false
|
|
26
|
+
return getDoctypesList(app.permissions).includes(doctype)
|
|
27
|
+
}
|
|
28
|
+
const pendingUpdateMatcher = () => app => !!app.availableVersion
|
|
29
|
+
|
|
30
|
+
const showMaintenanceMatcher = isShowMaintenance => app => {
|
|
31
|
+
if (isShowMaintenance) return true
|
|
32
|
+
return app.maintenance === undefined
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const qualificationLabelsMatcher = label => app => {
|
|
36
|
+
if (!Array.isArray(app.qualification_labels)) return false
|
|
37
|
+
return app.qualification_labels.includes(label)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const searchAttrToMatcher = {
|
|
41
|
+
type: typeMatcher,
|
|
42
|
+
category: categoryMatcher,
|
|
43
|
+
tag: tagMatcher,
|
|
44
|
+
doctype: doctypeMatcher,
|
|
45
|
+
pendingUpdate: pendingUpdateMatcher,
|
|
46
|
+
showMaintenance: showMaintenanceMatcher,
|
|
47
|
+
qualificationLabels: qualificationLabelsMatcher
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Returns a predicate function to match an app based on
|
|
52
|
+
* a search specification.
|
|
53
|
+
*
|
|
54
|
+
* @param {Search} search - What to search, ex: { type: 'webapp', category: 'banking'}
|
|
55
|
+
* @return {Function<App>}
|
|
56
|
+
*/
|
|
57
|
+
export const makeMatcherFromSearch = (search = {}) => {
|
|
58
|
+
// Create all predicates from the search object
|
|
59
|
+
const predicates = Object.values(
|
|
60
|
+
mapValues(search, (value, name) => {
|
|
61
|
+
return searchAttrToMatcher[name]?.(value)
|
|
62
|
+
})
|
|
63
|
+
)
|
|
64
|
+
// Return a function returning true if all predicates pass
|
|
65
|
+
return overEvery(predicates)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns a predicate to find the corresponding category option for
|
|
70
|
+
* a search
|
|
71
|
+
*
|
|
72
|
+
* @param {Search}
|
|
73
|
+
* @return {Function<CategoryOption>}
|
|
74
|
+
*/
|
|
75
|
+
export const makeOptionMatcherFromSearch = (search = {}) => {
|
|
76
|
+
const typeParam = search.type
|
|
77
|
+
const categoryParam = search.category
|
|
78
|
+
if (typeParam === APP_TYPE.KONNECTOR && !categoryParam) {
|
|
79
|
+
return matches({ value: 'konnectors' })
|
|
80
|
+
} else if (!typeParam && !categoryParam) {
|
|
81
|
+
return matches({ value: 'all' })
|
|
82
|
+
}
|
|
83
|
+
return matches({ value: categoryParam, type: typeParam })
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Returns a Search from a category option
|
|
88
|
+
*
|
|
89
|
+
* @param {CategoryOption}
|
|
90
|
+
* @return {Search}
|
|
91
|
+
*/
|
|
92
|
+
export const makeSearchFromOption = option => {
|
|
93
|
+
if (option.value === 'all') {
|
|
94
|
+
return {}
|
|
95
|
+
}
|
|
96
|
+
const search = {}
|
|
97
|
+
if (option.value === 'konnectors') {
|
|
98
|
+
search.type = APP_TYPE.KONNECTOR
|
|
99
|
+
} else {
|
|
100
|
+
search.type = option.type
|
|
101
|
+
search.category = option.value
|
|
102
|
+
}
|
|
103
|
+
return search
|
|
104
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/* eslint-env jest */
|
|
4
|
+
|
|
5
|
+
import mockApps from './_testApps'
|
|
6
|
+
import { makeMatcherFromSearch } from './search'
|
|
7
|
+
|
|
8
|
+
const mockMaintenanceApps = [
|
|
9
|
+
{ slug: 'collect' },
|
|
10
|
+
{ slug: 'drive' },
|
|
11
|
+
{
|
|
12
|
+
slug: 'konnectorInMaintenance',
|
|
13
|
+
maintenance: {
|
|
14
|
+
flag_infra_maintenance: true,
|
|
15
|
+
flag_short_maintenance: true,
|
|
16
|
+
flag_disallow_manual_exec: true,
|
|
17
|
+
messages: []
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
describe('makeMatcherFromSearch', () => {
|
|
23
|
+
it('should filter correctly on type', () => {
|
|
24
|
+
const matcher = makeMatcherFromSearch({ type: 'webapp' })
|
|
25
|
+
expect(mockApps.filter(matcher)).toMatchSnapshot()
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('should filter correctly on doctype', () => {
|
|
29
|
+
const matcher = makeMatcherFromSearch({ doctype: 'io.mock.doctype2' })
|
|
30
|
+
expect(mockApps.filter(matcher)).toMatchSnapshot()
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('should filter correctly on tags', () => {
|
|
34
|
+
const matcher = makeMatcherFromSearch({ tag: 'bills' })
|
|
35
|
+
expect(mockApps.filter(matcher)).toMatchSnapshot()
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('should filter correctly on category', () => {
|
|
39
|
+
const matcher = makeMatcherFromSearch({ category: 'cozy' })
|
|
40
|
+
expect(mockApps.filter(matcher)).toMatchSnapshot()
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it('should filter correctly on pending update apps', () => {
|
|
44
|
+
const matcher = makeMatcherFromSearch({ pendingUpdate: true })
|
|
45
|
+
expect(mockApps.filter(matcher)).toMatchSnapshot()
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('should filter correctly when show maintenance is false', () => {
|
|
49
|
+
const matcher = makeMatcherFromSearch({ showMaintenance: false })
|
|
50
|
+
expect(mockMaintenanceApps.filter(matcher)).toStrictEqual([
|
|
51
|
+
{ slug: 'collect' },
|
|
52
|
+
{ slug: 'drive' }
|
|
53
|
+
])
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('should filter correctly when show maintenance is true', () => {
|
|
57
|
+
const matcher = makeMatcherFromSearch({ showMaintenance: true })
|
|
58
|
+
expect(mockMaintenanceApps.filter(matcher)).toStrictEqual([
|
|
59
|
+
{ slug: 'collect' },
|
|
60
|
+
{ slug: 'drive' },
|
|
61
|
+
{
|
|
62
|
+
maintenance: {
|
|
63
|
+
flag_disallow_manual_exec: true,
|
|
64
|
+
flag_infra_maintenance: true,
|
|
65
|
+
flag_short_maintenance: true,
|
|
66
|
+
messages: []
|
|
67
|
+
},
|
|
68
|
+
slug: 'konnectorInMaintenance'
|
|
69
|
+
}
|
|
70
|
+
])
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
it('should handle correctly multi filters', () => {
|
|
74
|
+
const matcher = makeMatcherFromSearch({
|
|
75
|
+
type: 'konnector',
|
|
76
|
+
doctype: 'io.mock.doctype'
|
|
77
|
+
})
|
|
78
|
+
expect(mockApps.filter(matcher)).toMatchSnapshot()
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
it('should not throw error if search is not provided', () => {
|
|
82
|
+
const matcher = makeMatcherFromSearch()
|
|
83
|
+
expect(mockApps.filter(matcher)).toMatchSnapshot()
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it('should not throw error if app with malformed permission and search on doctype', () => {
|
|
87
|
+
const malFormedPermApp = {
|
|
88
|
+
slug: 'collect',
|
|
89
|
+
name: 'Collect',
|
|
90
|
+
editor: 'Cozy',
|
|
91
|
+
name_prefix: 'Cozy',
|
|
92
|
+
categories: ['cozy'],
|
|
93
|
+
developer: { name: 'Cozy' },
|
|
94
|
+
type: 'webapp',
|
|
95
|
+
icon: '<svg></svg>',
|
|
96
|
+
permissions: {
|
|
97
|
+
mock: {
|
|
98
|
+
// NO TYPE = malformed
|
|
99
|
+
description: 'io.mock.doctype'
|
|
100
|
+
},
|
|
101
|
+
mock2: {
|
|
102
|
+
type: 'io.mock.doctype2'
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
tags: ['konnector', 'collect', 'bills', 'providers', 'files'],
|
|
106
|
+
version: '3.0.0',
|
|
107
|
+
versions: {
|
|
108
|
+
stable: ['3.0.0'],
|
|
109
|
+
beta: ['3.0.0'],
|
|
110
|
+
dev: ['3.0.0']
|
|
111
|
+
},
|
|
112
|
+
uninstallable: false,
|
|
113
|
+
installed: true,
|
|
114
|
+
isInRegistry: true,
|
|
115
|
+
related: 'http://collect.cozy.mock/'
|
|
116
|
+
}
|
|
117
|
+
const matcher = makeMatcherFromSearch({ doctype: 'io.mock.doctype' })
|
|
118
|
+
expect([malFormedPermApp].filter(matcher)).toMatchSnapshot()
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
it('should not throw error if app with no categories and search on category', () => {
|
|
122
|
+
const appWithoutCategories = {
|
|
123
|
+
slug: 'collect',
|
|
124
|
+
name: 'Collect',
|
|
125
|
+
editor: 'Cozy',
|
|
126
|
+
name_prefix: 'Cozy',
|
|
127
|
+
developer: { name: 'Cozy' },
|
|
128
|
+
type: 'webapp',
|
|
129
|
+
icon: '<svg></svg>',
|
|
130
|
+
permissions: {
|
|
131
|
+
mock: {
|
|
132
|
+
type: 'io.mock.doctype'
|
|
133
|
+
},
|
|
134
|
+
mock2: {
|
|
135
|
+
type: 'io.mock.doctype2'
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
tags: ['konnector', 'collect', 'bills', 'providers', 'files'],
|
|
139
|
+
version: '3.0.0',
|
|
140
|
+
versions: {
|
|
141
|
+
stable: ['3.0.0'],
|
|
142
|
+
beta: ['3.0.0'],
|
|
143
|
+
dev: ['3.0.0']
|
|
144
|
+
},
|
|
145
|
+
uninstallable: false,
|
|
146
|
+
installed: true,
|
|
147
|
+
isInRegistry: true,
|
|
148
|
+
related: 'http://collect.cozy.mock/'
|
|
149
|
+
}
|
|
150
|
+
const matcher = makeMatcherFromSearch({ category: 'cozy' })
|
|
151
|
+
expect([appWithoutCategories].filter(matcher)).toMatchSnapshot()
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
it('should work even for an unsupported filter', () => {
|
|
155
|
+
const matcher = makeMatcherFromSearch({ unsupportedKey: 'omg' })
|
|
156
|
+
expect(mockApps.filter(matcher)).toMatchSnapshot()
|
|
157
|
+
})
|
|
158
|
+
})
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/* eslint-env jest */
|
|
4
|
+
|
|
5
|
+
import { render } from '@testing-library/react'
|
|
6
|
+
import React from 'react'
|
|
7
|
+
|
|
8
|
+
import I18n from 'cozy-ui/transpiled/react/providers/I18n'
|
|
9
|
+
|
|
10
|
+
import AppTile from '.'
|
|
11
|
+
import en from '../AppSections/locales/en.json'
|
|
12
|
+
import DemoProvider from '../providers/DemoProvider'
|
|
13
|
+
|
|
14
|
+
const appMock = {
|
|
15
|
+
slug: 'test',
|
|
16
|
+
editor: 'cozy',
|
|
17
|
+
namePrefix: 'Cozy',
|
|
18
|
+
developer: {
|
|
19
|
+
name: 'Cozy'
|
|
20
|
+
},
|
|
21
|
+
icon: '<svg></svg>',
|
|
22
|
+
name: 'Test',
|
|
23
|
+
version: '3.0.3',
|
|
24
|
+
onClick: jest.fn()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const appMock2 = {
|
|
28
|
+
slug: 'test2',
|
|
29
|
+
editor: '',
|
|
30
|
+
developer: {
|
|
31
|
+
name: 'Naming me'
|
|
32
|
+
},
|
|
33
|
+
icon: '<svg></svg>',
|
|
34
|
+
name: 'Test2',
|
|
35
|
+
version: '3.0.3-beta7483',
|
|
36
|
+
installedAppLink: 'test2.cozy.mock',
|
|
37
|
+
installed: true,
|
|
38
|
+
onClick: jest.fn()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const Wrapper = props => {
|
|
42
|
+
return (
|
|
43
|
+
<DemoProvider>
|
|
44
|
+
<I18n dictRequire={() => en} lang="en">
|
|
45
|
+
<AppTile {...props} />
|
|
46
|
+
</I18n>
|
|
47
|
+
</DemoProvider>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
describe('AppTile component', () => {
|
|
52
|
+
it('should render correctly an app', () => {
|
|
53
|
+
const root = render(<Wrapper {...appMock} app={appMock} />)
|
|
54
|
+
expect(root.getByText('Cozy Test')).toBeTruthy()
|
|
55
|
+
expect(root.getByText('By Cozy')).toBeTruthy()
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
it('should render correctly an app without developer property', () => {
|
|
59
|
+
const appMockWithoutDevelopper = Object.assign({}, appMock)
|
|
60
|
+
delete appMockWithoutDevelopper.developer
|
|
61
|
+
const root = render(
|
|
62
|
+
<Wrapper {...appMockWithoutDevelopper} app={appMockWithoutDevelopper} />
|
|
63
|
+
)
|
|
64
|
+
expect(root.getByText('Cozy Test')).toBeTruthy()
|
|
65
|
+
expect(root.queryByText('By Cozy')).toBeFalsy()
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it('should render correctly an app in maintenance', () => {
|
|
69
|
+
const appInMaintenance = Object.assign({}, appMock2, {
|
|
70
|
+
maintenance: { maintenance_options: {} }
|
|
71
|
+
})
|
|
72
|
+
const setup = ({ displaySpecificMaintenanceStyle }) =>
|
|
73
|
+
render(
|
|
74
|
+
<Wrapper
|
|
75
|
+
{...appInMaintenance}
|
|
76
|
+
app={appInMaintenance}
|
|
77
|
+
displaySpecificMaintenanceStyle={displaySpecificMaintenanceStyle}
|
|
78
|
+
/>
|
|
79
|
+
)
|
|
80
|
+
const root = setup({ displaySpecificMaintenanceStyle: false })
|
|
81
|
+
expect(root.getByText('Test2')).toBeTruthy()
|
|
82
|
+
expect(root.getByText('By Naming me')).toBeTruthy()
|
|
83
|
+
expect(root.getByText('In maintenance')).toBeTruthy()
|
|
84
|
+
expect(root.queryByTestId('icon-maintenance')).toBeNull()
|
|
85
|
+
|
|
86
|
+
const rootWithIcon = setup({ displaySpecificMaintenanceStyle: true })
|
|
87
|
+
expect(rootWithIcon.getByTestId('icon-maintenance')).toBeTruthy()
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
it('should render correctly an installed app', () => {
|
|
91
|
+
const root = render(<Wrapper {...appMock2} app={appMock2} />)
|
|
92
|
+
expect(root.getByText('Installed')).toBeTruthy()
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
it('should render correctly an installed app without icon provided', () => {
|
|
96
|
+
const appMockWithoutIcon = Object.assign({}, appMock, {
|
|
97
|
+
icon: 'https://hello.svg'
|
|
98
|
+
})
|
|
99
|
+
const root = render(
|
|
100
|
+
<Wrapper
|
|
101
|
+
{...appMockWithoutIcon}
|
|
102
|
+
app={appMockWithoutIcon}
|
|
103
|
+
alt="Alternative text"
|
|
104
|
+
/>
|
|
105
|
+
)
|
|
106
|
+
expect(root.getByText('Cozy Test')).toBeTruthy()
|
|
107
|
+
expect(root.getByText('By Cozy')).toBeTruthy()
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
it('should render correctly an installed app without icon provided', () => {
|
|
111
|
+
const appMockWithoutIcon = Object.assign({}, appMock, { icon: '' })
|
|
112
|
+
const root = render(
|
|
113
|
+
<Wrapper {...appMockWithoutIcon} app={appMockWithoutIcon} />
|
|
114
|
+
)
|
|
115
|
+
expect(root.queryByRole('progressbar')).toBeFalsy()
|
|
116
|
+
})
|
|
117
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Component used to show an app status, can be used in
|
|
2
|
+
a list of apps for example in the Store.
|
|
3
|
+
|
|
4
|
+
```jsx
|
|
5
|
+
import AppTile from 'cozy-ui/transpiled/react/AppTile'
|
|
6
|
+
import mockApps from '../AppSections/_mockApps'
|
|
7
|
+
import { I18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
8
|
+
import Grid from 'cozy-ui/transpiled/react/Grid'
|
|
9
|
+
|
|
10
|
+
const locale = {}
|
|
11
|
+
const app = mockApps[0]
|
|
12
|
+
|
|
13
|
+
;
|
|
14
|
+
|
|
15
|
+
<I18n dictRequire={lang => locale} lang="en">
|
|
16
|
+
<Grid container>
|
|
17
|
+
<AppTile app={app} />
|
|
18
|
+
<AppTile app={{...app, maintenance: true}} />
|
|
19
|
+
<AppTile app={{...app, maintenance: true}} displaySpecificMaintenanceStyle={true} />
|
|
20
|
+
<AppTile app={{...app, availableVersion: true}} />
|
|
21
|
+
<AppTile app={{...app, availableVersion: true}} showStatus={['maintenance']} />
|
|
22
|
+
</Grid>
|
|
23
|
+
</I18n>
|
|
24
|
+
```
|