mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-23 06:49:37 +02:00
Refactor release workflow to use "released" event type
This commit is contained in:
parent
d0791faad5
commit
f354cd1ffe
5 changed files with 125 additions and 57 deletions
2
.github/workflows/backend-release.yml
vendored
2
.github/workflows/backend-release.yml
vendored
|
@ -2,7 +2,7 @@ name: Upload the tagged release backend image to GHCR and Docker Hub
|
|||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
types: [released]
|
||||
|
||||
env:
|
||||
IMAGE_NAME: "adventurelog-backend"
|
||||
|
|
2
.github/workflows/frontend-release.yml
vendored
2
.github/workflows/frontend-release.yml
vendored
|
@ -2,7 +2,7 @@ name: Upload tagged release frontend image to GHCR and Docker Hub
|
|||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
types: [released]
|
||||
|
||||
env:
|
||||
IMAGE_NAME: "adventurelog-frontend"
|
||||
|
|
|
@ -19,14 +19,14 @@
|
|||
if (modal) {
|
||||
modal.showModal();
|
||||
}
|
||||
let res = await fetch(`/api/adventures/all/?include_collections=false`, {
|
||||
let res = await fetch(`/api/adventures/?include_collections=false`, {
|
||||
method: 'GET'
|
||||
});
|
||||
|
||||
const newAdventures = await res.json();
|
||||
|
||||
if (res.ok && adventures) {
|
||||
adventures = newAdventures;
|
||||
adventures = newAdventures.results;
|
||||
}
|
||||
isLoading = false;
|
||||
});
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
let places: OpenStreetMapPlace[] = [];
|
||||
let images: { id: string; image: string }[] = [];
|
||||
let warningMessage: string = '';
|
||||
let constrainDates: boolean = false;
|
||||
|
||||
import ActivityComplete from './ActivityComplete.svelte';
|
||||
import { appVersion } from '$lib/config';
|
||||
|
@ -638,16 +639,19 @@ it would also work to just use on:click on the MapLibre component itself. -->
|
|||
</div>
|
||||
<div class="collapse-content">
|
||||
<label class="label cursor-pointer flex items-start space-x-2">
|
||||
{#if adventure.collection && collection && collection.start_date && collection.end_date}
|
||||
<span class="label-text">Constrain to collection dates</span>
|
||||
<input
|
||||
type="checkbox"
|
||||
class="toggle toggle-primary"
|
||||
id="is_public"
|
||||
name="is_public"
|
||||
id="constrain_dates"
|
||||
name="constrain_dates"
|
||||
on:change={() => (constrainDates = !constrainDates)}
|
||||
/>
|
||||
<!-- TODO: implement this constrain -->
|
||||
{/if}
|
||||
</label>
|
||||
<div class="flex gap-2 mb-1">
|
||||
{#if !constrainDates}
|
||||
<input
|
||||
type="date"
|
||||
class="input input-bordered w-full"
|
||||
|
@ -672,6 +676,36 @@ it would also work to just use on:click on the MapLibre component itself. -->
|
|||
}
|
||||
}}
|
||||
/>
|
||||
{:else}
|
||||
<input
|
||||
type="date"
|
||||
class="input input-bordered w-full"
|
||||
placeholder="Start Date"
|
||||
min={collection?.start_date}
|
||||
max={collection?.end_date}
|
||||
bind:value={new_start_date}
|
||||
on:keydown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
addNewVisit();
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<input
|
||||
type="date"
|
||||
class="input input-bordered w-full"
|
||||
placeholder="End Date"
|
||||
bind:value={new_end_date}
|
||||
min={collection?.start_date}
|
||||
max={collection?.end_date}
|
||||
on:keydown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
addNewVisit();
|
||||
}
|
||||
}}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="flex gap-2 mb-1">
|
||||
<!-- textarea for notes -->
|
||||
|
@ -695,6 +729,7 @@ it would also work to just use on:click on the MapLibre component itself. -->
|
|||
{#if adventure.visits.length > 0}
|
||||
<h2 class=" font-bold text-xl mt-2">My Visits</h2>
|
||||
{#each adventure.visits as visit}
|
||||
<div class="flex flex-col gap-2">
|
||||
<div class="flex gap-2">
|
||||
<p>
|
||||
{new Date(visit.start_date).toLocaleDateString(undefined, {
|
||||
|
@ -702,13 +737,15 @@ it would also work to just use on:click on the MapLibre component itself. -->
|
|||
})}
|
||||
</p>
|
||||
<p>
|
||||
{new Date(visit.end_date).toLocaleDateString(undefined, { timeZone: 'UTC' })}
|
||||
{new Date(visit.end_date).toLocaleDateString(undefined, {
|
||||
timeZone: 'UTC'
|
||||
})}
|
||||
</p>
|
||||
<p>{visit.notes}</p>
|
||||
|
||||
<div>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-sm btn-error mb-1"
|
||||
class="btn btn-sm btn-error"
|
||||
on:click={() => {
|
||||
adventure.visits = adventure.visits.filter((v) => v !== visit);
|
||||
}}
|
||||
|
@ -717,6 +754,8 @@ it would also work to just use on:click on the MapLibre component itself. -->
|
|||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<p class="whitespace-pre-wrap -mt-2 mb-2">{visit.notes}</p>
|
||||
</div>
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
import EditAdventure from '$lib/components/AdventureModal.svelte';
|
||||
import AdventureModal from '$lib/components/AdventureModal.svelte';
|
||||
import ImageDisplayModal from '$lib/components/ImageDisplayModal.svelte';
|
||||
import { typeToString } from '$lib';
|
||||
|
||||
onMount(() => {
|
||||
if (data.props.adventure) {
|
||||
|
@ -310,7 +311,7 @@
|
|||
<div>
|
||||
<p class="text-sm text-muted-foreground">Adventure Type</p>
|
||||
<p class="text-base font-medium">
|
||||
{adventure.type[0].toLocaleUpperCase() + adventure.type.slice(1)}
|
||||
{typeToString(adventure.type)}
|
||||
</p>
|
||||
</div>
|
||||
{#if data.props.collection}
|
||||
|
@ -322,6 +323,34 @@
|
|||
>
|
||||
</div>
|
||||
{/if}
|
||||
{#if adventure.visits.length > 0}
|
||||
<div>
|
||||
<p class="text-sm text-muted-foreground">Visits</p>
|
||||
<p class="text-base font-medium">
|
||||
{adventure.visits.length}
|
||||
{adventure.visits.length > 1 ? 'visits' : 'visit' + ':'}
|
||||
</p>
|
||||
<!-- show each visit start and end date as well as notes -->
|
||||
{#each adventure.visits as visit}
|
||||
<div class="grid gap-2">
|
||||
<p class="text-sm text-muted-foreground">
|
||||
{visit.start_date
|
||||
? new Date(visit.start_date).toLocaleDateString(undefined, {
|
||||
timeZone: 'UTC'
|
||||
})
|
||||
: ''}
|
||||
{visit.end_date && visit.end_date !== ''
|
||||
? ' - ' +
|
||||
new Date(visit.end_date).toLocaleDateString(undefined, {
|
||||
timeZone: 'UTC'
|
||||
})
|
||||
: ''}
|
||||
</p>
|
||||
<p class="text-sm text-muted-foreground -mt-2 mb-2">{visit.notes}</p>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{#if adventure.longitude && adventure.latitude}
|
||||
<div class="grid md:grid-cols-2 gap-4">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue