feature/projects-all-the-way-down #3323

Merged
konrad merged 123 commits from feature/projects-all-the-way-down into main 2023-05-30 10:09:40 +00:00
10 changed files with 6 additions and 16 deletions
Showing only changes of commit ed8de7e3eb - Show all commits

View File

@ -67,7 +67,7 @@
</template>
<script setup lang="ts">
import {computed, watch, ref} from 'vue'
import {computed, ref} from 'vue'

Define default types or handle undefined defaults. E.g. level might be undefined.
Could it be that ts doesn't display errors in the editor for you?

Define default types or handle undefined defaults. E.g. `level` might be `undefined`. Could it be that ts doesn't display errors in the editor for you?

Added.

Could it be that ts doesn't display errors in the editor for you?

Looks like it 🤔

Added. > Could it be that ts doesn't display errors in the editor for you? Looks like it 🤔
import {useProjectStore} from '@/stores/projects'
import {useBaseStore} from '@/stores/base'

View File

@ -22,7 +22,6 @@
<script lang="ts" setup>
import {reactive, ref, watch} from 'vue'
import type {PropType} from 'vue'
import {useI18n} from 'vue-i18n'
import type {IProject} from '@/modelTypes/IProject'
@ -41,8 +40,6 @@ const props = defineProps({
})
const emit = defineEmits(['update:modelValue'])
const {t} = useI18n({useScope: 'global'})
const project: IProject = reactive(new ProjectModel())
watch(

View File

@ -1,6 +1,5 @@
import {i18n} from '@/i18n'
import type {IProject} from '@/modelTypes/IProject'
import {useProjectStore} from '@/stores/projects'
export function getProjectTitle(project: IProject) {
dpschen marked this conversation as resolved Outdated

Use long var names.

Use long var names.

Done.

Done.
if (project.id === -1) {

View File

@ -1,4 +1,4 @@
import {watch, reactive, shallowReactive, unref, toRefs, readonly, ref, computed, watchEffect} from 'vue'
import {watch, reactive, shallowReactive, unref, readonly, ref, computed, watchEffect} from 'vue'
import {acceptHMRUpdate, defineStore} from 'pinia'
import {useI18n} from 'vue-i18n'
import {useRouter} from 'vue-router'
@ -18,7 +18,7 @@ import ProjectModel from '@/models/project'
import {success} from '@/message'
import {useBaseStore} from '@/stores/base'
const {add, remove, search, update} = createNewIndexer('projects', ['title', 'description'])
const {remove, search, update} = createNewIndexer('projects', ['title', 'description'])
export interface ProjectState {
[id: IProject['id']]: IProject

View File

@ -464,6 +464,7 @@ export const useTaskStore = defineStore('task', () => {
setCoverImage,
findProjectId,
ensureLabelsExist,
toggleFavorite,
}
})

View File

@ -57,7 +57,6 @@ import {useProjectStore} from '@/stores/projects'
import {useConfigStore} from '@/stores/config'
import {useAuthStore} from '@/stores/auth'
import {useTaskStore} from '@/stores/tasks'
import type {IProject} from '@/modelTypes/IProject'
const salutation = useDaytimeSalutation()

View File

@ -26,11 +26,9 @@
import {computed} from 'vue'
import {useI18n} from 'vue-i18n'
import BaseButton from '@/components/base/BaseButton.vue'
import Fancycheckbox from '@/components/input/fancycheckbox.vue'
import ProjectCardGrid from '@/components/project/partials/ProjectCardGrid.vue'
import {getProjectTitle} from '@/helpers/getProjectTitle'
import {useTitle} from '@/composables/useTitle'
import {useStorage} from '@vueuse/core'

View File

@ -44,7 +44,6 @@
<script setup lang="ts">
import {ref, reactive, shallowReactive, watch} from 'vue'
import {useI18n} from 'vue-i18n'
import {useRouter, useRoute} from 'vue-router'
import ProjectService from '@/services/project'
import ProjectModel from '@/models/project'
@ -58,8 +57,6 @@ import ProjectSearch from '@/components/tasks/partials/projectSearch.vue'
import type {IProject} from '@/modelTypes/IProject'
const {t} = useI18n({useScope: 'global'})
const router = useRouter()
const route = useRoute()
useTitle(() => t('project.create.header'))

View File

@ -13,7 +13,7 @@
<script setup lang="ts">
import {ref, watch} from 'vue'
import {useRoute, useRouter} from 'vue-router'
import {useRoute} from 'vue-router'
import {useI18n} from 'vue-i18n'
import CreateEdit from '@/components/misc/create-edit.vue'
@ -28,7 +28,6 @@ const {t} = useI18n({useScope: 'global'})
useTitle(() => t('project.duplicate.title'))
const route = useRoute()
const router = useRouter()
const projectStore = useProjectStore()
const {project, isLoading, duplicateProject} = useProject(route.params.projectId)

View File

@ -14,7 +14,7 @@
ref="heading"
/>
<h6 class="subtitle" v-if="project?.id">
<template v-for="p in projectStore.getAncestors(project)">

Shouldn't we still show the parent here?

Shouldn't we still show the parent here?

I've changed it now so that is shows this:

Screenshot_20230328_174428.png

(each project is clickable individually)

For a hierarchy like this:

Screenshot_20230328_174646.png

I've changed it now so that is shows this: ![Screenshot_20230328_174428.png](/attachments/35babb55-b48a-49bf-a595-3fcc28da12dc) (each project is clickable individually) For a hierarchy like this: ![Screenshot_20230328_174646.png](/attachments/070d677e-d199-45ee-af6b-c0a6b3196681)

Can't see these images either

Can't see these images either

Again 404?

Again 404?

This starts to feel like a gitea bug...

This starts to feel like a gitea bug...
<template v-for="p in projectStore.getAncestors(project)" :key="p.id">

This won't update dynamically. Should we change the getParentProjects to a computed parentProjects that automatically updates instead?

This won't update dynamically. Should we change the `getParentProjects` to a computed `parentProjects` that automatically updates instead?

I tried to change it but it fails with getAncestors is not a function. Any idea?

I tried to change it but it fails with `getAncestors is not a function`. Any idea?

Actually this does update dynamically when the project changes. I've had a task open, moved the project to another parent project and it updated instantly.

Actually this does update dynamically when the project changes. I've had a task open, moved the project to another parent project and it updated instantly.
<router-link :to="{ name: 'project.index', params: { projectId: p.id } }">
{{ getProjectTitle(p) }}
</router-link>