-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from Pugma:feat/me_and_group
created MyPage and GroupPage / activate Suspense and prism
- Loading branch information
Showing
14 changed files
with
1,504 additions
and
17 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script setup lang="ts"> | ||
import { type GroupItem } from '@/lib/apis' | ||
interface Props { | ||
groups: GroupItem[] | ||
} | ||
defineProps<Props>() | ||
</script> | ||
|
||
<template> | ||
<ul> | ||
<li v-for="group in groups" :key="group.GroupUuid"> | ||
{{ group.GroupName }} | ||
</li> | ||
</ul> | ||
</template> | ||
|
||
<style lang="scss" scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script setup lang="ts"> | ||
import { type ScheduleItem } from '@/lib/apis' | ||
interface Props { | ||
schedules: ScheduleItem[] | ||
} | ||
defineProps<Props>() | ||
</script> | ||
|
||
<template> | ||
<ul> | ||
<li v-for="schedule in schedules" :key="schedule.UserName"> | ||
{{ schedule.Since }} ~ {{ schedule.Until }} | ||
{{ schedule.Condition }} | ||
</li> | ||
</ul> | ||
</template> | ||
|
||
<style lang="scss" scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
/* eslint-disable no-restricted-imports */ | ||
import { AuthApi, Configuration } from '@/lib/apis/generated' | ||
import { AuthApi, Configuration, GroupApi, UserApi, ScheduleApi } from '@/lib/apis/generated' | ||
|
||
const apis = new AuthApi(new Configuration({ basePath: '/api' })) | ||
class Apis { | ||
auth: AuthApi | ||
group: GroupApi | ||
user: UserApi | ||
schedule: ScheduleApi | ||
|
||
constructor() { | ||
this.auth = new AuthApi(new Configuration({ basePath: '/api' })) | ||
this.group = new GroupApi(new Configuration({ basePath: '/api' })) | ||
this.user = new UserApi(new Configuration({ basePath: '/api' })) | ||
this.schedule = new ScheduleApi(new Configuration({ basePath: '/api' })) | ||
} | ||
} | ||
const apis = new Apis() | ||
|
||
export default apis | ||
export * from '@/lib/apis/generated' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { useRoute } from 'vue-router' | ||
import { computed, type ComputedRef } from 'vue' | ||
|
||
const toStringIfArray = (s: string | undefined | readonly string[]) => (Array.isArray(s) ? s[0] : s) | ||
|
||
/** | ||
* @param paramName - 取得するparam、存在しないものを取得しようとした場合、undefinedが返るので注意 | ||
*/ | ||
const useParam = (paramName: string): ComputedRef<string> => { | ||
const route = useRoute() | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
return computed(() => toStringIfArray(route.params[paramName])!) | ||
} | ||
|
||
export default useParam |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<script setup lang="ts"> | ||
import PageHeader from '@/components/PageHeader.vue' | ||
import PageContainer from '@/components/PageContainer.vue' | ||
import apis, { type ScheduleItem } from '@/lib/apis' | ||
import { ref } from 'vue' | ||
import PageTitle from '@/components/PageTitle.vue' | ||
import useParam from '@/lib/param' | ||
import ScheduleList from '@/components/ScheduleList.vue' | ||
const info = ref<ScheduleItem[]>([]) | ||
const groupId = useParam('groupId') | ||
info.value = (await apis.schedule.scheduleGroupIdGet(groupId.value)).data | ||
</script> | ||
|
||
<template> | ||
<PageHeader /> | ||
<PageContainer> | ||
<PageTitle title="メンバーの忙しさ一覧" /> | ||
<ScheduleList :schedules="info" /> | ||
</PageContainer> | ||
</template> | ||
|
||
<style lang="scss" scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script setup lang="ts"> | ||
import PageHeader from '@/components/PageHeader.vue' | ||
import PageContainer from '@/components/PageContainer.vue' | ||
import apis, { type GroupItem } from '@/lib/apis' | ||
import { ref } from 'vue' | ||
import GroupList from '@/components/GroupList.vue' | ||
import PageTitle from '@/components/PageTitle.vue' | ||
const groups = ref<GroupItem[]>([]) | ||
groups.value = (await apis.user.meGet()).data | ||
</script> | ||
|
||
<template> | ||
<PageHeader /> | ||
<PageContainer> | ||
<PageTitle title="所属しているグループ一覧" /> | ||
<GroupList :groups="groups" /> | ||
</PageContainer> | ||
</template> | ||
|
||
<style lang="scss" scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters