diff --git a/package-lock.json b/package-lock.json index 29b4b26..d366dc3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1157,6 +1157,14 @@ "@fortawesome/fontawesome-common-types": "^0.2.30" } }, + "@fortawesome/free-regular-svg-icons": { + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-5.14.0.tgz", + "integrity": "sha512-6LCFvjGSMPoUQbn3NVlgiG4CY5iIY8fOm+to/D6QS/GvdqhDt+xZklQeERdCvVRbnFa1ITc1rJHPRXqkX5wztQ==", + "requires": { + "@fortawesome/fontawesome-common-types": "^0.2.30" + } + }, "@fortawesome/free-solid-svg-icons": { "version": "5.14.0", "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.14.0.tgz", diff --git a/package.json b/package.json index 26e21fc..345a312 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.30", "@fortawesome/free-brands-svg-icons": "^5.14.0", + "@fortawesome/free-regular-svg-icons": "^5.14.0", "@fortawesome/free-solid-svg-icons": "^5.14.0", "@fortawesome/vue-fontawesome": "^0.1.10", "@vue/cli": "^4.4.6", diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 53a3b23..fa80bfa 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -5,12 +5,25 @@
- -

{{ profile.nickname }}

+

+ {{ profile.nickname }} +

- {{ profile.first_name }} {{ profile.last_name }}

-

{{ profile.email }}

+ {{ profile.first_name }} {{ profile.last_name }} + +

+ {{ profile.email }} +

+ +

+ +  {{ profile.external_user_id }}  + () +  {{ profile.id }}  + () +

 {{ profile.email }} @@ -26,28 +39,23 @@

- + + + - + -

- &f19b; -  {{ $t('external user') }} - -

-

-  {{ $t('internal user') }} -

@@ -89,8 +97,11 @@ diff --git a/src/main.ts b/src/main.ts index a5ef1a4..561de6e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,7 +11,7 @@ import VueLogger from 'vuejs-logger'; import VueSocketIOExt from 'vue-socket.io-extended'; import io from 'socket.io-client'; import i18n from '@/plugins/i18n'; -import { ValidationProvider } from 'vee-validate'; +import { ValidationObserver, ValidationProvider, extend, localize } from 'vee-validate'; // @ts-ignore import FlagIcon from 'vue-flag-icon'; // @ts-ignore @@ -34,6 +34,7 @@ import { faPencilAlt, faCogs, faAt, + faIdBadge, faUser, faEnvelope, faHome, @@ -57,6 +58,11 @@ import { import { faOpenid, } from '@fortawesome/free-brands-svg-icons'; + +import { + faDotCircle, +} from '@fortawesome/free-regular-svg-icons'; + import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'; @@ -71,7 +77,8 @@ Vue.prototype.$isProduction = isProduction; library.add(faCoffee, faTrash, faPencilAlt, faScroll, faCheck, faCircle, faList, faPlus, faDoorOpen, faCogs, faAt, faUser, faEnvelope, faUserTag, faExternalLinkAlt, faSync, faHome, faCode, faBarcode, faTag, faTags, faVideo, faLock, - faLockOpen, faArrowCircleLeft, faArrowCircleRight, faWrench, faPlay, faFrown, faSmile, faThumbsUp, faThumbsDown, faOpenid); + faLockOpen, faArrowCircleLeft, faArrowCircleRight, faWrench, faPlay, faFrown, faSmile, faThumbsUp, faThumbsDown, + faOpenid, faDotCircle, faIdBadge); Vue.component('font-awesome-icon', FontAwesomeIcon); @@ -92,9 +99,24 @@ Vue.use(BootstrapVue); Vue.use(FlagIcon); Vue.use(VueCookies); Vue.use(VueSweetalert2); -// Vue.use(VeeValidate); Vue.use(VueMoment); + +import en from 'vee-validate/dist/locale/en.json'; +import de from 'vee-validate/dist/locale/de.json'; +import es from 'vee-validate/dist/locale/es.json'; +import * as rules from 'vee-validate/dist/rules'; + +// install rules and localization +Object.keys(rules).forEach((rule) => { + // @ts-ignore + extend(rule, rules[rule]); +}); + +localize('de', de); + +// Install components globally +Vue.component('ValidationObserver', ValidationObserver); Vue.component('ValidationProvider', ValidationProvider); // const socket = io('ws://localhost:5000',{autoConnect: false, reconnectionAttempts: 3}); @@ -106,10 +128,6 @@ const socket = io('ws://localhost:5443', { Vue.use(VueSocketIOExt, socket); -// setup fake backend -// import { configureFakeBackend } from './helpers'; -// configureFakeBackend(); - Vue.config.productionTip = false; diff --git a/src/validation.js b/src/validation.js new file mode 100644 index 0000000..08ffcec --- /dev/null +++ b/src/validation.js @@ -0,0 +1,9 @@ +import { extend } from 'vee-validate'; +import { required, email } from 'vee-validate/dist/rules'; + +extend('positive', value => { + return value >= 0; +}); + +extend('email', email); +extend('required', required); diff --git a/tsconfig.json b/tsconfig.json index e7e7290..1f28376 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "importHelpers": true, "moduleResolution": "node", "experimentalDecorators": true, + "resolveJsonModule": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "sourceMap": true,