Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VO-1070 & VO-778 & VO-1036] feat(ApplicationPage): Add / remove additional apps from home page #923

Merged
merged 8 commits into from
Oct 9, 2024
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@
"@sentry/react": "^8.5.0",
"cozy-app-publish": "^0.27.2",
"cozy-bar": "^15.0.0",
"cozy-client": "^48.25.0",
"cozy-client": "^49.3.0",
"cozy-device-helper": "^2.1.0",
"cozy-doctypes": "1.85.0",
"cozy-flags": "^4.0.0",
"cozy-intent": "^2.0.2",
"cozy-intent": "^2.23.0",
"cozy-interapp": "0.9.0",
"cozy-logger": "1.9.0",
"cozy-minilog": "^3.3.1",
"cozy-realtime": "3.14.4",
"cozy-stack-client": "^48.16.0",
"cozy-stack-client": "^49.0.0",
"cozy-ui": "^111.13.0",
"emoji-js": "3.7.0",
"focus-trap-react": "4.0.1",
Expand Down
126 changes: 59 additions & 67 deletions src/ducks/AlternativeStore/tests/transformData.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ describe('transformData', () => {
{
id: '01904ab1-f1fd-7243-b39b-37fe73b5579a',
metadata: {
description: 'Description for I-Paf',
target: {
category: 'perso',
description: 'Description for I-Paf'
category: 'perso'
},
externalDataSource: {
source: 'Developer A'
creator: 'Developer A'
}
},
path: '/Settings/Home/Barfoo/I-Paf.url',
Expand All @@ -22,12 +22,12 @@ describe('transformData', () => {
{
id: '01904ab2-20a9-7243-9972-df18c9c671d3',
metadata: {
description: 'Description for Gestion des dossiers publidoc',
target: {
category: 'foobaz',
description: 'Description for Gestion des dossiers publidoc'
category: 'foobaz'
},
externalDataSource: {
source: 'Developer B'
creator: 'Developer B'
}
},
path: '/Settings/Home/Foobaz/Gestion des dossiers publidoc.url',
Expand All @@ -36,12 +36,12 @@ describe('transformData', () => {
{
id: '01904ab2-2633-7243-9774-dc81fb0bc46a',
metadata: {
description: 'Description for M@gistère',
target: {
category: 'quxbaz',
description: 'Description for M@gistère'
category: 'quxbaz'
},
externalDataSource: {
source: 'Developer C'
creator: 'Developer C'
}
},
path: '/Settings/Home/Barfoo/M@gistère.url',
Expand All @@ -53,12 +53,12 @@ describe('transformData', () => {
{
id: '01904ab1-f1fd-7243-b39b-37fe73b5579a',
metadata: {
description: 'Description for I-Paf',
target: {
category: 'perso',
description: 'Description for I-Paf'
category: 'perso'
},
externalDataSource: {
source: 'Developer A'
creator: 'Developer A'
}
},
path: '/Settings/Home/Barfoo/I-Paf.url',
Expand All @@ -72,12 +72,12 @@ describe('transformData', () => {
{
id: '01904ab2-20a9-7243-9972-df18c9c671d3',
metadata: {
description: 'Description for Gestion des dossiers publidoc',
target: {
category: 'foobaz',
description: 'Description for Gestion des dossiers publidoc'
category: 'foobaz'
},
externalDataSource: {
source: 'Developer B'
creator: 'Developer B'
}
},
path: '/Settings/Home/Foobaz/Gestion des dossiers publidoc.url',
Expand All @@ -91,12 +91,12 @@ describe('transformData', () => {
{
id: '01904ab2-2633-7243-9774-dc81fb0bc46a',
metadata: {
description: 'Description for M@gistère',
target: {
category: 'quxbaz',
description: 'Description for M@gistère'
category: 'quxbaz'
},
externalDataSource: {
source: 'Developer C'
creator: 'Developer C'
}
},
path: '/Settings/Home/Barfoo/M@gistère.url',
Expand All @@ -118,12 +118,12 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c89c',
metadata: {
description: 'Description for quxbaz',
target: {
category: 'foobaz',
description: 'Description for quxbaz'
category: 'foobaz'
},
externalDataSource: {
source: 'Developer D'
creator: 'Developer D'
}
},
path: '/Settings/Home/Applications Foobar/Store Foobar/quxbaz.url',
Expand All @@ -132,12 +132,12 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c89d',
metadata: {
description: 'Description for OtherFile',
target: {
category: 'other',
description: 'Description for OtherFile'
category: 'other'
},
externalDataSource: {
source: 'Developer E'
creator: 'Developer E'
}
},
path: '/Settings/Home/Applications Foobar/Store Foobar/OtherFile.url',
Expand All @@ -149,12 +149,12 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c89c',
metadata: {
description: 'Description for quxbaz',
target: {
category: 'foobaz',
description: 'Description for quxbaz'
category: 'foobaz'
},
externalDataSource: {
source: 'Developer D'
creator: 'Developer D'
}
},
path: '/Settings/Home/Applications Foobar/Store Foobar/quxbaz.url',
Expand All @@ -168,12 +168,12 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c89d',
metadata: {
description: 'Description for OtherFile',
target: {
category: 'other',
description: 'Description for OtherFile'
category: 'other'
},
externalDataSource: {
source: 'Developer E'
creator: 'Developer E'
}
},
path: '/Settings/Home/Applications Foobar/Store Foobar/OtherFile.url',
Expand All @@ -195,11 +195,9 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c890',
metadata: {
target: {
description: 'Description for NoCategory'
},
description: 'Description for NoCategory',
externalDataSource: {
source: 'Developer F'
creator: 'Developer F'
}
},
path: '/Settings/Home/Foobaz/NoCategory.url',
Expand All @@ -208,12 +206,12 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c891',
metadata: {
description: 'Description for UndefinedCategory',
target: {
category: undefined,
description: 'Description for UndefinedCategory'
category: undefined
},
externalDataSource: {
source: 'Developer G'
creator: 'Developer G'
}
},
path:
Expand All @@ -226,11 +224,9 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c890',
metadata: {
target: {
description: 'Description for NoCategory'
},
description: 'Description for NoCategory',
externalDataSource: {
source: 'Developer F'
creator: 'Developer F'
}
},
path: '/Settings/Home/Foobaz/NoCategory.url',
Expand All @@ -244,12 +240,12 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c891',
metadata: {
description: 'Description for UndefinedCategory',
target: {
category: undefined,
description: 'Description for UndefinedCategory'
category: undefined
},
externalDataSource: {
source: 'Developer G'
creator: 'Developer G'
}
},
path:
Expand All @@ -272,12 +268,12 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c892',
metadata: {
description: 'Description for Unknown',
target: {
category: 'unknown',
description: 'Description for Unknown'
category: 'unknown'
},
externalDataSource: {
source: 'Developer H'
creator: 'Developer H'
}
},
path: '/ultra/bogus/path',
Expand All @@ -296,12 +292,12 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c89c',
metadata: {
description: 'Description for quxbaz',
target: {
category: 'foobaz',
description: 'Description for quxbaz'
category: 'foobaz'
},
externalDataSource: {
source: 'Developer I'
creator: 'Developer I'
}
},
path: '/Settings/Home/Applications Foobar/Store Foobar/quxbaz.url',
Expand All @@ -310,11 +306,9 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c890',
metadata: {
target: {
description: 'Description for NoType'
},
description: 'Description for NoType',
externalDataSource: {
source: 'Developer J'
creator: 'Developer J'
}
},
path: '/Settings/Home/Foobaz/NoType.url',
Expand All @@ -323,12 +317,12 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c892',
metadata: {
description: 'Description for Unknown',
target: {
category: 'unknown',
description: 'Description for Unknown'
category: 'unknown'
},
externalDataSource: {
source: 'Developer K'
creator: 'Developer K'
}
},
path: '/Settings/Home/Applications Foobar/Store Foobar/Unknown.url',
Expand All @@ -340,12 +334,12 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c89c',
metadata: {
description: 'Description for quxbaz',
target: {
category: 'foobaz',
description: 'Description for quxbaz'
category: 'foobaz'
},
externalDataSource: {
source: 'Developer I'
creator: 'Developer I'
}
},
path: '/Settings/Home/Applications Foobar/Store Foobar/quxbaz.url',
Expand All @@ -359,11 +353,9 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c890',
metadata: {
target: {
description: 'Description for NoType'
},
description: 'Description for NoType',
externalDataSource: {
source: 'Developer J'
creator: 'Developer J'
}
},
path: '/Settings/Home/Foobaz/NoType.url',
Expand All @@ -377,12 +369,12 @@ describe('transformData', () => {
{
id: '01908039-3b2c-7852-b4bd-1d768199c892',
metadata: {
description: 'Description for Unknown',
target: {
category: 'unknown',
description: 'Description for Unknown'
category: 'unknown'
},
externalDataSource: {
source: 'Developer K'
creator: 'Developer K'
}
},
path: '/Settings/Home/Applications Foobar/Store Foobar/Unknown.url',
Expand Down
4 changes: 2 additions & 2 deletions src/ducks/AlternativeStore/transformData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ export const transformData = (
return {
...file,
name: file.name.replace('.url', ''),
long_description: file.metadata.target?.description,
long_description: file.metadata.description,
installed: !isStorePath,
categories: [category],
slug: file.id, // This is much easier than refactoring the whole app
developer: {
name: file.metadata.externalDataSource?.source
name: file.metadata.externalDataSource?.creator
}
}
})
Expand Down
Loading