diff --git a/package.json b/package.json index 3fc759b73..f556aef94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "integreatly-web-app", - "version": "2.26.1", + "version": "2.26.2", "private": true, "proxy": "http://localhost:5001/", "dependencies": { diff --git a/src/pages/settings/settings.js b/src/pages/settings/settings.js index ecc192069..6f251df34 100644 --- a/src/pages/settings/settings.js +++ b/src/pages/settings/settings.js @@ -283,16 +283,14 @@ class SettingsPage extends React.Component { const currentDate = new Date(); const nextDayDate = new Date(); let goodBackupDate = new Date(); - let rawBackupTime = rhmiConfig.spec.backup.applyOn; + const rawBackupTime = rhmiConfig.spec.backup.applyOn; const rawBackupHour = rawBackupTime.split(':')[0]; - const rawBackupMin = rawBackupTime.split(':')[1]; + const rawBackupMin = '00'; const curHour = currentDate.getHours(); let backupDate = ''; nextDayDate.setDate(currentDate.getDate() + 1); - rawBackupTime = `${rawBackupHour[0]}:00`; - if (curHour < rawBackupHour) { // if hour has not occurred yet today, display date should be currentDate goodBackupDate = currentDate; @@ -318,7 +316,7 @@ class SettingsPage extends React.Component { const rawMaintDay = rawMaintDate.split(' ')[0]; // Sun const rawMaintTime = rawMaintDate.split(' ')[1]; // 10:00 const rawMaintHour = rawMaintTime.split(':')[0]; // 10 - const rawMaintMin = rawMaintTime.split(':')[1]; // 00 + const rawMaintMin = '00'; const curDay = currentDate.getDay(); const curHour = currentDate.getHours(); @@ -377,7 +375,8 @@ class SettingsPage extends React.Component { let utcBackupTime = Date(); const cfgMaintDate = rhmiConfig.spec.maintenance.applyFrom; - const cfgMaintTime = cfgMaintDate.split(' ')[1]; // 10:00 + const cfgMaintHours = cfgMaintDate.split(' ')[1].split(':')[0]; + const cfgMaintTime = `${cfgMaintHours}:00`; let sameTime; dropDownItems.push( @@ -420,11 +419,16 @@ class SettingsPage extends React.Component { this.contentRef2 = React.createRef(); let isAdmin = window.localStorage.getItem('currentUserIsAdmin') === 'true'; + let isOSv4 = true; // no admin protection for openshift 3 or for running demo/locally if (window.OPENSHIFT_CONFIG && window.OPENSHIFT_CONFIG.openshiftVersion === 3) { isAdmin = true; + isOSv4 = false; } + // local testing purposes only - toggle true for simulating OS3, false for OS4 + // isOSv4 = true; + return ( Skip to content @@ -437,16 +441,18 @@ class SettingsPage extends React.Component { Settings - + {isOSv4 && ( + + )} {isAdmin ? ( - - {/* + {isOSv4 && ( + + {/* The schedule for this cluster - [cluster ID] - was last updated by [user] on [date]. */} - - -

Daily Backups

-
- - - - - The backup process will not impact the availability of your cluster. - - - - - - Next daily backup: - - - {this.getDailyBackup()} - - - - -
- - - - Start time for your backups - - - {this.state.buStartTimeDisplay} - - } - isOpen={this.state.isOpen} - dropdownItems={ - window.OPENSHIFT_CONFIG && window.OPENSHIFT_CONFIG.openshiftVersion === 3 - ? this.populateBackupsDropdown() - : this.state.dropDownItems - } - /> - - -
- - Backups may not be scheduled during the first hour of your maintenance window.{' '} - -
- - - Weekly maintenance window - - - -
- - - - Next maintenance window: - - - {this.getMaintenanceWindow()} - - - -
-
-
-
- - {' '} - {' '} - -
-
- + + +

Daily Backups

+
+ + + + + The backup process will not impact the availability of your cluster. + + + + + + Next daily backup: + + + {this.getDailyBackup()} + + + + +
+ + + + Start time for your backups + + + {this.state.buStartTimeDisplay} + + } + isOpen={this.state.isOpen} + dropdownItems={ + window.OPENSHIFT_CONFIG && window.OPENSHIFT_CONFIG.openshiftVersion === 3 + ? this.populateBackupsDropdown() + : this.state.dropDownItems + } + /> + + +
+ + Backups may not be scheduled during the first hour of your maintenance window.{' '} + +
+ + + Weekly maintenance window + + + +
+ + + + Next maintenance window: + + + {this.getMaintenanceWindow()} + + + +
+
+
+
+ + {' '} + {' '} + +
+
+ )}