@schandlergarcia/sf-web-components 1.9.16 → 1.9.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +1 -1
- package/scripts/reset-command-center.sh +66 -13
package/README.md
CHANGED
|
@@ -302,15 +302,15 @@ bash node_modules/@schandlergarcia/sf-web-components/scripts/reset-command-cente
|
|
|
302
302
|
```
|
|
303
303
|
|
|
304
304
|
**What it does:**
|
|
305
|
-
- Removes custom dashboard pages
|
|
305
|
+
- Removes custom dashboard pages (including those created at SFDX project root)
|
|
306
306
|
- Reinstalls BlankDashboard.tsx with EmptyState
|
|
307
307
|
- Resets CommandCenter.tsx (preserves theme mode)
|
|
308
|
-
- Updates Home.tsx to render
|
|
308
|
+
- Updates Home.tsx to render search interface
|
|
309
309
|
- Creates Search.tsx for search interface at `/search` route
|
|
310
310
|
- Resets routes to baseline configuration
|
|
311
311
|
- Preserves: component library, authentication, all dependencies
|
|
312
312
|
|
|
313
|
-
**Result:** Home route (`/`) displays the
|
|
313
|
+
**Result:** Home route (`/`) displays the search interface (baseline state)
|
|
314
314
|
|
|
315
315
|
---
|
|
316
316
|
|
package/package.json
CHANGED
|
@@ -42,9 +42,9 @@ removed=0
|
|
|
42
42
|
# If so, also clean up SFDX project root paths
|
|
43
43
|
SFDX_ROOT=""
|
|
44
44
|
if [[ "$ROOT" == */force-app/main/default/webapplications/* ]]; then
|
|
45
|
-
# Extract SFDX project root (go up
|
|
46
|
-
SFDX_ROOT="$(cd "$ROOT" && cd
|
|
47
|
-
echo " ℹ Detected SFDX project structure"
|
|
45
|
+
# Extract SFDX project root (go up 5 levels: webapp/webapplications/default/main/force-app)
|
|
46
|
+
SFDX_ROOT="$(cd "$ROOT" && cd ../../../../../ && pwd)"
|
|
47
|
+
echo " ℹ Detected SFDX project structure at $SFDX_ROOT"
|
|
48
48
|
fi
|
|
49
49
|
|
|
50
50
|
# Remove from src/pages/
|
|
@@ -164,20 +164,73 @@ WRAPPER_EOF
|
|
|
164
164
|
echo " ✓ Wired up BlankDashboard"
|
|
165
165
|
echo ""
|
|
166
166
|
|
|
167
|
-
# ── 4. Reset Home.tsx to render
|
|
167
|
+
# ── 4. Reset Home.tsx to render search interface ────────────────────────────
|
|
168
168
|
|
|
169
169
|
HOME="src/pages/Home.tsx"
|
|
170
170
|
echo "→ Updating ${HOME}..."
|
|
171
171
|
|
|
172
172
|
cat > "$HOME" << 'HOME_EOF'
|
|
173
|
-
import
|
|
173
|
+
import { useState } from "react";
|
|
174
|
+
import { useNavigate } from "react-router";
|
|
175
|
+
import UIInput from '@/components/library/ui/UIInput';
|
|
176
|
+
import UIButton from '@/components/library/ui/UIButton';
|
|
177
|
+
import { Search } from "lucide-react";
|
|
174
178
|
|
|
175
179
|
export default function HomePage() {
|
|
176
|
-
|
|
180
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
181
|
+
const navigate = useNavigate();
|
|
182
|
+
|
|
183
|
+
const handleSearch = () => {
|
|
184
|
+
const trimmed = searchQuery.trim();
|
|
185
|
+
if (trimmed) {
|
|
186
|
+
navigate(`/accounts?search=${encodeURIComponent(trimmed)}`);
|
|
187
|
+
} else {
|
|
188
|
+
navigate('/accounts');
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
193
|
+
if (e.key === "Enter") {
|
|
194
|
+
e.preventDefault();
|
|
195
|
+
handleSearch();
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
return (
|
|
200
|
+
<div className="flex min-h-[80vh] items-center justify-center px-4 sm:px-6 lg:px-8 bg-slate-50 dark:bg-slate-950 transition-colors">
|
|
201
|
+
<div className="w-full max-w-4xl">
|
|
202
|
+
<div className="text-center mb-8">
|
|
203
|
+
<h1 className="text-4xl font-bold text-slate-900 dark:text-slate-50 mb-4">Search</h1>
|
|
204
|
+
<p className="text-lg text-slate-600 dark:text-slate-300">Find records across your organization.</p>
|
|
205
|
+
</div>
|
|
206
|
+
<div className="flex flex-col gap-4">
|
|
207
|
+
<div className="relative">
|
|
208
|
+
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-slate-400" />
|
|
209
|
+
<UIInput
|
|
210
|
+
type="text"
|
|
211
|
+
value={searchQuery}
|
|
212
|
+
onChange={(e) => setSearchQuery(e.target.value)}
|
|
213
|
+
onKeyDown={handleKeyDown}
|
|
214
|
+
placeholder="Search..."
|
|
215
|
+
className="pl-10 w-full"
|
|
216
|
+
/>
|
|
217
|
+
</div>
|
|
218
|
+
<div className="flex gap-3 justify-center">
|
|
219
|
+
<UIButton onClick={handleSearch} variant="primary">
|
|
220
|
+
Search
|
|
221
|
+
</UIButton>
|
|
222
|
+
<UIButton onClick={() => navigate('/accounts')} variant="secondary">
|
|
223
|
+
Browse All
|
|
224
|
+
</UIButton>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
);
|
|
177
230
|
}
|
|
178
231
|
HOME_EOF
|
|
179
232
|
|
|
180
|
-
echo " ✓ Home renders
|
|
233
|
+
echo " ✓ Home renders search interface"
|
|
181
234
|
echo ""
|
|
182
235
|
|
|
183
236
|
# ── 5. Ensure Search.tsx page exists ─────────────────────────────────────────
|
|
@@ -311,14 +364,14 @@ echo "║ • Authentication features ║"
|
|
|
311
364
|
echo "║ • All styles & dependencies ║"
|
|
312
365
|
echo "║ ║"
|
|
313
366
|
echo "║ Layout: ║"
|
|
314
|
-
echo "║ / →
|
|
315
|
-
echo "║ /search → Search interface
|
|
367
|
+
echo "║ / → Search interface ║"
|
|
368
|
+
echo "║ /search → Search interface (duplicate) ║"
|
|
316
369
|
echo "║ /accounts → Account search and browse ║"
|
|
317
370
|
echo "║ ║"
|
|
318
|
-
echo "║
|
|
319
|
-
echo "║ •
|
|
320
|
-
echo "║ •
|
|
321
|
-
echo "║ •
|
|
371
|
+
echo "║ Search functionality: ║"
|
|
372
|
+
echo "║ • Search button navigates to /accounts ║"
|
|
373
|
+
echo "║ • Enter key triggers search ║"
|
|
374
|
+
echo "║ • Browse All shows all accounts ║"
|
|
322
375
|
echo "║ ║"
|
|
323
376
|
echo "║ Start building: ║"
|
|
324
377
|
echo "║ npm run dev ║"
|