@bigbinary/neeto-molecules 1.1.16 → 1.1.17
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/dist/AutoSaveInput.js +658 -0
- package/dist/AutoSaveInput.js.map +1 -0
- package/dist/Breadcrumbs.js +38 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/BrowserSupport.js +418 -0
- package/dist/BrowserSupport.js.map +1 -0
- package/dist/Builder.js +662 -0
- package/dist/Builder.js.map +1 -0
- package/dist/CalendarView.js +538 -0
- package/dist/CalendarView.js.map +1 -0
- package/dist/Codeblock.js +236 -0
- package/dist/Codeblock.js.map +1 -0
- package/dist/{Columns/index.js → Columns.js} +130 -13
- package/dist/Columns.js.map +1 -0
- package/dist/{ConfirmationModal/index.js → ConfirmationModal.js} +20 -8
- package/dist/ConfirmationModal.js.map +1 -0
- package/dist/Container.js +1211 -0
- package/dist/Container.js.map +1 -0
- package/dist/CopyToClipboardButton.js +209 -0
- package/dist/CopyToClipboardButton.js.map +1 -0
- package/dist/CustomDomain.js +688 -0
- package/dist/CustomDomain.js.map +1 -0
- package/dist/CustomDomainDashboard.js +2283 -0
- package/dist/CustomDomainDashboard.js.map +1 -0
- package/dist/{DateFormat/index.js → DateFormat.js} +25 -8
- package/dist/DateFormat.js.map +1 -0
- package/dist/DateRangeFilter.js +229 -0
- package/dist/DateRangeFilter.js.map +1 -0
- package/dist/DynamicVariables.js +183 -0
- package/dist/DynamicVariables.js.map +1 -0
- package/dist/EmailForm.js +2291 -0
- package/dist/EmailForm.js.map +1 -0
- package/dist/EmailPreview.js +1353 -0
- package/dist/EmailPreview.js.map +1 -0
- package/dist/{ErrorPage/constants.js → ErrorPage.js} +137 -36
- package/dist/ErrorPage.js.map +1 -0
- package/dist/Header.js +122 -0
- package/dist/Header.js.map +1 -0
- package/dist/IconPicker.js +313 -0
- package/dist/IconPicker.js.map +1 -0
- package/dist/ImageWithFallback.js +181 -0
- package/dist/ImageWithFallback.js.map +1 -0
- package/dist/IntegrationCard.js +343 -0
- package/dist/IntegrationCard.js.map +1 -0
- package/dist/IntegrationDisconnectAlert.js +80 -0
- package/dist/IntegrationDisconnectAlert.js.map +1 -0
- package/dist/{IntegrationWalkthroughModal/index.js → IntegrationWalkthroughModal.js} +8 -6
- package/dist/IntegrationWalkthroughModal.js.map +1 -0
- package/dist/IpRestriction.js +857 -0
- package/dist/IpRestriction.js.map +1 -0
- package/dist/KeyboardShortcuts.js +359 -0
- package/dist/KeyboardShortcuts.js.map +1 -0
- package/dist/LoginPage.js +593 -0
- package/dist/LoginPage.js.map +1 -0
- package/dist/MenuBar.js +1461 -0
- package/dist/MenuBar.js.map +1 -0
- package/dist/Metadata.js +206 -0
- package/dist/Metadata.js.map +1 -0
- package/dist/{MoreDropdown/index.js → MoreDropdown.js} +102 -9
- package/dist/MoreDropdown.js.map +1 -0
- package/dist/NavigationHeader.js +690 -0
- package/dist/NavigationHeader.js.map +1 -0
- package/dist/NeetoWidget.js +1333 -0
- package/dist/NeetoWidget.js.map +1 -0
- package/dist/PageLoader.js +134 -0
- package/dist/PageLoader.js.map +1 -0
- package/dist/PhoneNumber.js +365 -0
- package/dist/PhoneNumber.js.map +1 -0
- package/dist/PublishBlock.js +158 -0
- package/dist/PublishBlock.js.map +1 -0
- package/dist/Rename.js +450 -0
- package/dist/Rename.js.map +1 -0
- package/dist/ResponsiveDevicePicker.js +194 -0
- package/dist/ResponsiveDevicePicker.js.map +1 -0
- package/dist/Schedule.js +1046 -0
- package/dist/Schedule.js.map +1 -0
- package/dist/Scrollable.js +122 -0
- package/dist/Scrollable.js.map +1 -0
- package/dist/Search.js +151 -0
- package/dist/Search.js.map +1 -0
- package/dist/Security.js +1835 -0
- package/dist/Security.js.map +1 -0
- package/dist/SendToFields.js +601 -0
- package/dist/SendToFields.js.map +1 -0
- package/dist/Settings.js +435 -0
- package/dist/Settings.js.map +1 -0
- package/dist/ShareViaEmail.js +2277 -0
- package/dist/ShareViaEmail.js.map +1 -0
- package/dist/ShareViaLink.js +628 -0
- package/dist/ShareViaLink.js.map +1 -0
- package/dist/Sidebar.js +972 -0
- package/dist/Sidebar.js.map +1 -0
- package/dist/SubHeader.js +216 -0
- package/dist/SubHeader.js.map +1 -0
- package/dist/{TableWrapper/index.js → TableWrapper.js} +6 -3
- package/dist/TableWrapper.js.map +1 -0
- package/dist/ThemeSidebar.js +1984 -0
- package/dist/ThemeSidebar.js.map +1 -0
- package/dist/TimeFormat.js +47 -0
- package/dist/TimeFormat.js.map +1 -0
- package/dist/TimezoneMismatchModal.js +168 -0
- package/dist/TimezoneMismatchModal.js.map +1 -0
- package/dist/ToggleFeatureCard.js +323 -0
- package/dist/ToggleFeatureCard.js.map +1 -0
- package/package.json +22 -13
- package/dist/AutoSaveInput/autosaveinput.scss +0 -15
- package/dist/AutoSaveInput/constants.js +0 -13
- package/dist/AutoSaveInput/index.js +0 -124
- package/dist/AutoSaveInput/utils.js +0 -10
- package/dist/Breadcrumbs/breadcrumbs.scss +0 -33
- package/dist/Breadcrumbs/index.js +0 -31
- package/dist/BrowserSupport/Callout.js +0 -15
- package/dist/BrowserSupport/ContactUs.js +0 -21
- package/dist/BrowserSupport/DownloadLink.js +0 -17
- package/dist/BrowserSupport/PartialSupportedBrowserVersion.js +0 -17
- package/dist/BrowserSupport/UnknownBrowser.js +0 -13
- package/dist/BrowserSupport/UnsupportedBrowser.js +0 -24
- package/dist/BrowserSupport/UnsupportedBrowserMessage.js +0 -22
- package/dist/BrowserSupport/UnsupportedBrowserVersion.js +0 -27
- package/dist/BrowserSupport/UnsupportedVersionMessage.js +0 -30
- package/dist/BrowserSupport/browsersupport.scss +0 -71
- package/dist/BrowserSupport/constants.js +0 -63
- package/dist/BrowserSupport/index.js +0 -58
- package/dist/BrowserSupport/utils.js +0 -32
- package/dist/Builder/Body.js +0 -9
- package/dist/Builder/ElementsPanel/ElementsList/Element.js +0 -27
- package/dist/Builder/ElementsPanel/ElementsList/Section.js +0 -28
- package/dist/Builder/ElementsPanel/ElementsList/TitleBar.js +0 -28
- package/dist/Builder/ElementsPanel/ElementsList/index.js +0 -63
- package/dist/Builder/ElementsPanel/SelectedElementsList/SelectedElement.js +0 -73
- package/dist/Builder/ElementsPanel/SelectedElementsList/TitleBar.js +0 -50
- package/dist/Builder/ElementsPanel/SelectedElementsList/index.js +0 -91
- package/dist/Builder/ElementsPanel/index.js +0 -70
- package/dist/Builder/PropertiesPanel/EmptyProperty.js +0 -21
- package/dist/Builder/PropertiesPanel/Skeleton.js +0 -24
- package/dist/Builder/PropertiesPanel/index.js +0 -12
- package/dist/Builder/index.js +0 -3
- package/dist/Builder/styles.scss +0 -84
- package/dist/CalendarView/CustomDatePicker.js +0 -87
- package/dist/CalendarView/Header.js +0 -53
- package/dist/CalendarView/constants.js +0 -19
- package/dist/CalendarView/index.js +0 -83
- package/dist/CalendarView/utils.js +0 -50
- package/dist/Codeblock/index.js +0 -30
- package/dist/Columns/utils.js +0 -20
- package/dist/ConfirmationModal/constants.js +0 -3
- package/dist/ConfirmationModal/utils.js +0 -6
- package/dist/Container/container.scss +0 -21
- package/dist/Container/index.js +0 -23
- package/dist/CopyToClipboardButton/constants.js +0 -13
- package/dist/CopyToClipboardButton/copyToClipboard.scss +0 -22
- package/dist/CopyToClipboardButton/index.js +0 -59
- package/dist/CustomDomain/index.js +0 -98
- package/dist/CustomDomainDashboard/DeleteAlert.js +0 -28
- package/dist/CustomDomainDashboard/Header.js +0 -32
- package/dist/CustomDomainDashboard/Manage/Record.js +0 -42
- package/dist/CustomDomainDashboard/Manage/StatusInfo.js +0 -21
- package/dist/CustomDomainDashboard/Manage/TagBlock.js +0 -36
- package/dist/CustomDomainDashboard/Manage/constants.js +0 -4
- package/dist/CustomDomainDashboard/Manage/index.js +0 -125
- package/dist/CustomDomainDashboard/Manage/utils.js +0 -8
- package/dist/CustomDomainDashboard/api.js +0 -35
- package/dist/CustomDomainDashboard/constants.js +0 -2
- package/dist/CustomDomainDashboard/index.js +0 -118
- package/dist/CustomDomainDashboard/useCustomDomainApi.js +0 -71
- package/dist/CustomDomainDashboard/utils.js +0 -84
- package/dist/DateRangeFilter/index.js +0 -60
- package/dist/DateRangeFilter/utils.js +0 -113
- package/dist/DynamicVariables/dynamic-variables.scss +0 -34
- package/dist/DynamicVariables/index.js +0 -59
- package/dist/DynamicVariables/utils.js +0 -37
- package/dist/EmailForm/EmailForm.js +0 -98
- package/dist/EmailForm/EmailFormProvider.js +0 -45
- package/dist/EmailForm/EmailPreview.js +0 -129
- package/dist/EmailForm/ReplyToField.js +0 -55
- package/dist/EmailForm/SendToField.js +0 -28
- package/dist/EmailForm/SubjectField.js +0 -64
- package/dist/EmailForm/constants.js +0 -33
- package/dist/EmailForm/contexts/EmailForm.js +0 -7
- package/dist/EmailForm/index.js +0 -4
- package/dist/EmailForm/utils.js +0 -10
- package/dist/EmailPreview/index.js +0 -2
- package/dist/ErrorPage/index.js +0 -78
- package/dist/Header/Breadcrumbs.js +0 -31
- package/dist/Header/Dropdown.js +0 -12
- package/dist/Header/constants.js +0 -6
- package/dist/Header/header.scss +0 -121
- package/dist/Header/index.js +0 -61
- package/dist/IconPicker/Icon.js +0 -34
- package/dist/IconPicker/NoResults.js +0 -12
- package/dist/IconPicker/constants.js +0 -8
- package/dist/IconPicker/icon-picker.scss +0 -1
- package/dist/IconPicker/index.js +0 -164
- package/dist/ImageWithFallback/ImagePlaceholder.js +0 -16
- package/dist/ImageWithFallback/index.js +0 -31
- package/dist/IntegrationCard/Dropdown.js +0 -45
- package/dist/IntegrationCard/Status.js +0 -25
- package/dist/IntegrationCard/index.js +0 -128
- package/dist/IntegrationDisconnectAlert/index.js +0 -36
- package/dist/IpRestriction/AllowedIpRanges.js +0 -75
- package/dist/IpRestriction/CurrentIp.js +0 -26
- package/dist/IpRestriction/FormRow.js +0 -84
- package/dist/IpRestriction/Row.js +0 -91
- package/dist/IpRestriction/apis/allowed_ip_ranges.js +0 -28
- package/dist/IpRestriction/apis/current_ip.js +0 -11
- package/dist/IpRestriction/apis/ip_restriction.js +0 -16
- package/dist/IpRestriction/constants.js +0 -20
- package/dist/IpRestriction/hooks/reactQuery/useAllowedIpRanges.js +0 -34
- package/dist/IpRestriction/hooks/reactQuery/useCurrentIp.js +0 -10
- package/dist/IpRestriction/hooks/reactQuery/useIpRestrictions.js +0 -18
- package/dist/IpRestriction/index.js +0 -102
- package/dist/IpRestriction/utils.js +0 -85
- package/dist/KeyboardShortcuts/Pane/HotKey.js +0 -44
- package/dist/KeyboardShortcuts/Pane/HotKeyList.js +0 -42
- package/dist/KeyboardShortcuts/Pane/constants.js +0 -25
- package/dist/KeyboardShortcuts/Pane/index.js +0 -61
- package/dist/KeyboardShortcuts/Pane/keyboard-shortcuts.scss +0 -5
- package/dist/KeyboardShortcuts/Pane/utils.js +0 -66
- package/dist/KeyboardShortcuts/hooks/useKeyboardShortcutsPaneState.js +0 -31
- package/dist/KeyboardShortcuts/index.js +0 -9
- package/dist/LoginPage/Form.js +0 -57
- package/dist/LoginPage/constants.js +0 -12
- package/dist/LoginPage/index.js +0 -103
- package/dist/MenuBar/AddNew.js +0 -25
- package/dist/MenuBar/Block.js +0 -60
- package/dist/MenuBar/Item.js +0 -32
- package/dist/MenuBar/Search.js +0 -39
- package/dist/MenuBar/SubTitle.js +0 -23
- package/dist/MenuBar/index.js +0 -46
- package/dist/MenuBar/menubar.scss +0 -154
- package/dist/Metadata/Block.js +0 -30
- package/dist/Metadata/DetailsBlock.js +0 -86
- package/dist/Metadata/constants.js +0 -9
- package/dist/Metadata/index.js +0 -29
- package/dist/Metadata/metadata.scss +0 -15
- package/dist/MoreDropdown/constants.js +0 -25
- package/dist/NavigationHeader/LeftBlock.js +0 -32
- package/dist/NavigationHeader/Navigation.js +0 -24
- package/dist/NavigationHeader/RightBlock.js +0 -68
- package/dist/NavigationHeader/constants.js +0 -11
- package/dist/NavigationHeader/index.js +0 -19
- package/dist/NavigationHeader/navigation-header.scss +0 -3
- package/dist/NeetoWidget/CodeBlock.js +0 -57
- package/dist/NeetoWidget/CodeSnippet.js +0 -119
- package/dist/NeetoWidget/EmbedCode.js +0 -281
- package/dist/NeetoWidget/Main.js +0 -19
- package/dist/NeetoWidget/SelectionSwitches/TooltipSwitch.js +0 -25
- package/dist/NeetoWidget/SelectionSwitches/index.js +0 -44
- package/dist/NeetoWidget/SyntaxHighlighter.js +0 -17
- package/dist/NeetoWidget/api.js +0 -20
- package/dist/NeetoWidget/constants.js +0 -62
- package/dist/NeetoWidget/hooks/useForceUpdate.js +0 -14
- package/dist/NeetoWidget/index.js +0 -7
- package/dist/NeetoWidget/mutations.js +0 -9
- package/dist/NeetoWidget/queries.js +0 -32
- package/dist/NeetoWidget/utils.js +0 -83
- package/dist/PageLoader/index.js +0 -81
- package/dist/PageLoader/page-loader.scss +0 -95
- package/dist/PhoneNumber/CountryPicker/SingleValue.js +0 -21
- package/dist/PhoneNumber/CountryPicker/constants.js +0 -26
- package/dist/PhoneNumber/CountryPicker/index.js +0 -59
- package/dist/PhoneNumber/FormikPhoneNumberInput.js +0 -21
- package/dist/PhoneNumber/PhoneNumber.js +0 -30
- package/dist/PhoneNumber/PhoneNumberInput.js +0 -79
- package/dist/PhoneNumber/index.js +0 -5
- package/dist/PhoneNumber/utils.js +0 -55
- package/dist/PublishBlock/AlertBlock.js +0 -14
- package/dist/PublishBlock/index.js +0 -100
- package/dist/PublishBlock/publish-block.scss +0 -25
- package/dist/Rename/DummySpan.js +0 -21
- package/dist/Rename/constants.js +0 -1
- package/dist/Rename/index.js +0 -191
- package/dist/Rename/rename.scss +0 -69
- package/dist/Rename/utils.js +0 -10
- package/dist/ResponsiveDevicePicker/constants.js +0 -19
- package/dist/ResponsiveDevicePicker/index.js +0 -36
- package/dist/Schedule/DisplayAvailability.js +0 -58
- package/dist/Schedule/Fields.js +0 -43
- package/dist/Schedule/Form/ScheduleRow.js +0 -125
- package/dist/Schedule/Form/constants.js +0 -20
- package/dist/Schedule/Form/index.js +0 -144
- package/dist/Schedule/Form/utils.js +0 -63
- package/dist/Schedule/Header.js +0 -76
- package/dist/Schedule/ScheduleContext.js +0 -8
- package/dist/Schedule/constants.js +0 -8
- package/dist/Schedule/dayjsExtended/constants.js +0 -1
- package/dist/Schedule/dayjsExtended/index.js +0 -14
- package/dist/Schedule/dayjsExtended/range.js +0 -73
- package/dist/Schedule/index.js +0 -80
- package/dist/Schedule/utils.js +0 -152
- package/dist/Scrollable/constants.js +0 -8
- package/dist/Scrollable/index.js +0 -26
- package/dist/Scrollable/scrollable.scss +0 -32
- package/dist/Search/index.js +0 -52
- package/dist/Security/AllowedKeywords/Add.js +0 -38
- package/dist/Security/AllowedKeywords/index.js +0 -38
- package/dist/Security/PasswordBlock.js +0 -31
- package/dist/Security/RadioBlock.js +0 -38
- package/dist/Security/api.js +0 -12
- package/dist/Security/constants.js +0 -58
- package/dist/Security/index.js +0 -68
- package/dist/Security/useSecurityApi.js +0 -22
- package/dist/Security/utils.js +0 -31
- package/dist/SendToFields/FilePicker.js +0 -34
- package/dist/SendToFields/constants.js +0 -6
- package/dist/SendToFields/index.js +0 -102
- package/dist/SendToFields/utils.js +0 -54
- package/dist/Settings/Category.js +0 -30
- package/dist/Settings/Item.js +0 -38
- package/dist/Settings/index.js +0 -37
- package/dist/Settings/utils.js +0 -4
- package/dist/ShareViaEmail/EmailBodyEditor.js +0 -22
- package/dist/ShareViaEmail/FilePicker.js +0 -43
- package/dist/ShareViaEmail/Form.js +0 -105
- package/dist/ShareViaEmail/FormikDatePicker.js +0 -24
- package/dist/ShareViaEmail/constants.js +0 -14
- package/dist/ShareViaEmail/index.js +0 -92
- package/dist/ShareViaEmail/utils.js +0 -72
- package/dist/ShareViaLink/EditURL.js +0 -74
- package/dist/ShareViaLink/Link.js +0 -105
- package/dist/ShareViaLink/QRCode.js +0 -41
- package/dist/ShareViaLink/RegenerateURL.js +0 -47
- package/dist/ShareViaLink/SocialMedia.js +0 -52
- package/dist/ShareViaLink/constants.js +0 -25
- package/dist/ShareViaLink/edit-url.scss +0 -8
- package/dist/ShareViaLink/index.js +0 -46
- package/dist/ShareViaLink/utils.js +0 -47
- package/dist/Sidebar/AppSwitcher/AppLink.js +0 -45
- package/dist/Sidebar/AppSwitcher/Backdrop.js +0 -13
- package/dist/Sidebar/AppSwitcher/Body.js +0 -65
- package/dist/Sidebar/AppSwitcher/Portal.js +0 -27
- package/dist/Sidebar/AppSwitcher/appswitcher.scss +0 -164
- package/dist/Sidebar/AppSwitcher/index.js +0 -47
- package/dist/Sidebar/AppSwitcher/utils.js +0 -25
- package/dist/Sidebar/Chevron.js +0 -14
- package/dist/Sidebar/FeaturedTooltip.js +0 -19
- package/dist/Sidebar/Footer/AppSwitcherButton.js +0 -48
- package/dist/Sidebar/Footer/ProfileButton.js +0 -30
- package/dist/Sidebar/Footer/index.js +0 -56
- package/dist/Sidebar/Footer/utils.js +0 -39
- package/dist/Sidebar/Header.js +0 -33
- package/dist/Sidebar/HelpSection/HelpSectionMenu.js +0 -52
- package/dist/Sidebar/HelpSection/index.js +0 -32
- package/dist/Sidebar/Links.js +0 -112
- package/dist/Sidebar/NavIconWrapper.js +0 -20
- package/dist/Sidebar/ProfileSection/LinkSection.js +0 -36
- package/dist/Sidebar/ProfileSection/ProfileMenu.js +0 -48
- package/dist/Sidebar/ProfileSection/index.js +0 -42
- package/dist/Sidebar/constants.js +0 -40
- package/dist/Sidebar/index.js +0 -94
- package/dist/Sidebar/sidebar.scss +0 -379
- package/dist/Sidebar/utils.js +0 -18
- package/dist/SubHeader/RightBlock/Columns.js +0 -35
- package/dist/SubHeader/RightBlock/Download.js +0 -28
- package/dist/SubHeader/RightBlock/Filter.js +0 -31
- package/dist/SubHeader/RightBlock/index.js +0 -21
- package/dist/SubHeader/RightBlock/utils.js +0 -13
- package/dist/SubHeader/index.js +0 -28
- package/dist/SubHeader/subheader.scss +0 -78
- package/dist/ThemeSidebar/Customize/Logo.js +0 -39
- package/dist/ThemeSidebar/Customize/Properties.js +0 -170
- package/dist/ThemeSidebar/Customize/index.js +0 -66
- package/dist/ThemeSidebar/Themes/ThemeCard.js +0 -135
- package/dist/ThemeSidebar/Themes/index.js +0 -110
- package/dist/ThemeSidebar/TitleBar.js +0 -62
- package/dist/ThemeSidebar/constants.js +0 -127
- package/dist/ThemeSidebar/fields/AlignmentBlock.js +0 -50
- package/dist/ThemeSidebar/fields/Card.js +0 -19
- package/dist/ThemeSidebar/fields/ColorBlock.js +0 -19
- package/dist/ThemeSidebar/fields/FontPickerBlock.js +0 -35
- package/dist/ThemeSidebar/fields/ImageBlock/ImageUploader.js +0 -67
- package/dist/ThemeSidebar/fields/ImageBlock/ProgressBar.js +0 -22
- package/dist/ThemeSidebar/fields/ImageBlock/index.js +0 -55
- package/dist/ThemeSidebar/fields/SelectBlock.js +0 -24
- package/dist/ThemeSidebar/fields/SliderBlock.js +0 -30
- package/dist/ThemeSidebar/fields/SwitchBlock.js +0 -17
- package/dist/ThemeSidebar/fields/TextBlock.js +0 -13
- package/dist/ThemeSidebar/fields/slider.scss +0 -199
- package/dist/ThemeSidebar/hooks/useDirectUploadDropzone.js +0 -149
- package/dist/ThemeSidebar/index.js +0 -118
- package/dist/ThemeSidebar/themeSidebar.scss +0 -45
- package/dist/ThemeSidebar/utils.js +0 -169
- package/dist/TimeFormat/index.js +0 -3
- package/dist/TimezoneMismatchModal/apis/time_zone.js +0 -9
- package/dist/TimezoneMismatchModal/index.js +0 -83
- package/dist/TimezoneMismatchModal/useTimeZoneApi.js +0 -10
- package/dist/TimezoneMismatchModal/utils.js +0 -12
- package/dist/ToggleFeatureCard/ToolTipSwitch.js +0 -31
- package/dist/ToggleFeatureCard/constants.js +0 -5
- package/dist/ToggleFeatureCard/hooks/useScrollIntoView.js +0 -11
- package/dist/ToggleFeatureCard/index.js +0 -148
- package/dist/ToggleFeatureCard/toggleFeatureCard.scss +0 -4
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { useState } from "react";
|
|
3
|
-
import { Button, Typography } from "@bigbinary/neetoui";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { INITIAL_VALUES } from "./constants";
|
|
6
|
-
import FormRow from "./FormRow";
|
|
7
|
-
import { useFetchAllowedIpRanges } from "./hooks/reactQuery/useAllowedIpRanges";
|
|
8
|
-
import Row from "./Row";
|
|
9
|
-
var AllowedIpRanges = function AllowedIpRanges() {
|
|
10
|
-
var _useState = useState(""),
|
|
11
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
12
|
-
editingRow = _useState2[0],
|
|
13
|
-
setEditingRow = _useState2[1];
|
|
14
|
-
var _useState3 = useState(false),
|
|
15
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
16
|
-
showAddNew = _useState4[0],
|
|
17
|
-
setShowAddNew = _useState4[1];
|
|
18
|
-
var _useTranslation = useTranslation(),
|
|
19
|
-
t = _useTranslation.t;
|
|
20
|
-
var _useFetchAllowedIpRan = useFetchAllowedIpRanges(),
|
|
21
|
-
allowedIpRanges = _useFetchAllowedIpRan.data;
|
|
22
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
-
className: "space-y-6",
|
|
24
|
-
"data-cy": "allowed-ip-range-container"
|
|
25
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
26
|
-
"data-cy": "allowed-ip-range-heading",
|
|
27
|
-
style: "h4"
|
|
28
|
-
}, t("neetoMolecules.ipRestriction.allowedIpRangeTitle")), /*#__PURE__*/React.createElement("div", {
|
|
29
|
-
className: "space-y-4"
|
|
30
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
31
|
-
className: "grid grid-cols-12 gap-4 px-3"
|
|
32
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
33
|
-
className: "neeto-ui-text-gray-700 col-span-4 uppercase",
|
|
34
|
-
style: "h6"
|
|
35
|
-
}, t("neetoMolecules.ipRestriction.ipStart")), /*#__PURE__*/React.createElement(Typography, {
|
|
36
|
-
className: "neeto-ui-text-gray-700 col-span-4 uppercase",
|
|
37
|
-
style: "h6"
|
|
38
|
-
}, t("neetoMolecules.ipRestriction.ipEnd")), /*#__PURE__*/React.createElement(Typography, {
|
|
39
|
-
className: "neeto-ui-text-gray-700 col-span-2 uppercase",
|
|
40
|
-
style: "h6"
|
|
41
|
-
}, t("neetoMolecules.ipRestriction.type")), /*#__PURE__*/React.createElement(Typography, {
|
|
42
|
-
className: "neeto-ui-text-gray-700 col-span-2 text-center uppercase",
|
|
43
|
-
style: "h6"
|
|
44
|
-
}, t("neetoMolecules.ipRestriction.actions"))), /*#__PURE__*/React.createElement("div", {
|
|
45
|
-
className: "w-full space-y-2"
|
|
46
|
-
}, allowedIpRanges === null || allowedIpRanges === void 0 ? void 0 : allowedIpRanges.map(function (allowedIpRange) {
|
|
47
|
-
return editingRow === allowedIpRange.id ? /*#__PURE__*/React.createElement(FormRow, {
|
|
48
|
-
data: allowedIpRange,
|
|
49
|
-
isAddNew: false,
|
|
50
|
-
key: allowedIpRange.id,
|
|
51
|
-
onCollapse: function onCollapse() {
|
|
52
|
-
return setEditingRow("");
|
|
53
|
-
}
|
|
54
|
-
}) : /*#__PURE__*/React.createElement(Row, {
|
|
55
|
-
data: allowedIpRange,
|
|
56
|
-
key: allowedIpRange.id,
|
|
57
|
-
setEditingRow: setEditingRow
|
|
58
|
-
});
|
|
59
|
-
}), showAddNew && /*#__PURE__*/React.createElement(FormRow, {
|
|
60
|
-
isAddNew: true,
|
|
61
|
-
data: INITIAL_VALUES,
|
|
62
|
-
onCollapse: function onCollapse() {
|
|
63
|
-
return setShowAddNew(false);
|
|
64
|
-
}
|
|
65
|
-
})), /*#__PURE__*/React.createElement(Button, {
|
|
66
|
-
"data-cy": "add-allowed-ip-range-button",
|
|
67
|
-
disabled: showAddNew,
|
|
68
|
-
label: t("neetoMolecules.ipRestriction.addNew"),
|
|
69
|
-
style: "link",
|
|
70
|
-
onClick: function onClick() {
|
|
71
|
-
return setShowAddNew(true);
|
|
72
|
-
}
|
|
73
|
-
})));
|
|
74
|
-
};
|
|
75
|
-
export default /*#__PURE__*/React.memo(AllowedIpRanges);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Typography } from "@bigbinary/neetoui";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { useShowCurrentIp } from "./hooks/reactQuery/useCurrentIp";
|
|
5
|
-
var CurrentIp = function CurrentIp() {
|
|
6
|
-
var _useShowCurrentIp = useShowCurrentIp(),
|
|
7
|
-
data = _useShowCurrentIp.data,
|
|
8
|
-
isLoading = _useShowCurrentIp.isLoading;
|
|
9
|
-
var _useTranslation = useTranslation(),
|
|
10
|
-
t = _useTranslation.t;
|
|
11
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
-
className: "flex flex-wrap items-baseline gap-1",
|
|
13
|
-
"data-cy": "current-ip-container"
|
|
14
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
15
|
-
"data-cy": "current-ip-heading",
|
|
16
|
-
style: "body2"
|
|
17
|
-
}, t("neetoMolecules.ipRestriction.currentIpTitle")), /*#__PURE__*/React.createElement(Typography, {
|
|
18
|
-
"data-cy": "current-ip-value",
|
|
19
|
-
style: "h4",
|
|
20
|
-
weight: "semibold"
|
|
21
|
-
}, isLoading ? "..." : data.ip), /*#__PURE__*/React.createElement(Typography, {
|
|
22
|
-
"data-cy": "current-ip-description",
|
|
23
|
-
style: "body2"
|
|
24
|
-
}, t("neetoMolecules.ipRestriction.currentIpDescription")));
|
|
25
|
-
};
|
|
26
|
-
export default /*#__PURE__*/React.memo(CurrentIp);
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Check, Close } from "@bigbinary/neeto-icons";
|
|
3
|
-
import { Button } from "@bigbinary/neetoui";
|
|
4
|
-
import { Input, Form, Button as FormikButton, Select } from "@bigbinary/neetoui/formik";
|
|
5
|
-
import { assoc } from "ramda";
|
|
6
|
-
import { useTranslation } from "react-i18next";
|
|
7
|
-
import { ADDRESS_TYPE_SELECT_OPTIONS } from "./constants";
|
|
8
|
-
import { useCreateAllowedIpRanges, useUpdateAllowedIpRanges } from "./hooks/reactQuery/useAllowedIpRanges";
|
|
9
|
-
import { buildInitialValue, getIpRestrictionValidationSchema } from "./utils";
|
|
10
|
-
var FormRow = function FormRow(_ref) {
|
|
11
|
-
var data = _ref.data,
|
|
12
|
-
isAddNew = _ref.isAddNew,
|
|
13
|
-
onCollapse = _ref.onCollapse;
|
|
14
|
-
var _useCreateAllowedIpRa = useCreateAllowedIpRanges(),
|
|
15
|
-
createAllowedIpRange = _useCreateAllowedIpRa.mutate;
|
|
16
|
-
var _useUpdateAllowedIpRa = useUpdateAllowedIpRanges(),
|
|
17
|
-
updateAllowedIpRange = _useUpdateAllowedIpRa.mutate;
|
|
18
|
-
var _useTranslation = useTranslation(),
|
|
19
|
-
t = _useTranslation.t;
|
|
20
|
-
var handleSubmit = function handleSubmit(values) {
|
|
21
|
-
var payload = assoc("addressType", values.addressType.value, values);
|
|
22
|
-
if (isAddNew) {
|
|
23
|
-
createAllowedIpRange(payload);
|
|
24
|
-
} else {
|
|
25
|
-
updateAllowedIpRange({
|
|
26
|
-
id: data.id,
|
|
27
|
-
payload: payload
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
onCollapse();
|
|
31
|
-
};
|
|
32
|
-
return /*#__PURE__*/React.createElement(Form, {
|
|
33
|
-
"data-cy": "allowed-ip-range-form",
|
|
34
|
-
formikProps: {
|
|
35
|
-
initialValues: buildInitialValue(data),
|
|
36
|
-
validationSchema: getIpRestrictionValidationSchema(),
|
|
37
|
-
onSubmit: handleSubmit
|
|
38
|
-
}
|
|
39
|
-
}, function (_ref2) {
|
|
40
|
-
var isSubmitting = _ref2.isSubmitting;
|
|
41
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
className: "neeto-ui-bg-white neeto-ui-rounded-lg grid grid-cols-12 gap-4 p-3"
|
|
43
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
44
|
-
autoFocus: true,
|
|
45
|
-
className: "col-span-4 text-left",
|
|
46
|
-
"data-cy": "ip-start-text-field",
|
|
47
|
-
name: "ipStart",
|
|
48
|
-
placeholder: t("neetoMolecules.ipRestriction.ipStart")
|
|
49
|
-
}), /*#__PURE__*/React.createElement(Input, {
|
|
50
|
-
className: "col-span-4 text-left",
|
|
51
|
-
"data-cy": "ip-end-text-field",
|
|
52
|
-
name: "ipEnd",
|
|
53
|
-
placeholder: t("neetoMolecules.ipRestriction.ipEnd")
|
|
54
|
-
}), /*#__PURE__*/React.createElement(Select, {
|
|
55
|
-
className: "col-span-2 text-left",
|
|
56
|
-
name: "addressType",
|
|
57
|
-
options: ADDRESS_TYPE_SELECT_OPTIONS
|
|
58
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
59
|
-
className: "col-span-2 flex items-start justify-center gap-1"
|
|
60
|
-
}, /*#__PURE__*/React.createElement(FormikButton, {
|
|
61
|
-
"data-cy": "save-changes-button",
|
|
62
|
-
"data-testid": "save-changes-button",
|
|
63
|
-
disabled: isSubmitting,
|
|
64
|
-
icon: Check,
|
|
65
|
-
style: "text",
|
|
66
|
-
tooltipProps: {
|
|
67
|
-
content: "Submit",
|
|
68
|
-
position: "top"
|
|
69
|
-
},
|
|
70
|
-
type: "submit"
|
|
71
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
72
|
-
"data-cy": "ip-cancel-button",
|
|
73
|
-
icon: Close,
|
|
74
|
-
style: "text",
|
|
75
|
-
type: "reset",
|
|
76
|
-
tooltipProps: {
|
|
77
|
-
content: t("neetoMolecules.common.actions.cancel"),
|
|
78
|
-
position: "top"
|
|
79
|
-
},
|
|
80
|
-
onClick: onCollapse
|
|
81
|
-
})));
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
export default FormRow;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { useState } from "react";
|
|
3
|
-
import { truncate } from "@bigbinary/neeto-commons-frontend/pure";
|
|
4
|
-
import { Typography, Alert, Tooltip } from "@bigbinary/neetoui";
|
|
5
|
-
import { useTranslation, Trans } from "react-i18next";
|
|
6
|
-
import MoreDropdown from "../MoreDropdown";
|
|
7
|
-
import { TRUNCATE_LENGTH } from "./constants";
|
|
8
|
-
import { useDestroyAllowedIpRanges } from "./hooks/reactQuery/useAllowedIpRanges";
|
|
9
|
-
import { humanizeIpAddressFormat } from "./utils";
|
|
10
|
-
var Row = function Row(_ref) {
|
|
11
|
-
var data = _ref.data,
|
|
12
|
-
setEditingRow = _ref.setEditingRow;
|
|
13
|
-
var _useState = useState(false),
|
|
14
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
15
|
-
isDeleteIpRangeAlertOpen = _useState2[0],
|
|
16
|
-
setIsDeleteIpRangeAlertOpen = _useState2[1];
|
|
17
|
-
var _useDestroyAllowedIpR = useDestroyAllowedIpRanges(),
|
|
18
|
-
destroyAllowedIpRange = _useDestroyAllowedIpR.mutate;
|
|
19
|
-
var _useTranslation = useTranslation(),
|
|
20
|
-
t = _useTranslation.t;
|
|
21
|
-
var handleDelete = function handleDelete() {
|
|
22
|
-
destroyAllowedIpRange(data.id);
|
|
23
|
-
setIsDeleteIpRangeAlertOpen(false);
|
|
24
|
-
};
|
|
25
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
-
className: "neeto-ui-bg-white neeto-ui-rounded-lg grid grid-cols-12 items-center gap-4 p-3",
|
|
27
|
-
"data-cy": "ip-range-row"
|
|
28
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
29
|
-
content: data.ipStart,
|
|
30
|
-
disabled: data.ipStart.length < TRUNCATE_LENGTH,
|
|
31
|
-
position: "top"
|
|
32
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
33
|
-
className: "col-span-4",
|
|
34
|
-
"data-cy": "ip-range-start-value",
|
|
35
|
-
style: "body2"
|
|
36
|
-
}, truncate(data.ipStart, TRUNCATE_LENGTH))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
37
|
-
content: data.ipEnd,
|
|
38
|
-
disabled: data.ipEnd.length < TRUNCATE_LENGTH,
|
|
39
|
-
position: "top"
|
|
40
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
41
|
-
className: "col-span-4",
|
|
42
|
-
"data-cy": "ip-range-end-value",
|
|
43
|
-
style: "body2"
|
|
44
|
-
}, truncate(data.ipEnd, TRUNCATE_LENGTH))), /*#__PURE__*/React.createElement(Typography, {
|
|
45
|
-
className: "col-span-2",
|
|
46
|
-
"data-cy": "ip-range-end-value",
|
|
47
|
-
style: "body2"
|
|
48
|
-
}, humanizeIpAddressFormat(data.addressType)), /*#__PURE__*/React.createElement("div", {
|
|
49
|
-
className: "col-span-2 flex justify-center"
|
|
50
|
-
}, /*#__PURE__*/React.createElement(MoreDropdown, {
|
|
51
|
-
dropdownButtonProps: {
|
|
52
|
-
"data-testid": "ip-range-actions-dropdown"
|
|
53
|
-
},
|
|
54
|
-
dropdownProps: {
|
|
55
|
-
position: "bottom-end"
|
|
56
|
-
},
|
|
57
|
-
menuItems: [{
|
|
58
|
-
"data-cy": "ip-range-edit-button",
|
|
59
|
-
key: "ip-range-edit-button",
|
|
60
|
-
label: t("neetoMolecules.common.actions.edit"),
|
|
61
|
-
onClick: function onClick() {
|
|
62
|
-
return setEditingRow(data.id);
|
|
63
|
-
}
|
|
64
|
-
}, {
|
|
65
|
-
"data-cy": "ip-range-delete-button",
|
|
66
|
-
key: "ip-range-delete-button",
|
|
67
|
-
label: t("neetoMolecules.common.actions.delete"),
|
|
68
|
-
onClick: function onClick() {
|
|
69
|
-
return setIsDeleteIpRangeAlertOpen(true);
|
|
70
|
-
}
|
|
71
|
-
}]
|
|
72
|
-
}), /*#__PURE__*/React.createElement(Alert, {
|
|
73
|
-
isOpen: isDeleteIpRangeAlertOpen,
|
|
74
|
-
submitButtonLabel: t("neetoMolecules.common.actions.delete"),
|
|
75
|
-
message: /*#__PURE__*/React.createElement(Trans, {
|
|
76
|
-
i18nKey: "neetoMolecules.ipRestriction.allowedIpRangeConfirmation",
|
|
77
|
-
values: {
|
|
78
|
-
ipStart: data.ipStart,
|
|
79
|
-
ipEnd: data.ipEnd
|
|
80
|
-
}
|
|
81
|
-
}),
|
|
82
|
-
title: t("neetoMolecules.common.deleteAlert.title", {
|
|
83
|
-
entity: t("neetoMolecules.ipRestriction.allowedIpRangeConfirmationTitle")
|
|
84
|
-
}),
|
|
85
|
-
onClose: function onClose() {
|
|
86
|
-
return setIsDeleteIpRangeAlertOpen(false);
|
|
87
|
-
},
|
|
88
|
-
onSubmit: handleDelete
|
|
89
|
-
})));
|
|
90
|
-
};
|
|
91
|
-
export default /*#__PURE__*/React.memo(Row);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
import { IP_RESTRICTIONS_ENGINE_BASE_URL } from "../constants";
|
|
3
|
-
var allowedIpRangesUrl = "".concat(IP_RESTRICTIONS_ENGINE_BASE_URL, "/allowed_ips");
|
|
4
|
-
var fetch = function fetch() {
|
|
5
|
-
return axios.get(allowedIpRangesUrl);
|
|
6
|
-
};
|
|
7
|
-
var create = function create(payload) {
|
|
8
|
-
return axios.post(allowedIpRangesUrl, {
|
|
9
|
-
allowedIpRange: payload
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
var destroy = function destroy(id) {
|
|
13
|
-
return axios["delete"]("".concat(allowedIpRangesUrl, "/").concat(id));
|
|
14
|
-
};
|
|
15
|
-
var update = function update(_ref) {
|
|
16
|
-
var id = _ref.id,
|
|
17
|
-
payload = _ref.payload;
|
|
18
|
-
return axios.patch("".concat(allowedIpRangesUrl, "/").concat(id), {
|
|
19
|
-
allowedIpRange: payload
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var allowedIpRangesApi = {
|
|
23
|
-
fetch: fetch,
|
|
24
|
-
create: create,
|
|
25
|
-
destroy: destroy,
|
|
26
|
-
update: update
|
|
27
|
-
};
|
|
28
|
-
export default allowedIpRangesApi;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
import { IP_RESTRICTIONS_ENGINE_BASE_URL } from "../constants";
|
|
3
|
-
var show = function show(params) {
|
|
4
|
-
return axios.get("".concat(IP_RESTRICTIONS_ENGINE_BASE_URL, "/current_ip"), {
|
|
5
|
-
params: params
|
|
6
|
-
});
|
|
7
|
-
};
|
|
8
|
-
var currentIpApi = {
|
|
9
|
-
show: show
|
|
10
|
-
};
|
|
11
|
-
export default currentIpApi;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
import { IP_RESTRICTIONS_ENGINE_BASE_URL } from "../constants";
|
|
3
|
-
var ipRestrictionUrl = "".concat(IP_RESTRICTIONS_ENGINE_BASE_URL, "/ip_restriction");
|
|
4
|
-
var update = function update(params) {
|
|
5
|
-
return axios.patch(ipRestrictionUrl, {
|
|
6
|
-
ipRestriction: params
|
|
7
|
-
});
|
|
8
|
-
};
|
|
9
|
-
var show = function show() {
|
|
10
|
-
return axios.get(ipRestrictionUrl);
|
|
11
|
-
};
|
|
12
|
-
var ipRestrictionApi = {
|
|
13
|
-
update: update,
|
|
14
|
-
show: show
|
|
15
|
-
};
|
|
16
|
-
export default ipRestrictionApi;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { t } from "i18next";
|
|
2
|
-
export var IP_RESTRICTIONS_ENGINE_BASE_URL = "ip_restrictions/api/v1";
|
|
3
|
-
export var QUERY_KEYS = {
|
|
4
|
-
IP_RESTRICTION: "IP_RESTRICTION",
|
|
5
|
-
ALLOWED_IP_RANGES: "ALLOWED_IP_RANGES",
|
|
6
|
-
CURRENT_IP: "CURRENT_IP"
|
|
7
|
-
};
|
|
8
|
-
export var TRUNCATE_LENGTH = 18;
|
|
9
|
-
export var ADDRESS_TYPE_SELECT_OPTIONS = [{
|
|
10
|
-
label: t("neetoMolecules.ipRestriction.ipv4"),
|
|
11
|
-
value: "ipv4"
|
|
12
|
-
}, {
|
|
13
|
-
label: t("neetoMolecules.ipRestriction.ipv6"),
|
|
14
|
-
value: "ipv6"
|
|
15
|
-
}];
|
|
16
|
-
export var INITIAL_VALUES = {
|
|
17
|
-
ipStart: "",
|
|
18
|
-
ipEnd: "",
|
|
19
|
-
addressType: ADDRESS_TYPE_SELECT_OPTIONS[0].value
|
|
20
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { useQuery, useQueryClient, useMutation } from "react-query";
|
|
2
|
-
import allowedIpRangesApi from "../../apis/allowed_ip_ranges";
|
|
3
|
-
import { QUERY_KEYS } from "../../constants";
|
|
4
|
-
var ALLOWED_IP_RANGES = QUERY_KEYS.ALLOWED_IP_RANGES;
|
|
5
|
-
var useFetchAllowedIpRanges = function useFetchAllowedIpRanges() {
|
|
6
|
-
return useQuery([ALLOWED_IP_RANGES], function () {
|
|
7
|
-
return allowedIpRangesApi.fetch();
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var useCreateAllowedIpRanges = function useCreateAllowedIpRanges() {
|
|
11
|
-
var queryClient = useQueryClient();
|
|
12
|
-
return useMutation(allowedIpRangesApi.create, {
|
|
13
|
-
onSuccess: function onSuccess() {
|
|
14
|
-
return queryClient.invalidateQueries(ALLOWED_IP_RANGES);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
var useDestroyAllowedIpRanges = function useDestroyAllowedIpRanges() {
|
|
19
|
-
var queryClient = useQueryClient();
|
|
20
|
-
return useMutation(allowedIpRangesApi.destroy, {
|
|
21
|
-
onSuccess: function onSuccess() {
|
|
22
|
-
queryClient.invalidateQueries(ALLOWED_IP_RANGES);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var useUpdateAllowedIpRanges = function useUpdateAllowedIpRanges() {
|
|
27
|
-
var queryClient = useQueryClient();
|
|
28
|
-
return useMutation(allowedIpRangesApi.update, {
|
|
29
|
-
onSuccess: function onSuccess() {
|
|
30
|
-
queryClient.invalidateQueries(ALLOWED_IP_RANGES);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
export { useFetchAllowedIpRanges, useCreateAllowedIpRanges, useDestroyAllowedIpRanges, useUpdateAllowedIpRanges };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useQuery } from "react-query";
|
|
2
|
-
import currentIpApi from "../../apis/current_ip";
|
|
3
|
-
import { QUERY_KEYS } from "../../constants";
|
|
4
|
-
var CURRENT_IP = QUERY_KEYS.CURRENT_IP;
|
|
5
|
-
var useShowCurrentIp = function useShowCurrentIp() {
|
|
6
|
-
return useQuery([CURRENT_IP], function () {
|
|
7
|
-
return currentIpApi.show();
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
export { useShowCurrentIp };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { useMutation, useQuery, useQueryClient } from "react-query";
|
|
2
|
-
import ipRestrictionApi from "../../apis/ip_restriction";
|
|
3
|
-
import { QUERY_KEYS } from "../../constants";
|
|
4
|
-
var IP_RESTRICTION = QUERY_KEYS.IP_RESTRICTION;
|
|
5
|
-
var useShowIpRestriction = function useShowIpRestriction() {
|
|
6
|
-
return useQuery([IP_RESTRICTION], function () {
|
|
7
|
-
return ipRestrictionApi.show();
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var useUpdateIpRestriction = function useUpdateIpRestriction() {
|
|
11
|
-
var queryClient = useQueryClient();
|
|
12
|
-
return useMutation(ipRestrictionApi.update, {
|
|
13
|
-
onSuccess: function onSuccess() {
|
|
14
|
-
return queryClient.invalidateQueries(IP_RESTRICTION);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
export { useShowIpRestriction, useUpdateIpRestriction };
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { useState } from "react";
|
|
3
|
-
import { useStateWithDependency } from "@bigbinary/neeto-commons-frontend/react-utils";
|
|
4
|
-
import { Warning } from "@bigbinary/neeto-icons";
|
|
5
|
-
import { Typography, Button, Alert, Callout, Checkbox } from "@bigbinary/neetoui";
|
|
6
|
-
import { Trans, useTranslation } from "react-i18next";
|
|
7
|
-
import PageLoader from "../PageLoader";
|
|
8
|
-
import AllowedIpRanges from "./AllowedIpRanges";
|
|
9
|
-
import CurrentIp from "./CurrentIp";
|
|
10
|
-
import { useShowIpRestriction, useUpdateIpRestriction } from "./hooks/reactQuery/useIpRestrictions";
|
|
11
|
-
var IpRestriction = function IpRestriction() {
|
|
12
|
-
var _useTranslation = useTranslation(),
|
|
13
|
-
t = _useTranslation.t;
|
|
14
|
-
var _useShowIpRestriction = useShowIpRestriction(),
|
|
15
|
-
data = _useShowIpRestriction.data,
|
|
16
|
-
isFetching = _useShowIpRestriction.isLoading;
|
|
17
|
-
var _useState = useState(false),
|
|
18
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
-
isAlertOpen = _useState2[0],
|
|
20
|
-
setIsAlertOpen = _useState2[1];
|
|
21
|
-
var _useStateWithDependen = useStateWithDependency((data === null || data === void 0 ? void 0 : data.isIpRestrictionEnabled) || false, [data]),
|
|
22
|
-
_useStateWithDependen2 = _slicedToArray(_useStateWithDependen, 2),
|
|
23
|
-
isIpRestrictionVisible = _useStateWithDependen2[0],
|
|
24
|
-
setIsIpRestrictionVisible = _useStateWithDependen2[1];
|
|
25
|
-
var _useUpdateIpRestricti = useUpdateIpRestriction(),
|
|
26
|
-
updateIpRestriction = _useUpdateIpRestricti.mutate,
|
|
27
|
-
isUpdating = _useUpdateIpRestricti.isLoading;
|
|
28
|
-
if (isFetching) {
|
|
29
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
-
className: "h-screen"
|
|
31
|
-
}, /*#__PURE__*/React.createElement(PageLoader, null));
|
|
32
|
-
}
|
|
33
|
-
var updateIpRestrictionStatus = function updateIpRestrictionStatus() {
|
|
34
|
-
return updateIpRestriction({
|
|
35
|
-
isIpRestrictionEnabled: isIpRestrictionVisible
|
|
36
|
-
}, {
|
|
37
|
-
onSuccess: function onSuccess() {
|
|
38
|
-
return setIsAlertOpen(false);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
var handleOnChange = function handleOnChange() {
|
|
43
|
-
if (data.isIpRestrictionEnabled) {
|
|
44
|
-
updateIpRestriction({
|
|
45
|
-
isIpRestrictionEnabled: false
|
|
46
|
-
}, {
|
|
47
|
-
onSuccess: function onSuccess() {
|
|
48
|
-
return setIsIpRestrictionVisible(false);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
} else {
|
|
52
|
-
setIsIpRestrictionVisible(function (previousState) {
|
|
53
|
-
return !previousState;
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: "neeto-ui-bg-white neeto-ui-border-gray-200 neeto-ui-rounded-lg mx-auto mb-4 w-full overflow-hidden border sm:max-w-screen-sm md:max-w-screen-md lg:max-w-3xl",
|
|
59
|
-
"data-cy": "ip-restrictions-card"
|
|
60
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
className: "space-y-2 p-6"
|
|
62
|
-
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
63
|
-
checked: isIpRestrictionVisible,
|
|
64
|
-
className: "flex-grow-0",
|
|
65
|
-
"data-cy": "enable-ip-restriction-checkbox",
|
|
66
|
-
disabled: isFetching || isUpdating,
|
|
67
|
-
label: /*#__PURE__*/React.createElement(Typography, {
|
|
68
|
-
style: "h3"
|
|
69
|
-
}, t("neetoMolecules.ipRestriction.switchLabel")),
|
|
70
|
-
onChange: handleOnChange
|
|
71
|
-
}), /*#__PURE__*/React.createElement(Typography, {
|
|
72
|
-
"data-cy": "ip-restriction-description",
|
|
73
|
-
style: "body2"
|
|
74
|
-
}, t("neetoMolecules.ipRestriction.description"))), isIpRestrictionVisible && /*#__PURE__*/React.createElement("div", {
|
|
75
|
-
className: "neeto-ui-bg-gray-100 w-full space-y-6 p-6"
|
|
76
|
-
}, /*#__PURE__*/React.createElement(CurrentIp, null), /*#__PURE__*/React.createElement(AllowedIpRanges, null), /*#__PURE__*/React.createElement(Callout, {
|
|
77
|
-
icon: Warning,
|
|
78
|
-
style: "warning"
|
|
79
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
80
|
-
className: "leading-2 block whitespace-pre-wrap py-1"
|
|
81
|
-
}, /*#__PURE__*/React.createElement(Trans, {
|
|
82
|
-
i18nKey: "neetoMolecules.ipRestriction.warningMessage"
|
|
83
|
-
}))), /*#__PURE__*/React.createElement(Button, {
|
|
84
|
-
label: t("neetoMolecules.common.actions.saveChanges"),
|
|
85
|
-
onClick: function onClick() {
|
|
86
|
-
return setIsAlertOpen(true);
|
|
87
|
-
}
|
|
88
|
-
}), /*#__PURE__*/React.createElement(Alert, {
|
|
89
|
-
isOpen: isAlertOpen,
|
|
90
|
-
isSubmitting: isUpdating,
|
|
91
|
-
title: t("neetoMolecules.ipRestriction.enableAlert.title"),
|
|
92
|
-
message: /*#__PURE__*/React.createElement(Trans, {
|
|
93
|
-
i18nKey: "neetoMolecules.ipRestriction.enableAlert.message"
|
|
94
|
-
}),
|
|
95
|
-
submitButtonLabel: t("neetoMolecules.ipRestriction.enableAlert.submitButtonLabel"),
|
|
96
|
-
onClose: function onClose() {
|
|
97
|
-
return setIsAlertOpen(false);
|
|
98
|
-
},
|
|
99
|
-
onSubmit: updateIpRestrictionStatus
|
|
100
|
-
})));
|
|
101
|
-
};
|
|
102
|
-
export default /*#__PURE__*/React.memo(IpRestriction);
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { t } from "i18next";
|
|
2
|
-
import { IPv4, IPv6, Validator } from "ip-num";
|
|
3
|
-
import { assoc, isNil, isNotNil } from "ramda";
|
|
4
|
-
import * as yup from "yup";
|
|
5
|
-
var isValidIPv4String = function isValidIPv4String(ip) {
|
|
6
|
-
return isNotNil(ip) && Validator.isValidIPv4String(ip)[0];
|
|
7
|
-
};
|
|
8
|
-
var isValidIPv6String = function isValidIPv6String(ip) {
|
|
9
|
-
return isNotNil(ip) && Validator.isValidIPv6String(ip)[0];
|
|
10
|
-
};
|
|
11
|
-
var isValidIpString = function isValidIpString(ip) {
|
|
12
|
-
return isValidIPv4String(ip) || isValidIPv6String(ip);
|
|
13
|
-
};
|
|
14
|
-
var areIpAddressesInSameFormat = function areIpAddressesInSameFormat(ipStart, ipEnd) {
|
|
15
|
-
return isValidIPv4String(ipStart) && isValidIPv4String(ipEnd) || isValidIPv6String(ipStart) && isValidIPv6String(ipEnd);
|
|
16
|
-
};
|
|
17
|
-
var isValidIPv4Range = function isValidIPv4Range(ipStart, ipEnd) {
|
|
18
|
-
var ipStartAddr = IPv4.fromDecimalDottedString(ipStart);
|
|
19
|
-
var ipEndAddr = IPv4.fromDecimalDottedString(ipEnd);
|
|
20
|
-
return ipStartAddr.isLessThanOrEquals(ipEndAddr);
|
|
21
|
-
};
|
|
22
|
-
var isValidIPv6Range = function isValidIPv6Range(ipStart, ipEnd) {
|
|
23
|
-
var ipStartAddr = IPv6.fromString(ipStart);
|
|
24
|
-
var ipEndAddr = IPv6.fromString(ipEnd);
|
|
25
|
-
return ipStartAddr.isLessThanOrEquals(ipEndAddr);
|
|
26
|
-
};
|
|
27
|
-
var isValidIPRange = function isValidIPRange(ipStart, ipEnd) {
|
|
28
|
-
if (isValidIPv4String(ipStart) && isValidIPv4String(ipEnd)) {
|
|
29
|
-
return isValidIPv4Range(ipStart, ipEnd);
|
|
30
|
-
}
|
|
31
|
-
if (isValidIPv6String(ipStart) && isValidIPv6String(ipEnd)) {
|
|
32
|
-
return isValidIPv6Range(ipStart, ipEnd);
|
|
33
|
-
}
|
|
34
|
-
return false;
|
|
35
|
-
};
|
|
36
|
-
yup.addMethod(yup.string, "validIp", function (errorMessage) {
|
|
37
|
-
return this.test("valid-ip", errorMessage, function (value) {
|
|
38
|
-
if (isNil(value)) {
|
|
39
|
-
return this;
|
|
40
|
-
}
|
|
41
|
-
var isValidIp = isValidIpString(value);
|
|
42
|
-
return isValidIp || this.createError({
|
|
43
|
-
path: this.path,
|
|
44
|
-
message: errorMessage
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
export var getIpRestrictionValidationSchema = function getIpRestrictionValidationSchema() {
|
|
49
|
-
return yup.object().shape({
|
|
50
|
-
ipStart: yup.string().validIp(t("neetoMolecules.ipRestriction.validations.invalidIp")).required(t("neetoMolecules.ipRestriction.validations.ipStartRequired")),
|
|
51
|
-
ipEnd: yup.string().validIp(t("neetoMolecules.ipRestriction.validations.invalidIp")).when("ipStart", function (ipStart, schema) {
|
|
52
|
-
return schema.test({
|
|
53
|
-
test: function test(ipEnd) {
|
|
54
|
-
return areIpAddressesInSameFormat(ipStart, ipEnd);
|
|
55
|
-
},
|
|
56
|
-
message: t("neetoMolecules.ipRestriction.validations.eitherIpv4OrIpv6")
|
|
57
|
-
});
|
|
58
|
-
}).when("ipStart", function (ipStart, schema) {
|
|
59
|
-
return schema.test({
|
|
60
|
-
test: function test(ipEnd) {
|
|
61
|
-
return isValidIPRange(ipStart, ipEnd);
|
|
62
|
-
},
|
|
63
|
-
message: t("neetoMolecules.ipRestriction.validations.ipEndGreaterThanIpStart")
|
|
64
|
-
});
|
|
65
|
-
}).required(t("neetoMolecules.ipRestriction.validations.ipEndRequired")),
|
|
66
|
-
addressType: yup.object().shape({
|
|
67
|
-
value: yup.string().required(),
|
|
68
|
-
label: yup.string().required()
|
|
69
|
-
}).nullable().required(t("neetoMolecules.ipRestriction.validations.addressTypeRequired"))
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
export var humanizeIpAddressFormat = function humanizeIpAddressFormat(addressFormat) {
|
|
73
|
-
var addressFormats = {
|
|
74
|
-
ipv4: "IPv4",
|
|
75
|
-
ipv6: "IPv6"
|
|
76
|
-
};
|
|
77
|
-
return addressFormats[addressFormat];
|
|
78
|
-
};
|
|
79
|
-
export var buildInitialValue = function buildInitialValue(values) {
|
|
80
|
-
var labelAndValue = {
|
|
81
|
-
label: humanizeIpAddressFormat(values.addressType),
|
|
82
|
-
value: values.addressType
|
|
83
|
-
};
|
|
84
|
-
return assoc("addressType", labelAndValue, values);
|
|
85
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line @bigbinary/neeto/use-webpack-alias
|
|
4
|
-
import { Kbd, Typography } from "@bigbinary/neetoui";
|
|
5
|
-
import { convertHotkeyToUsersPlatform, shortenHotKey, getTooltipProps } from "./utils";
|
|
6
|
-
var HotKey = function HotKey(_ref) {
|
|
7
|
-
var description = _ref.description,
|
|
8
|
-
sequence = _ref.sequence;
|
|
9
|
-
var hotkey = shortenHotKey(convertHotkeyToUsersPlatform(sequence));
|
|
10
|
-
var isSequentialHotkey = hotkey.includes(" ");
|
|
11
|
-
var isSimultaneousHotkey = hotkey.includes("+");
|
|
12
|
-
var isSingleKeyHotkey = !isSequentialHotkey && !isSimultaneousHotkey;
|
|
13
|
-
var sequences = [];
|
|
14
|
-
if (isSingleKeyHotkey) {
|
|
15
|
-
sequences = [hotkey];
|
|
16
|
-
} else if (isSequentialHotkey) {
|
|
17
|
-
sequences = hotkey.split(" ");
|
|
18
|
-
} else if (isSimultaneousHotkey) {
|
|
19
|
-
sequences = hotkey.split("+");
|
|
20
|
-
}
|
|
21
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
22
|
-
className: "my-3 w-full"
|
|
23
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
24
|
-
className: "flex items-center justify-between gap-3",
|
|
25
|
-
"data-cy": "hotkey-item",
|
|
26
|
-
"data-testid": "hotkey-item"
|
|
27
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
28
|
-
className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
|
|
29
|
-
lineHeight: "normal",
|
|
30
|
-
style: "body2"
|
|
31
|
-
}, description), /*#__PURE__*/React.createElement("div", {
|
|
32
|
-
className: "flex flex-shrink-0 items-center gap-1"
|
|
33
|
-
}, sequences.map(function (keyName, idx) {
|
|
34
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
35
|
-
key: idx
|
|
36
|
-
}, /*#__PURE__*/React.createElement(Kbd, {
|
|
37
|
-
keyName: keyName,
|
|
38
|
-
tooltipProps: getTooltipProps(keyName)
|
|
39
|
-
}), isSequentialHotkey && idx + 1 !== sequences.length && /*#__PURE__*/React.createElement(Kbd, {
|
|
40
|
-
keyName: "then"
|
|
41
|
-
}));
|
|
42
|
-
}))));
|
|
43
|
-
};
|
|
44
|
-
export default /*#__PURE__*/React.memo(HotKey);
|