2019-01-24 20:15:10 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
2018-12-05 16:39:03 +00:00
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
<template>
|
2019-02-15 13:19:17 +00:00
|
|
|
<div class="team-area">
|
2019-01-10 14:44:15 +00:00
|
|
|
<div class="team-header">
|
2018-12-05 16:39:03 +00:00
|
|
|
<HeaderArea/>
|
|
|
|
</div>
|
2019-01-10 14:44:15 +00:00
|
|
|
<div id="scrollable_team_container" v-if="projectMembers.length > 0" v-on:scroll="handleScroll" class="team-container">
|
2018-12-05 16:39:03 +00:00
|
|
|
<div class="team-container__content">
|
2018-12-26 15:05:33 +00:00
|
|
|
<div v-for="(member, index) in projectMembers" v-on:click="onMemberClick(member)" v-bind:key="index">
|
2018-12-12 16:19:20 +00:00
|
|
|
<TeamMemberItem
|
2018-12-26 15:05:33 +00:00
|
|
|
:projectMember = "member"
|
|
|
|
v-bind:class = "[member.isSelected ? 'selected' : '']"
|
2018-12-12 16:19:20 +00:00
|
|
|
/>
|
|
|
|
</div>
|
2018-12-05 16:39:03 +00:00
|
|
|
</div>
|
|
|
|
<!-- only when selecting team members -->
|
2018-12-12 16:19:20 +00:00
|
|
|
<div v-if="selectedProjectMembers.length > 0" >
|
|
|
|
<Footer/>
|
|
|
|
</div>
|
2018-12-05 16:39:03 +00:00
|
|
|
</div>
|
2019-02-15 13:19:17 +00:00
|
|
|
<div class="empty-search-result-area" v-if="projectMembers.length === 0">
|
|
|
|
<h1 class="empty-search-result-area__text">No results found</h1>
|
|
|
|
<div class="empty-search-result-area__image" v-html="emptyImage"></div>
|
|
|
|
</div>
|
2018-12-05 16:39:03 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { Component, Vue } from 'vue-property-decorator';
|
|
|
|
import TeamMemberItem from '@/components/team/TeamMemberItem.vue';
|
|
|
|
import HeaderArea from '@/components/team/headerArea/HeaderArea.vue';
|
|
|
|
import Footer from '@/components/team/footerArea/Footer.vue';
|
|
|
|
import { EMPTY_STATE_IMAGES } from '@/utils/constants/emptyStatesImages';
|
2019-01-10 14:44:15 +00:00
|
|
|
import { NOTIFICATION_ACTIONS, PM_ACTIONS } from '@/utils/constants/actionNames';
|
2018-12-05 16:39:03 +00:00
|
|
|
|
|
|
|
@Component({
|
2018-12-18 14:43:23 +00:00
|
|
|
data: function () {
|
|
|
|
return {
|
2019-01-10 14:44:15 +00:00
|
|
|
emptyImage: EMPTY_STATE_IMAGES.TEAM,
|
|
|
|
isFetchInProgress: false,
|
2018-12-18 14:43:23 +00:00
|
|
|
};
|
|
|
|
},
|
2018-12-12 16:19:20 +00:00
|
|
|
methods: {
|
2018-12-18 14:43:23 +00:00
|
|
|
onMemberClick: function (member: any) {
|
2019-01-09 15:40:21 +00:00
|
|
|
this.$store.dispatch(PM_ACTIONS.TOGGLE_SELECTION, member.user.id);
|
2019-01-10 14:44:15 +00:00
|
|
|
},
|
|
|
|
handleScroll: async function () {
|
|
|
|
const documentElement = document.getElementById('scrollable_team_container');
|
|
|
|
if (!documentElement) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const isAtBottom = documentElement.scrollTop + documentElement.clientHeight === documentElement.scrollHeight;
|
|
|
|
|
|
|
|
if (!isAtBottom || this.$data.isFetchInProgress) return;
|
|
|
|
|
|
|
|
this.$data.isFetchInProgress = true;
|
|
|
|
|
|
|
|
const response = await this.$store.dispatch(PM_ACTIONS.FETCH);
|
|
|
|
|
|
|
|
this.$data.isFetchInProgress = false;
|
|
|
|
|
|
|
|
if (response.isSuccess) return;
|
|
|
|
|
|
|
|
this.$store.dispatch(NOTIFICATION_ACTIONS.ERROR, 'Unable to fetch project members');
|
2018-12-18 14:43:23 +00:00
|
|
|
},
|
2018-12-12 16:19:20 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
projectMembers: function () {
|
|
|
|
return this.$store.getters.projectMembers;
|
2018-12-18 14:43:23 +00:00
|
|
|
},
|
2018-12-12 16:19:20 +00:00
|
|
|
selectedProjectMembers: function () {
|
|
|
|
return this.$store.getters.selectedProjectMembers;
|
2019-01-10 14:44:15 +00:00
|
|
|
},
|
2018-12-12 16:19:20 +00:00
|
|
|
},
|
2018-12-05 16:39:03 +00:00
|
|
|
components: {
|
|
|
|
TeamMemberItem,
|
|
|
|
HeaderArea,
|
|
|
|
Footer,
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2018-12-18 14:43:23 +00:00
|
|
|
export default class TeamArea extends Vue {
|
|
|
|
}
|
2018-12-05 16:39:03 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2019-02-15 13:19:17 +00:00
|
|
|
.team-area {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
2018-12-05 16:39:03 +00:00
|
|
|
.team-header {
|
|
|
|
position: fixed;
|
2019-01-10 14:44:15 +00:00
|
|
|
top: 100px;
|
2019-01-30 13:18:07 +00:00
|
|
|
padding: 55px 30px 0px 64px;
|
2018-12-05 16:39:03 +00:00
|
|
|
max-width: 79.7%;
|
|
|
|
width: 100%;
|
2019-01-30 13:18:07 +00:00
|
|
|
background-color: #F5F6FA;
|
2018-12-05 16:39:03 +00:00
|
|
|
z-index: 999;
|
|
|
|
}
|
|
|
|
.team-container {
|
|
|
|
padding: 0px 30px 55px 64px;
|
|
|
|
overflow-y: scroll;
|
|
|
|
max-height: 84vh;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
&__content {
|
|
|
|
display: grid;
|
2019-01-30 13:18:07 +00:00
|
|
|
grid-template-columns: 230px 230px 230px 230px 230px 230px;
|
2018-12-05 16:39:03 +00:00
|
|
|
width: 100%;
|
2019-01-30 13:18:07 +00:00
|
|
|
grid-column-gap: 20px;
|
2018-12-05 16:39:03 +00:00
|
|
|
grid-row-gap: 20px;
|
|
|
|
justify-content: space-between;
|
2019-01-30 13:18:07 +00:00
|
|
|
margin-top: 150px;
|
2018-12-05 16:39:03 +00:00
|
|
|
margin-bottom: 100px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-30 13:18:07 +00:00
|
|
|
.user-container {
|
|
|
|
height: 160px;
|
|
|
|
}
|
|
|
|
|
2019-02-15 13:19:17 +00:00
|
|
|
.empty-search-result-area {
|
|
|
|
height: 80vh;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
&__text {
|
|
|
|
font-family: 'montserrat_bold';
|
|
|
|
font-size: 32px;
|
|
|
|
line-height: 39px;
|
|
|
|
margin-top: 100px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__image {
|
|
|
|
margin-top: 40px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-05 16:39:03 +00:00
|
|
|
@media screen and (max-width: 1600px) {
|
|
|
|
.team-container {
|
|
|
|
|
|
|
|
&__content {
|
2019-01-30 13:18:07 +00:00
|
|
|
grid-template-columns: 220px 220px 220px 220px 220px;
|
2018-12-05 16:39:03 +00:00
|
|
|
}
|
2019-01-30 13:18:07 +00:00
|
|
|
}
|
|
|
|
|
2018-12-05 16:39:03 +00:00
|
|
|
.team-header {
|
2019-01-30 13:18:07 +00:00
|
|
|
max-width: 75%;
|
2018-12-05 16:39:03 +00:00
|
|
|
}
|
2019-01-30 13:18:07 +00:00
|
|
|
|
|
|
|
.user-container {
|
|
|
|
height: 160px;
|
|
|
|
}
|
2018-12-05 16:39:03 +00:00
|
|
|
}
|
|
|
|
|
2019-01-30 13:18:07 +00:00
|
|
|
@media screen and (max-width: 1366px) {
|
2018-12-05 16:39:03 +00:00
|
|
|
.team-container {
|
|
|
|
|
|
|
|
&__content {
|
2019-01-30 13:18:07 +00:00
|
|
|
grid-template-columns: 210px 210px 210px 210px;
|
2018-12-05 16:39:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.team-header {
|
2019-01-30 13:18:07 +00:00
|
|
|
max-width: 70.2%;
|
2018-12-05 16:39:03 +00:00
|
|
|
}
|
2019-01-30 13:18:07 +00:00
|
|
|
|
|
|
|
.user-container {
|
|
|
|
height: 160px;
|
|
|
|
}
|
2018-12-05 16:39:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (max-width: 1120px) {
|
|
|
|
.team-container {
|
|
|
|
|
2019-01-30 13:18:07 +00:00
|
|
|
&__content {
|
|
|
|
grid-template-columns: 200px 200px 200px 200px;
|
2018-12-05 16:39:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
.team-header {
|
|
|
|
max-width: 82.7%;
|
|
|
|
}
|
2019-01-30 13:18:07 +00:00
|
|
|
|
|
|
|
.user-container {
|
|
|
|
height: 150px;
|
|
|
|
}
|
2018-12-05 16:39:03 +00:00
|
|
|
}
|
|
|
|
</style>
|