From d623e5477bf498a96de521afd28430e9ec55a274 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Sun, 30 Nov 2025 21:40:56 -0500 Subject: [PATCH 1/4] feat: Implement dynamic loading of application links from a JSON configuration using a new JavaScript module. --- .../internal-launchpad/assets/data/links.json | 145 ++++++ .../assets/js/links-loader.js | 63 +++ firebase/internal-launchpad/index.html | 436 ++++++------------ 3 files changed, 357 insertions(+), 287 deletions(-) create mode 100644 firebase/internal-launchpad/assets/data/links.json create mode 100644 firebase/internal-launchpad/assets/js/links-loader.js diff --git a/firebase/internal-launchpad/assets/data/links.json b/firebase/internal-launchpad/assets/data/links.json new file mode 100644 index 00000000..0b2c2446 --- /dev/null +++ b/firebase/internal-launchpad/assets/data/links.json @@ -0,0 +1,145 @@ +[ + { + "title": "Applications", + "iconColorClass": "bg-primary-100", + "iconSvg": "", + "links": [ + { + "title": "Control Tower", + "url": "https://krow-workforce-dev.web.app", + "badge": "Dev", + "badgeColorClass": "bg-blue-500", + "containerClass": "bg-gradient-to-r from-blue-50 to-blue-100 hover:from-blue-100 hover:to-blue-200", + "iconClass": "w-2 h-2 bg-blue-500 rounded-full", + "textHoverClass": "group-hover:text-blue-700" + }, + { + "title": "Control Tower", + "url": "https://krow-workforce-staging.web.app", + "badge": "Staging", + "badgeColorClass": "bg-amber-500", + "containerClass": "bg-gradient-to-r from-amber-50 to-amber-100 hover:from-amber-100 hover:to-amber-200", + "iconClass": "w-2 h-2 bg-amber-500 rounded-full", + "textHoverClass": "group-hover:text-amber-700" + } + ] + }, + { + "title": "Legacy Mobile Apps", + "iconColorClass": "bg-green-100", + "iconSvg": "", + "links": [ + { + "title": "Google Play Store", + "url": "https://play.google.com/store/apps/dev?id=9163719228191263405&hl=en", + "badge": "Live", + "badgeColorClass": "bg-green-500", + "containerClass": "bg-gradient-to-r from-green-50 to-emerald-100 hover:from-green-100 hover:to-emerald-200", + "iconSvg": "", + "textHoverClass": "group-hover:text-green-700" + }, + { + "title": "Apple App Store", + "url": "https://apps.apple.com/us/developer/thinkloops-llc/id1719034287", + "badge": "Live", + "badgeColorClass": "bg-gray-700", + "containerClass": "bg-gradient-to-r from-gray-50 to-gray-100 hover:from-gray-100 hover:to-gray-200", + "iconSvg": "", + "textHoverClass": "group-hover:text-gray-700" + } + ] + }, + { + "title": "Cloud Infrastructure", + "iconColorClass": "bg-purple-100", + "iconSvg": "", + "links": [ + { + "title": "Firebase Console", + "url": "https://console.firebase.google.com/project/krow-workforce-dev/overview", + "badge": "Dev", + "badgeColorClass": "bg-blue-500", + "containerClass": "bg-gradient-to-r from-blue-50 to-indigo-100 hover:from-blue-100 hover:to-indigo-200", + "iconSvg": "", + "textHoverClass": "group-hover:text-indigo-700" + }, + { + "title": "Firebase Console", + "url": "https://console.firebase.google.com/project/krow-workforce-staging/overview", + "badge": "Staging", + "badgeColorClass": "bg-amber-500", + "containerClass": "bg-gradient-to-r from-amber-50 to-orange-100 hover:from-amber-100 hover:to-orange-200", + "iconSvg": "", + "textHoverClass": "group-hover:text-orange-700" + }, + { + "title": "Google Cloud", + "url": "https://console.cloud.google.com/welcome/new?project=krow-workforce-dev", + "badge": "Dev", + "badgeColorClass": "bg-blue-500", + "containerClass": "bg-gradient-to-r from-blue-50 to-cyan-100 hover:from-blue-100 hover:to-cyan-200", + "iconSvg": "", + "textHoverClass": "group-hover:text-cyan-700" + }, + { + "title": "Google Cloud", + "url": "https://console.cloud.google.com/welcome/new?project=krow-workforce-staging", + "badge": "Staging", + "badgeColorClass": "bg-amber-500", + "containerClass": "bg-gradient-to-r from-amber-50 to-yellow-100 hover:from-amber-100 hover:to-yellow-200", + "iconSvg": "", + "textHoverClass": "group-hover:text-yellow-700" + } + ] + }, + { + "title": "Design", + "iconColorClass": "bg-pink-100", + "iconSvg": "", + "links": [ + { + "title": "Staff App Figma File", + "url": "#", + "badge": "Design", + "badgeColorClass": "bg-pink-500", + "containerClass": "bg-gradient-to-r from-pink-50 to-rose-100 hover:from-pink-100 hover:to-rose-200", + "iconSvg": "", + "textHoverClass": "group-hover:text-pink-700" + }, + { + "title": "Staff App Preview", + "url": "#", + "badge": "Preview", + "badgeColorClass": "bg-purple-500", + "containerClass": "bg-gradient-to-r from-purple-50 to-fuchsia-100 hover:from-purple-100 hover:to-fuchsia-200", + "iconSvg": "", + "textHoverClass": "group-hover:text-purple-700" + } + ] + }, + { + "title": "Resources", + "iconColorClass": "bg-indigo-100", + "iconSvg": "", + "links": [ + { + "title": "GitHub Repository", + "subtitle": "View source code", + "url": "https://github.com/Oloodi/krow-workforce", + "containerClass": "bg-gradient-to-r from-gray-50 to-slate-100 hover:from-gray-100 hover:to-slate-200", + "iconSvg": "", + "textHoverClass": "group-hover:text-gray-700", + "arrowIcon": true + }, + { + "title": "Team Communication", + "subtitle": "Google Chat", + "url": "https://chat.google.com/", + "containerClass": "bg-gradient-to-r from-green-50 to-teal-100 hover:from-green-100 hover:to-teal-200", + "iconSvg": "", + "textHoverClass": "group-hover:text-teal-700", + "arrowIcon": true + } + ] + } +] diff --git a/firebase/internal-launchpad/assets/js/links-loader.js b/firebase/internal-launchpad/assets/js/links-loader.js new file mode 100644 index 00000000..f00b10a9 --- /dev/null +++ b/firebase/internal-launchpad/assets/js/links-loader.js @@ -0,0 +1,63 @@ +async function loadLinks() { + const container = document.getElementById('links-container'); + if (!container) return; + + try { + const response = await fetch('./assets/data/links.json'); + if (!response.ok) { + throw new Error(`Failed to load links: ${response.status}`); + } + + const groups = await response.json(); + + container.innerHTML = groups.map(group => ` + +
+
+
+ ${group.iconSvg} +
+

${group.title}

+
+ + +
+ `).join(''); + + } catch (error) { + console.error('Error loading links:', error); + container.innerHTML = ` +
+ Failed to load application links. Please try refreshing the page. +
+ `; + } +} + +// Load links when the DOM is loaded +document.addEventListener('DOMContentLoaded', loadLinks); diff --git a/firebase/internal-launchpad/index.html b/firebase/internal-launchpad/index.html index 9b8e22a3..5857dfd4 100644 --- a/firebase/internal-launchpad/index.html +++ b/firebase/internal-launchpad/index.html @@ -6,16 +6,16 @@ KROW Launchpad - + - + - + - + - + + Figma.logo + Created using Figma + + + + + + \ No newline at end of file diff --git a/firebase/internal-launchpad/assets/images/icon-firebase-console.svg b/firebase/internal-launchpad/assets/images/icon-firebase-console.svg new file mode 100644 index 00000000..d6ed32f0 --- /dev/null +++ b/firebase/internal-launchpad/assets/images/icon-firebase-console.svg @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/firebase/internal-launchpad/assets/images/icon-github.svg b/firebase/internal-launchpad/assets/images/icon-github.svg new file mode 100644 index 00000000..f5f2bd80 --- /dev/null +++ b/firebase/internal-launchpad/assets/images/icon-github.svg @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/firebase/internal-launchpad/assets/images/icon-google-cloud.svg b/firebase/internal-launchpad/assets/images/icon-google-cloud.svg new file mode 100644 index 00000000..6f5213d3 --- /dev/null +++ b/firebase/internal-launchpad/assets/images/icon-google-cloud.svg @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/firebase/internal-launchpad/assets/images/icon-google-play.svg b/firebase/internal-launchpad/assets/images/icon-google-play.svg new file mode 100644 index 00000000..8a02867a --- /dev/null +++ b/firebase/internal-launchpad/assets/images/icon-google-play.svg @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/firebase/internal-launchpad/assets/images/icon-legacy-mobile-apps.svg b/firebase/internal-launchpad/assets/images/icon-legacy-mobile-apps.svg new file mode 100644 index 00000000..c43a10d4 --- /dev/null +++ b/firebase/internal-launchpad/assets/images/icon-legacy-mobile-apps.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/firebase/internal-launchpad/assets/images/icon-preview.svg b/firebase/internal-launchpad/assets/images/icon-preview.svg new file mode 100644 index 00000000..e9846535 --- /dev/null +++ b/firebase/internal-launchpad/assets/images/icon-preview.svg @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/firebase/internal-launchpad/assets/images/icon-resources.svg b/firebase/internal-launchpad/assets/images/icon-resources.svg new file mode 100644 index 00000000..cda1666d --- /dev/null +++ b/firebase/internal-launchpad/assets/images/icon-resources.svg @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/firebase/internal-launchpad/assets/js/links-loader.js b/firebase/internal-launchpad/assets/js/links-loader.js index f00b10a9..9bca36f7 100644 --- a/firebase/internal-launchpad/assets/js/links-loader.js +++ b/firebase/internal-launchpad/assets/js/links-loader.js @@ -10,7 +10,32 @@ async function loadLinks() { const groups = await response.json(); - container.innerHTML = groups.map(group => ` + // Helper function to fetch SVG content + const fetchSvg = async (path) => { + if (!path) return ''; + try { + const res = await fetch(path); + if (!res.ok) return ''; + return await res.text(); + } catch (e) { + console.error(`Failed to load SVG: ${path}`, e); + return ''; + } + }; + + // Process groups and fetch SVGs in parallel + const groupsWithSvgs = await Promise.all(groups.map(async (group) => { + const groupIconSvg = await fetchSvg(group.iconPath); + + const linksWithSvgs = await Promise.all(group.links.map(async (link) => { + const linkIconSvg = link.iconPath ? await fetchSvg(link.iconPath) : ''; + return { ...link, iconSvg: linkIconSvg }; + })); + + return { ...group, iconSvg: groupIconSvg, links: linksWithSvgs }; + })); + + container.innerHTML = groupsWithSvgs.map(group => `
From 41fc7c8316cd8a7bd380063f0e535b65dd325ddf Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Sun, 30 Nov 2025 21:58:48 -0500 Subject: [PATCH 3/4] feat: update icon-figma SVG attributes and replace icon-design SVG content --- firebase/internal-launchpad/assets/data/links.json | 4 ++-- .../internal-launchpad/assets/images/icon-design.svg | 12 ++++++++---- .../internal-launchpad/assets/images/icon-figma.svg | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/firebase/internal-launchpad/assets/data/links.json b/firebase/internal-launchpad/assets/data/links.json index 40b7f76d..c71818da 100644 --- a/firebase/internal-launchpad/assets/data/links.json +++ b/firebase/internal-launchpad/assets/data/links.json @@ -99,7 +99,7 @@ "links": [ { "title": "Staff App Figma File", - "url": "#", + "url": "https://www.figma.com/design/HfNpoYOpkfUu2lgDMp4xQK/KROW-Staff-App-Revamp?node-id=0-1&t=4TLUeCIWf7I1TTGQ-1", "badge": "Design", "badgeColorClass": "bg-pink-500", "containerClass": "bg-gradient-to-r from-pink-50 to-rose-100 hover:from-pink-100 hover:to-rose-200", @@ -108,7 +108,7 @@ }, { "title": "Staff App Preview", - "url": "#", + "url": "https://9000-firebase-studio-1764098159606.cluster-oe5pskshnfducslpwllk6difqk.cloudworkstations.dev/", "badge": "Preview", "badgeColorClass": "bg-purple-500", "containerClass": "bg-gradient-to-r from-purple-50 to-fuchsia-100 hover:from-purple-100 hover:to-fuchsia-200", diff --git a/firebase/internal-launchpad/assets/images/icon-design.svg b/firebase/internal-launchpad/assets/images/icon-design.svg index 0442362c..4aade6eb 100644 --- a/firebase/internal-launchpad/assets/images/icon-design.svg +++ b/firebase/internal-launchpad/assets/images/icon-design.svg @@ -1,5 +1,9 @@ - - - + + + + + \ No newline at end of file diff --git a/firebase/internal-launchpad/assets/images/icon-figma.svg b/firebase/internal-launchpad/assets/images/icon-figma.svg index 88fa947d..2d8439c3 100644 --- a/firebase/internal-launchpad/assets/images/icon-figma.svg +++ b/firebase/internal-launchpad/assets/images/icon-figma.svg @@ -1,4 +1,4 @@ - +