From f600ef6f91fb24040f80f14099629a4ea17d08dc Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 12 Mar 2024 18:53:30 +0100 Subject: [PATCH] fixup! Testing data Signed-off-by: Ferdinand Thiessen --- apps/settings/discover.json | 200 ++++++++++++++++++ .../lib/Controller/AppSettingsController.php | 7 +- 2 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 apps/settings/discover.json diff --git a/apps/settings/discover.json b/apps/settings/discover.json new file mode 100644 index 0000000000000..35dfe836456f0 --- /dev/null +++ b/apps/settings/discover.json @@ -0,0 +1,200 @@ +[ + { + "type": "post", + "id": "1d41a08e-4aa6-49b3-ad1b-ff2e83bcdc85", + "headline": { + "en": "Amazing wallpapers", + "de": "Bezaubernde Hintergründe" + }, + "text": { + "en": "This are the most amazing wallpapers that you can possible have. Get them now!", + "de": "Die wohl beeindruckensten Hintergründe die man haben kann. Hol sie dir jetzt!" + }, + "link": "https://example.com/wallpapers", + "media": { + "alignment": "end", + "content": { + "en": { + "src": [ + { "src": "https://nextcloud.com/c/uploads/2023/01/nextcloud-podcast-featured-image-1024x576.png", "mime": "image/webp"} + ], + "alt": "Amazing wallpaper" + } + } + } + }, + { + "type": "post", + "id": "1d41a08e-4aa6-49b3-ad1b-ff2e83bcdc86", + "headline": { + "en": "Amazing wallpapers 2", + "de": "Bezaubernde Hintergründe" + }, + "text": { + "en": "This are the most amazing wallpaers that you can possible have. Get them now!", + "de": "Die wohl beeindruckensten Hintergründe die man haben kann. Hol sie dir jetzt!" + }, + "link": "https://example.com/wallpapers", + "media": { + "alignment": "start", + "content": { + "en": { + "src": [ + { "src": "https://nextcloud.com/c/uploads/2023/01/nextcloud-podcast-featured-image-1024x576.png", "mime": "image/webp"} + ], + "alt": "Amazing wallpaper" + } + } + } + }, + { + "type": "post", + "id": "1d41a08e-4aa6-49b3-ad1b-ff2e83bcdc96", + "headline": { + "en": "Text only", + "de": "Nur Text" + }, + "text": { + "en": "This is a post without any media.", + "de": "Dies is ein Post ohne jegliche multimediale Elemente." + }, + "link": "https://example.com/text-only" + }, + { + "type": "post", + "id": "1d41a08e-4aa6-49b3-ad1b-ff2e83bcdc87", + "link": "https://example.com/wallpapers", + "media": { + "alignment": "center", + "content": { + "en": { + "src": [ + { "src": "https://nextcloud.com/c/uploads/2023/01/nextcloud-podcast-featured-image-1024x576.png", "mime": "image/webp"} + ], + "alt": "Amazing wallpaper" + } + } + } + }, + { + "type": "post", + "id": "1d41a08e-4aa6-49b3-ad1b-ff2e83bcdc88", + "media": { + "alignment": "center", + "content": { + "en": { + "src": [ + { "src": "https://github.com/nextcloud/firstrunwizard/raw/master/img/Nextcloud.webm", "mime": "video/webm"}, + { "src": "https://github.com/nextcloud/firstrunwizard/raw/master/img/Nextcloud.mp4", "mime": "video/mp4"} + ], + "alt": "HUB Update", + "link": "https://example.com/wallpapers" + } + } + } + }, + { + "type": "carousel", + "id": "1d41a08e-4ca6-49b3-ad1b-ff2e83bcdf96", + "headline": { + "en": "Another carousel", + "de": "Ein weiteres Karussel" + }, + "content": [ + { + "type": "post", + "id": "f-4aa6-49b4-ad1b-fe2e83bcdc96", + "media": { + "alignment": "center", + "content": { + "en": { + "src": { + "src": "https://nextcloud.com/c/uploads/2023/12/featured-image-owncloud-to-nextcloud-migration-1024x576.png", + "mime": "image/webp" + }, + "alt": "ooo" + } + } + } + }, + { + "type": "post", + "id": "d-4aa6-49b4-ad1b-fe2e83bcdc96", + "media": { + "alignment": "center", + "content": { + "en": { + "src": { + "src": "https://nextcloud.com/c/uploads/2023/11/owncloud-nextcloud-kiteworks-migration-tools-1024x576.png", + "mime": "image/webp" + }, + "alt": "ooo" + } + } + } + }, + { + "type": "post", + "id": "e-4aa6-49b4-ad1b-fe2e83bcdc96", + "headline": { + "en": "A big day for the Nextcloud community" + }, + "text": { + "en": "Earlier today, our founder Frank Karlitschek accepted the honorary SFS Award for ongoing contribution to the mission of Free Software. The award is a highlight of the 20th annual SFSCON dedicated to promotion and implementation of FOSS in Europe and beyond. Image source: NOI Techpark" + }, + "media": { + "alignment": "start", + "content": { + "en": { + "src": { + "src": "https://nextcloud.com/c/uploads/2023/11/frank-karlitschek-nextcloud-award-european-sfs-community-864x576.jpeg", + "mime": "image/webp" + }, + "alt": "ooo" + } + } + } + } + ] + }, + { + "type": "carousel", + "id": "1d41a08e-4aa6-49b3-ad1b-ff2e83bcdf96", + "headline": { + "en": "A carousel", + "de": "Ein Karussel" + }, + "content": [ + { + "type": "post", + "id": "1d41a08e-4aa6-49b4-ad1b-ff2e83bcdc96", + "headline": { + "en": "One" + }, + "text": { + "en": "This is a post without any media." + } + }, + { + "type": "post", + "id": "1d41a08e-4aa6-49b5-ad1b-ff2e83bcdc96", + "headline": { + "en": "Two" + }, + "text": { + "en": "This is a post without any media." + } + }, + { + "type": "post", + "id": "1d41a08e-4aa6-49b6-ad1b-ff2e83bcdc96", + "headline": { + "en": "Three" + }, + "text": { + "en": "This is a post without any media." + } + } + ] + } +] diff --git a/apps/settings/lib/Controller/AppSettingsController.php b/apps/settings/lib/Controller/AppSettingsController.php index 5d92b02d5c1cd..719786b8be71d 100644 --- a/apps/settings/lib/Controller/AppSettingsController.php +++ b/apps/settings/lib/Controller/AppSettingsController.php @@ -131,7 +131,12 @@ public function viewApps(): TemplateResponse { * @NoCSRFRequired */ public function getAppDiscoverJSON(): JSONResponse { - $data = $this->discoverFetcher->get(); + // $data = $this->discoverFetcher->get(); + + // TODO REMOVE JUST FOR TESTING + $file = file_get_contents(__DIR__ . '/../../discover.json'); + $data = json_decode($file); + // END TODO return new JSONResponse($data); }