Skip to content

Commit 687af94

Browse files
Thomas FinkThomas Fink
Thomas Fink
authored and
Thomas Fink
committed
fix(ZMS-3466): fix white space scroll error
1 parent ea9b087 commit 687af94

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

zmsadmin/js/page/availabilityDay/form/content.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const FormContent = (props) => {
120120
<Label attributes={{ "htmlFor": "AvDayType" }}>Typ</Label>
121121
<Controls>
122122
<Inputs.Select name="type"
123-
attributes={{ disabled: data.id ? 'disabled' : null, "id": "AvDayType", "disabled": inputDisabled }}
123+
attributes={{ disabled: data.id ? 'disabled' : null, "id": "AvDayType" }}
124124
value={data.type ? data.type : "appointment"} {...{ onChange }}
125125
options={availabilityTypes} />
126126
<Description attributes={{ "id": "help_AvDayTypDescription" }}>Typ der Öffnungszeit.
@@ -165,7 +165,7 @@ const FormContent = (props) => {
165165
<Inputs.Text name="slotTimeInMinutes"
166166
value={data.slotTimeInMinutes}
167167
width="2"
168-
attributes={{ disabled: 'disabled', maxLength: 3, "id": "AvDaySlottime", "disabled": inputDisabled }}
168+
attributes={{ disabled: 'disabled', maxLength: 3, "id": "AvDaySlottime" }}
169169
{...{ onChange }} />
170170
<Label attributes={{ "htmlFor": "AvDaySlottime", "className": "light" }}>&nbsp;Minuten Abstand zweier aufeinander folgender Termine</Label>
171171
</Controls>

zmsadmin/js/page/availabilityDay/helpers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ export const getNewAvailability = (timestamp, tempId, scope, existingAvailabilit
102102
})
103103

104104
const currentTime = moment()
105-
const dayEndTime = moment('22:00:00', 'HH:mm:ss')
106-
let startTime = moment('07:00:00', 'HH:mm:ss')
105+
const dayEndTime = moment('23:00:00', 'HH:mm:ss')
106+
let startTime = moment('06:00:00', 'HH:mm:ss')
107107

108108
if (now.format('YYYY-MM-DD') === currentTime.format('YYYY-MM-DD') && currentTime.isAfter(startTime)) {
109109
startTime = moment(currentTime).add(5 - (currentTime.minutes() % 5), 'minutes')

zmsadmin/js/page/availabilityDay/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,13 @@ class AvailabilityPage extends Component {
150150
lastSave: new Date().getTime(),
151151
saveSuccess: true,
152152
}, () => {
153-
this.successElement.scrollIntoView();
153+
// Attempt to scroll immediately after state update, before the 6-second timer expires
154+
if (this.successElement) {
155+
this.successElement.scrollIntoView();
156+
} else {
157+
// Fallback to bottom scroll if the element isn't available
158+
this.handleScrollToBottom();
159+
}
154160
});
155161
hideSpinner();
156162
this.handleScrollToBottom();
@@ -168,7 +174,11 @@ class AvailabilityPage extends Component {
168174
}
169175
this.setState({
170176
lastSave: new Date().getTime(),
171-
saveSuccess: false,
177+
saveSuccess: true,
178+
}, () => {
179+
if (this.successElement) {
180+
this.successElement.scrollIntoView();
181+
}
172182
});
173183
this.getValidationList();
174184
hideSpinner();

zmsadmin/src/Zmsadmin/AvailabilityConflicts.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ protected static function checkNewVsNewConflicts(AvailabilityList $collection, \
158158
}
159159
}
160160
}
161-
error_log(json_encode("Conflicts: " . $conflicts));
162161
return $conflicts;
163162
}
164163

0 commit comments

Comments
 (0)