@schandlergarcia/sf-web-components 1.9.13 → 1.9.15
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 +5 -2
- package/package.json +1 -1
- package/scripts/reset-command-center.sh +21 -61
package/README.md
CHANGED
|
@@ -303,12 +303,15 @@ bash node_modules/@schandlergarcia/sf-web-components/scripts/reset-command-cente
|
|
|
303
303
|
|
|
304
304
|
**What it does:**
|
|
305
305
|
- Removes custom dashboard pages
|
|
306
|
-
-
|
|
306
|
+
- Reinstalls BlankDashboard.tsx with EmptyState
|
|
307
307
|
- Resets CommandCenter.tsx (preserves theme mode)
|
|
308
|
-
- Updates Home.tsx to
|
|
308
|
+
- Updates Home.tsx to render CommandCenter (blank dashboard)
|
|
309
|
+
- Creates Search.tsx for search interface at `/search` route
|
|
309
310
|
- Resets routes to baseline configuration
|
|
310
311
|
- Preserves: component library, authentication, all dependencies
|
|
311
312
|
|
|
313
|
+
**Result:** Home route (`/`) displays the CommandCenter with BlankDashboard, ready for customization
|
|
314
|
+
|
|
312
315
|
---
|
|
313
316
|
|
|
314
317
|
## Troubleshooting
|
package/package.json
CHANGED
|
@@ -37,6 +37,7 @@ echo ""
|
|
|
37
37
|
echo "→ Removing custom dashboards…"
|
|
38
38
|
|
|
39
39
|
removed=0
|
|
40
|
+
# Remove from src/pages/
|
|
40
41
|
for f in src/pages/*Dashboard*.tsx src/pages/*Dashboard*.jsx; do
|
|
41
42
|
# Don't remove BlankDashboard
|
|
42
43
|
if [ -f "$f" ] && [[ "$(basename "$f")" != "BlankDashboard"* ]]; then
|
|
@@ -46,6 +47,17 @@ for f in src/pages/*Dashboard*.tsx src/pages/*Dashboard*.jsx; do
|
|
|
46
47
|
fi
|
|
47
48
|
done
|
|
48
49
|
|
|
50
|
+
# Also remove from src/components/pages/ if it exists
|
|
51
|
+
if [ -d "src/components/pages" ]; then
|
|
52
|
+
for f in src/components/pages/*Dashboard*.tsx src/components/pages/*Dashboard*.jsx; do
|
|
53
|
+
if [ -f "$f" ] && [[ "$(basename "$f")" != "BlankDashboard"* ]]; then
|
|
54
|
+
rm "$f"
|
|
55
|
+
echo " ✓ Removed $(basename "$f")"
|
|
56
|
+
removed=$((removed + 1))
|
|
57
|
+
fi
|
|
58
|
+
done
|
|
59
|
+
fi
|
|
60
|
+
|
|
49
61
|
if [ "$removed" -eq 0 ]; then
|
|
50
62
|
echo " (no custom dashboards found)"
|
|
51
63
|
fi
|
|
@@ -123,67 +135,14 @@ HOME="src/pages/Home.tsx"
|
|
|
123
135
|
echo "→ Updating ${HOME}..."
|
|
124
136
|
|
|
125
137
|
cat > "$HOME" << 'HOME_EOF'
|
|
126
|
-
import
|
|
127
|
-
import { useNavigate } from "react-router";
|
|
128
|
-
import UIInput from '@/components/library/ui/UIInput';
|
|
129
|
-
import UIButton from '@/components/library/ui/UIButton';
|
|
130
|
-
import { Search } from "lucide-react";
|
|
138
|
+
import CommandCenter from "@/components/workspace/CommandCenter";
|
|
131
139
|
|
|
132
140
|
export default function HomePage() {
|
|
133
|
-
|
|
134
|
-
const navigate = useNavigate();
|
|
135
|
-
|
|
136
|
-
const handleSearch = () => {
|
|
137
|
-
const trimmed = searchQuery.trim();
|
|
138
|
-
if (trimmed) {
|
|
139
|
-
navigate(`/accounts?search=${encodeURIComponent(trimmed)}`);
|
|
140
|
-
} else {
|
|
141
|
-
navigate('/accounts');
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
146
|
-
if (e.key === "Enter") {
|
|
147
|
-
e.preventDefault();
|
|
148
|
-
handleSearch();
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
return (
|
|
153
|
-
<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">
|
|
154
|
-
<div className="w-full max-w-4xl">
|
|
155
|
-
<div className="text-center mb-8">
|
|
156
|
-
<h1 className="text-4xl font-bold text-slate-900 dark:text-slate-50 mb-4">Search</h1>
|
|
157
|
-
<p className="text-lg text-slate-600 dark:text-slate-300">Find records across your organization.</p>
|
|
158
|
-
</div>
|
|
159
|
-
<div className="flex flex-col gap-4">
|
|
160
|
-
<div className="relative">
|
|
161
|
-
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-slate-400" />
|
|
162
|
-
<UIInput
|
|
163
|
-
type="text"
|
|
164
|
-
value={searchQuery}
|
|
165
|
-
onChange={(e) => setSearchQuery(e.target.value)}
|
|
166
|
-
onKeyDown={handleKeyDown}
|
|
167
|
-
placeholder="Search..."
|
|
168
|
-
className="pl-10 w-full"
|
|
169
|
-
/>
|
|
170
|
-
</div>
|
|
171
|
-
<div className="flex gap-3 justify-center">
|
|
172
|
-
<UIButton onClick={handleSearch} variant="primary">
|
|
173
|
-
Search
|
|
174
|
-
</UIButton>
|
|
175
|
-
<UIButton onClick={() => navigate('/accounts')} variant="secondary">
|
|
176
|
-
Browse All
|
|
177
|
-
</UIButton>
|
|
178
|
-
</div>
|
|
179
|
-
</div>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
);
|
|
141
|
+
return <CommandCenter />;
|
|
183
142
|
}
|
|
184
143
|
HOME_EOF
|
|
185
144
|
|
|
186
|
-
echo " ✓ Home renders
|
|
145
|
+
echo " ✓ Home renders CommandCenter (dashboard)"
|
|
187
146
|
echo ""
|
|
188
147
|
|
|
189
148
|
# ── 5. Ensure Search.tsx page exists ─────────────────────────────────────────
|
|
@@ -317,13 +276,14 @@ echo "║ • Authentication features ║"
|
|
|
317
276
|
echo "║ • All styles & dependencies ║"
|
|
318
277
|
echo "║ ║"
|
|
319
278
|
echo "║ Layout: ║"
|
|
320
|
-
echo "║ / →
|
|
279
|
+
echo "║ / → CommandCenter (blank dashboard)║"
|
|
280
|
+
echo "║ /search → Search interface ║"
|
|
321
281
|
echo "║ /accounts → Account search and browse ║"
|
|
322
282
|
echo "║ ║"
|
|
323
|
-
echo "║
|
|
324
|
-
echo "║ •
|
|
325
|
-
echo "║ •
|
|
326
|
-
echo "║ •
|
|
283
|
+
echo "║ Command Center setup: ║"
|
|
284
|
+
echo "║ • Home renders BlankDashboard ║"
|
|
285
|
+
echo "║ • Theme and data providers configured ║"
|
|
286
|
+
echo "║ • Ready to build custom dashboards ║"
|
|
327
287
|
echo "║ ║"
|
|
328
288
|
echo "║ Start building: ║"
|
|
329
289
|
echo "║ npm run dev ║"
|