2025-08-03 21:56:45 +03:00
|
|
|
import UserCard from 'src/components/user_card/user_card.vue'
|
2020-05-10 06:46:06 +03:00
|
|
|
import Checkbox from 'src/components/checkbox/checkbox.vue'
|
2022-02-22 23:31:40 +02:00
|
|
|
import BooleanSetting from '../helpers/boolean_setting.vue'
|
|
|
|
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
2025-08-04 13:48:09 +03:00
|
|
|
import ProfileSettingIndicator from '../helpers/profile_setting_indicator.vue'
|
|
|
|
|
|
2020-10-20 21:18:23 +03:00
|
|
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
|
|
|
import {
|
2020-10-20 22:13:19 +03:00
|
|
|
faTimes,
|
2020-10-21 00:01:28 +03:00
|
|
|
faPlus,
|
|
|
|
|
faCircleNotch
|
2020-10-20 21:18:23 +03:00
|
|
|
} from '@fortawesome/free-solid-svg-icons'
|
|
|
|
|
|
|
|
|
|
library.add(
|
2020-10-20 22:13:19 +03:00
|
|
|
faTimes,
|
2020-10-21 00:01:28 +03:00
|
|
|
faPlus,
|
|
|
|
|
faCircleNotch
|
2020-10-20 21:18:23 +03:00
|
|
|
)
|
2020-05-03 17:36:12 +03:00
|
|
|
|
|
|
|
|
const ProfileTab = {
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
2025-08-05 17:08:33 +03:00
|
|
|
// Whether user is locked or not
|
2025-08-04 13:48:09 +03:00
|
|
|
locked: this.$store.state.users.currentUser.locked,
|
2020-05-03 17:36:12 +03:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
components: {
|
2025-08-03 21:56:45 +03:00
|
|
|
UserCard,
|
2022-02-22 23:31:40 +02:00
|
|
|
Checkbox,
|
2022-05-22 16:40:59 +00:00
|
|
|
BooleanSetting,
|
2025-08-05 17:08:33 +03:00
|
|
|
ProfileSettingIndicator
|
2020-05-03 17:36:12 +03:00
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
user () {
|
|
|
|
|
return this.$store.state.users.currentUser
|
|
|
|
|
},
|
2025-08-05 17:08:33 +03:00
|
|
|
...SharedComputedObject()
|
2020-05-03 17:36:12 +03:00
|
|
|
},
|
|
|
|
|
methods: {
|
2025-08-04 13:48:09 +03:00
|
|
|
updateProfile () {
|
|
|
|
|
const params = {
|
|
|
|
|
locked: this.locked
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$store.state.api.backendInteractor
|
|
|
|
|
.updateProfile({ params })
|
|
|
|
|
.then((user) => {
|
|
|
|
|
this.$store.commit('addNewUsers', [user])
|
|
|
|
|
this.$store.commit('setCurrentUser', user)
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
this.displayUploadError(error)
|
|
|
|
|
})
|
2020-05-03 17:36:12 +03:00
|
|
|
}
|
2025-08-04 13:48:09 +03:00
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
locked () {
|
|
|
|
|
this.updateProfile()
|
|
|
|
|
}
|
2020-05-03 17:36:12 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ProfileTab
|