Skip to content

Commit

Permalink
fronting entry edits
Browse files Browse the repository at this point in the history
  • Loading branch information
NyaomiDEV committed Aug 7, 2024
1 parent 78ecd76 commit 7442315
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
13 changes: 8 additions & 5 deletions src/modals/FrontingEntryEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@
function updateSelectedMember(members: Member[]){
frontingEntry.value.member = members[0];
}
function removeFromFront() {
frontingEntry.value.endTime = new Date();
}
</script>

<template>
Expand Down Expand Up @@ -160,11 +164,10 @@
</IonLabel>
<IonDatetimeButton slot="end" datetime="startTime"></IonDatetimeButton>
</IonItem>
<IonItem v-if="!frontingEntry.endTime">
<IonItem button v-if="!frontingEntry.endTime" @click="removeFromFront">
<IonLabel>
<p>
{{ $t("options:frontHistory.edit.endTimeUnavailable") }}
</p>
<h2>{{ $t("options:frontHistory.edit.removeFromFront.title") }}</h2>
<p>{{ $t("options:frontHistory.edit.removeFromFront.desc") }}</p>
</IonLabel>
</IonItem>
<IonItem button v-if="frontingEntry.endTime">
Expand All @@ -190,7 +193,7 @@
</IonList>

<IonFab slot="fixed" vertical="bottom" horizontal="end">
<IonFabButton @click="save">
<IonFabButton @click="save" v-if="frontingEntry.member">
<IonIcon :ios="saveIOS" :md="saveMD" />
</IonFabButton>
</IonFab>
Expand Down
15 changes: 12 additions & 3 deletions src/views/options/FrontHistory.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { IonContent, IonHeader, IonList, IonPage, IonTitle, IonLabel, IonToolbar, IonBackButton, IonItem, IonItemDivider, IonDatetime, IonButtons, IonIcon, IonButton, IonSearchbar } from '@ionic/vue';
import { IonContent, IonHeader, IonList, IonPage, IonTitle, IonLabel, IonToolbar, IonBackButton, IonItem, IonItemDivider, IonDatetime, IonButtons, IonIcon, IonButton, IonSearchbar, IonFabButton, IonFab } from '@ionic/vue';
import { inject, onMounted, onUnmounted, ref, ShallowRef, shallowRef, watch, WatchStopHandle } from 'vue';
import FrontingEntryAvatar from "../../components/frontingEntry/FrontingEntryAvatar.vue";
import FrontingEntryLabel from "../../components/frontingEntry/FrontingEntryLabel.vue";
Expand All @@ -12,11 +12,14 @@
import {
calendarOutline as calendarIOS,
listOutline as listIOS
listOutline as listIOS,
addOutline as addIOS
} from "ionicons/icons";
import calendarMD from "@material-design-icons/svg/outlined/calendar_month.svg";
import listMD from "@material-design-icons/svg/outlined/list.svg";
import addMD from "@material-design-icons/svg/outlined/add.svg";
import { appConfig } from '../../lib/config';
import { from, useObservable } from '@vueuse/rxjs';
import { liveQuery } from 'dexie';
Expand Down Expand Up @@ -58,7 +61,7 @@
handle();
});
async function showModal(clickedFrontingEntry: FrontingEntryComplete){
async function showModal(clickedFrontingEntry?: FrontingEntryComplete){
if(clickedFrontingEntry)
frontingEntry.value = {...clickedFrontingEntry};
else {
Expand Down Expand Up @@ -176,6 +179,12 @@
</IonItem>
</template>
</IonList>

<IonFab slot="fixed" vertical="bottom" horizontal="end">
<IonFabButton @click="showModal()">
<IonIcon :ios="addIOS" :md="addMD" />
</IonFabButton>
</IonFab>
</IonContent>

<FrontingEntryEdit :frontingEntry ref="frontingEntryModal" />
Expand Down
5 changes: 4 additions & 1 deletion translations/en/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
"customStatus": "Custom status",
"startTime": "Start time",
"endTime": "End time",
"endTimeUnavailable": "To edit the end time, first remove this member from front",
"removeFromFront": {
"title": "Remove from front",
"desc": "You won't be able to undo this action after saving!"
},
"isMainFronter": "Main fronter?",
"delete": {
"title": "Delete fronting entry",
Expand Down

0 comments on commit 7442315

Please sign in to comment.