Replace Vuetity components in account/home

pull/4615/head
Angel Fernando Quiroz Campos 3 years ago
parent 956fe873f6
commit d21370eabb
  1. 27
      assets/css/scss/atoms/_avatar.scss
  2. 1
      assets/css/scss/index.scss
  3. 94
      assets/vue/views/account/Home.vue
  4. 17
      tests/behat/features/profile.feature

@ -0,0 +1,27 @@
.p-avatar {
@apply rounded-md bg-gray-25;
&.p-avatar-lg {
@apply h-12 w-12;
font-size: 1.5rem;
.p-avatar-icon {
font-size: 1.5rem;
}
}
&.p-avatar-xl {
@apply h-16 w-16;
font-size: 2rem;
.p-avatar-icon {
font-size: 2rem;
}
}
}
.p-avatar-group {
.p-avatar {
@apply border border-solid border-white;
}
}

@ -13,6 +13,7 @@
@import "settings/typography";
@import "atoms/avatar";
@import "atoms/buttons";
@import "atoms/checkbox";
@import "atoms/dropdown";

@ -1,47 +1,55 @@
<template>
<v-card>
<q-item>
<q-item-section side>
<q-avatar size="64px">
<img :src="user.illustrationUrl + '?w=80&h=80&fit=crop'" />
</q-avatar>
</q-item-section>
<q-item-section>
<q-item-label>{{ user.fullName }}</q-item-label>
<q-item-label caption>{{ user.username }}</q-item-label>
</q-item-section>
</q-item>
<q-tabs align="left" dense inline-label no-caps>
<q-route-tab to="/resources/friends" label="My friends" />
<q-route-tab to="/resources/personal_files" label="My files" />
</q-tabs>
<a href="/account/edit" class="btn btn--primary">
Edit profile
</a>
</v-card>
<div id="account-home">
<div class="flex mb-4">
<Avatar
:image="user.illustrationUrl + '?w=80&h=80&fit=crop'"
shape="circle"
size="large"
class="flex-none mr-2"
/>
<div class="flex-1">
<p class="text-body-1">
{{ user.fullName }}
</p>
<p class="text-caption">
{{ user.username }}
</p>
</div>
</div>
<Button
class="p-button-sm mb-4"
label="Edit profile"
@click="btnEditProfileOnClick"
/>
<p>
<router-link to="/resources/friends">
{{ t('My friends') }}
</router-link>
</p>
<p>
<router-link to="/resources/personal_files">
{{ t('My files') }}
</router-link>
</p>
</div>
</template>
<script>
import { useRoute } from 'vue-router'
import axios from "axios";
import { ENTRYPOINT } from '../../config/entrypoint';
import {computed, reactive, ref, toRefs} from 'vue'
import {mapGetters, useStore} from "vuex";
export default {
name: 'Home',
components: {
},
setup() {
const state = reactive({user: []});
const store = useStore();
state.user = computed(() => store.getters['security/getUser']);
state.isAuthenticated = computed(() => store.getters['security/isAuthenticated']);
return toRefs(state);
},
};
<script setup>
import { computed } from 'vue';
import { useStore } from 'vuex';
import Avatar from 'primevue/avatar';
import { useI18n } from 'vue-i18n';
const store = useStore();
const { t } = useI18n();
const user = computed(() => store.getters['security/getUser']);
function btnEditProfileOnClick () {
window.location = '/account/edit';
}
</script>

@ -6,16 +6,17 @@ Feature: Profile page
Scenario: Change user first name with Andrew then restore to Andrea
Given I am on "/account/home"
Then I should see "Profile"
Then I follow "Edit profile"
Then I fill in the following:
And I press "Edit profile"
And I wait for the page to be loaded
And I fill in the following:
| profile_firstname | Andrew |
And I press "update_profile"
And wait for the page to be loaded
And I should see "Andrew Doe"
Then I follow "Edit profile"
Then I fill in the following:
And I wait for the page to be loaded
Then I should see "Andrew Doe"
And I press "Edit profile"
And I wait for the page to be loaded
And I fill in the following:
| profile_firstname | Andrea |
And I press "update_profile"
And wait for the page to be loaded
And I should see "Andrea Doe"
Then I should see "Andrea Doe"

Loading…
Cancel
Save