Skip to content

Commit

Permalink
Merge pull request #391 from suvarnakale/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #000 bug: edit event issue fixes
  • Loading branch information
itsvick authored Nov 12, 2024
2 parents 591eb85 + 0cba644 commit fc22919
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions src/components/PlannedSession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -880,22 +880,21 @@ const PlannedSession: React.FC<PlannedModalProps> = ({
'success'
);


const windowUrl = window.location.pathname;
const cleanedUrl = windowUrl.replace(/^\//, '');
const telemetryInteract = {
context: {
env: 'teaching-center',
cdata: [],
},
edata: {
id: 'event-created-successfully',
type: Telemetry.CLICK,
subtype: '',
pageid: cleanedUrl,
},
};
telemetryFactory.interact(telemetryInteract);
const cleanedUrl = windowUrl.replace(/^\//, '');
const telemetryInteract = {
context: {
env: 'teaching-center',
cdata: [],
},
edata: {
id: 'event-created-successfully',
type: Telemetry.CLICK,
subtype: '',
pageid: cleanedUrl,
},
};
telemetryFactory.interact(telemetryInteract);

ReactGA.event('event-created-successfully', {
creatorId: userId,
Expand Down Expand Up @@ -1244,7 +1243,9 @@ const PlannedSession: React.FC<PlannedModalProps> = ({
handleCourseTypeChange(block?.id, event)
}
value={
block?.courseType === undefined ? '' : selectedCourseType
block?.courseType === undefined || block?.courseType === ''
? selectedCourseType
: eventData?.metadata?.courseType
}
disabled={!StateName || !medium || !grade || !board}
>
Expand Down Expand Up @@ -1277,7 +1278,11 @@ const PlannedSession: React.FC<PlannedModalProps> = ({
onChange={(event: any) =>
handleSubjectChange(block?.id, event)
}
value={block?.subject ?? selectedSubject}
value={
block?.subject === undefined || block?.subject === ''
? selectedSubject
: eventData?.metadata?.subject
}
disabled={!(StateName && medium && grade && board)}
>
{subjects?.map((subject: string) => (
Expand Down Expand Up @@ -1468,7 +1473,7 @@ const PlannedSession: React.FC<PlannedModalProps> = ({
useAbbreviation={true}
selectedDays={
selectedDays?.length
? editSession?.daysOfWeek
? editSession?.recurrencePattern?.daysOfWeek
: block?.selectedWeekDays
}
onSelectionChange={(newSelectedDays) => {
Expand Down

0 comments on commit fc22919

Please sign in to comment.