Skip to content

Commit

Permalink
updating accessmonitoring enums + schema + solved bug about model name
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgirard committed Sep 8, 2017
1 parent 0dd3b08 commit ab8b506
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 13 deletions.
10 changes: 9 additions & 1 deletion server/routes/editLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,15 @@ function formatEdits(data, model){
}

const getAccessMonitoringsFromData = (model, data) => {
const paths = getAccessMonitoringPaths(model)
let paths = []
if (model === 'organizations')
paths = getAccessMonitoringPaths('organization')
else
if (model === 'activities')
paths = getAccessMonitoringPaths('activity')
else
paths = getAccessMonitoringPaths(model)

const modified = Object.keys(flatten(data))
let result = new Set()
Object.keys(paths)
Expand Down
20 changes: 17 additions & 3 deletions specs/enums.json
Original file line number Diff line number Diff line change
Expand Up @@ -3525,10 +3525,24 @@
],
"accessMonitoring": [
{
"value": "corporate",
"value": "DRH",
"label": {
"fr": "Corporate",
"en": ""
"fr": "DRH",
"en": "HR"
}
},
{
"value": "DS",
"label": {
"fr": "DS",
"en": "scientific direction"
}
},
{
"value": "DSI",
"label": {
"fr": "DSI",
"en": "IT services"
}
}
]
Expand Down
1 change: 1 addition & 0 deletions specs/schema.activity.json
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
},
"grants": [
{
"accessMonitoring":"DS",
"label": {
"fr": "Financements",
"en": "Grants"
Expand Down
4 changes: 4 additions & 0 deletions specs/schema.organization.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"template": "objectName",
"researchUnitCodes": [
{
"accessMonitoring":"DS",
"label": {
"fr": "label numéro(s)",
"en": "label(s) "
Expand Down Expand Up @@ -45,6 +46,7 @@
],
"idsBanner": [
{
"accessMonitoring":"DSI",
"label": {
"fr": "Identifiant Banner",
"en": "banner ID"
Expand All @@ -53,6 +55,7 @@
],
"idsSpire": [
{
"accessMonitoring":"DSI",
"label": {
"fr": "Identifiant Spire",
"en": "Spire ID"
Expand Down Expand Up @@ -153,6 +156,7 @@
}
],
"isariMonitored": {
"accessMonitoring":"DS",
"label": {
"fr": "communauté académique de Sciences Po",
"en": "Sciences Po's academic community"
Expand Down
24 changes: 15 additions & 9 deletions specs/schema.people.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@
"fr": "Nom",
"en": "Name"
},
"accessMonitoring": "corporate"
"accessMonitoring": "DRH"
},
"firstName": {
"label": {
"fr": "Prénom",
"en": "Firstname"
},
"accessMonitoring": "corporate"
"accessMonitoring": "DRH"
},
"template": "peopleName",
"birthName": {
"label": {
"fr": "Nom de naissance",
"en": "Birth name"
},
"accessMonitoring": "corporate"
"accessMonitoring": "DRH"
},
"gender": {
"requirement": "recommended",
"label": {
"fr": "Genre",
"en": "Gender"
},
"accessMonitoring": "corporate",
"accessMonitoring": "DRH",
"enum": "genders"
},
"birthDate": {
Expand All @@ -37,7 +37,7 @@
"fr": "Date de naissance",
"en": "Birthdate"
},
"accessMonitoring": "corporate",
"accessMonitoring": "DRH",
"type": "date"
},
"nationalities": [
Expand All @@ -46,7 +46,7 @@
"fr": "Nationalité(s)",
"en": "Nationality(ies)"
},
"accessMonitoring": "corporate",
"accessMonitoring": "DRH",
"enum": "nationalities"
}
],
Expand All @@ -60,7 +60,7 @@
"fr": "Contrats de travail, postes publiques, ...",
"en": "Academic positions, working positions, ..."
},
"accessMonitoring": "corporate",
"accessMonitoring": "DRH",
"organization": {
"label": {
"fr": "Tutelle",
Expand Down Expand Up @@ -154,7 +154,7 @@
"en": "Unit affiliation"
},
"requirement": "recommended",
"accessMonitoring": "corporate",
"accessMonitoring": "DS",
"organization": {
"label": {
"fr": "Laboratoire de recherche",
Expand Down Expand Up @@ -195,7 +195,7 @@
"en": "Departement affiliation"
},
"requirement": "recommended",
"accessMonitoring": "corporate",
"accessMonitoring": "DS",
"departement": {
"label": {
"fr": "Département d'enseignement",
Expand Down Expand Up @@ -306,6 +306,7 @@
"fr": "Statut et grades",
"en": "Statuses and grades"
},
"accessMonitoring":"DS",
"description": {
"fr": "Professeur, DR1, CR1...",
"en": "Associate Prof, Full Prof..."
Expand Down Expand Up @@ -613,6 +614,7 @@
}
}],
"ldapUid": {
"accessMonitoring":"DSI",
"label": {
"fr": "Identifiant annuaire Sciences Po",
"en": "Sciences Po's directory identifier"
Expand All @@ -630,6 +632,7 @@
"sparse": true
},
"bannerUid": {
"accessMonitoring":"DSI",
"label": {
"fr": "Identifiant scolarité Sciences Po",
"en": "Sciences Po's teaching identifier"
Expand All @@ -639,6 +642,7 @@
"sparse": true
},
"sirhMatricule": {
"accessMonitoring":"DRH",
"label": {
"fr": "Identifiant RH Sciences Po",
"en": "Sciences Po's HR identifier"
Expand All @@ -648,6 +652,7 @@
"sparse": true
},
"CNRSMatricule": {
"accessMonitoring":"DS",
"label": {
"fr": "Identifiant CNRS",
"en": "CNRS identifier"
Expand All @@ -656,6 +661,7 @@
"sparse": true
},
"idSpire": {
"accessMonitoring":"DSI",
"label": {
"fr": "ID SPIRE",
"en": "SPIRE identifier"
Expand Down

0 comments on commit ab8b506

Please sign in to comment.