Skip to content

Commit 61a9c71

Browse files
authored
Merge pull request #336 from vuejs-jp/feature/staffs-volunteer
is_volunteer to staffs
2 parents 48f3688 + b699193 commit 61a9c71

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

apps/web/app/components/admin/StaffItem.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const newStaff = ref({
2222
github_id: props.staff?.github_id ?? '',
2323
is_open: props.staff?.is_open ?? true,
2424
display_order: props.staff?.display_order ?? null,
25+
is_volunteer: props.staff?.is_volunteer ?? false,
2526
})
2627
2728
const updateName = (e: any) => {
@@ -121,6 +122,16 @@ const onSubmit = () => {
121122
label="表示順"
122123
@input="updateDisplayOrder"
123124
/>
125+
<VFDropdownField
126+
id="is_volunteer"
127+
v-model="newStaff.is_volunteer"
128+
name="is_volunteer"
129+
label="ボランティアスタッフか否か"
130+
:items="[
131+
{ value: 'false', text: 'コアスタッフ' },
132+
{ value: 'true', text: 'ボランティアスタッフ' },
133+
]"
134+
/>
124135
<div class="form-button">
125136
<VFSubmitButton>Save</VFSubmitButton>
126137
<VFLinkButton

apps/web/app/components/admin/StaffList.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const handleDialog = (id?: string) => {
2727
<th>x_id</th>
2828
<th>github_id</th>
2929
<th>is_open</th>
30+
<th>is_volunteer</th>
3031
<th style="min-width: 80px">action</th>
3132
</tr>
3233
<tr v-for="staff in staffs" :key="staff.id">
@@ -50,6 +51,9 @@ const handleDialog = (id?: string) => {
5051
<p>{{ staff.is_open ? '表示' : '非表示' }}</p>
5152
<p v-if="staff.display_order">{{ `(${staff.display_order})` }}</p>
5253
</td>
54+
<td>
55+
<p>{{ staff.is_volunteer ? 'ボランティアスタッフ' : 'コアスタッフ' }}</p>
56+
</td>
5357
<td>
5458
<VFLinkButton
5559
is="button"

packages/model/lib/staff.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export type Staff = {
77
github_id?: string
88
is_open: boolean
99
display_order?: number
10+
is_volunteer: boolean
1011
created_at: string
1112
updated_at: string
1213
}

supabase/schema.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ create table if not exists public.staffs (
157157

158158
ALTER TABLE public.staffs ADD COLUMN detail_page_id varchar(40);
159159

160+
ALTER TABLE public.staffs ADD COLUMN is_volunteer bool not null default false;
161+
160162
alter table
161163
public.staffs enable row level security;
162164

0 commit comments

Comments
 (0)