From 1adce54fd6000ba878dc9460e84376c5c6383122 Mon Sep 17 00:00:00 2001 From: shota Date: Fri, 23 Aug 2024 23:49:10 +0900 Subject: [PATCH 01/11] =?UTF-8?q?pinia=E3=81=AE=E5=B0=8E=E5=85=A5=E3=80=81?= =?UTF-8?q?mywiki=E3=81=AE=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=AE=E4=BD=9C?= =?UTF-8?q?=E6=88=90=E3=80=81=E3=81=BE=E3=81=9F=E3=80=81traqId=E3=81=8C?= =?UTF-8?q?=E5=8F=96=E5=BE=97=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=8B=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E6=99=82=E3=81=AB=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=8C?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 51 ++++++++++++ package.json | 1 + src/App.vue | 21 ++++- src/assets/bold.svg | 19 ----- src/assets/checkbox.svg | 12 --- src/assets/code.svg | 12 --- src/components/MarkDownEditor.vue | 6 +- src/components/WikiCard.vue | 126 ++++++++++++++++++++++++++++++ src/main.js | 4 +- src/pages/MyWiki.vue | 36 +++++++++ src/pages/Search.vue | 121 ++-------------------------- src/store/user.js | 20 +++++ 12 files changed, 268 insertions(+), 161 deletions(-) delete mode 100644 src/assets/bold.svg delete mode 100644 src/assets/checkbox.svg delete mode 100644 src/assets/code.svg create mode 100644 src/components/WikiCard.vue create mode 100644 src/store/user.js diff --git a/package-lock.json b/package-lock.json index 4b3f416..525fc64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "highlight.js": "^11.10.0", "marked": "^14.0.0", "marked-highlight": "^2.1.4", + "pinia": "^2.2.2", "vue": "^3.4.35", "vue-router": "^4.4.3", "vue-toast-notification": "^3.1.2" @@ -1761,6 +1762,56 @@ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" }, + "node_modules/pinia": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.2.2.tgz", + "integrity": "sha512-ja2XqFWZC36mupU4z1ZzxeTApV7DOw44cV4dhQ9sGwun+N89v/XP7+j7q6TanS1u1tdbK4r+1BUx7heMaIdagA==", + "dependencies": { + "@vue/devtools-api": "^6.6.3", + "vue-demi": "^0.14.10" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "@vue/composition-api": "^1.4.0", + "typescript": ">=4.4.4", + "vue": "^2.6.14 || ^3.3.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/pinia/node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, "node_modules/postcss": { "version": "8.4.41", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", diff --git a/package.json b/package.json index 95975f7..efb01db 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "highlight.js": "^11.10.0", "marked": "^14.0.0", "marked-highlight": "^2.1.4", + "pinia": "^2.2.2", "vue": "^3.4.35", "vue-router": "^4.4.3", "vue-toast-notification": "^3.1.2" diff --git a/src/App.vue b/src/App.vue index 827f3ba..ebb3843 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,11 +1,30 @@ \ No newline at end of file diff --git a/src/store/user.js b/src/store/user.js new file mode 100644 index 0000000..7bd5e5f --- /dev/null +++ b/src/store/user.js @@ -0,0 +1,20 @@ +import { defineStore } from 'pinia'; + +export const useUserStore = defineStore('uer', { + state: () => ({ + traqId: "", + name: "", + iconUri: "" + }), + actions: { + async setUser(){ + const response = await fetch("/api/me"); + if(response && response.ok){ + const user = await response.json(); + this.traqId = await user.traqId; + this.name = await user.name; + this.iconUri = await user.iconUri; + } + } + } +}); \ No newline at end of file From 8961685e67dfa22bffa99e74e4d4e0691fb6386e Mon Sep 17 00:00:00 2001 From: shota Date: Sun, 25 Aug 2024 14:40:49 +0900 Subject: [PATCH 02/11] =?UTF-8?q?tagpage=E3=81=AE=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MarkDownEditor.vue | 11 ++--- src/components/WikiCard.vue | 6 +-- src/pages/IndividualMemo.vue | 3 +- src/pages/IndividualSodan.vue | 2 +- src/pages/Lectures.vue | 3 ++ src/pages/MyWiki.vue | 40 ----------------- src/pages/Search.vue | 14 +++--- src/pages/TagPage.vue | 75 ++++++++++++++++++++++++++++++- src/router.ts | 1 - 9 files changed, 94 insertions(+), 61 deletions(-) diff --git a/src/components/MarkDownEditor.vue b/src/components/MarkDownEditor.vue index 41705f0..917c92b 100644 --- a/src/components/MarkDownEditor.vue +++ b/src/components/MarkDownEditor.vue @@ -5,7 +5,6 @@ import hljs from 'highlight.js' import { markedHighlight } from 'marked-highlight' import 'highlight.js/styles/github-dark.css' import router from '../router' -import { useUserStore } from '../store/user' import {useToast} from 'vue-toast-notification'; import 'vue-toast-notification/dist/theme-sugar.css'; @@ -28,7 +27,6 @@ const shiftTabFlg = ref(false); const wikiId = ref(-1); const $toast = useToast(); const checkTargets = ref(["- [ ] ", "- ", "1. ", "> "]) -const userStore = useUserStore(); const marked = new Marked(markedHighlight({ langPrefix: 'hljs language-', highlight(code, lang) { @@ -535,8 +533,7 @@ const Update = async() =>{ body: JSON.stringify({ id: wikiId.value, title: title.value, - content: Content.value, - ownerTraqId: userStore.traqId}) + content: Content.value}) }).catch((e) =>{ $toast.error("something wrong", { duration: 1200, @@ -585,7 +582,7 @@ const Create = async(CreateButtonDown: boolean) =>{ body: JSON.stringify({ title: title.value, content: Content.value, - ownerTraqId: userStore.traqId}) + tags:[""]}) }).catch((e) => { $toast.error("something wrong", { duration: 1200, @@ -638,7 +635,7 @@ const Show = async() =>{

title

- +

contents

@@ -698,7 +695,7 @@ const Show = async() =>{ border-left: 3px solid lightgray; color: gray; } -input{ +.title{ border:1px solid lightgray; width: 90%; } diff --git a/src/components/WikiCard.vue b/src/components/WikiCard.vue index a0b3c7d..4c0204f 100644 --- a/src/components/WikiCard.vue +++ b/src/components/WikiCard.vue @@ -24,9 +24,9 @@ const SelectWiki = (wiki: Wiki) => { router.push("/memo/" + wiki.id.toString()); } }; -const TagClick = (tag: string) => { - router.push("/tag/" + tag); -}; +const TagClick = (tag :string) => { + router.push('/tag/' + tag.replace(/ /g, "+")) +} \ No newline at end of file diff --git a/src/pages/TagPage.vue b/src/pages/TagPage.vue index 79f2866..235ea00 100644 --- a/src/pages/TagPage.vue +++ b/src/pages/TagPage.vue @@ -1,3 +1,74 @@ + + \ No newline at end of file +

tag

+ + +
+ + \ No newline at end of file diff --git a/src/router.ts b/src/router.ts index 6810e07..c348e57 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1,5 +1,4 @@ import { createRouter, createWebHistory } from 'vue-router' -import MyWiki from './pages/MyWiki.vue' import NotFound from './pages/NotFound.vue' import CreateSodan from './pages/CreateSodan.vue' import IndividualSodan from './pages/IndividualSodan.vue' From 8907b436b5838965cacee0f744ded3d7d1d7051a Mon Sep 17 00:00:00 2001 From: kavos Date: Sun, 25 Aug 2024 16:07:15 +0900 Subject: [PATCH 03/11] fix sidebar --- docs/openapi.yaml | 2 +- src/App.vue | 14 ++++--- src/components/Header.vue | 50 +++++++++++------------- src/pages/Lectures.vue | 81 ++++++++++++++++++++------------------- src/style.css | 1 - src/styles/SideBar.css | 11 +++--- 6 files changed, 78 insertions(+), 81 deletions(-) diff --git a/docs/openapi.yaml b/docs/openapi.yaml index 024eb17..f96468b 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -417,7 +417,7 @@ components: example: Introduction to Computer Science content: type: string - example: マークダウン形式 資料へのリンク + example: 資料へのリンク(URL)のみ folderpath: type: string example: /School/ComputerScience diff --git a/src/App.vue b/src/App.vue index 827f3ba..bb6f6b0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,16 +3,18 @@ import Header from "./components/Header.vue"; \ No newline at end of file diff --git a/src/components/Header.vue b/src/components/Header.vue index 8efab5c..88f040e 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -1,48 +1,43 @@ + \ No newline at end of file diff --git a/src/pages/Lectures.vue b/src/pages/Lectures.vue index 6cef892..1923f80 100644 --- a/src/pages/Lectures.vue +++ b/src/pages/Lectures.vue @@ -30,38 +30,40 @@ onBeforeRouteUpdate(async (to, from) => {