Skip to content

Commit cab872d

Browse files
committed
feat: show all app types in the filter
1 parent 1e9135a commit cab872d

File tree

10 files changed

+3914
-3955
lines changed

10 files changed

+3914
-3955
lines changed

dist/appverse.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/appverse.es.js

Lines changed: 3845 additions & 3832 deletions
Large diffs are not rendered by default.

dist/appverse.es.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/appverse.umd.js

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/appverse.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/home/FilterSidebar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export default function FilterSidebar({ filters, onFilterChange, filterOptions =
110110
},
111111
filterOptions.appType?.length > 0 && {
112112
key: 'appType',
113-
title: 'Type',
113+
title: 'App Type',
114114
options: filterOptions.appType.map(item => ({
115115
value: item.name, // Use name for URL params
116116
label: item.name.replace(/_/g, ' ') // "batch_connect" → "batch connect"

src/contexts/AppverseDataContext.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* const { software, apps, appsBySoftwareId, loading, error } = useAppverseData()
1010
*/
1111
import { createContext, useState, useEffect, useMemo } from 'react';
12-
import { fetchAllSoftware, fetchAllApps, groupAppsBySoftware, extractFilterOptionsFromApps, extractFilterOptionsFromSoftware } from '../utils/api';
12+
import { fetchAllSoftware, fetchAllApps, fetchAllAppTypes, groupAppsBySoftware, extractFilterOptionsFromApps, extractFilterOptionsFromSoftware } from '../utils/api';
1313
import { slugify } from '../utils/slugify';
1414
import { useConfig } from './ConfigContext';
1515

@@ -115,9 +115,9 @@ export function AppverseDataProvider({ children }) {
115115
setData(prev => ({ ...prev, softwareLoading: false, error }));
116116
});
117117

118-
// Fetch apps — update state as soon as it resolves
119-
fetchAllApps(config)
120-
.then(({ apps, included: appsIncluded }) => {
118+
// Fetch apps and all app types concurrently
119+
Promise.all([fetchAllApps(config), fetchAllAppTypes(config)])
120+
.then(([{ apps, included: appsIncluded }, allAppTypes]) => {
121121
const appsFilterOptions = extractFilterOptionsFromApps(appsIncluded);
122122
const appsBySoftwareId = groupAppsBySoftware(apps);
123123
setData(prev => ({
@@ -127,7 +127,7 @@ export function AppverseDataProvider({ children }) {
127127
appsLoading: false,
128128
filterOptions: {
129129
...prev.filterOptions,
130-
appType: appsFilterOptions.appType,
130+
appType: allAppTypes,
131131
tags: mergeTags(prev.filterOptions.tags, appsFilterOptions.tags)
132132
}
133133
}));

src/index.css

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,81 +2,6 @@
22
@tailwind components;
33
@tailwind utilities;
44

5-
/* Scoped preflight resets — only apply within #appverse-root to avoid
6-
leaking Tailwind's global resets onto the host page (e.g., Drupal navbar). */
7-
#appverse-root {
8-
line-height: 1.5;
9-
-webkit-text-size-adjust: 100%;
10-
-moz-tab-size: 4;
11-
tab-size: 4;
12-
}
13-
14-
#appverse-root *,
15-
#appverse-root *::before,
16-
#appverse-root *::after {
17-
box-sizing: border-box;
18-
border-width: 0;
19-
border-style: solid;
20-
border-color: #e5e7eb;
21-
}
22-
23-
#appverse-root h1,
24-
#appverse-root h2,
25-
#appverse-root h3,
26-
#appverse-root h4,
27-
#appverse-root h5,
28-
#appverse-root h6 {
29-
font-size: inherit;
30-
font-weight: inherit;
31-
}
32-
33-
#appverse-root a {
34-
color: inherit;
35-
text-decoration: inherit;
36-
}
37-
38-
#appverse-root ol,
39-
#appverse-root ul,
40-
#appverse-root menu {
41-
list-style: none;
42-
margin: 0;
43-
padding: 0;
44-
}
45-
46-
#appverse-root img,
47-
#appverse-root svg,
48-
#appverse-root video,
49-
#appverse-root canvas,
50-
#appverse-root audio,
51-
#appverse-root iframe,
52-
#appverse-root embed,
53-
#appverse-root object {
54-
display: block;
55-
vertical-align: middle;
56-
}
57-
58-
#appverse-root img,
59-
#appverse-root video {
60-
max-width: 100%;
61-
height: auto;
62-
}
63-
64-
#appverse-root button,
65-
#appverse-root input,
66-
#appverse-root optgroup,
67-
#appverse-root select,
68-
#appverse-root textarea {
69-
font-family: inherit;
70-
font-feature-settings: inherit;
71-
font-variation-settings: inherit;
72-
font-size: 100%;
73-
font-weight: inherit;
74-
line-height: inherit;
75-
color: inherit;
76-
margin: 0;
77-
padding: 0;
78-
}
79-
805
/* AppVerse Browser Styles */
816
.appverse-container {
827
@apply font-sans text-appverse-black;

src/utils/api.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ async function fetchAllPages(initialUrl, _logLabel, apiBaseUrl = DEFAULT_API_BAS
8181
const endpoints = {
8282
allSoftware: (baseUrl) => `${baseUrl}/node/appverse_software?include=field_appverse_logo.field_media_image_1,field_appverse_logo.field_media_image,field_appverse_topics,field_license,field_tags`,
8383
allApps: (baseUrl) => `${baseUrl}/node/appverse_app?include=field_appverse_software_implemen,field_add_implementation_tags,field_appverse_app_type`,
84+
allAppTypes: (baseUrl) => `${baseUrl}/taxonomy_term/appverse_app_type?sort=name`,
8485
softwareById: (baseUrl, id) => `${baseUrl}/node/appverse_software/${id}?include=field_appverse_logo.field_media_image_1,field_appverse_logo.field_media_image,field_appverse_topics,field_license,field_tags`,
8586
appsBySoftwareId: (baseUrl, softwareId) => `${baseUrl}/node/appverse_app?filter[field_appverse_software_implemen.id]=${softwareId}&include=field_appverse_app_type,field_add_implementation_tags,field_appverse_organization,field_license`
8687
};
@@ -238,6 +239,29 @@ export async function fetchAllApps(config = {}) {
238239
}
239240
}
240241

242+
/**
243+
* Fetch all app type taxonomy terms directly
244+
* Returns all available app types, not just those referenced by existing apps
245+
* @param {Object} config - Configuration object
246+
* @param {string} config.apiBaseUrl - Base URL for API calls
247+
* @returns {Promise<Array>} Array of {id, name} objects
248+
*/
249+
export async function fetchAllAppTypes(config = {}) {
250+
const apiBaseUrl = config.apiBaseUrl ?? DEFAULT_API_BASE_URL;
251+
const url = endpoints.allAppTypes(apiBaseUrl);
252+
253+
try {
254+
const { data } = await fetchAllPages(url, 'ALL_APP_TYPES', apiBaseUrl);
255+
return data.map(item => ({
256+
id: item.id,
257+
name: item.attributes.name
258+
}));
259+
} catch (error) {
260+
console.error('Error fetching app types:', error);
261+
return [];
262+
}
263+
}
264+
241265
/**
242266
* Extract filter options from included taxonomy terms (Apps response)
243267
* @param {Array} included - Included array from JSON:API response

tailwind.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ export default {
44
"./index.html",
55
"./src/**/*.{js,ts,jsx,tsx}",
66
],
7-
corePlugins: {
8-
preflight: false,
9-
},
107
theme: {
118
extend: {
129
colors: {

0 commit comments

Comments
 (0)