Skip to content

Commit

Permalink
Merge pull request #39 from eea/develop
Browse files Browse the repository at this point in the history
fix: correct email for hybrid meetings
  • Loading branch information
gabmnic authored Dec 17, 2024
2 parents 6048dd4 + 7d2dd87 commit 3ae377e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [3.1.2](https://github.com/eea/eionet2-dashboard/compare/3.1.1...3.1.2) - 16 December 2024
### [3.1.3](https://github.com/eea/eionet2-dashboard/compare/3.1.2...3.1.3) - 17 December 2024

#### :bug: Bug Fixes

- fix: missing config, small ui improvements [Mihai Nicolae - [`5667719`](https://github.com/eea/eionet2-dashboard/commit/5667719ebcc7e75743a4cb55e840268a37e6d391)]
- fix: correct email for hybrid meetings [Mihai Nicolae - [`2a3440c`](https://github.com/eea/eionet2-dashboard/commit/2a3440c83644600059c355319fd51974c7b305b2)]

### [3.1.2](https://github.com/eea/eionet2-dashboard/compare/3.1.1...3.1.2) - 16 December 2024

### [3.1.1](https://github.com/eea/eionet2-dashboard/compare/3.1.0...3.1.1) - 13 December 2024

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eionet2-dashboard",
"version": "3.1.2",
"version": "3.1.3",
"description": "",
"author": "",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function EventExternalRegistration({ event, userInfo }) {
if (response) {
participant.id = response.id;
event.Participants.push(participant);
setEventProperties(true);
setEventProperties();
setSuccessRegister(true);
}
}
Expand All @@ -83,8 +83,7 @@ export function EventExternalRegistration({ event, userInfo }) {
}
setLoading(false);
},
setEventProperties = (hasRegistered) => {
event.HasRegistered = hasRegistered;
setEventProperties = () => {
event.NoOfRegistered = event.Participants.filter((p) => {
return p.Registered;
}).length;
Expand Down
12 changes: 5 additions & 7 deletions tabs/src/data/sharepointProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ export async function getMeetings(fromDate, country, userInfo) {
IsPast: isPast,

IsOnline: fields.MeetingType && fields.MeetingType == 'Online',
IsOnlineOrHybrid: fields.MeetingType && fields.MeetingType != 'Offline',
IsOffline: fields.MeetingType && fields.MeetingType != 'Online',

CustomMeetingRequest: fields.CustomMeetingRequests,
Expand Down Expand Up @@ -690,32 +691,29 @@ export async function patchParticipant(participant, event, approvalChanged) {
}

function getNotificationSubject(config, event, forNFP) {
let emailSubjectProperty = `Reg${
event.MeetingType == 'Online' ? 'Online' : 'Offline'
}EmailSubject`;
let emailSubjectProperty = `Reg${event.IsOnlineOrHybrid ? 'Online' : 'Offline'}EmailSubject`;

const suffix = forNFP ? 'NFP' : 'User';
emailSubjectProperty += suffix;
return config[emailSubjectProperty]?.replaceAll(MEETING_TITLE_PLACEHOLDER, event.Title);
}

function getNotificationBody(config, event, forNFP) {
let emailBodyProperty = `Reg${event.MeetingType == 'Online' ? 'Online' : 'Offline'}EmailBody`;
let emailBodyProperty = `Reg${event.IsOnlineOrHybrid ? 'Online' : 'Offline'}EmailBody`;

const suffix = forNFP ? 'NFP' : 'User';
emailBodyProperty += suffix;
return replacePlaceholders(config[emailBodyProperty], event);
}

function getExternalNotificationSubject(config, event) {
const subject =
config[`Invite${event.MeetingType == 'Online' ? 'Online' : 'Offline'}EmailSubject`];
const subject = config[`Invite${event.IsOnlineOrHybrid ? 'Online' : 'Offline'}EmailSubject`];
return subject?.replaceAll(MEETING_TITLE_PLACEHOLDER, event.Title);
}

function getExternalNotificationBody(config, event) {
return replacePlaceholders(
config[`Invite${event.MeetingType == 'Online' ? 'Online' : 'Offline'}EmailBody`],
config[`Invite${event.IsOnlineOrHybrid ? 'Online' : 'Offline'}EmailBody`],
event,
);
}
Expand Down

0 comments on commit 3ae377e

Please sign in to comment.