2019-01-24 20:15:10 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
2018-11-27 10:51:33 +00:00
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
2018-11-14 14:00:01 +00:00
|
|
|
<template>
|
2018-11-19 15:32:50 +00:00
|
|
|
<div class="account-area-container">
|
2019-01-02 13:20:51 +00:00
|
|
|
<div class="account-area-row-container__main">
|
|
|
|
<!--start of Account settings area -->
|
|
|
|
<div class="account-area-settings-container">
|
|
|
|
<div class="account-area-row-container">
|
|
|
|
<div class="account-area-settings-container__avatar">
|
|
|
|
<h1>{{avatarLetter}}</h1>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h1>Account Settings</h1>
|
|
|
|
<h2>This information will be visible to all users</h2>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-11-30 15:49:14 +00:00
|
|
|
<HeaderedInput
|
2019-01-02 13:20:51 +00:00
|
|
|
class="full-input"
|
2019-03-27 12:33:32 +00:00
|
|
|
label="Full name"
|
|
|
|
placeholder="Enter Full Name"
|
2018-11-23 15:48:11 +00:00
|
|
|
width="100%"
|
2019-03-27 12:33:32 +00:00
|
|
|
ref="fullNameInput"
|
|
|
|
:error="fullNameError"
|
|
|
|
:initValue="user.fullName"
|
|
|
|
@setData="setFullName" />
|
2018-11-30 15:49:14 +00:00
|
|
|
<HeaderedInput
|
2019-01-02 13:20:51 +00:00
|
|
|
class="full-input"
|
2019-03-27 12:33:32 +00:00
|
|
|
label="Short Name"
|
|
|
|
placeholder="Enter Short Name"
|
2018-11-23 15:48:11 +00:00
|
|
|
width="100%"
|
2019-03-27 12:33:32 +00:00
|
|
|
ref="shortNameInput"
|
|
|
|
:initValue="user.shortName"
|
|
|
|
@setData="setShortName"/>
|
2018-11-23 15:48:11 +00:00
|
|
|
<HeaderedInput
|
|
|
|
class="full-input"
|
|
|
|
label="Email"
|
2018-11-30 15:49:14 +00:00
|
|
|
placeholder ="Enter Email"
|
2018-11-23 15:48:11 +00:00
|
|
|
width="100%"
|
2018-11-30 15:49:14 +00:00
|
|
|
ref="emailInput"
|
|
|
|
:error="emailError"
|
2018-12-24 12:52:52 +00:00
|
|
|
:initValue="user.email"
|
2018-11-30 15:49:14 +00:00
|
|
|
@setData="setEmail" />
|
2019-01-02 13:20:51 +00:00
|
|
|
<div v-if="isAccountSettingsEditing" class="account-area-save-button-area" >
|
2019-01-30 13:18:07 +00:00
|
|
|
<div class="account-area-save-button-area__btn-active">
|
|
|
|
<Button class="account-area-save-button-area__cancel-button" label="Cancel" width="288px" height="56px" :onPress="cancelAccountSettings" isWhite/>
|
|
|
|
<Button class="account-area-save-button-area__save-button" label="Save" width="288px" height="56px" :onPress="onSaveAccountSettingsButtonClick"/>
|
2019-01-02 13:20:51 +00:00
|
|
|
</div>
|
2018-11-14 14:00:01 +00:00
|
|
|
</div>
|
2019-01-02 13:20:51 +00:00
|
|
|
<div v-if="!isAccountSettingsEditing" class="account-area-save-button-area" >
|
|
|
|
<div class="account-area-save-button-area__btn">
|
2019-01-30 13:18:07 +00:00
|
|
|
<Button class="account-area-save-button-area__save-button" label="Save" width="288px" height="56px" :onPress="onSaveAccountSettingsButtonClick" isDisabled />
|
2019-01-02 13:20:51 +00:00
|
|
|
</div>
|
2018-11-30 15:49:14 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-01-02 13:20:51 +00:00
|
|
|
<!--end of Account settings area -->
|
|
|
|
<!--start of Password area -->
|
|
|
|
<div class="account-area-password-container">
|
|
|
|
<div class="account-area-row-container">
|
|
|
|
<svg class="account-area-password-container__svg" width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
|
<path d="M30 60C46.5685 60 60 46.5685 60 30C60 13.4315 46.5685 0 30 0C13.4315 0 0 13.4315 0 30C0 46.5685 13.4315 60 30 60Z" fill="#2683FF"/>
|
|
|
|
<path d="M29.5001 34.5196C30.1001 34.5196 30.5865 34.0452 30.5865 33.46C30.5865 32.8748 30.1001 32.4004 29.5001 32.4004C28.9 32.4004 28.4136 32.8748 28.4136 33.46C28.4136 34.0452 28.9 34.5196 29.5001 34.5196Z" fill="#FEFEFF"/>
|
|
|
|
<path d="M39.9405 40.2152C40.1781 40 40.3139 39.6854 40.3139 39.3709V25.5464C40.3139 24.9007 39.7707 24.3709 39.1086 24.3709H35.7473V21.0927C35.7473 17.7318 32.9462 15 29.5 15C26.0538 15 23.2527 17.7318 23.2527 21.0927V24.3709H19.8914C19.2293 24.3709 18.686 24.9007 18.686 25.5464V39.3709C18.686 39.6854 18.8218 40 19.0595 40.2152L23.7959 44.6689C24.0166 44.8841 24.3222 45 24.6278 45H34.3552C34.6608 45 34.9664 44.8841 35.1871 44.6689L39.9405 40.2152ZM30.7053 36.6391V38.1291C30.7053 38.7748 30.1621 39.3046 29.5 39.3046C28.8379 39.3046 28.2947 38.7748 28.2947 38.1291V36.6391C26.9705 36.1589 26.0198 34.9172 26.0198 33.4437C26.0198 31.5728 27.5817 30.0497 29.5 30.0497C31.4183 30.0497 32.9801 31.5728 32.9801 33.4437C32.9801 34.9172 32.0295 36.1589 30.7053 36.6391ZM33.3367 24.3709H25.6464V21.0927C25.6464 19.0232 27.3779 17.351 29.483 17.351C31.5881 17.351 33.3197 19.0397 33.3197 21.0927V24.3709H33.3367Z" fill="#FEFEFF"/>
|
|
|
|
<defs>
|
|
|
|
<clipPath id="clip0">
|
|
|
|
<rect width="21.6279" height="30" fill="#FFFFFF" transform="translate(18.686 15)"/>
|
|
|
|
</clipPath>
|
|
|
|
</defs>
|
|
|
|
</svg>
|
|
|
|
<div>
|
|
|
|
<h1>Change Password</h1>
|
|
|
|
<h2>6 or more characters, at least 1 letter and number.</h2>
|
|
|
|
</div>
|
2018-11-23 15:48:11 +00:00
|
|
|
</div>
|
2019-01-02 13:20:51 +00:00
|
|
|
<HeaderlessInput
|
|
|
|
class="full-input"
|
2018-11-30 15:49:14 +00:00
|
|
|
label="Old Password"
|
|
|
|
placeholder ="Enter Old Password"
|
2018-11-23 15:48:11 +00:00
|
|
|
width="100%"
|
2018-11-14 14:00:01 +00:00
|
|
|
isPassword
|
2018-11-30 15:49:14 +00:00
|
|
|
ref="oldPasswordInput"
|
|
|
|
:error="oldPasswordError"
|
|
|
|
@setData="setOldPassword" />
|
2019-01-02 13:20:51 +00:00
|
|
|
<HeaderlessInput
|
|
|
|
class="full-input mt"
|
2018-11-30 15:49:14 +00:00
|
|
|
label="New Password"
|
|
|
|
placeholder ="Enter New Password"
|
2018-11-23 15:48:11 +00:00
|
|
|
width="100%"
|
2018-11-30 15:49:14 +00:00
|
|
|
ref="newPasswordInput"
|
2018-11-14 14:00:01 +00:00
|
|
|
isPassword
|
2018-11-30 15:49:14 +00:00
|
|
|
:error="newPasswordError"
|
|
|
|
@setData="setNewPassword" />
|
2019-01-02 13:20:51 +00:00
|
|
|
<HeaderlessInput
|
|
|
|
class="full-input mt"
|
2018-11-30 15:49:14 +00:00
|
|
|
label="Confirm password"
|
2019-01-02 13:20:51 +00:00
|
|
|
placeholder="Confirm password"
|
2018-11-23 15:48:11 +00:00
|
|
|
width="100%"
|
2019-01-03 15:05:22 +00:00
|
|
|
ref="confirmPasswordInput"
|
2018-11-14 14:00:01 +00:00
|
|
|
isPassword
|
2018-11-30 15:49:14 +00:00
|
|
|
:error="confirmationPasswordError"
|
|
|
|
@setData="setPasswordConfirmation" />
|
2019-01-30 13:18:07 +00:00
|
|
|
<div v-if="isPasswordEditing" class="account-area-save-button-area active" >
|
|
|
|
<div class="account-area-save-button-area__btn-active">
|
|
|
|
<Button class="account-area-save-button-area__cancel-button" label="Cancel" width="288px" height="56px" :onPress="onCancelPasswordEditButtonClick" isWhite/>
|
|
|
|
<Button class="account-area-save-button-area__save-button" label="Save" width="288px" height="56px" :onPress="onSavePasswordButtonClick"/>
|
2019-01-02 13:20:51 +00:00
|
|
|
</div>
|
2018-11-30 15:49:14 +00:00
|
|
|
</div>
|
2019-01-02 13:20:51 +00:00
|
|
|
<div v-if="!isPasswordEditing" class="account-area-save-button-area" >
|
|
|
|
<div class="account-area-save-button-area__btn">
|
2019-01-30 13:18:07 +00:00
|
|
|
<Button class="account-area-save-button-area__save-button" label="Save" width="288px" height="56px" isDisabled/>
|
2019-01-02 13:20:51 +00:00
|
|
|
</div>
|
2018-11-28 16:20:23 +00:00
|
|
|
</div>
|
2018-11-14 14:00:01 +00:00
|
|
|
</div>
|
2019-01-02 13:20:51 +00:00
|
|
|
<!--end of Password area -->
|
2018-11-14 14:00:01 +00:00
|
|
|
</div>
|
2019-01-09 15:40:21 +00:00
|
|
|
<div class="account-area-button-area" id="deleteAccountPopupButton">
|
2019-01-30 13:18:07 +00:00
|
|
|
<Button class="account-area-save-button-area__delete-button" label="Delete account" width="210px" height="56px" :onPress="togglePopup" isDeletion/>
|
2018-11-14 14:00:01 +00:00
|
|
|
</div>
|
2019-01-09 15:40:21 +00:00
|
|
|
<DeleteAccountPopup v-if="isPopupShown" />
|
2018-11-14 14:00:01 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
|
|
|
import Button from '@/components/common/Button.vue';
|
|
|
|
import HeaderedInput from '@/components/common/HeaderedInput.vue';
|
2019-01-02 13:20:51 +00:00
|
|
|
import HeaderlessInput from '@/components/common/HeaderlessInput.vue';
|
2018-11-14 14:00:01 +00:00
|
|
|
import Checkbox from '@/components/common/Checkbox.vue';
|
2019-01-09 15:40:21 +00:00
|
|
|
import { USER_ACTIONS, NOTIFICATION_ACTIONS, APP_STATE_ACTIONS } from '@/utils/constants/actionNames';
|
|
|
|
import DeleteAccountPopup from '@/components/account/DeleteAccountPopup.vue';
|
2019-01-02 13:20:51 +00:00
|
|
|
import { validateEmail, validatePassword } from '@/utils/validation';
|
2018-11-14 14:00:01 +00:00
|
|
|
|
|
|
|
@Component(
|
2018-11-30 15:49:14 +00:00
|
|
|
{
|
2018-12-18 14:43:23 +00:00
|
|
|
data: function () {
|
2018-11-14 14:00:01 +00:00
|
|
|
return {
|
2019-03-27 12:33:32 +00:00
|
|
|
originalFullName: this.$store.getters.user.fullName,
|
|
|
|
originalShortName: this.$store.getters.user.shortName,
|
2018-12-18 14:43:23 +00:00
|
|
|
originalEmail: this.$store.getters.user.email,
|
2018-11-30 15:49:14 +00:00
|
|
|
|
2019-03-27 12:33:32 +00:00
|
|
|
fullName: this.$store.getters.user.fullName,
|
|
|
|
shortName: this.$store.getters.user.shortName,
|
2018-11-30 15:49:14 +00:00
|
|
|
email: this.$store.getters.user.email,
|
|
|
|
|
2019-03-27 12:33:32 +00:00
|
|
|
fullNameError: '',
|
2018-12-18 14:43:23 +00:00
|
|
|
emailError: '',
|
2018-11-30 15:49:14 +00:00
|
|
|
|
|
|
|
isAccountSettingsEditing: false,
|
|
|
|
|
2018-12-18 14:43:23 +00:00
|
|
|
oldPassword: '',
|
|
|
|
newPassword: '',
|
|
|
|
confirmationPassword: '',
|
2018-11-30 15:49:14 +00:00
|
|
|
|
2018-12-18 14:43:23 +00:00
|
|
|
oldPasswordError: '',
|
|
|
|
newPasswordError: '',
|
|
|
|
confirmationPasswordError: '',
|
2018-12-20 16:44:42 +00:00
|
|
|
isPasswordEditing: false,
|
2018-12-18 14:43:23 +00:00
|
|
|
};
|
2018-11-30 15:49:14 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2019-03-27 12:33:32 +00:00
|
|
|
setFullName: function (value: string) {
|
|
|
|
this.$data.fullName = value;
|
|
|
|
this.$data.fullNameError = '';
|
2018-11-30 15:49:14 +00:00
|
|
|
this.$data.isAccountSettingsEditing = true;
|
|
|
|
},
|
2019-03-27 12:33:32 +00:00
|
|
|
setShortName: function (value: string) {
|
|
|
|
this.$data.shortName = value;
|
2018-11-30 15:49:14 +00:00
|
|
|
this.$data.isAccountSettingsEditing = true;
|
|
|
|
},
|
|
|
|
setEmail: function (value: string) {
|
|
|
|
this.$data.email = value;
|
2018-12-18 14:43:23 +00:00
|
|
|
this.$data.emailError = '';
|
2018-11-30 15:49:14 +00:00
|
|
|
this.$data.isAccountSettingsEditing = true;
|
|
|
|
},
|
2019-01-03 15:05:22 +00:00
|
|
|
cancelAccountSettings: function () {
|
2019-03-27 12:33:32 +00:00
|
|
|
this.$data.fullName = this.$data.originalFullName;
|
|
|
|
this.$data.fullNameError = '';
|
|
|
|
this.$data.shortName = this.$data.originalShortName;
|
2018-11-30 15:49:14 +00:00
|
|
|
this.$data.email = this.$data.originalEmail;
|
2018-12-18 14:43:23 +00:00
|
|
|
this.$data.emailError = '';
|
2018-11-30 15:49:14 +00:00
|
|
|
|
2019-03-27 12:33:32 +00:00
|
|
|
let fullNameInput: any = this.$refs['fullNameInput'];
|
|
|
|
fullNameInput.setValue(this.$data.originalFullName);
|
2019-01-03 15:05:22 +00:00
|
|
|
|
2019-03-27 12:33:32 +00:00
|
|
|
let shortNameInput: any = this.$refs['shortNameInput'];
|
|
|
|
shortNameInput.setValue(this.$data.originalShortName);
|
2019-01-03 15:05:22 +00:00
|
|
|
|
|
|
|
let emailInput: any = this.$refs['emailInput'];
|
|
|
|
emailInput.setValue(this.$data.originalEmail);
|
2018-11-14 14:00:01 +00:00
|
|
|
|
2018-11-30 15:49:14 +00:00
|
|
|
this.$data.isAccountSettingsEditing = false;
|
|
|
|
},
|
|
|
|
onSaveAccountSettingsButtonClick: async function () {
|
|
|
|
let hasError = false;
|
|
|
|
|
2019-03-27 12:33:32 +00:00
|
|
|
if (!this.$data.fullName) {
|
|
|
|
this.$data.fullNameError = 'Full name expected';
|
2018-11-30 15:49:14 +00:00
|
|
|
hasError = true;
|
|
|
|
}
|
|
|
|
|
2019-01-02 13:20:51 +00:00
|
|
|
if (!validateEmail(this.$data.email)) {
|
|
|
|
this.$data.emailError = 'Incorrect email';
|
2018-11-30 15:49:14 +00:00
|
|
|
hasError = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasError) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
let user = {
|
|
|
|
email: this.$data.email,
|
2019-03-27 12:33:32 +00:00
|
|
|
fullName: this.$data.fullName,
|
|
|
|
shortName: this.$data.shortName,
|
2018-11-30 15:49:14 +00:00
|
|
|
};
|
2018-12-24 12:52:52 +00:00
|
|
|
|
2019-01-09 15:40:21 +00:00
|
|
|
let response = await this.$store.dispatch(USER_ACTIONS.UPDATE, user);
|
2018-12-24 12:52:52 +00:00
|
|
|
if (!response.isSuccess) {
|
2019-01-09 15:40:21 +00:00
|
|
|
this.$store.dispatch(NOTIFICATION_ACTIONS.ERROR, response.errorMessage);
|
2018-11-30 15:49:14 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2018-12-24 12:52:52 +00:00
|
|
|
|
2019-01-09 15:40:21 +00:00
|
|
|
this.$store.dispatch(NOTIFICATION_ACTIONS.SUCCESS, 'Account info successfully updated!');
|
2018-12-24 12:52:52 +00:00
|
|
|
|
2019-03-27 12:33:32 +00:00
|
|
|
this.$data.originalFullName = this.$store.getters.user.fullName;
|
|
|
|
this.$data.originalShortName = this.$store.getters.user.shortName;
|
2019-01-03 15:05:22 +00:00
|
|
|
this.$data.originalEmail = this.$store.getters.user.email;
|
|
|
|
|
2018-11-30 15:49:14 +00:00
|
|
|
this.$data.isAccountSettingsEditing = false;
|
|
|
|
},
|
|
|
|
|
|
|
|
setOldPassword: function (value: string) {
|
|
|
|
this.$data.oldPassword = value;
|
2018-12-18 14:43:23 +00:00
|
|
|
this.$data.oldPasswordError = '';
|
2018-11-30 15:49:14 +00:00
|
|
|
this.$data.isPasswordEditing = true;
|
|
|
|
},
|
|
|
|
setNewPassword: function (value: string) {
|
|
|
|
this.$data.newPassword = value;
|
2018-12-18 14:43:23 +00:00
|
|
|
this.$data.newPasswordError = '';
|
2018-11-30 15:49:14 +00:00
|
|
|
this.$data.isPasswordEditing = true;
|
|
|
|
},
|
|
|
|
setPasswordConfirmation: function (value: string) {
|
|
|
|
this.$data.confirmationPassword = value;
|
2018-12-18 14:43:23 +00:00
|
|
|
this.$data.confirmationPasswordError = '';
|
2018-11-30 15:49:14 +00:00
|
|
|
this.$data.isPasswordEditing = true;
|
|
|
|
},
|
|
|
|
onCancelPasswordEditButtonClick: function () {
|
2018-12-18 14:43:23 +00:00
|
|
|
this.$data.oldPassword = '';
|
|
|
|
this.$data.newPassword = '';
|
|
|
|
this.$data.confirmationPassword = '';
|
2018-11-30 15:49:14 +00:00
|
|
|
|
2018-12-18 14:43:23 +00:00
|
|
|
this.$data.oldPasswordError = '';
|
|
|
|
this.$data.newPasswordError = '';
|
|
|
|
this.$data.confirmationPasswordError = '';
|
2018-11-30 15:49:14 +00:00
|
|
|
|
2019-01-03 15:05:22 +00:00
|
|
|
let oldPasswordInput: any = this.$refs['oldPasswordInput'];
|
|
|
|
oldPasswordInput.setValue('');
|
|
|
|
|
|
|
|
let newPasswordInput: any = this.$refs['newPasswordInput'];
|
|
|
|
newPasswordInput.setValue('');
|
|
|
|
|
|
|
|
let confirmPasswordInput: any = this.$refs['confirmPasswordInput'];
|
|
|
|
confirmPasswordInput.setValue('');
|
2018-11-30 15:49:14 +00:00
|
|
|
|
|
|
|
this.$data.isPasswordEditing = false;
|
|
|
|
},
|
|
|
|
onSavePasswordButtonClick: async function () {
|
|
|
|
let hasError = false;
|
|
|
|
|
|
|
|
if (!this.$data.oldPassword) {
|
2018-12-18 14:43:23 +00:00
|
|
|
this.$data.oldPasswordError = 'Password required';
|
2018-11-30 15:49:14 +00:00
|
|
|
hasError = true;
|
|
|
|
}
|
|
|
|
|
2019-01-02 13:20:51 +00:00
|
|
|
if (!validatePassword(this.$data.newPassword)) {
|
|
|
|
this.$data.newPasswordError = 'Invalid password';
|
2018-11-30 15:49:14 +00:00
|
|
|
hasError = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.$data.confirmationPassword) {
|
2018-12-18 14:43:23 +00:00
|
|
|
this.$data.confirmationPasswordError = 'Password required';
|
2018-11-30 15:49:14 +00:00
|
|
|
hasError = true;
|
|
|
|
}
|
|
|
|
|
2018-12-18 14:43:23 +00:00
|
|
|
if (this.$data.newPassword !== this.$data.confirmationPassword) {
|
|
|
|
this.$data.confirmationPasswordError = 'Password not match to new one';
|
2018-11-30 15:49:14 +00:00
|
|
|
hasError = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasError) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-01-09 15:40:21 +00:00
|
|
|
let response = await this.$store.dispatch(USER_ACTIONS.CHANGE_PASSWORD,
|
2018-12-24 12:52:52 +00:00
|
|
|
{
|
|
|
|
oldPassword: this.$data.oldPassword,
|
|
|
|
newPassword: this.$data.newPassword
|
|
|
|
}
|
|
|
|
);
|
|
|
|
if (!response.isSuccess) {
|
2019-01-09 15:40:21 +00:00
|
|
|
this.$store.dispatch(NOTIFICATION_ACTIONS.ERROR, response.errorMessage);
|
2018-11-30 15:49:14 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-01-09 15:40:21 +00:00
|
|
|
this.$store.dispatch(NOTIFICATION_ACTIONS.SUCCESS, 'Password successfully changed!');
|
2019-01-03 15:05:22 +00:00
|
|
|
|
|
|
|
this.$data.oldPassword = '';
|
|
|
|
this.$data.newPassword = '';
|
|
|
|
this.$data.confirmationPassword = '';
|
|
|
|
|
|
|
|
this.$data.oldPasswordError = '';
|
|
|
|
this.$data.newPasswordError = '';
|
|
|
|
this.$data.confirmationPasswordError = '';
|
|
|
|
|
|
|
|
let oldPasswordInput: any = this.$refs['oldPasswordInput'];
|
|
|
|
oldPasswordInput.setValue('');
|
|
|
|
|
|
|
|
let newPasswordInput: any = this.$refs['newPasswordInput'];
|
|
|
|
newPasswordInput.setValue('');
|
|
|
|
|
|
|
|
let confirmPasswordInput: any = this.$refs['confirmPasswordInput'];
|
|
|
|
confirmPasswordInput.setValue('');
|
2018-11-30 15:49:14 +00:00
|
|
|
|
|
|
|
this.$data.isPasswordEditing = false;
|
|
|
|
},
|
2018-12-20 16:44:42 +00:00
|
|
|
togglePopup: function(): void {
|
2019-01-09 15:40:21 +00:00
|
|
|
this.$store.dispatch(APP_STATE_ACTIONS.TOGGLE_DEL_ACCOUNT);
|
2018-12-20 16:44:42 +00:00
|
|
|
},
|
2018-11-14 14:00:01 +00:00
|
|
|
},
|
2018-12-24 12:52:52 +00:00
|
|
|
computed: {
|
|
|
|
user: function() {
|
|
|
|
return {
|
2019-03-27 12:33:32 +00:00
|
|
|
fullName: this.$store.getters.user.fullName,
|
|
|
|
shortName: this.$store.getters.user.shortName,
|
2018-12-24 12:52:52 +00:00
|
|
|
email: this.$store.getters.user.email,
|
|
|
|
};
|
2019-01-02 13:20:51 +00:00
|
|
|
},
|
|
|
|
// May change later
|
|
|
|
avatarLetter: function (): string {
|
|
|
|
return this.$store.getters.userName.slice(0, 1).toUpperCase();
|
|
|
|
},
|
2019-01-09 15:40:21 +00:00
|
|
|
isPopupShown: function (): boolean {
|
|
|
|
return this.$store.state.appStateModule.appState.isDeleteAccountPopupShown;
|
|
|
|
}
|
2018-12-24 12:52:52 +00:00
|
|
|
},
|
2018-11-14 14:00:01 +00:00
|
|
|
components: {
|
|
|
|
Button,
|
|
|
|
HeaderedInput,
|
2019-01-02 13:20:51 +00:00
|
|
|
HeaderlessInput,
|
2018-12-20 16:44:42 +00:00
|
|
|
Checkbox,
|
2019-01-02 13:20:51 +00:00
|
|
|
DeleteAccountPopup,
|
2018-11-30 15:49:14 +00:00
|
|
|
},
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2018-12-18 14:43:23 +00:00
|
|
|
export default class AccountArea extends Vue {
|
|
|
|
}
|
2018-11-30 15:49:14 +00:00
|
|
|
|
2018-11-14 14:00:01 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2018-11-19 15:32:50 +00:00
|
|
|
.account-area-container {
|
2018-11-14 14:00:01 +00:00
|
|
|
padding: 55px 55px 55px 55px;
|
|
|
|
position: relative;
|
2019-01-02 13:20:51 +00:00
|
|
|
|
2018-11-14 14:00:01 +00:00
|
|
|
h1 {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_bold';
|
2018-11-14 14:00:01 +00:00
|
|
|
font-size: 18px;
|
|
|
|
line-height: 27px;
|
|
|
|
color: #354049;
|
2019-01-02 13:20:51 +00:00
|
|
|
margin-block-start: 0.2em;
|
|
|
|
margin-block-end: 0.2em;
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
|
|
|
h2 {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_regular';
|
2018-11-14 14:00:01 +00:00
|
|
|
font-size: 16px;
|
|
|
|
line-height: 21px;
|
|
|
|
color: rgba(56, 75, 101, 0.4);
|
2019-01-02 13:20:51 +00:00
|
|
|
margin-block-start: 0.17em;
|
|
|
|
margin-block-end: 0.17em;
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
|
|
|
}
|
2019-01-02 13:20:51 +00:00
|
|
|
.input-container.full-input,
|
|
|
|
.input-wrap.full-input {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
.mt {
|
|
|
|
margin-top: 15px;
|
|
|
|
}
|
2018-11-19 15:32:50 +00:00
|
|
|
.account-area-settings-container {
|
2019-01-30 13:18:07 +00:00
|
|
|
max-width: 680px;
|
2019-01-02 13:20:51 +00:00
|
|
|
width: 100%;
|
2018-11-14 14:00:01 +00:00
|
|
|
border-radius: 6px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: flex-start;
|
2018-11-23 15:48:11 +00:00
|
|
|
padding: 32px;
|
2018-11-14 14:00:01 +00:00
|
|
|
background-color: #fff;
|
2019-01-02 13:20:51 +00:00
|
|
|
|
|
|
|
&__avatar {
|
|
|
|
width: 60px;
|
|
|
|
height: 60px;
|
|
|
|
border-radius: 6px;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2019-01-30 13:18:07 +00:00
|
|
|
background: #E8EAF2;
|
2019-01-02 13:20:51 +00:00
|
|
|
margin-right: 20px;
|
|
|
|
|
|
|
|
h1 {
|
2019-03-26 16:38:35 +00:00
|
|
|
font-family: 'font_medium';
|
2019-01-02 13:20:51 +00:00
|
|
|
font-size: 16px;
|
|
|
|
line-height: 23px;
|
|
|
|
color: #354049;
|
|
|
|
}
|
|
|
|
}
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
2018-11-19 15:32:50 +00:00
|
|
|
.account-area-password-container {
|
2019-01-30 13:18:07 +00:00
|
|
|
max-width: 680px;
|
2019-01-02 13:20:51 +00:00
|
|
|
width: 100%;
|
|
|
|
border-radius: 6px;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: flex-start;
|
|
|
|
padding: 32px;
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
|
|
&__svg {
|
|
|
|
margin-right: 20px;
|
|
|
|
}
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
2018-11-19 15:32:50 +00:00
|
|
|
.account-area-button-area {
|
2018-11-23 15:48:11 +00:00
|
|
|
margin-top: 40px;
|
|
|
|
height: 130px;
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
2019-01-02 13:20:51 +00:00
|
|
|
.account-area-row-container__main {
|
2018-11-14 14:00:01 +00:00
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
2018-11-23 15:48:11 +00:00
|
|
|
align-content: center;
|
2018-11-14 14:00:01 +00:00
|
|
|
justify-content: space-between;
|
2019-01-02 13:20:51 +00:00
|
|
|
flex-wrap: wrap;
|
|
|
|
}
|
|
|
|
.account-area-row-container {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-content: center;
|
|
|
|
justify-content: flex-start;
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
2018-11-19 15:32:50 +00:00
|
|
|
.account-area-save-button-area {
|
2018-11-23 15:48:11 +00:00
|
|
|
margin-top: 40px;
|
2018-11-14 14:00:01 +00:00
|
|
|
width: 100%;
|
|
|
|
align-self: flex-end;
|
2018-11-23 15:48:11 +00:00
|
|
|
align-items: center;
|
2018-11-14 14:00:01 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: flex-end;
|
2018-11-19 15:32:50 +00:00
|
|
|
|
2018-11-14 14:00:01 +00:00
|
|
|
Button {
|
|
|
|
align-self: center;
|
|
|
|
}
|
2018-11-19 15:32:50 +00:00
|
|
|
|
2018-11-23 15:48:11 +00:00
|
|
|
&__btn {
|
2019-01-30 13:18:07 +00:00
|
|
|
width: 100%;
|
2018-11-23 15:48:11 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2019-01-02 13:20:51 +00:00
|
|
|
justify-content: flex-end;
|
2018-11-23 15:48:11 +00:00
|
|
|
|
2019-01-30 13:18:07 +00:00
|
|
|
&-active {
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
2019-01-02 13:20:51 +00:00
|
|
|
}
|
|
|
|
}
|
2019-01-30 13:18:07 +00:00
|
|
|
|
|
|
|
@media screen and (max-width: 1831px) {
|
2019-01-02 13:20:51 +00:00
|
|
|
.account-area-settings-container,
|
|
|
|
.account-area-password-container {
|
2019-01-30 13:18:07 +00:00
|
|
|
max-width: 530px;
|
|
|
|
width: 530px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.account-area-save-button-area__cancel-button,
|
|
|
|
.account-area-save-button-area__save-button {
|
|
|
|
width: 240px !important;
|
|
|
|
}
|
|
|
|
.account-area-save-button-area__delete-button {
|
|
|
|
width: 160px !important;
|
2019-01-02 13:20:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@media screen and (max-width: 1520px) {
|
|
|
|
.account-area-save-button-area__cancel-button {
|
|
|
|
margin-right: 0;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
}
|
|
|
|
.account-area-save-button-area {
|
2018-11-19 15:32:50 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2019-01-02 13:20:51 +00:00
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
.account-area-button-area {
|
|
|
|
margin-bottom: 100px;
|
|
|
|
}
|
|
|
|
.account-area-save-button-area__btn {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
}
|
|
|
|
.account-area-container {
|
|
|
|
overflow-y: scroll;
|
|
|
|
height: 800px;
|
|
|
|
}
|
|
|
|
.account-area-settings-container,
|
|
|
|
.account-area-password-container {
|
2019-01-30 13:18:07 +00:00
|
|
|
max-width: 450px;
|
|
|
|
width: 450px;
|
2019-01-02 13:20:51 +00:00
|
|
|
margin-bottom: 30px;
|
|
|
|
justify-content: flex-start;
|
|
|
|
}
|
|
|
|
}
|
2019-01-30 13:18:07 +00:00
|
|
|
@media screen and (max-width: 1520px) {
|
2019-01-02 13:20:51 +00:00
|
|
|
.account-area-settings-container,
|
|
|
|
.account-area-password-container {
|
2019-01-30 13:18:07 +00:00
|
|
|
max-width: 450px;
|
|
|
|
width: 450px;
|
|
|
|
margin-bottom: 30px;
|
|
|
|
justify-content: flex-start;
|
|
|
|
}
|
|
|
|
.account-area-save-button-area__cancel-button,
|
|
|
|
.account-area-save-button-area__save-button {
|
|
|
|
width: 205px !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@media screen and (max-width: 1330px) {
|
|
|
|
.account-area-save-button-area__cancel-button {
|
|
|
|
margin-right: 0;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
}
|
|
|
|
.account-area-save-button-area {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
.account-area-button-area {
|
|
|
|
margin-bottom: 100px;
|
2019-01-02 13:20:51 +00:00
|
|
|
}
|
|
|
|
.account-area-save-button-area__btn {
|
2019-01-30 13:18:07 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2019-01-02 13:20:51 +00:00
|
|
|
width: 100%;
|
|
|
|
justify-content: flex-end;
|
2019-01-30 13:18:07 +00:00
|
|
|
flex-wrap: wrap;
|
|
|
|
}
|
|
|
|
.account-area-container {
|
|
|
|
overflow-y: scroll;
|
|
|
|
height: 800px;
|
|
|
|
}
|
|
|
|
.account-area-settings-container,
|
|
|
|
.account-area-password-container {
|
|
|
|
max-width: 800px;
|
|
|
|
width: 800px;
|
2018-11-19 15:32:50 +00:00
|
|
|
}
|
|
|
|
|
2019-01-02 13:20:51 +00:00
|
|
|
.account-area-save-button-area__cancel-button {
|
|
|
|
margin-bottom: 0px;
|
2018-11-23 15:48:11 +00:00
|
|
|
margin-right: 20px;
|
|
|
|
}
|
2019-01-30 13:18:07 +00:00
|
|
|
.account-area-save-button-area__cancel-button,
|
|
|
|
.account-area-save-button-area__save-button {
|
|
|
|
width: 300px !important;
|
|
|
|
}
|
2018-11-23 15:48:11 +00:00
|
|
|
}
|
|
|
|
@media screen and (max-width: 1020px) {
|
|
|
|
.account-area-save-button-area {
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
&__btn{
|
|
|
|
width: 100%;
|
|
|
|
justify-content: center;
|
|
|
|
margin-top: 40px;
|
|
|
|
}
|
2018-11-19 15:32:50 +00:00
|
|
|
}
|
2018-11-14 14:00:01 +00:00
|
|
|
}
|
|
|
|
</style>
|