Skip to content

Commit

Permalink
Merge branch '2.8' into create-pull-request/2.8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenlan-amzn authored Sep 6, 2023
2 parents 9a0bcb3 + 5e25793 commit b85f801
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,25 @@ const CronSchedule = ({
const [dayOfWeek, setWeek] = useState(initWeek);
const [dayOfMonth, setMonth] = useState(initMonth);

// When edit policy is clicked, during the initial render DEFAULT values get passed
// As a result when the actual policy details are passed, the state does not get updated and we end up
// showing incorrect values in schedule controls.
if (initHour !== hour) {
setHour(initHour);
}

if (initMin !== minute) {
setMinute(initMin);
}

if (initWeek !== dayOfWeek) {
setWeek(initWeek);
}

if (initMonth !== dayOfMonth) {
setMonth(initMonth);
}

useEffect(() => {
changeCron();
}, [minute, hour, dayOfWeek, dayOfMonth]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class SnapshotFlyout extends Component<SnapshotFlyoutProps, Snaps
};

render() {
const { onCloseFlyout } = this.props;
const { onCloseFlyout, repository } = this.props;
const { snapshot } = this.state;

const items1 = [
Expand All @@ -78,7 +78,7 @@ export default class SnapshotFlyout extends Component<SnapshotFlyoutProps, Snaps
const items2 = [
{ term: "Start time", value: snapshot?.start_time },
{ term: "End time", value: snapshot?.end_time },
{ term: "Repository", value: snapshot?.snapshot },
{ term: "Repository", value: repository },
{
term: "Policy",
value: (
Expand Down

0 comments on commit b85f801

Please sign in to comment.