Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/vue/eslint-config-…
Browse files Browse the repository at this point in the history
…typescript-13.0.0
  • Loading branch information
mathsuky authored Oct 7, 2024
2 parents 602887d + 712d0b3 commit 4a9f9c4
Show file tree
Hide file tree
Showing 7 changed files with 229 additions and 123 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn cache
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -22,7 +22,7 @@ jobs:
${{ runner.os }}-yarn-
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -44,7 +44,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn cache
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -53,7 +53,7 @@ jobs:
${{ runner.os }}-yarn-
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -77,7 +77,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn cache
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -86,7 +86,7 @@ jobs:
${{ runner.os }}-yarn-
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "room-web",
"version": "1.5.0",
"version": "1.5.1",
"private": true,
"scripts": {
"build": "vite build",
Expand All @@ -12,13 +12,13 @@
},
"dependencies": {
"@cloudcmd/clipboard": "^2.0.0",
"axios": "^1.6.4",
"axios": "^1.7.4",
"csv-parse": "^5.5.0",
"direct-vuex": "^0.12.1",
"highlight.js": "^11.6.0",
"markdown-it": "^13.0.1",
"markdown-it-link-attributes": "^4.0.0",
"moment": "^2.29.4",
"moment": "^2.30.1",
"reflect-metadata": "^0.1.13",
"vue": "^2.7.14",
"vue-class-component": "^7.2.6",
Expand Down Expand Up @@ -48,8 +48,8 @@
"prettier": "2.8",
"sass": "~1.69",
"typescript": "5.2.2",
"unplugin-vue-components": "^0.25.2",
"vite": "^4.5.3",
"unplugin-vue-components": "^0.27.4",
"vite": "^4.5.5",
"vue-template-compiler": "^2.7.14"
},
"browserslist": [
Expand All @@ -63,4 +63,4 @@
]
},
"packageManager": "[email protected]"
}
}
19 changes: 7 additions & 12 deletions src/components/event/EventFormTimeAndPlaceInstant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,20 @@ export default class EventFormTimeAndPlaceInstant extends Vue {
private timeStartMem = ''
private timeEndMem = ''
@Watch('timeStartInput', { immediate: true })
private onTimeStartPropChange() {
created() {
this.dateStartMem = this.timeStartInput && getDate(this.timeStartInput)
this.timeStartMem = this.timeStartInput && getTime(this.timeStartInput)
}
@Watch('timeEndInput', { immediate: true })
private onTimeEndPropChange() {
this.dateEndMem = this.timeEndInput && getDate(this.timeEndInput)
this.timeStartMem = this.timeStartInput && getTime(this.timeStartInput)
this.timeEndMem = this.timeEndInput && getTime(this.timeEndInput)
}
@Ref()
readonly form!: { validate(): void }
@Watch('timeStartMem')
@Watch('timeEndMem')
private async onTimeMemFixed() {
if (!this.timeStartMem || !this.timeEndMem) {
@Watch('timeStartInput')
@Watch('timeEndInput')
private async onDateTimeFixed() {
if (!this.timeStartInput || !this.timeEndInput) {
return
}
await this.$nextTick()
Expand All @@ -107,7 +102,7 @@ export default class EventFormTimeAndPlaceInstant extends Vue {
}
}
private setDefaultDateEnd() {
public setDefaultDateEnd() {
if (!this.dateEndMem) this.dateEndMem = this.dateStartMem
}
Expand Down
15 changes: 14 additions & 1 deletion src/components/shared/Calendar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<v-sheet height="64">
<v-sheet :height="status === 'loading' ? 60 : 64">
<v-toolbar flat>
<v-btn
outlined
Expand Down Expand Up @@ -44,6 +44,11 @@
</v-menu>
</v-toolbar>
</v-sheet>
<v-progress-linear
v-if="status == 'loading'"
indeterminate
color="primary"
></v-progress-linear>
<v-sheet :height="height - 64">
<v-calendar
:ref="calendarRefName"
Expand All @@ -56,6 +61,7 @@
@click:event="showEvent"
@click:more="viewDay"
@click:date="viewDay"
@input="onMonthChange"
/>

<v-menu
Expand Down Expand Up @@ -129,6 +135,9 @@ export default class Calendar extends Vue {
@Prop({ type: Array, default: [] })
events!: ResponseEvent[]
@Prop({ type: String, default: 'loading' })
status!: 'loading' | 'loaded' | 'error'
focus = ''
type = 'month'
Expand Down Expand Up @@ -217,6 +226,10 @@ export default class Calendar extends Vue {
return (event: CalendarEvent) =>
event?.admins.includes(this.$store.direct.state.me?.userId ?? '') ?? false
}
onMonthChange(value) {
value = new Date(value)
this.$emit('monthChanged', value)
}
}
</script>

Expand Down
25 changes: 23 additions & 2 deletions src/pages/Calendar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<template>
<v-col>
<calendar :height="784" :events="events" />
<calendar
:height="784"
:events="events"
:status="status"
@monthChanged="fetchMonthlyEvents"
/>
</v-col>
</template>

Expand All @@ -16,10 +21,26 @@ import api, { ResponseEvent } from '@/api'
},
})
export default class CalendarPage extends Vue {
status: 'loading' | 'loaded' | 'error' = 'loading'
events: ResponseEvent[] = []
async created() {
this.events = await api.events.getEvents({})
await this.fetchMonthlyEvents(new Date())
}
async fetchMonthlyEvents(newDate) {
this.status = 'loading'
const startDate = new Date(newDate.getFullYear(), newDate.getMonth(), 1)
const endDate = new Date(newDate.getFullYear(), newDate.getMonth() + 1, 0)
try {
this.events = await api.events.getEvents({
dateBegin: startDate.toISOString(),
dateEnd: endDate.toISOString(),
})
this.status = 'loaded'
} catch (e) {
this.status = 'error'
}
}
}
</script>
4 changes: 2 additions & 2 deletions src/workers/api.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import axios, { AxiosPromise } from 'axios'

export const baseURL =
process.env.NODE_ENV === 'development' ? 'http://localhost:6006/api' : '/api'
process.env.NODE_ENV === 'development' ? 'http://localhost:3000/api' : '/api'
export const icalURL =
process.env.NODE_ENV === 'development'
? 'http://localhost:6006/api/ical/v1'
? 'http://localhost:3000/api/ical/v1'
: `${window.location.origin}/api/ical/v1`
const traQAPIBaseURL = 'https://q.trap.jp/api/1.0'

Expand Down
Loading

0 comments on commit 4a9f9c4

Please sign in to comment.