From 7018d49e26aa366962e0073f3e964adab47ccea2 Mon Sep 17 00:00:00 2001 From: k-j-kim <17989954+k-j-kim@users.noreply.github.com> Date: Thu, 26 Mar 2026 22:27:57 -0700 Subject: [PATCH] fix: correct .gitignore to track sample lib/ folders @W-21361802@ (#119) fix: use glob pattern in .gitignore to track sample lib/ folders The lib/ negation rules had incorrect webapp folder names (appreactsampleb2e/appreactsampleb2x instead of propertymanagementapp/propertyrentalapp), causing the sample lib/ directories to remain git-ignored. Replaced with a simpler !samples/**/lib/ glob that is resilient to future name changes. Made-with: Cursor --- .gitignore | 6 +- .../src/lib/constants.ts | 60 +++++++++++++++++++ .../src/lib/routeConfig.ts | 35 +++++++++++ .../propertymanagementapp/src/lib/utils.ts | 6 ++ .../propertyrentalapp/src/lib/utils.ts | 6 ++ 5 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/propertymanagementapp/src/lib/constants.ts create mode 100644 samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/propertymanagementapp/src/lib/routeConfig.ts create mode 100644 samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/propertymanagementapp/src/lib/utils.ts create mode 100644 samples/webapp-template-app-react-sample-b2x-experimental/force-app/main/default/webapplications/propertyrentalapp/src/lib/utils.ts diff --git a/.gitignore b/.gitignore index f5e8915..7e40e99 100644 --- a/.gitignore +++ b/.gitignore @@ -128,10 +128,8 @@ venv.bak/ # React sample templates: track internal `src/lib` utility modules # These rules override the global `lib/` ignore in the Python section above. -!samples/webapp-template-app-react-sample-b2x-experimental/force-app/main/default/webapplications/appreactsampleb2x/src/lib/ -!samples/webapp-template-app-react-sample-b2x-experimental/force-app/main/default/webapplications/appreactsampleb2x/src/lib/** -!samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/appreactsampleb2e/src/lib/ -!samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/appreactsampleb2e/src/lib/** +!samples/**/lib/ +!samples/**/lib/** # IDEs and Editors .vscode/ diff --git a/samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/propertymanagementapp/src/lib/constants.ts b/samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/propertymanagementapp/src/lib/constants.ts new file mode 100644 index 0000000..e420ed7 --- /dev/null +++ b/samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/propertymanagementapp/src/lib/constants.ts @@ -0,0 +1,60 @@ +/** + * Application-wide constants. + */ + +import type { PaginationConfig } from "../features/object-search/hooks/useObjectSearchParams"; + +export const PAGE_SIZE_LIST = 12; +export const DASHBOARD_MAINTENANCE_LIMIT = 5; + +export const PROPERTY_FILTER_EXCLUDED_FIELD_PATHS = new Set([ + "CreatedDate", + "Hero_Image__c", + "Year_Built__c", + "Available_Date__c", +]); + +export const MAINTENANCE_WORKER_FILTER_EXCLUDED_FIELD_PATHS = new Set([]); +export const MAINTENANCE_FILTER_EXCLUDED_FIELD_PATHS = new Set(["Scheduled__c"]); +export const APPLICATION_FILTER_EXCLUDED_FIELD_PATHS = new Set([]); + +export const MAINTENANCE_WORKER_OBJECT_API_NAME = "Maintenance_Worker__c" as const; + +export const FALLBACK_LABEL_PROPERTIES_PLURAL = "Properties"; +export const FALLBACK_LABEL_MAINTENANCE_PLURAL = "Maintenance Requests"; +export const FALLBACK_LABEL_MAINTENANCE_WORKERS_PLURAL = "Maintenance Workers"; +export const FALLBACK_LABEL_APPLICATIONS_PLURAL = "Applications"; + +export const PROPERTY_OBJECT_API_NAME = "Property__c" as const; +export const MAINTENANCE_OBJECT_API_NAME = "Maintenance_Request__c" as const; +export const APPLICATION_OBJECT_API_NAME = "Application__c" as const; + +export const SEARCHABLE_OBJECTS = [ + { + objectApiName: "Property__c" as const, + path: "/properties", + fallbackLabelPlural: FALLBACK_LABEL_PROPERTIES_PLURAL, + }, + { + objectApiName: "Maintenance_Request__c" as const, + path: "/maintenance/requests", + fallbackLabelPlural: FALLBACK_LABEL_MAINTENANCE_PLURAL, + }, + { + objectApiName: MAINTENANCE_WORKER_OBJECT_API_NAME, + path: "/maintenance/workers", + fallbackLabelPlural: FALLBACK_LABEL_MAINTENANCE_WORKERS_PLURAL, + }, + { + objectApiName: "Application__c" as const, + path: "/applications", + fallbackLabelPlural: FALLBACK_LABEL_APPLICATIONS_PLURAL, + }, +] as const; + +export type SearchableObjectConfig = (typeof SEARCHABLE_OBJECTS)[number]; + +export const PAGINATION_CONFIG: PaginationConfig = { + defaultPageSize: 6, + validPageSizes: [6, 12, 24, 48], +}; diff --git a/samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/propertymanagementapp/src/lib/routeConfig.ts b/samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/propertymanagementapp/src/lib/routeConfig.ts new file mode 100644 index 0000000..08332bf --- /dev/null +++ b/samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/propertymanagementapp/src/lib/routeConfig.ts @@ -0,0 +1,35 @@ +/** + * Central route configuration for list pages and navigation. + * Use these paths for links and search redirects to avoid duplication. + */ +export const PATHS = { + HOME: "/", + PROPERTIES: "/properties", + MAINTENANCE_REQUESTS: "/maintenance/requests", + MAINTENANCE_WORKERS: "/maintenance/workers", + APPLICATIONS: "/applications", +} as const; + +export interface ListPageRoute { + path: string; + label: string; + searchParamKey?: string; +} + +/** List pages that appear in the Home search object dropdown and in nav */ +export const LIST_PAGE_ROUTES: Record = { + properties: { path: PATHS.PROPERTIES, label: "Properties", searchParamKey: "q" }, + maintenance_requests: { + path: PATHS.MAINTENANCE_REQUESTS, + label: "Maintenance Requests", + searchParamKey: "q", + }, + maintenance_workers: { + path: PATHS.MAINTENANCE_WORKERS, + label: "Maintenance Workers", + searchParamKey: "q", + }, + applications: { path: PATHS.APPLICATIONS, label: "Applications", searchParamKey: "q" }, +} as const; + +export type ListPageKey = keyof typeof LIST_PAGE_ROUTES; diff --git a/samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/propertymanagementapp/src/lib/utils.ts b/samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/propertymanagementapp/src/lib/utils.ts new file mode 100644 index 0000000..2819a83 --- /dev/null +++ b/samples/webapp-template-app-react-sample-b2e-experimental/force-app/main/default/webapplications/propertymanagementapp/src/lib/utils.ts @@ -0,0 +1,6 @@ +import { clsx, type ClassValue } from 'clsx'; +import { twMerge } from 'tailwind-merge'; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} diff --git a/samples/webapp-template-app-react-sample-b2x-experimental/force-app/main/default/webapplications/propertyrentalapp/src/lib/utils.ts b/samples/webapp-template-app-react-sample-b2x-experimental/force-app/main/default/webapplications/propertyrentalapp/src/lib/utils.ts new file mode 100644 index 0000000..2819a83 --- /dev/null +++ b/samples/webapp-template-app-react-sample-b2x-experimental/force-app/main/default/webapplications/propertyrentalapp/src/lib/utils.ts @@ -0,0 +1,6 @@ +import { clsx, type ClassValue } from 'clsx'; +import { twMerge } from 'tailwind-merge'; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +}