@fleetbase/solid-engine 0.0.4 → 0.0.5
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/ACL_SOLUTION.md +72 -0
- package/CSS_SCOPE_ISSUE.md +140 -0
- package/HOTFIX_SYNTAX_ERROR.md +100 -0
- package/MANUAL_ACL_SETUP.md +135 -0
- package/REFACTORING_SUMMARY.md +330 -0
- package/VERIFICATION_CHECKLIST.md +82 -0
- package/addon/components/modals/create-solid-folder.hbs +29 -0
- package/addon/components/modals/import-solid-resources.hbs +85 -0
- package/addon/controllers/data/content.js +17 -0
- package/addon/controllers/data/index.js +219 -0
- package/addon/controllers/home.js +84 -0
- package/addon/engine.js +1 -24
- package/addon/extension.js +26 -0
- package/addon/routes/data/content.js +11 -0
- package/addon/routes/data/index.js +17 -0
- package/addon/routes.js +2 -7
- package/addon/styles/solid-engine.css +1 -2
- package/addon/templates/account.hbs +3 -3
- package/addon/templates/application.hbs +2 -12
- package/addon/templates/data/content.hbs +48 -0
- package/addon/templates/{pods/explorer.hbs → data/index.hbs} +6 -5
- package/addon/templates/home.hbs +168 -10
- package/app/components/modals/{backup-pod.js → create-solid-folder.js} +1 -1
- package/app/components/modals/{resync-pod.js → import-solid-resources.js} +1 -1
- package/app/components/modals/{create-pod.js → setup-css-credentials.js} +1 -1
- package/composer.json +4 -10
- package/extension.json +1 -1
- package/index.js +0 -11
- package/package.json +8 -8
- package/server/migrations/2024_12_21_add_css_credentials_to_solid_identities_table.php +32 -0
- package/server/src/Client/OpenIDConnectClient.php +686 -15
- package/server/src/Client/SolidClient.php +104 -8
- package/server/src/Http/Controllers/DataController.php +261 -0
- package/server/src/Http/Controllers/OIDCController.php +42 -8
- package/server/src/Http/Controllers/SolidController.php +179 -85
- package/server/src/Models/SolidIdentity.php +13 -3
- package/server/src/Services/AclService.php +146 -0
- package/server/src/Services/PodService.php +863 -0
- package/server/src/Services/ResourceSyncService.php +336 -0
- package/server/src/Services/VehicleSyncService.php +289 -0
- package/server/src/Support/Utils.php +10 -0
- package/server/src/routes.php +25 -1
- package/addon/components/modals/backup-pod.hbs +0 -3
- package/addon/components/modals/create-pod.hbs +0 -5
- package/addon/components/modals/resync-pod.hbs +0 -3
- package/addon/controllers/pods/explorer/content.js +0 -12
- package/addon/controllers/pods/explorer.js +0 -149
- package/addon/controllers/pods/index/pod.js +0 -12
- package/addon/controllers/pods/index.js +0 -137
- package/addon/routes/pods/explorer/content.js +0 -10
- package/addon/routes/pods/explorer.js +0 -44
- package/addon/routes/pods/index/pod.js +0 -3
- package/addon/routes/pods/index.js +0 -21
- package/addon/templates/pods/explorer/content.hbs +0 -19
- package/addon/templates/pods/index/pod.hbs +0 -11
- package/addon/templates/pods/index.hbs +0 -19
- package/server/src/LegacyClient/Identity/IdentityProvider.php +0 -174
- package/server/src/LegacyClient/Identity/Profile.php +0 -18
- package/server/src/LegacyClient/OIDCClient.php +0 -350
- package/server/src/LegacyClient/Profile/WebID.php +0 -26
- package/server/src/LegacyClient/SolidClient.php +0 -271
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
# Solid Extension Refactoring Summary
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Refactored the Fleetbase Solid Protocol extension from a multi-pod architecture to a single-pod architecture with user-friendly terminology.
|
|
5
|
+
|
|
6
|
+
## Key Changes
|
|
7
|
+
|
|
8
|
+
### Terminology Updates
|
|
9
|
+
- **"Pods" → "Data"**: More intuitive for users to understand they're managing their data
|
|
10
|
+
- **"Container" → "Folder"**: Familiar file system metaphor instead of technical Solid terminology
|
|
11
|
+
|
|
12
|
+
### Architecture Shift
|
|
13
|
+
**Before (Multi-Pod):**
|
|
14
|
+
- Users could create multiple pods
|
|
15
|
+
- Complex pod listing and management UI
|
|
16
|
+
- Cross-pod authentication issues
|
|
17
|
+
- Routes: `pods`, `pods.index`, `pods.explorer`, `pods.index.pod`
|
|
18
|
+
|
|
19
|
+
**After (Single-Pod):**
|
|
20
|
+
- Users have ONE primary pod from OIDC authentication
|
|
21
|
+
- Data organized in folders within the pod (vehicles/, drivers/, contacts/, orders/)
|
|
22
|
+
- Simplified permissions model
|
|
23
|
+
- Routes: `data`, `data.content`
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Frontend Changes
|
|
28
|
+
|
|
29
|
+
### Routes Refactored
|
|
30
|
+
**File:** `addon/routes.js`
|
|
31
|
+
|
|
32
|
+
**Old Structure:**
|
|
33
|
+
```javascript
|
|
34
|
+
this.route('pods', function () {
|
|
35
|
+
this.route('explorer', { path: '/explorer/:id' }, function () {
|
|
36
|
+
this.route('content', { path: '/~/:slug' });
|
|
37
|
+
});
|
|
38
|
+
this.route('index', { path: '/' }, function () {
|
|
39
|
+
this.route('pod', { path: '/pod/:slug' });
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**New Structure:**
|
|
45
|
+
```javascript
|
|
46
|
+
this.route('data', { path: '/data' }, function () {
|
|
47
|
+
this.route('content', { path: '/:slug' });
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Files Created
|
|
52
|
+
1. **`addon/routes/data/index.js`** - Main data browser route
|
|
53
|
+
2. **`addon/routes/data/content.js`** - Folder navigation route
|
|
54
|
+
3. **`addon/controllers/data/index.js`** - Data browser controller with folder operations
|
|
55
|
+
4. **`addon/controllers/data/content.js`** - Folder content controller
|
|
56
|
+
5. **`addon/templates/data/index.hbs`** - Data browser template
|
|
57
|
+
6. **`addon/templates/data/content.hbs`** - Folder content viewer template
|
|
58
|
+
|
|
59
|
+
### Files Removed
|
|
60
|
+
- `addon/routes/pods/` (entire directory)
|
|
61
|
+
- `addon/controllers/pods/` (entire directory)
|
|
62
|
+
- `addon/templates/pods/` (entire directory)
|
|
63
|
+
|
|
64
|
+
### Files Updated
|
|
65
|
+
1. **`addon/templates/application.hbs`**
|
|
66
|
+
- Updated sidebar navigation: `console.solid-protocol.pods` → `console.solid-protocol.data`
|
|
67
|
+
|
|
68
|
+
2. **`addon/templates/home.hbs`**
|
|
69
|
+
- "Browse Pods" → "Browse Data"
|
|
70
|
+
- "Explore and manage your Solid pods" → "Explore and manage your Fleetops data in Solid"
|
|
71
|
+
- Updated all pod references to use "storage" terminology
|
|
72
|
+
|
|
73
|
+
3. **`addon/controllers/home.js`**
|
|
74
|
+
- `navigateToPods()` now routes to `console.solid-protocol.data`
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Backend Changes
|
|
79
|
+
|
|
80
|
+
### New Controller
|
|
81
|
+
**File:** `server/src/Http/Controllers/DataController.php`
|
|
82
|
+
|
|
83
|
+
**Methods:**
|
|
84
|
+
- `index()` - Get root level contents of user's pod
|
|
85
|
+
- `showFolder($slug)` - Get contents of a specific folder
|
|
86
|
+
- `createFolder()` - Create a new folder in the pod
|
|
87
|
+
- `deleteItem($type, $slug)` - Delete a file or folder
|
|
88
|
+
- `importResources()` - Import Fleetops resources into folders
|
|
89
|
+
|
|
90
|
+
### Routes Updated
|
|
91
|
+
**File:** `server/src/routes.php`
|
|
92
|
+
|
|
93
|
+
**Old Routes:**
|
|
94
|
+
```php
|
|
95
|
+
$router->get('pods', 'PodController@index');
|
|
96
|
+
$router->post('pods', 'PodController@create');
|
|
97
|
+
$router->get('pods/{podId}', 'PodController@show');
|
|
98
|
+
$router->delete('pods/{podId}', 'PodController@destroy');
|
|
99
|
+
$router->post('import-resources', 'PodController@importResources');
|
|
100
|
+
|
|
101
|
+
$router->get('containers', 'ContainerController@index');
|
|
102
|
+
$router->post('containers', 'ContainerController@create');
|
|
103
|
+
$router->delete('containers/{containerName}', 'ContainerController@destroy');
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**New Routes:**
|
|
107
|
+
```php
|
|
108
|
+
$router->get('data', 'DataController@index');
|
|
109
|
+
$router->get('data/folder/{slug}', 'DataController@showFolder');
|
|
110
|
+
$router->post('data/folder', 'DataController@createFolder');
|
|
111
|
+
$router->delete('data/{type}/{slug}', 'DataController@deleteItem');
|
|
112
|
+
$router->post('data/import', 'DataController@importResources');
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Service Methods Added
|
|
116
|
+
**File:** `server/src/Services/PodService.php`
|
|
117
|
+
|
|
118
|
+
**New Methods:**
|
|
119
|
+
- `createFolder(SolidIdentity $identity, string $folderUrl): bool`
|
|
120
|
+
- Creates a folder (LDP BasicContainer) in the pod
|
|
121
|
+
- Uses PUT request with proper Content-Type and Link headers
|
|
122
|
+
|
|
123
|
+
- `deleteResource(SolidIdentity $identity, string $resourceUrl): bool`
|
|
124
|
+
- Deletes a file or folder from the pod
|
|
125
|
+
- Uses DELETE request
|
|
126
|
+
|
|
127
|
+
**Existing Method Used:**
|
|
128
|
+
- `getPodUrlFromWebId(string $webId): string`
|
|
129
|
+
- Extracts the pod URL from the user's WebID
|
|
130
|
+
- Example: `http://solid:3000/test/profile/card#me` → `http://solid:3000/test/`
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## API Endpoint Mapping
|
|
135
|
+
|
|
136
|
+
### Frontend → Backend
|
|
137
|
+
| Frontend Route | API Endpoint | Controller Method |
|
|
138
|
+
|----------------|--------------|-------------------|
|
|
139
|
+
| `data.index` | `GET /data` | `DataController@index` |
|
|
140
|
+
| `data.content/:slug` | `GET /data/folder/:slug` | `DataController@showFolder` |
|
|
141
|
+
| Create folder action | `POST /data/folder` | `DataController@createFolder` |
|
|
142
|
+
| Delete item action | `DELETE /data/:type/:slug` | `DataController@deleteItem` |
|
|
143
|
+
| Import resources | `POST /data/import` | `DataController@importResources` |
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## User Experience Improvements
|
|
148
|
+
|
|
149
|
+
### Navigation
|
|
150
|
+
- **Sidebar:** "Data" instead of "Pods"
|
|
151
|
+
- **Home Page:** "Browse Data" quick action
|
|
152
|
+
- **Breadcrumbs:** Will show folder hierarchy instead of pod names
|
|
153
|
+
|
|
154
|
+
### Data Browser Features
|
|
155
|
+
1. **Folder Management**
|
|
156
|
+
- Create new folders with "New Folder" button
|
|
157
|
+
- Browse folders like a file explorer
|
|
158
|
+
- Delete folders and files
|
|
159
|
+
|
|
160
|
+
2. **Resource Import**
|
|
161
|
+
- "Import Resources" button in data browser
|
|
162
|
+
- Select resource types: Vehicles, Drivers, Contacts, Orders
|
|
163
|
+
- Resources imported into respective folders in the pod
|
|
164
|
+
|
|
165
|
+
3. **File Operations**
|
|
166
|
+
- View file information in overlay
|
|
167
|
+
- Open files in new tab
|
|
168
|
+
- Delete files with confirmation
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Technical Benefits
|
|
173
|
+
|
|
174
|
+
### Simplified Architecture
|
|
175
|
+
1. **No Multi-Pod Management**
|
|
176
|
+
- Removed pod listing complexity
|
|
177
|
+
- Removed pod creation/deletion UI
|
|
178
|
+
- Removed pod selection logic
|
|
179
|
+
|
|
180
|
+
2. **Single Authentication Flow**
|
|
181
|
+
- One DPoP-bound access token for the user's pod
|
|
182
|
+
- No cross-pod permission issues
|
|
183
|
+
- Cleaner token management
|
|
184
|
+
|
|
185
|
+
3. **Standard Solid Patterns**
|
|
186
|
+
- Follows Solid specification for single-pod-per-user
|
|
187
|
+
- Uses LDP containers (folders) for organization
|
|
188
|
+
- Proper RDF/Turtle format for resources
|
|
189
|
+
|
|
190
|
+
### Code Cleanliness
|
|
191
|
+
1. **Removed Unused Code**
|
|
192
|
+
- Deleted 12 files related to multi-pod management
|
|
193
|
+
- Removed unused routes and controllers
|
|
194
|
+
- Cleaner route structure (2 routes vs 4)
|
|
195
|
+
|
|
196
|
+
2. **Clear Naming**
|
|
197
|
+
- `DataController` vs `PodController` - clearer intent
|
|
198
|
+
- `data/folder` routes - self-documenting
|
|
199
|
+
- User-facing terms match technical implementation
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Data Organization
|
|
204
|
+
|
|
205
|
+
### Pod Structure
|
|
206
|
+
```
|
|
207
|
+
http://solid:3000/user/
|
|
208
|
+
├── vehicles/
|
|
209
|
+
│ ├── vehicle-uuid-1.ttl
|
|
210
|
+
│ ├── vehicle-uuid-2.ttl
|
|
211
|
+
│ └── ...
|
|
212
|
+
├── drivers/
|
|
213
|
+
│ ├── driver-uuid-1.ttl
|
|
214
|
+
│ └── ...
|
|
215
|
+
├── contacts/
|
|
216
|
+
│ ├── contact-uuid-1.ttl
|
|
217
|
+
│ └── ...
|
|
218
|
+
└── orders/
|
|
219
|
+
├── order-uuid-1.ttl
|
|
220
|
+
└── ...
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Resource Format
|
|
224
|
+
Each resource is stored as an RDF/Turtle file with semantic metadata following Solid conventions.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Next Steps
|
|
229
|
+
|
|
230
|
+
### Testing Required
|
|
231
|
+
1. **Authentication Flow**
|
|
232
|
+
- Verify OIDC authentication still works
|
|
233
|
+
- Check DPoP token binding
|
|
234
|
+
- Confirm pod URL extraction from WebID
|
|
235
|
+
|
|
236
|
+
2. **Data Browser**
|
|
237
|
+
- Test folder creation
|
|
238
|
+
- Test folder navigation
|
|
239
|
+
- Test file deletion
|
|
240
|
+
- Test search functionality
|
|
241
|
+
|
|
242
|
+
3. **Resource Import**
|
|
243
|
+
- Test importing vehicles
|
|
244
|
+
- Test importing drivers
|
|
245
|
+
- Test importing contacts
|
|
246
|
+
- Test importing orders
|
|
247
|
+
- Verify RDF/Turtle format
|
|
248
|
+
- Check folder creation for each resource type
|
|
249
|
+
|
|
250
|
+
4. **Error Handling**
|
|
251
|
+
- Test 401 unauthorized scenarios
|
|
252
|
+
- Test invalid folder names
|
|
253
|
+
- Test deleting non-existent resources
|
|
254
|
+
|
|
255
|
+
### Future Enhancements
|
|
256
|
+
1. **Incremental Sync**
|
|
257
|
+
- Only sync changed resources
|
|
258
|
+
- Track last sync timestamp
|
|
259
|
+
- Show sync status per resource type
|
|
260
|
+
|
|
261
|
+
2. **Resource Filtering**
|
|
262
|
+
- Filter by date range
|
|
263
|
+
- Filter by status
|
|
264
|
+
- Search within resources
|
|
265
|
+
|
|
266
|
+
3. **Sync History**
|
|
267
|
+
- Track sync operations
|
|
268
|
+
- Show sync logs
|
|
269
|
+
- Rollback capability
|
|
270
|
+
|
|
271
|
+
4. **Real-time Sync**
|
|
272
|
+
- Webhook integration with Fleetops
|
|
273
|
+
- Automatic sync on data changes
|
|
274
|
+
- Conflict resolution
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Migration Notes
|
|
279
|
+
|
|
280
|
+
### For Developers
|
|
281
|
+
- Update any references to `pods` routes to use `data` routes
|
|
282
|
+
- Replace `PodController` usage with `DataController`
|
|
283
|
+
- Update API calls from `import-resources` to `data/import`
|
|
284
|
+
- Remove any pod selection logic from components
|
|
285
|
+
|
|
286
|
+
### For Users
|
|
287
|
+
- Existing data: Users will need to re-import resources into their primary pod
|
|
288
|
+
- No action required for authentication - existing OIDC flow remains the same
|
|
289
|
+
- UI will automatically reflect new "Data" terminology
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Files Modified Summary
|
|
294
|
+
|
|
295
|
+
### Created (7 files)
|
|
296
|
+
- `addon/routes/data/index.js`
|
|
297
|
+
- `addon/routes/data/content.js`
|
|
298
|
+
- `addon/controllers/data/index.js`
|
|
299
|
+
- `addon/controllers/data/content.js`
|
|
300
|
+
- `addon/templates/data/index.hbs`
|
|
301
|
+
- `addon/templates/data/content.hbs`
|
|
302
|
+
- `server/src/Http/Controllers/DataController.php`
|
|
303
|
+
|
|
304
|
+
### Modified (6 files)
|
|
305
|
+
- `addon/routes.js`
|
|
306
|
+
- `addon/templates/application.hbs`
|
|
307
|
+
- `addon/templates/home.hbs`
|
|
308
|
+
- `addon/controllers/home.js`
|
|
309
|
+
- `server/src/routes.php`
|
|
310
|
+
- `server/src/Services/PodService.php`
|
|
311
|
+
|
|
312
|
+
### Deleted (12 files)
|
|
313
|
+
- `addon/routes/pods/explorer.js`
|
|
314
|
+
- `addon/routes/pods/explorer/content.js`
|
|
315
|
+
- `addon/routes/pods/index.js`
|
|
316
|
+
- `addon/routes/pods/index/pod.js`
|
|
317
|
+
- `addon/controllers/pods/explorer.js`
|
|
318
|
+
- `addon/controllers/pods/explorer/content.js`
|
|
319
|
+
- `addon/controllers/pods/index.js`
|
|
320
|
+
- `addon/controllers/pods/index/pod.js`
|
|
321
|
+
- `addon/templates/pods/explorer.hbs`
|
|
322
|
+
- `addon/templates/pods/explorer/content.hbs`
|
|
323
|
+
- `addon/templates/pods/index.hbs`
|
|
324
|
+
- `addon/templates/pods/index/pod.hbs`
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## Conclusion
|
|
329
|
+
|
|
330
|
+
This refactoring significantly simplifies the Solid extension architecture while improving user experience through familiar terminology. The single-pod approach aligns with Solid best practices and eliminates cross-pod authentication complexity. The codebase is now cleaner, more maintainable, and easier for developers to understand.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Refactoring Verification Checklist
|
|
2
|
+
|
|
3
|
+
## Code Cleanup ✓
|
|
4
|
+
- [x] Removed old `addon/routes/pods/` directory
|
|
5
|
+
- [x] Removed old `addon/controllers/pods/` directory
|
|
6
|
+
- [x] Removed old `addon/templates/pods/` directory
|
|
7
|
+
- [x] Removed `server/src/Http/Controllers/PodController.php`
|
|
8
|
+
- [x] Removed `server/src/Http/Controllers/ContainerController.php`
|
|
9
|
+
- [x] Removed commented code from `addon/templates/application.hbs`
|
|
10
|
+
- [x] Removed commented routes from `server/src/routes.php`
|
|
11
|
+
|
|
12
|
+
## New Files Created ✓
|
|
13
|
+
- [x] `addon/routes/data/index.js`
|
|
14
|
+
- [x] `addon/routes/data/content.js`
|
|
15
|
+
- [x] `addon/controllers/data/index.js`
|
|
16
|
+
- [x] `addon/controllers/data/content.js`
|
|
17
|
+
- [x] `addon/templates/data/index.hbs`
|
|
18
|
+
- [x] `addon/templates/data/content.hbs`
|
|
19
|
+
- [x] `server/src/Http/Controllers/DataController.php`
|
|
20
|
+
|
|
21
|
+
## Routes Updated ✓
|
|
22
|
+
- [x] `addon/routes.js` - Simplified to data routes
|
|
23
|
+
- [x] `server/src/routes.php` - Updated API endpoints
|
|
24
|
+
|
|
25
|
+
## Templates Updated ✓
|
|
26
|
+
- [x] `addon/templates/application.hbs` - Sidebar navigation
|
|
27
|
+
- [x] `addon/templates/home.hbs` - Quick actions and terminology
|
|
28
|
+
|
|
29
|
+
## Controllers Updated ✓
|
|
30
|
+
- [x] `addon/controllers/home.js` - Navigation method
|
|
31
|
+
|
|
32
|
+
## Services Updated ✓
|
|
33
|
+
- [x] `server/src/Services/PodService.php` - Added createFolder() and deleteResource()
|
|
34
|
+
|
|
35
|
+
## Terminology Changes ✓
|
|
36
|
+
- [x] "Pods" → "Data" throughout UI
|
|
37
|
+
- [x] "Container" → "Folder" in code comments and user-facing text
|
|
38
|
+
- [x] Updated all user-facing messages
|
|
39
|
+
|
|
40
|
+
## Testing Required
|
|
41
|
+
- [ ] OIDC authentication flow
|
|
42
|
+
- [ ] Pod URL extraction from WebID
|
|
43
|
+
- [ ] Data browser loads correctly
|
|
44
|
+
- [ ] Folder creation works
|
|
45
|
+
- [ ] Folder navigation works
|
|
46
|
+
- [ ] File/folder deletion works
|
|
47
|
+
- [ ] Resource import (vehicles, drivers, contacts, orders)
|
|
48
|
+
- [ ] Search functionality
|
|
49
|
+
- [ ] Error handling (401, invalid inputs)
|
|
50
|
+
|
|
51
|
+
## API Endpoints to Test
|
|
52
|
+
|
|
53
|
+
### GET /solid/int/v1/data
|
|
54
|
+
Expected: Returns root contents of user's pod
|
|
55
|
+
|
|
56
|
+
### GET /solid/int/v1/data/folder/{slug}
|
|
57
|
+
Expected: Returns contents of specified folder
|
|
58
|
+
|
|
59
|
+
### POST /solid/int/v1/data/folder
|
|
60
|
+
Payload: `{ "name": "test-folder", "path": "" }`
|
|
61
|
+
Expected: Creates new folder
|
|
62
|
+
|
|
63
|
+
### DELETE /solid/int/v1/data/{type}/{slug}
|
|
64
|
+
Example: `DELETE /solid/int/v1/data/folder/vehicles`
|
|
65
|
+
Expected: Deletes specified folder or file
|
|
66
|
+
|
|
67
|
+
### POST /solid/int/v1/data/import
|
|
68
|
+
Payload: `{ "resource_types": ["vehicles", "drivers"] }`
|
|
69
|
+
Expected: Imports selected resources into folders
|
|
70
|
+
|
|
71
|
+
## Files Count Summary
|
|
72
|
+
- **Created:** 7 files
|
|
73
|
+
- **Modified:** 6 files
|
|
74
|
+
- **Deleted:** 14 files (12 frontend + 2 backend)
|
|
75
|
+
- **Net change:** -1 files (cleaner codebase!)
|
|
76
|
+
|
|
77
|
+
## Code Quality Checks
|
|
78
|
+
- [x] No references to old `pods.explorer` or `pods.index` routes
|
|
79
|
+
- [x] No references to `PodController` or `ContainerController`
|
|
80
|
+
- [x] All imports and dependencies updated
|
|
81
|
+
- [x] Consistent naming conventions (data/folder)
|
|
82
|
+
- [x] Clean, readable code structure
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<Modal::Default
|
|
2
|
+
@modalIsOpened={{@modalIsOpened}}
|
|
3
|
+
@options={{@options}}
|
|
4
|
+
@confirm={{@options.confirm}}
|
|
5
|
+
@decline={{@options.decline}}
|
|
6
|
+
>
|
|
7
|
+
<div class="modal-body-container">
|
|
8
|
+
<div class="space-y-4">
|
|
9
|
+
<InputGroup @name="Folder Name" @wrapperClass="mb-0">
|
|
10
|
+
<Input
|
|
11
|
+
@type="text"
|
|
12
|
+
@value={{@options.folderName}}
|
|
13
|
+
placeholder="Enter folder name (e.g., vehicles, drivers)"
|
|
14
|
+
class="w-full form-input"
|
|
15
|
+
/>
|
|
16
|
+
</InputGroup>
|
|
17
|
+
|
|
18
|
+
<div class="text-sm text-gray-600 dark:text-gray-400">
|
|
19
|
+
<p>This will create a new folder in your Solid pod for organizing your data.</p>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
{{#if @options.error}}
|
|
23
|
+
<div class="bg-red-50 dark:bg-red-900 border border-red-200 dark:border-red-700 rounded p-3">
|
|
24
|
+
<p class="text-sm text-red-800 dark:text-red-200">{{@options.error}}</p>
|
|
25
|
+
</div>
|
|
26
|
+
{{/if}}
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</Modal::Default>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<Modal::Default
|
|
2
|
+
@modalIsOpened={{@modalIsOpened}}
|
|
3
|
+
@options={{@options}}
|
|
4
|
+
@confirm={{@options.confirm}}
|
|
5
|
+
@decline={{@options.decline}}
|
|
6
|
+
>
|
|
7
|
+
<div class="modal-body-container">
|
|
8
|
+
<div class="space-y-4">
|
|
9
|
+
<div>
|
|
10
|
+
<p class="text-gray-700 dark:text-gray-300 mb-4">
|
|
11
|
+
Select the Fleetops resources you want to import into your Solid pod:
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<div class="space-y-3">
|
|
15
|
+
<label class="flex items-center p-3 bg-gray-50 dark:bg-gray-800 rounded cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
|
|
16
|
+
<input
|
|
17
|
+
type="checkbox"
|
|
18
|
+
checked={{@options.resourceTypes.vehicles}}
|
|
19
|
+
{{on "change" (fn @options.toggleResourceType "vehicles")}}
|
|
20
|
+
class="form-checkbox h-5 w-5 text-blue-600"
|
|
21
|
+
/>
|
|
22
|
+
<div class="ml-3">
|
|
23
|
+
<div class="font-medium text-gray-900 dark:text-white">Vehicles</div>
|
|
24
|
+
<div class="text-sm text-gray-600 dark:text-gray-400">Import all vehicles from Fleetops</div>
|
|
25
|
+
</div>
|
|
26
|
+
</label>
|
|
27
|
+
|
|
28
|
+
<label class="flex items-center p-3 bg-gray-50 dark:bg-gray-800 rounded cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
|
|
29
|
+
<input
|
|
30
|
+
type="checkbox"
|
|
31
|
+
checked={{@options.resourceTypes.drivers}}
|
|
32
|
+
{{on "change" (fn @options.toggleResourceType "drivers")}}
|
|
33
|
+
class="form-checkbox h-5 w-5 text-blue-600"
|
|
34
|
+
/>
|
|
35
|
+
<div class="ml-3">
|
|
36
|
+
<div class="font-medium text-gray-900 dark:text-white">Drivers</div>
|
|
37
|
+
<div class="text-sm text-gray-600 dark:text-gray-400">Import all drivers from Fleetops</div>
|
|
38
|
+
</div>
|
|
39
|
+
</label>
|
|
40
|
+
|
|
41
|
+
<label class="flex items-center p-3 bg-gray-50 dark:bg-gray-800 rounded cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
|
|
42
|
+
<input
|
|
43
|
+
type="checkbox"
|
|
44
|
+
checked={{@options.resourceTypes.contacts}}
|
|
45
|
+
{{on "change" (fn @options.toggleResourceType "contacts")}}
|
|
46
|
+
class="form-checkbox h-5 w-5 text-blue-600"
|
|
47
|
+
/>
|
|
48
|
+
<div class="ml-3">
|
|
49
|
+
<div class="font-medium text-gray-900 dark:text-white">Contacts</div>
|
|
50
|
+
<div class="text-sm text-gray-600 dark:text-gray-400">Import all contacts/customers from Fleetops</div>
|
|
51
|
+
</div>
|
|
52
|
+
</label>
|
|
53
|
+
|
|
54
|
+
<label class="flex items-center p-3 bg-gray-50 dark:bg-gray-800 rounded cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
|
|
55
|
+
<input
|
|
56
|
+
type="checkbox"
|
|
57
|
+
checked={{@options.resourceTypes.orders}}
|
|
58
|
+
{{on "change" (fn @options.toggleResourceType "orders")}}
|
|
59
|
+
class="form-checkbox h-5 w-5 text-blue-600"
|
|
60
|
+
/>
|
|
61
|
+
<div class="ml-3">
|
|
62
|
+
<div class="font-medium text-gray-900 dark:text-white">Orders</div>
|
|
63
|
+
<div class="text-sm text-gray-600 dark:text-gray-400">Import all orders from Fleetops</div>
|
|
64
|
+
</div>
|
|
65
|
+
</label>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
{{#if @options.importProgress}}
|
|
70
|
+
<div class="bg-blue-50 dark:bg-blue-900 border border-blue-200 dark:border-blue-700 rounded p-3">
|
|
71
|
+
<div class="flex items-center">
|
|
72
|
+
<Spinner class="mr-3" />
|
|
73
|
+
<p class="text-sm text-blue-800 dark:text-blue-200">{{@options.importProgress}}</p>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
{{/if}}
|
|
77
|
+
|
|
78
|
+
{{#if @options.error}}
|
|
79
|
+
<div class="bg-red-50 dark:bg-red-900 border border-red-200 dark:border-red-700 rounded p-3">
|
|
80
|
+
<p class="text-sm text-red-800 dark:text-red-200">{{@options.error}}</p>
|
|
81
|
+
</div>
|
|
82
|
+
{{/if}}
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</Modal::Default>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Controller from '@ember/controller';
|
|
2
|
+
import { action } from '@ember/object';
|
|
3
|
+
import { inject as service } from '@ember/service';
|
|
4
|
+
|
|
5
|
+
export default class DataContentController extends Controller {
|
|
6
|
+
@service hostRouter;
|
|
7
|
+
|
|
8
|
+
@action back() {
|
|
9
|
+
this.hostRouter.transitionTo('console.solid-protocol.data.index');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@action viewFile() {
|
|
13
|
+
if (this.model.url) {
|
|
14
|
+
window.open(this.model.url, '_blank');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|