Skip to content

Commit

Permalink
Fix context on marketplace
Browse files Browse the repository at this point in the history
  • Loading branch information
csuarez committed Oct 6, 2023
1 parent 8acbe5d commit 9ee96d4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const EnabledAppsCount = ({
percentage: number;
limit: number;
enabled: number;
context: 'private' | 'explore' | 'installed' | 'enterprise' | 'requested';
context: 'private' | 'explore' | 'installed' | 'premium' | 'requested';
}): ReactElement | null => {
const t = useTranslation();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import EnabledAppsCount from './EnabledAppsCount';
const MarketplaceHeader = ({ title }: { title: string }): ReactElement | null => {
const t = useTranslation();
const isAdmin = usePermission('manage-apps');
const context = (useRouteParameter('context') || 'explore') as 'private' | 'explore' | 'installed' | 'enterprise' | 'requested';
const context = (useRouteParameter('context') || 'explore') as 'private' | 'explore' | 'installed' | 'premium' | 'requested';
const route = useRoute('marketplace');
const setModal = useSetModal();
const result = useAppsCountQuery(context);
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/views/marketplace/hooks/useAppInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const useAppInfo = (appId: string, context: string): AppInfo | undefined
}

let appResult: App | undefined;
const marketplaceAppsContexts = ['explore', 'enterprise', 'requested'];
const marketplaceAppsContexts = ['explore', 'premium', 'requested'];

if (marketplaceAppsContexts.includes(context)) appResult = marketplaceApps.value?.apps.find((app) => app.id === appId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const getProgressBarValues = (numberOfEnabledApps: number, enabledAppsLimit: num
percentage: Math.round((numberOfEnabledApps / enabledAppsLimit) * 100),
});

export type MarketplaceRouteContext = 'private' | 'explore' | 'installed' | 'enterprise' | 'requested';
export type MarketplaceRouteContext = 'private' | 'explore' | 'installed' | 'premium' | 'requested';

export function isMarketplaceRouteContext(context: string): context is MarketplaceRouteContext {
return ['private', 'explore', 'installed', 'enterprise', 'requested'].includes(context);
return ['private', 'explore', 'installed', 'premium', 'requested'].includes(context);
}

export const useAppsCountQuery = (context: MarketplaceRouteContext) => {
Expand Down

0 comments on commit 9ee96d4

Please sign in to comment.