Skip to content

Commit

Permalink
#129 : merge applicationCategories and remove categories
Browse files Browse the repository at this point in the history
  • Loading branch information
guillermau committed Jan 17, 2025
1 parent 31bdfb9 commit 5c9fff0
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 63 deletions.
10 changes: 7 additions & 3 deletions api/src/core/adapters/dbApi/kysely/createPgSoftwareRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ export const createPgSoftwareRepository = (db: Kysely<Database>): SoftwareReposi
parentWikidataSoftware: parentExternalData,
keywords: software?.keywords ?? softwareExternalData?.keywords ?? [],
programmingLanguages: softwareExternalData?.programmingLanguages ?? [],
applicationCategories: softwareExternalData?.applicationCategories ?? []
applicationCategories: software.categories.concat(
softwareExternalData?.applicationCategories ?? []
)
});
}),
getById: getBySoftwareId,
Expand Down Expand Up @@ -285,7 +287,9 @@ export const createPgSoftwareRepository = (db: Kysely<Database>): SoftwareReposi
software.comptoirDuLibreSoftware?.providers.length ?? 0,
testUrl: testUrls[0]?.url,
parentWikidataSoftware: parentExternalData ?? undefined,
applicationCategories: softwareExternalData?.applicationCategories ?? [],
applicationCategories: software.categories.concat(
softwareExternalData?.applicationCategories ?? []
),
programmingLanguages: softwareExternalData?.programmingLanguages ?? []
});
}
Expand Down Expand Up @@ -547,6 +551,6 @@ const makeGetSoftwareById =
testUrl: testUrls[0]?.url,
parentWikidataSoftware: parentExternalData,
programmingLanguages: softwareExternalData?.programmingLanguages ?? [],
applicationCategories: softwareExternalData?.applicationCategories ?? []
applicationCategories: software.categories.concat(softwareExternalData?.applicationCategories ?? [])
});
});
62 changes: 21 additions & 41 deletions web/src/core/adapter/sillApiMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const sillApi: SillApi = {
"testUrl": undefined,
"addedTime": Date.now(),
"updateTime": Date.now(),
"categories": [],
"applicationCategories": [],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": formData.isFromFrenchPublicService,
Expand All @@ -111,8 +111,7 @@ export const sillApi: SillApi = {
},
"keywords": [],
"annuaireCnllServiceProviders": [],
"programmingLanguages": ["c++"],
"applicationCategories": []
"programmingLanguages": ["c++"]
};

softwares.push(software);
Expand Down Expand Up @@ -154,7 +153,7 @@ export const sillApi: SillApi = {
"testUrl": undefined,
"addedTime": Date.now(),
"updateTime": Date.now(),
"categories": [],
"applicationCategories": [],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": formData.isFromFrenchPublicService,
Expand All @@ -168,7 +167,6 @@ export const sillApi: SillApi = {
},
"keywords": [],
"annuaireCnllServiceProviders": [],
"applicationCategories": [],
"programmingLanguages": []
})
};
Expand Down Expand Up @@ -326,7 +324,7 @@ const softwares = [
"addedTime": 1670416144,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["messaging"],
"applicationCategories": ["messaging"],
"softwareType": {
"type": "cloud"
},
Expand All @@ -341,7 +339,6 @@ const softwares = [
"DINUM": { "referentCount": 2, "userCount": 43 }
},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -387,7 +384,7 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["traitement de texte"],
"applicationCategories": ["traitement de texte"],
"prerogatives": {
"doRespectRgaa": true,
"isFromFrenchPublicServices": true,
Expand All @@ -407,7 +404,6 @@ const softwares = [
"CA du Puy-en-Velay": { "referentCount": 1, "userCount": 0 }
},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -453,7 +449,7 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud", "software"],
"applicationCategories": ["cloud", "software"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
Expand All @@ -465,7 +461,6 @@ const softwares = [
"DINUM": { "referentCount": 2, "userCount": 43 }
},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -514,15 +509,14 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["player"],
"applicationCategories": ["player"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
"isPresentInSupportContract": false
},
"userAndReferentCountByOrganization": {},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -570,7 +564,7 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
Expand All @@ -582,7 +576,6 @@ const softwares = [
"DINUM": { "referentCount": 2, "userCount": 43 }
},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -645,7 +638,7 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
Expand All @@ -657,7 +650,6 @@ const softwares = [
"DINUM": { "referentCount": 2, "userCount": 43 }
},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -702,7 +694,7 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
Expand All @@ -713,7 +705,6 @@ const softwares = [
"DINUM": { "referentCount": 2, "userCount": 43 }
},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -763,7 +754,7 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
Expand All @@ -784,7 +775,6 @@ const softwares = [
"DINUM": { "referentCount": 2, "userCount": 43 }
},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -823,7 +813,7 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"softwareType": {
"type": "stack"
},
Expand All @@ -836,7 +826,6 @@ const softwares = [
"CA du Puy-en-Velay": { "referentCount": 0, "userCount": 1 }
},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -875,7 +864,7 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
Expand All @@ -887,7 +876,6 @@ const softwares = [
"DINUM": { "referentCount": 2, "userCount": 43 }
},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -927,15 +915,14 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
"isPresentInSupportContract": false
},
"userAndReferentCountByOrganization": {},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -975,15 +962,14 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
"isPresentInSupportContract": false
},
"userAndReferentCountByOrganization": {},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -1023,15 +1009,14 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
"isPresentInSupportContract": false
},
"userAndReferentCountByOrganization": {},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -1071,15 +1056,14 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
"isPresentInSupportContract": false
},
"userAndReferentCountByOrganization": {},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -1119,15 +1103,14 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
"isPresentInSupportContract": false
},
"userAndReferentCountByOrganization": {},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -1167,15 +1150,14 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
"isPresentInSupportContract": false
},
"userAndReferentCountByOrganization": {},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -1215,15 +1197,14 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
"isPresentInSupportContract": false
},
"userAndReferentCountByOrganization": {},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
}),
id<ApiTypes.Software>({
Expand Down Expand Up @@ -1263,15 +1244,14 @@ const softwares = [
"addedTime": 1674739365178,
"updateTime": 1674739365178,
"dereferencing": undefined,
"categories": ["cloud"],
"applicationCategories": ["cloud"],
"prerogatives": {
"doRespectRgaa": false,
"isFromFrenchPublicServices": false,
"isPresentInSupportContract": false
},
"userAndReferentCountByOrganization": {},
"keywords": [],
"applicationCategories": [],
"programmingLanguages": []
})
];
Expand Down
Loading

0 comments on commit 5c9fff0

Please sign in to comment.