Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Sébastien LeBlanc committed Oct 10, 2023
1 parent 3c5ac59 commit 220889c
Show file tree
Hide file tree
Showing 8 changed files with 371 additions and 388 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@nuxtjs/i18n": "^8.0.0-beta.9",
"@nuxtjs/tailwindcss": "^6.2.0",
"@pinia-plugin-persistedstate/nuxt": "^1.0.0",
"@types/file-saver": "^2.0.5",
"@types/inputmask": "^5.0.3",
"@types/moment-duration-format": "^2.2.3",
"@vueuse/components": "^10.3.0",
Expand Down
6 changes: 1 addition & 5 deletions src/components/SummarySidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,18 @@
<div class="mb-2 flex items-center justify-end gap-2">
<span class="text-xs font-bold uppercase tracking-wide opacity-60">{{ $t('Tri') }}</span>
<select v-model="sort" class="form-control form-select-bordered form-select pr-12">
<option value="entries">{{ $t("Nb. d'entrées") }}</option>
<option value="name">{{ $t('Alphabétique') }}</option>
<option value="creation">{{ $t('Date de création') }}</option>
</select>
</div>

<div
v-if="sortedProjects && sortedProjects.length"
v-for="[project, entries] in sortedProjects"
v-for="[project] in sortedProjects"
:key="project.id"
class="relative flex w-full items-center justify-between gap-4 rounded bg-gray-100 p-4 pr-16 dark:bg-gray-800"
>
<span class="font-bold">{{ project.name }}</span>
<span class="shrink-0 text-xs font-bold opacity-60">
{{ $t('Aucune entrée | {n} entrée | {n} entrées', entries) }}
</span>
<button
type="button"
class="absolute right-2 top-1/2 inline-flex h-10 w-10 flex-shrink-0 -translate-y-1/2 items-center justify-center rounded bg-red-500 font-bold text-white shadow ring-primary-200 transition hover:bg-red-400 focus:outline-none focus:ring active:bg-red-600 dark:text-gray-800 dark:ring-gray-600"
Expand Down
12 changes: 5 additions & 7 deletions src/components/TimeEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
</div>
<div>
<label>{{ $t('Projet') }}<span class="text-red-500">*</span></label>
<!-- TODO: Fix type error in @create -->
<Multiselect
v-model="model.project"
:options="projects"
Expand All @@ -57,14 +58,12 @@
createOption
@create="addProject"
/>
<!-- TODO: Fix Type here -->
</div>
<div>
<label>{{ $t('Description') }}</label>
<textarea
v-model="model.description"
class="form-control form-input-bordered form-input block h-auto w-full py-3"
style="form-sizing: normal"
class="form-control form-input-bordered form-input block h-auto w-full py-3 [form-sizing:content]"
rows="2"
:placeholder="`${$t('Description')}...`"
></textarea>
Expand Down Expand Up @@ -208,7 +207,6 @@ const { projects, selectedDay, todaysEntries } = storeToRefs(store);
const props = withDefaults(defineProps<{ entry?: Entry }>(), {
entry: () => ({
id: '',
is_creating: true,
is_editing: false,
is_synced: false,
Expand All @@ -226,7 +224,7 @@ const emit = defineEmits<{
(e: 'add'): void;
}>();
const model = ref(Object.assign({}, props.entry));
const model = ref(JSON.parse(JSON.stringify(props.entry)));
const placeholder = ref('00:00:00');
const computedDate = computed(() => {
Expand Down Expand Up @@ -381,7 +379,7 @@ function start() {
function stop() {
model.value.end_time = model.value.end_time || $moment().format('HH:mm');
model.value.is_live_clocking = false;
updateEntry(model.value);
updateEntry(model.value, props.entry);
}
function add() {
Expand All @@ -393,7 +391,7 @@ function add() {
function edit() {
model.value.is_creating = false;
model.value.is_editing = false;
updateEntry(model.value);
updateEntry(model.value, props.entry);
}
function cancel() {
Expand Down
1 change: 0 additions & 1 deletion src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"Êtes vous certain de vouloir supprimer les priorités complétées ?": "Are you sure you want to delete all completed priorities?",
"Tri": "Sort",
"Alphabétique": "Alphabetical",
"Nb. d'entrées": "Nb. of entries",
"Date de création": "Creation date",
"Aucune priorité complétée à supprimer": "No completed priorities to delete",
"Connexion avec Google": "Sign In with Google",
Expand Down
1 change: 1 addition & 0 deletions src/stores/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const useAuthStore = defineStore('auth', () => {
}

return {
// actions
login,
logout,
};
Expand Down
Loading

0 comments on commit 220889c

Please sign in to comment.