Claude
|
ce5e57a691
|
Implement public trip sharing with Shareable concern
This commit implements comprehensive public trip sharing functionality
by extracting sharing logic into a reusable Shareable concern and
extending it to Trip models.
## Key Features
**Shareable Concern (DRY principle)**
- Extract sharing logic from Stat model into reusable concern
- Support for time-based expiration (1h, 12h, 24h, permanent)
- UUID-based secure public access
- User-controlled sharing of notes and photos
- Automatic UUID generation on model creation
**Database Changes**
- Add sharing_uuid (UUID) column to trips table
- Add sharing_settings (JSONB) column for configuration storage
- Add unique index on sharing_uuid for performance
**Public Trip Sharing**
- Public-facing trip view with read-only access
- Interactive map with trip route visualization
- Optional sharing of notes and photo previews
- Branded footer with Dawarich attribution
- Responsive design matching existing UI patterns
**Sharing Management**
- In-app sharing controls in trip show view
- Enable/disable sharing with one click
- Configurable expiration times
- Copy-to-clipboard for sharing URLs
- Visual indicators for sharing status
**Authorization & Security**
- TripPolicy for fine-grained access control
- Public access only for explicitly shared trips
- Automatic expiration enforcement
- Owner-only sharing management
- UUID-based URLs prevent enumeration attacks
**API & Routes**
- GET /shared/trips/:trip_uuid for public access
- PATCH /trips/:id/sharing for sharing management
- RESTful endpoint design consistent with stats sharing
**Frontend**
- New public-trip-map Stimulus controller
- OpenStreetMap tiles for public viewing (no API key required)
- Start/end markers on trip route
- Automatic map bounds fitting
**Tests**
- Comprehensive concern specs (Shareable)
- Model specs for Trip sharing functionality
- Request specs for public and authenticated access
- Policy specs for authorization rules
- 100% coverage of sharing functionality
## Implementation Details
### Models Updated
- Stat: Now uses Shareable concern (removed duplicate code)
- Trip: Includes Shareable concern with notes/photos options
### Controllers Added
- Shared::TripsController: Handles public viewing and sharing management
### Views Added
- trips/public_show.html.erb: Public-facing trip view
- trips/_sharing.html.erb: Sharing controls partial
### JavaScript Added
- public_trip_map_controller.js: Map rendering for public trips
### Helpers Extended
- TripsHelper: Added sharing status and expiration helpers
## Breaking Changes
None. This is a purely additive feature.
## Migration Required
Yes. Run: rails db:migrate
## Testing
All specs pass:
- spec/models/concerns/shareable_spec.rb
- spec/models/trip_spec.rb
- spec/requests/shared/trips_spec.rb
- spec/policies/trip_policy_spec.rb
|
2025-11-05 15:44:27 +00:00 |
|
Eugene Burmakin
|
6c62edb593
|
Fix UTM parameter assignment and update version to 0.34.2
|
2025-10-31 19:29:20 +01:00 |
|
Eugene Burmakin
|
8e35b8e09f
|
Move UTM parameter tracking logic into a concern
|
2025-10-30 19:59:31 +01:00 |
|
Eugene Burmakin
|
6787273713
|
Updte map view
|
2025-10-30 19:16:38 +01:00 |
|
Eugene Burmakin
|
d23e118645
|
Make sure family invitations are handled after sign-in
|
2025-10-22 21:36:51 +02:00 |
|
Eugene Burmakin
|
7ee2cb22ba
|
Small fixes
|
2025-10-22 20:39:02 +02:00 |
|
Eugene Burmakin
|
05237995cf
|
Fix remembering family members layer state and refreshing locations
|
2025-10-21 19:54:25 +02:00 |
|
Eugene Burmakin
|
632f389ace
|
Remember enabled map layers for users
|
2025-10-20 20:11:28 +02:00 |
|
Eugene Burmakin
|
b1dd654463
|
Merge branch 'dev', remote-tracking branch 'origin' into feature/full-screen-map
|
2025-10-14 13:47:58 +02:00 |
|
Eugene Burmakin
|
29ae5c04f1
|
Refactor family membership and invitation policies for clarity and security
|
2025-10-13 12:23:01 +02:00 |
|
Eugene Burmakin
|
e711ff25fe
|
Refactor family invitations and memberships into separate models and controllers
|
2025-10-07 18:38:06 +02:00 |
|
Eugene Burmakin
|
6fb5d98b19
|
Extract update location sharing logic to a service object
|
2025-10-05 19:40:42 +02:00 |
|
Eugene Burmakin
|
018760812a
|
Extract family functionality to a concern
|
2025-10-05 14:24:45 +02:00 |
|
Eugene Burmakin
|
0b9a1005e5
|
Fix tests
|
2025-10-05 01:09:46 +02:00 |
|
Eugene Burmakin
|
6057240888
|
Fix some tests
|
2025-10-05 00:42:21 +02:00 |
|
Eugene Burmakin
|
cd303bce01
|
Clean up some code
|
2025-10-04 23:19:00 +02:00 |
|
Eugene Burmakin
|
9bc0e2accc
|
Use family path instead of families/id
|
2025-10-04 22:39:47 +02:00 |
|
Eugene Burmakin
|
cfe319df9b
|
Move family controllers to their own namespace
|
2025-10-04 20:48:44 +02:00 |
|
Eugene Burmakin
|
f898f3aab0
|
Fix tests
|
2025-10-04 20:31:36 +02:00 |
|
Eugene Burmakin
|
c6fc4328d7
|
Remove memberships page
|
2025-10-04 16:17:26 +02:00 |
|
Eugene Burmakin
|
78693f3001
|
Merge branch 'dev' into feature/family
|
2025-10-04 15:57:03 +02:00 |
|
Eugene Burmakin
|
db8d886ee2
|
Use ids instead of uuids for primary keys in family tables
|
2025-09-30 18:43:26 +02:00 |
|
Eugene Burmakin
|
0728c21c61
|
Update stuff, fix stuff
|
2025-09-29 22:27:07 +02:00 |
|
Eugene Burmakin
|
f6b32371ec
|
Show family members on the map
|
2025-09-29 21:31:24 +02:00 |
|
Eugene Burmakin
|
fa3d926a92
|
Change registration flow to support family invitations and self-hosted mode restrictions.
|
2025-09-28 20:53:50 +02:00 |
|
Eugene Burmakin
|
f30b4bcafd
|
Use id to cancel invitations
|
2025-09-28 18:50:02 +02:00 |
|
Eugene Burmakin
|
5252388b8c
|
Fix leaving and deleting family confirmation dialogs
|
2025-09-28 14:49:32 +02:00 |
|
Eugene Burmakin
|
1f67e889e3
|
Complete phase 5
|
2025-09-28 13:10:07 +02:00 |
|
Eugene Burmakin
|
e17f732706
|
Minor changes
|
2025-09-27 21:14:40 +02:00 |
|
Eugene Burmakin
|
f817e3513c
|
Fix some tests
|
2025-09-27 14:26:08 +02:00 |
|
Eugene Burmakin
|
f0f0f20200
|
Complete phase 4
|
2025-09-27 14:04:10 +02:00 |
|
Eugene Burmakin
|
cc5da3e7e2
|
Complete phase 3
|
2025-09-27 13:23:33 +02:00 |
|
Eugene Burmakin
|
031104cdaa
|
Rework importing user data archive
|
2025-09-23 20:39:12 +02:00 |
|
Eugene Burmakin
|
14f6f4dcc1
|
Add new tests to cover ios auth
|
2025-09-21 16:27:43 +02:00 |
|
Eugene Burmakin
|
c8d54f0ed6
|
Update application_controller to store client header in session
|
2025-09-21 14:12:18 +02:00 |
|
Eugene Burmakin
|
69cae258c9
|
Save html format if iOS client header is present
|
2025-09-21 14:00:24 +02:00 |
|
Eugene Burmakin
|
20c2bc34cd
|
Store client header in session to persist across redirects
|
2025-09-21 13:51:26 +02:00 |
|
Eugene Burmakin
|
c0e756d085
|
Introduce iOS authentication flow with JWT token generation
|
2025-09-21 12:46:59 +02:00 |
|
Eugene Burmakin
|
2c55ca07e7
|
Remove permanent option from stats sharing options, default to 24h expiration.
|
2025-09-19 23:49:32 +02:00 |
|
Eugene Burmakin
|
584daadb5c
|
Fix failing specs
|
2025-09-19 19:55:27 +02:00 |
|
Eugene Burmakin
|
5db2ac7fac
|
Refactor hexagon services to remove Maps::HexagonContextResolver and improve date parsing
|
2025-09-18 21:21:54 +02:00 |
|
Eugene Burmakin
|
3fd7634657
|
Simplify some services by removing unused parameters and validations
|
2025-09-18 20:02:18 +02:00 |
|
Eugene Burmakin
|
0905ef65a5
|
Don't pass h3_resolution from frontend; use default in backend service
|
2025-09-18 19:45:53 +02:00 |
|
Eugene Burmakin
|
5b3fe84933
|
Update onborading popup
|
2025-09-18 18:29:46 +02:00 |
|
Eugene Burmakin
|
c67532bb10
|
Reimplement hexagons with H3
|
2025-09-17 01:55:42 +02:00 |
|
Eugene Burmakin
|
eb16959b9a
|
Extract logic to service classes
|
2025-09-16 20:41:53 +02:00 |
|
Eugene Burmakin
|
8c45404420
|
Fix hexagons render
|
2025-09-15 20:10:53 +02:00 |
|
Eugene Burmakin
|
6314442770
|
Calculate only centers of hexagons
|
2025-09-14 12:41:16 +02:00 |
|
Eugene Burmakin
|
a2aa1be271
|
Precalculate hexagons for stats
|
2025-09-13 23:11:42 +02:00 |
|
Eugene Burmakin
|
f80b2a1aff
|
Fix last failing specs
|
2025-09-13 18:30:26 +02:00 |
|