Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ecolyo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
Ecolyo
Commits
5482b317
Commit
5482b317
authored
4 years ago
by
Yoan VALLET
Browse files
Options
Downloads
Patches
Plain Diff
feat: check if report is enable in user profil
parent
ed50dd3c
No related branches found
No related tags found
3 merge requests
!103
Support
,
!102
Dev
,
!83
Features/113 bilan mensuel
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/services/dataChallengeContracts.ts
+2
-2
2 additions, 2 deletions
src/services/dataChallengeContracts.ts
src/targets/services/monthlyReport.ts
+16
-2
16 additions, 2 deletions
src/targets/services/monthlyReport.ts
with
18 additions
and
4 deletions
src/services/dataChallengeContracts.ts
+
2
−
2
View file @
5482b317
...
...
@@ -142,7 +142,7 @@ export class UserProfile {
ecogestureHash
:
string
haveSeenWelcomeModal
:
boolean
notificationEcogesture
:
string
[]
report
:
string
report
:
boolean
constructor
(
id
:
string
,
...
...
@@ -151,7 +151,7 @@ export class UserProfile {
ecogestureHash
:
string
,
haveSeenWelcomeModal
:
boolean
,
notificationEcogesture
:
string
[],
report
:
string
report
:
boolean
)
{
this
.
id
=
id
this
.
level
=
level
...
...
This diff is collapsed.
Click to expand it.
src/targets/services/monthlyReport.ts
+
16
−
2
View file @
5482b317
...
...
@@ -3,6 +3,8 @@ import { runService } from './service'
import
{
Client
}
from
'
cozy-client
'
import
{
createEmail
}
from
'
./createEmail
'
import
UserProfileManager
from
'
services/userProfileDataManagerService
'
const
log
=
logger
.
namespace
(
'
report
'
)
interface
MonthlyReportProps
{
...
...
@@ -10,10 +12,22 @@ interface MonthlyReportProps {
}
const
monthlyReport
=
async
({
client
}:
MonthlyReportProps
)
=>
{
log
(
'
info
'
,
'
Fetching data for mail...
'
)
log
(
'
info
'
,
'
Fetching user profile...
'
)
const
upm
=
new
UserProfileManager
(
client
)
const
userProfil
=
await
upm
.
getUserProfile
()
if
(
!
userProfil
||
!
userProfil
.
report
)
{
log
(
'
info
'
,
'
End of process - Report disabled in user profile
'
)
return
}
const
username
=
''
const
url
=
''
const
period
=
''
const
monthlyPerformance
=
'
--%
'
log
(
'
info
'
,
'
Fetching data for mail...
'
)
log
(
'
info
'
,
'
Creation of mail...
'
)
const
mailContent
=
createEmail
(
'
John Doe
'
,
"
Mois d'aout 2020
"
,
'
-5%
'
)
const
mailContent
=
createEmail
(
username
,
url
,
period
,
monthlyPerformance
)
const
mailData
=
{
mode
:
'
noreply
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment