WEb: AutoBackup: Deleted isDesktop prop;

This commit is contained in:
Tatiana Lopaeva 2022-02-28 18:47:42 +03:00
parent e4deaa19b0
commit de5af49552
5 changed files with 13 additions and 22 deletions

View File

@ -254,7 +254,6 @@ class BackupDesktopView extends React.Component {
</Text>
<AutoBackup
isDesktop
backupSchedule={backupSchedule}
commonThirdPartyList={commonThirdPartyList}
/>

View File

@ -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 {

View File

@ -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 ? (
<Loader className="pageLoader" type="rombs" size="40px" />
) : (
<StyledAutoBackup isDesktop={isDesktop}>
<StyledAutoBackup>
<div className="backup_toggle-wrapper">
<ToggleButton
className="backup_toggle-btn"

View File

@ -27,14 +27,11 @@ const ScheduleComponent = ({
monthNumbersArray,
hoursArray,
maxNumberCopiesArray,
isDesktop,
}) => {
const { t } = useTranslation("Settings");
return (
<StyledScheduleComponent
isDesktop={isDesktop}
weeklySchedule={selectedWeeklySchedule}
monthlySchedule={selectedMonthlySchedule}
className="backup_schedule-component"

View File

@ -10,7 +10,6 @@ const EVERY_WEEK_TYPE = "1";
const EVERY_MONTH_TYPE = "2";
class BackupStore {
isMobileOnly = false;
backupSchedule = {};
backupStorage = {};
commonThirdPartyList = {};
@ -43,10 +42,6 @@ class BackupStore {
makeAutoObservable(this);
}
setIsMobileOnly = (isMobile) => {
this.isMobileOnly = isMobile;
};
setDefaultOptions = (t, periodObj, weekdayArr) => {
if (this.backupSchedule) {
const {