new trail view options: create copy & change visibility (#571)

* change visibility of multiple trails in trails view (multi-select)

* error handling

* create copy option added

* wait for meilisearch when updating trail

* remove toggles from dropdown

* change public/private logic

* adds loading spinner for bulk operations

* fixes trail duplicate

* fixes tags delete on visiblility change

* fix conflict resolving issue

* edit labels & german translation

---------

Co-authored-by: Christian Beutel <>
Co-authored-by: Flomp <Flomp@users.noreply.github.com>
This commit is contained in:
slothful-vassal
2026-03-01 18:18:09 +01:00
committed by GitHub
parent 2b9d5305a8
commit f2396ae574
21 changed files with 335 additions and 54 deletions

View File

@@ -238,7 +238,7 @@ export async function trails_create(trail: Trail, photos: File[], gpx: File | Bl
}
export async function trails_update(oldTrail: Trail, newTrail: Trail, photos?: File[], gpx?: File | Blob | null) {
export async function trails_update(oldTrail: Trail, newTrail: Trail, photos?: File[], gpx?: File | Blob | null, exclude?: (keyof Trail)[]) {
newTrail.author = oldTrail.author
const waypointUpdates = compareObjectArrays<Waypoint>(oldTrail.expand?.waypoints_via_trail ?? [], newTrail.expand?.waypoints_via_trail ?? []);
@@ -295,7 +295,7 @@ export async function trails_update(oldTrail: Trail, newTrail: Trail, photos?: F
newTrail.tags = newTrail.tags.filter(t => t != tag.id);
}
const formData = objectToFormData(newTrail, ["expand"])
const formData = objectToFormData(newTrail, ["expand", ...(exclude ?? [])])
if (gpx) {
formData.append("gpx", gpx);