From de5af495521449f96846a3e90330f043c96881e5 Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Mon, 28 Feb 2022 18:47:42 +0300 Subject: [PATCH] WEb: AutoBackup: Deleted isDesktop prop; --- .../data-management/backup/DesktopView.js | 1 - .../data-management/backup/StyledBackup.js | 13 +++++++------ .../data-management/backup/auto-backup/index.js | 13 ++++++------- .../auto-backup/sub-components/ScheduleComponent.js | 3 --- web/ASC.Web.Client/src/store/BackupStore.js | 5 ----- 5 files changed, 13 insertions(+), 22 deletions(-) diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/data-management/backup/DesktopView.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/data-management/backup/DesktopView.js index 52db9901f0..894ae8376f 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/categories/data-management/backup/DesktopView.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/data-management/backup/DesktopView.js @@ -254,7 +254,6 @@ class BackupDesktopView extends React.Component { diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/data-management/backup/StyledBackup.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/data-management/backup/StyledBackup.js index 9e0354c636..a8ea3bdd9b 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/categories/data-management/backup/StyledBackup.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/data-management/backup/StyledBackup.js @@ -1,6 +1,7 @@ import styled, { css } from "styled-components"; import commonSettingsStyles from "../../../utils/commonSettingsStyles"; import globalColors from "@appserver/components/utils/globalColors"; +import { isMobileOnly } from "react-device-detect"; const linkColor = globalColors.black; @@ -116,7 +117,7 @@ const StyledAutoBackup = styled.div` box-sizing: border-box; } .auto-backup_buttons { - ${(props) => props.isDesktop && "margin-bottom: 24px"} + ${(props) => !props.isMobileOnly && "margin-bottom: 24px"} } `; @@ -227,10 +228,10 @@ const StyledScheduleComponent = styled.div` grid-area: weekly-monthly; width: 100%; - max-width: ${(props) => (props.isDesktop ? "124px" : INPUT_LENGTH)}; + max-width: ${(props) => (!props.isMobileOnly ? "124px" : INPUT_LENGTH)}; .drop-down_variable-size { max-width: ${(props) => - props.isDesktop ? "124px" : INPUT_LENGTH} !important; + !props.isMobileOnly ? "124px" : INPUT_LENGTH} !important; width: 100% !important; } } @@ -244,7 +245,7 @@ const StyledScheduleComponent = styled.div` } ${(props) => - props.isDesktop + !props.isMobileOnly ? css` .main_options { max-width: ${INPUT_LENGTH}; @@ -280,7 +281,7 @@ const StyledScheduleComponent = styled.div` .time_options { grid-area: time; ${(props) => - !props.isDesktop && + props.isMobileOnly && css` max-width: ${INPUT_LENGTH}; `}; @@ -329,7 +330,7 @@ const StyledBackup = styled.div` padding-bottom: 8px; } .layout-progress-bar { - ${(props) => props.isDesktop && "cursor: default;"} + ${(props) => !props.isMobileOnly && "cursor: default;"} } .backup_modules-description { diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/data-management/backup/auto-backup/index.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/data-management/backup/auto-backup/index.js index ddd6f99735..fddf0e2258 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/categories/data-management/backup/auto-backup/index.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/data-management/backup/auto-backup/index.js @@ -23,6 +23,7 @@ import DocumentsModule from "./sub-components/DocumentsModule"; import ThirdPartyStorageModule from "./sub-components/ThirdPartyStorageModule"; import ToggleButton from "@appserver/components/toggle-button"; import { getBackupStorage } from "@appserver/common/api/settings"; +import { isMobileOnly } from "react-device-detect"; const { proxyURL } = AppServerConfig; @@ -36,7 +37,7 @@ const EVERY_MONTH_TYPE = 2; class AutomaticBackup extends React.PureComponent { constructor(props) { super(props); - const { t, language, isDesktop } = props; + const { t, language } = props; this.lng = language.substring(0, language.indexOf("-")); moment.locale(this.lng); @@ -77,7 +78,7 @@ class AutomaticBackup extends React.PureComponent { selectedStorageTypeNumber: "", isLoadingData: false, - isInitialLoading: isDesktop ? false : true, + isInitialLoading: !isMobileOnly ? false : true, isChanged: false, isChangedInStorage: false, isReset: false, @@ -162,7 +163,6 @@ class AutomaticBackup extends React.PureComponent { componentDidMount() { const { - isDesktop, backupSchedule, commonThirdPartyList, thirdPartyStorageInfo, @@ -171,7 +171,7 @@ class AutomaticBackup extends React.PureComponent { this._isMounted = true; this.getWeekdays(); - if (!isDesktop) this.setBasicSettings(); + if (isMobileOnly) this.setBasicSettings(); else { this.commonThirdPartyList = commonThirdPartyList; this.storageInfo = thirdPartyStorageInfo; @@ -1044,7 +1044,7 @@ class AutomaticBackup extends React.PureComponent { }; render() { - const { t, isDesktop } = this.props; + const { t } = this.props; const { isInitialLoading, isChanged, @@ -1085,7 +1085,6 @@ class AutomaticBackup extends React.PureComponent { maxNumberCopiesArray: this.maxNumberCopiesArray, periodsObject: this.periodsObject, weekdaysLabelArray: this.weekdaysLabelArray, - isDesktop: isDesktop, onSelectPeriod: this.onSelectPeriod, onSelectWeekDay: this.onSelectWeekDay, onSelectMonthNumber: this.onSelectMonthNumber, @@ -1107,7 +1106,7 @@ class AutomaticBackup extends React.PureComponent { return isInitialLoading ? ( ) : ( - +
{ const { t } = useTranslation("Settings"); return ( { - this.isMobileOnly = isMobile; - }; - setDefaultOptions = (t, periodObj, weekdayArr) => { if (this.backupSchedule) { const {