diff --git a/.reuse/dep5 b/.reuse/dep5
index 688310d..3bf3a5c 100644
--- a/.reuse/dep5
+++ b/.reuse/dep5
@@ -11,7 +11,7 @@ Files: .browserslistrc .dockerignore .eslintrc.js .gitignore
Copyright: WTF Kooperative eG
License: AGPL-3.0-or-later
-Files: src/assets/img/wtf_logo*
+Files: src/assets/img/wtf*
Copyright: WTF Kooperative eG
License: LicenseRef-WTF
diff --git a/package-lock.json b/package-lock.json
index 5ce9315..24de910 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -15,6 +15,7 @@
"@vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"bootstrap": "^5.0.1",
+ "bootstrap-icons": "^1.5.0",
"core-js": "^3.6.5",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0",
@@ -2854,6 +2855,15 @@
"@popperjs/core": "^2.10.1"
}
},
+ "node_modules/bootstrap-icons": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.5.0.tgz",
+ "integrity": "sha512-44feMc7DE1Ccpsas/1wioN8ewFJNquvi5FewA06wLnqct7CwMdGDVy41ieHaacogzDqLfG8nADIvMNp9e4bfbA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz?cache=0&sync_timestamp=1614010713935&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbrace-expansion%2Fdownload%2Fbrace-expansion-1.1.11.tgz",
@@ -17155,6 +17165,12 @@
"dev": true,
"requires": {}
},
+ "bootstrap-icons": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/bootstrap-icons/-/bootstrap-icons-1.5.0.tgz",
+ "integrity": "sha512-44feMc7DE1Ccpsas/1wioN8ewFJNquvi5FewA06wLnqct7CwMdGDVy41ieHaacogzDqLfG8nADIvMNp9e4bfbA==",
+ "dev": true
+ },
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz?cache=0&sync_timestamp=1614010713935&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbrace-expansion%2Fdownload%2Fbrace-expansion-1.1.11.tgz",
diff --git a/package.json b/package.json
index 088c008..a476688 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,7 @@
"@vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"bootstrap": "^5.0.1",
+ "bootstrap-icons": "^1.5.0",
"core-js": "^3.6.5",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0",
diff --git a/public/img/bootstrap-icons-1.5.0/pencil.license b/public/img/bootstrap-icons-1.5.0/pencil.license
deleted file mode 100644
index 290774b..0000000
--- a/public/img/bootstrap-icons-1.5.0/pencil.license
+++ /dev/null
@@ -1 +0,0 @@
-SPDX-License-Identifier: MIT
\ No newline at end of file
diff --git a/public/img/bootstrap-icons-1.5.0/pencil.svg b/public/img/bootstrap-icons-1.5.0/pencil.svg
deleted file mode 100644
index f8dbfeb..0000000
--- a/public/img/bootstrap-icons-1.5.0/pencil.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/public/img/bootstrap-icons-1.5.0/plus-lg.svg b/public/img/bootstrap-icons-1.5.0/plus-lg.svg
deleted file mode 100644
index 1723f2f..0000000
--- a/public/img/bootstrap-icons-1.5.0/plus-lg.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/public/img/bootstrap-icons-1.5.0/plus-lg.svg.license b/public/img/bootstrap-icons-1.5.0/plus-lg.svg.license
deleted file mode 100644
index 290774b..0000000
--- a/public/img/bootstrap-icons-1.5.0/plus-lg.svg.license
+++ /dev/null
@@ -1 +0,0 @@
-SPDX-License-Identifier: MIT
\ No newline at end of file
diff --git a/public/img/bootstrap-icons-1.5.0/search.svg b/public/img/bootstrap-icons-1.5.0/search.svg
deleted file mode 100644
index d3dc7ca..0000000
--- a/public/img/bootstrap-icons-1.5.0/search.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/public/img/bootstrap-icons-1.5.0/search.svg.license b/public/img/bootstrap-icons-1.5.0/search.svg.license
deleted file mode 100644
index 290774b..0000000
--- a/public/img/bootstrap-icons-1.5.0/search.svg.license
+++ /dev/null
@@ -1 +0,0 @@
-SPDX-License-Identifier: MIT
\ No newline at end of file
diff --git a/public/img/bootstrap-icons-1.5.0/trash.svg b/public/img/bootstrap-icons-1.5.0/trash.svg
deleted file mode 100644
index 0ba7218..0000000
--- a/public/img/bootstrap-icons-1.5.0/trash.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
\ No newline at end of file
diff --git a/public/img/bootstrap-icons-1.5.0/trash.svg.license b/public/img/bootstrap-icons-1.5.0/trash.svg.license
deleted file mode 100644
index 290774b..0000000
--- a/public/img/bootstrap-icons-1.5.0/trash.svg.license
+++ /dev/null
@@ -1 +0,0 @@
-SPDX-License-Identifier: MIT
\ No newline at end of file
diff --git a/src/App.vue b/src/App.vue
index e221db0..477a9e1 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -12,8 +12,8 @@ SPDX-License-Identifier: AGPL-3.0-or-later
+
+
diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue
index c6b5c5f..e25c293 100644
--- a/src/components/Navbar.vue
+++ b/src/components/Navbar.vue
@@ -26,59 +26,59 @@ SPDX-License-Identifier: AGPL-3.0-or-later
-
+
-
Suche
+ >Suche
-
Mein Profil
+ >Mein Profil
-
Bearbeiten
-
- -
-
+ >Bearbeiten
-
+
diff --git a/src/components/ProfileList.vue b/src/components/ProfileList.vue
index 3aad96e..22366f9 100644
--- a/src/components/ProfileList.vue
+++ b/src/components/ProfileList.vue
@@ -82,10 +82,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
aria-label="Löschen"
@click="$emit('removeValue', value[type].name)"
>
-
+
diff --git a/src/components/SearchResult.vue b/src/components/SearchResult.vue
new file mode 100644
index 0000000..8f97e78
--- /dev/null
+++ b/src/components/SearchResult.vue
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+ {{ profile.nickname}}
+ ({{ profile.pronouns }})
+
+
+ Top-Fähigkeiten: {{ topSkills }}
+
+
+
+
+
+
+
+
diff --git a/src/components/Spinner.vue b/src/components/Spinner.vue
new file mode 100644
index 0000000..94b3d76
--- /dev/null
+++ b/src/components/Spinner.vue
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/src/main.js b/src/main.js
index 9cf7246..6c381ae 100644
--- a/src/main.js
+++ b/src/main.js
@@ -7,6 +7,7 @@ import App from './App.vue'
import router from './router'
import store from '@/store'
+import 'bootstrap-icons/font/bootstrap-icons.css'
import './assets/global.scss'
const app = createApp(App)
diff --git a/src/store.js b/src/store/index.js
similarity index 95%
rename from src/store.js
rename to src/store/index.js
index c6eaf60..c36f364 100644
--- a/src/store.js
+++ b/src/store/index.js
@@ -4,12 +4,17 @@
import { createStore } from 'vuex'
+import search from './search'
+
const localStorageKeys = {
currentUserId: 'ki_current_user_id',
token: 'ki_token',
}
export default createStore({
+ modules: {
+ search,
+ },
state() {
return {
currentUserId: JSON.parse(localStorage.getItem(localStorageKeys.currentUserId)),
diff --git a/src/store/search.js b/src/store/search.js
new file mode 100644
index 0000000..b383fef
--- /dev/null
+++ b/src/store/search.js
@@ -0,0 +1,100 @@
+// SPDX-FileCopyrightText: WTF Kooperative eG
+//
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+export default {
+ namespaced: true,
+ state() {
+ return {
+ searching: false,
+ showSpinner: false,
+ searched: false,
+ profiles: [],
+ error: false,
+ errorMessage: '',
+ query: {
+ search: ''
+ }
+ }
+ },
+ mutations: {
+ setSearching(state, searching) {
+ state.searching = searching
+ },
+ showSpinner(state) {
+ state.showSpinner = true
+ },
+ hideSpinner(state) {
+ state.showSpinner = false
+ },
+ clearProfiles(state) {
+ state.profiles = []
+ },
+ setProfiles(state, profiles) {
+ state.profiles = profiles
+ },
+ setError(state, error) {
+ state.error = error
+ },
+ setErrorMessage(state, errorMessage) {
+ state.errorMessage = errorMessage
+ },
+ setQuerySearch(state, search) {
+ state.query.search = search
+ }
+ },
+ actions: {
+ async search({state, commit, rootState}) {
+ if (state.searching) {
+ return
+ }
+
+ commit('setSearching', true)
+
+ const timeoutId = setTimeout(() => {
+ commit('showSpinner')
+ commit('clearProfiles')
+ }, 100)
+
+ commit('setError', false)
+ commit('setErrorMessage', '')
+
+ const url = new URL(`${window.ki.apiUrl}/users/profiles`)
+
+ if (state.query.search) {
+ url.searchParams.append('search', state.query.search)
+ }
+
+ const headers = {
+ Authorization: `Bearer ${rootState.token}`,
+ }
+
+ let response
+
+ try {
+ response = await fetch(url, {headers})
+ } catch {
+ commit('setError', true)
+ commit('clearProfiles')
+ commit('setSearching', false)
+ commit('hideSpinner')
+ return
+ }
+
+ clearTimeout(timeoutId)
+
+ if (!response.ok) {
+ commit('setError', true)
+ commit('clearProfiles')
+ commit('setSearching', false)
+ commit('hideSpinner')
+ return
+ }
+
+ const responseData = await response.json()
+ commit('setProfiles', responseData.profiles)
+ commit('setSearching', false)
+ commit('hideSpinner')
+ }
+ }
+}
diff --git a/src/views/Index.vue b/src/views/Index.vue
index 083bbbc..e3dd905 100644
--- a/src/views/Index.vue
+++ b/src/views/Index.vue
@@ -5,46 +5,51 @@ SPDX-License-Identifier: AGPL-3.0-or-later
-->
-
-
-
-
Kompetenzinventar
+
+
+
+
+
Kompetenzinventar
+
+
-
+