Skip to content

Commit

Permalink
Merge pull request #30 from eea/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
gabmnic authored May 3, 2024
2 parents 08eceb7 + 427543e commit e1e9ccc
Show file tree
Hide file tree
Showing 11 changed files with 12,571 additions and 21 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ 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).

### [1.8.7](https://github.com/eea/eionet2-dashboard/compare/1.8.6...1.8.7) - 30 April 2024

#### :rocket: New Features

- feat: filter consultation [Mihai Nicolae - [`c11c0e6`](https://github.com/eea/eionet2-dashboard/commit/c11c0e6d715023130c7b321f1d45867daf07847b)]
- feat: add affected user to logging [Mihai Nicolae - [`41e4ca9`](https://github.com/eea/eionet2-dashboard/commit/41e4ca95c403e172f7bc7dcf75dafbaad47e10a4)]

#### :bug: Bug Fixes

- fix: format [Mihai Nicolae - [`771c590`](https://github.com/eea/eionet2-dashboard/commit/771c59057942c42be6eb8e9cb087f0df9d7f4b0a)]

### [1.8.6](https://github.com/eea/eionet2-dashboard/compare/1.8.5...1.8.6) - 28 February 2024

#### :rocket: New Features
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": "1.8.6",
"version": "1.8.7",
"description": "",
"author": "",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion tabs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions tabs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eeacms/eionet2-dashboard",
"version": "1.8.4",
"version": "1.8.6",
"license": "SEE LICENSE IN LICENSE.md",
"description": "MS Teams app for accessing Eionet activity and managing account information.",
"dependencies": {
Expand Down Expand Up @@ -45,22 +45,22 @@
"stylelint-prettier": "^2.0.0"
},
"scripts": {
"prepare": "npm run build",
"prepare": "yarn run build",
"test": "jest",
"dev:teamsfx": "env-cmd --silent -f .env.teamsfx.local npm run start",
"dev:teamsfx": "env-cmd --silent -f .env.teamsfx.local yarn run start",
"start": "cross-env REACT_APP_VERSION=$npm_package_version GENERATE_SOURCEMAP=false react-scripts start",
"install:teamsfx": "npm install",
"install:teamsfx": "yarn install",
"build": "cross-env REACT_APP_VERSION=$npm_package_version GENERATE_SOURCEMAP=false react-scripts build",
"build:teamsfx": "cross-env-shell \"env-cmd -f .env.teamsfx.${TEAMS_FX_ENV} npm run build\"",
"build:teamsfx:dev": "cross-env TEAMS_FX_ENV=dev npm run build:teamsfx",
"build:teamsfx": "cross-env-shell \"env-cmd -f .env.teamsfx.${TEAMS_FX_ENV} yarn run build\"",
"build:teamsfx:dev": "cross-env TEAMS_FX_ENV=dev yarn run build:teamsfx",
"eject": "react-scripts eject",
"stylelint": "node_modules/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,scss}'",
"stylelint:fix": "yarn stylelint --fix",
"prettier": "node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,scss,md}'",
"prettier:fix": "node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,scss,md}'",
"lint": "node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'",
"lint:fix": "node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'",
"pc": "npm run stylelint:fix & npm run prettier:fix & npm run lint:fix & npm run test"
"pc": "yarn run stylelint:fix & yarn run prettier:fix & yarn run lint:fix & yarn run test"
},
"eslintConfig": {
"extends": [
Expand Down Expand Up @@ -95,4 +95,4 @@
"@azure/keyvault-keys": "4.4.0"
},
"homepage": "."
}
}
2 changes: 1 addition & 1 deletion tabs/src/components/activity/Activity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export function Activity({
console.log(e.message);
});

getConsultations(undefined, fromDate, country).then((loadedConsultations) => {
getConsultations(fromDate, country).then((loadedConsultations) => {
if (loadedConsultations) {
const currentDate = new Date(new Date().toDateString());
setOpenConsultations(
Expand Down
2 changes: 1 addition & 1 deletion tabs/src/components/my_country/AtAGlance.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function AtAGlance({
const noOfYears = configuration.DashboardNoOfDisplayedYears || 2;
const fromDate = new Date(new Date().getFullYear() - noOfYears, 0, 1);
let loadedMeetings = await getMeetings(fromDate, country, userInfo),
loadedConsultations = await getConsultations(undefined, fromDate);
loadedConsultations = await getConsultations(fromDate);

const current = new Date().getFullYear();
let years = [];
Expand Down
3 changes: 2 additions & 1 deletion tabs/src/data/apiProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export async function logError(err, apiPath, data) {
}
}

export async function logInfo(message, apiPath, data, action, skipEmail = false) {
export async function logInfo(message, apiPath, data, action, affectedUser, skipEmail = false) {
const spConfig = await getConfiguration(),
userMail = await getUserMail();

Expand All @@ -150,6 +150,7 @@ export async function logInfo(message, apiPath, data, action, skipEmail = false)
Timestamp: new Date(),
Logtype: 'Info',
Action: action,
AffectedUser: affectedUser,
},
};

Expand Down
3 changes: 2 additions & 1 deletion tabs/src/data/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ export async function sendEmail(subject, text, emails, attachment) {
});

if (config.DashboardEmailLoggingEnabled == 'true') {
await logInfo('Mail sent during registration process', apiPath, message);
const email = emails.length == 1 ? emails[0] : '';
await logInfo('Mail sent during registration process', apiPath, message, '', email);
}
} else {
await logError('Missing subject, body or recipients!', '', {
Expand Down
2 changes: 1 addition & 1 deletion tabs/src/data/selfServiceProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function saveData(user) {

try {
await saveSPUser(user);
await logInfo('User edited information', '', user, 'Edit user');
await logInfo('User edited information', '', user, 'Edit user', user.Email);
} catch (err) {
return wrapError(err, 'saveSPUser');
}
Expand Down
20 changes: 14 additions & 6 deletions tabs/src/data/sharepointProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export async function getSPUserByMail(email) {
}
}

export async function getConsultations(consultationType, fromDate, userCountry) {
export async function getConsultations(fromDate, userCountry) {
const config = await getConfiguration();
try {
let path =
Expand All @@ -150,16 +150,23 @@ export async function getConsultations(consultationType, fromDate, userCountry)
config.ConsultationListId +
'/items?$expand=fields&$top=999&$select=id,fields';

if (consultationType) {
path += "&$filter=fields/ConsultationType eq '";
path += consultationType + "'";
}

let hasFilter = false;
if (fromDate) {
path += "&$filter=fields/Startdate ge '";
path += format(new Date(fromDate), 'yyyy-MM-dd') + "'";
hasFilter = true;
}

const ecConsultationFilter =
"(fields/IsECConsultation eq 'Eionet-only' or fields/IsECConsultation eq 'Eionet-and-EC')";
if (hasFilter) {
path += ' and ';
} else {
path += '&$filter=';
}

path += ecConsultationFilter;

const response = await apiGet(path),
consultations = await response.graphClientMessage;

Expand Down Expand Up @@ -881,6 +888,7 @@ export async function postRating(event, participant, value) {
RatingValue: ratingValue,
},
'Rating',
'',
true,
);
} catch (err) {
Expand Down
Loading

0 comments on commit e1e9ccc

Please sign in to comment.