Skip to content

Commit

Permalink
Change album page source select position
Browse files Browse the repository at this point in the history
  • Loading branch information
staniel359 committed Jun 30, 2021
1 parent 304d46c commit 6362abd
Show file tree
Hide file tree
Showing 16 changed files with 85 additions and 113 deletions.
1 change: 0 additions & 1 deletion src/assets/styles/Shared.sass
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ $mainModalHeight: 80vh
$imageModalHeight: 90vh
$imageModalThumbHeight: 120px
$trackContentMarginWidth: 0.5em
$albumSourceSelectMenuWidth: 220px
$mainCheckboxThumbHeight: 1.2em
$mainCheckboxWidth: 3em
$trackPagePlayerPanelHeight: 40px
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
:isShowLoader="!albumData"
:isLoading="isLoading"
:error="error"
@init="handleInit"
@refresh="handleRefresh"
>
<slot
Expand Down Expand Up @@ -51,9 +50,6 @@ export default {
responsePageLimit: Number,
pageNameKey: String
},
emits: [
'init'
],
data () {
return {
albumData: null,
Expand Down Expand Up @@ -100,9 +96,6 @@ export default {
...mapActions('layout', [
'setNavigationSections'
]),
handleInit (el) {
this.$emit('init', el)
},
handleRefresh (page) {
this.error = null
Expand Down
3 changes: 1 addition & 2 deletions src/helpers/data/plugins/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ export const messages = {
albumVarious: 'V/A album',
group: 'Album group',
track: 'Single'
},
reset: 'Reset'
}
}
},
track: {
Expand Down
32 changes: 17 additions & 15 deletions src/views/album/MainPage.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
<template>
<BaseAlbumPageContainer
@init="handleContainerInit"
>
<BaseAlbumPageContainer>
<template #default="slotProps">
<BaseAlbumPageSegmentContainer
:isLoading="slotProps.isLoading"
:error="slotProps.error"
@refresh="slotProps.handleRefresh"
>
<template #default>
<div class="columns-container">
<AlbumSourceSelect
:albumData="slotProps.albumData"
/>

<BaseDivider />

<div
class="columns-container"
ref="scrollable"
>
<LeftColumn
v-if="$refs.scrollable"
:albumData="slotProps.albumData"
:scrollable="scrollable"
:scrollable="$refs.scrollable"
/>
<RightColumn
:albumData="slotProps.albumData"
Expand All @@ -30,6 +38,8 @@ import BaseAlbumPageContainer
from '@/containers/pages/album/BaseAlbumPageContainer.vue'
import BaseAlbumPageSegmentContainer
from '@/containers/pages/album/BaseAlbumPageSegmentContainer.vue'
import AlbumSourceSelect from './MainPage/AlbumSourceSelect.vue'
import BaseDivider from '@/BaseDivider.vue'
import LeftColumn from './MainPage/LeftColumn.vue'
import RightColumn from './MainPage/RightColumn.vue'
Expand All @@ -38,18 +48,10 @@ export default {
components: {
BaseAlbumPageContainer,
BaseAlbumPageSegmentContainer,
AlbumSourceSelect,
BaseDivider,
LeftColumn,
RightColumn
},
data () {
return {
scrollable: null
}
},
methods: {
handleContainerInit (el) {
this.scrollable = el
}
}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
<template>
<SourceSelect
ref="source"
:artistName="artistName"
:albumTitle="albumTitle"
/>
<div class="album-source-select-container">
<div class="album-source-select-content">
<SourceSelect
ref="source"
:artistName="artistName"
:albumTitle="albumTitle"
/>

<template v-if="selectedSourceData">
<TypeSelect
v-if="isSelectedSourceWithMultipleTypes"
:key="typeSelectKey"
:albumsData="selectedSourceAlbumsData"
:types="selectedSourceTypes"
/>
<template v-if="selectedSourceData">
<TypeSelect
v-if="isSelectedSourceWithMultipleTypes"
:key="typeSelectKey"
:albumsData="selectedSourceAlbumsData"
:types="selectedSourceTypes"
/>

<AlbumSelect
v-if="selectedTypeId"
:key="albumSelectKey"
:albums="selectedTypeAlbums"
:typeId="selectedTypeId"
/>
<AlbumSelect
v-if="selectedTypeId"
:key="albumSelectKey"
:albums="selectedTypeAlbums"
:typeId="selectedTypeId"
/>
</template>
</div>

<ResetButton @click="handleReset"/>
</template>
<BaseButton
v-if="selectedSourceData"
class="circular red basic compact tiny reset-button"
icon="close"
@click="handleReset"
/>
</div>
</template>

<script>
import SourceSelect from './AlbumSourceSelect/SourceSelect.vue'
import TypeSelect from './AlbumSourceSelect/TypeSelect.vue'
import AlbumSelect from './AlbumSourceSelect/AlbumSelect.vue'
import ResetButton from './AlbumSourceSelect/ResetButton.vue'
import BaseButton from '@/BaseButton.vue'
import { generateKey } from '#/utils'
import formatAlbumRequestData from '#/actions/api/album/formatters/requestData'
Expand All @@ -38,7 +47,7 @@ export default {
SourceSelect,
TypeSelect,
AlbumSelect,
ResetButton
BaseButton
},
provide () {
return {
Expand All @@ -52,8 +61,10 @@ export default {
'resetRequestAlbumData'
],
props: {
albumTitle: String,
artistName: String
albumData: {
type: Object,
required: true
}
},
data () {
return {
Expand All @@ -66,6 +77,12 @@ export default {
}
},
computed: {
albumTitle () {
return this.albumData.title
},
artistName () {
return this.albumData.artist.name
},
isSelectedSourceWithMultipleTypes () {
return this.selectedSourceTypes.length > 1
},
Expand Down Expand Up @@ -143,4 +160,13 @@ export default {
}
</script>

<style lang="sass" scoped></style>
<style lang="sass" scoped>
.album-source-select-container
@extend .d-flex, .align-items-center
.album-source-select-content
@extend .d-flex, .align-items-center, .flex-full
.reset-button
@extend .no-margin
</style>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<BaseDropdownContainer
class="basic fluid pointing left scrolling button album-select"
class="basic pointing scrolling button album-select"
:header="headerFormatted"
>
<AlbumsList :albums="albums" />
Expand Down Expand Up @@ -42,5 +42,6 @@ export default {

<style lang="sass" scoped>
.album-select
margin-bottom: 10px
width: 210px
margin-right: 1em
</style>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="menu albums-list">
<div class="menu">
<AlbumItem
v-for="albumData in albumsFormatted"
:key="albumData.uuid"
Expand Down Expand Up @@ -33,7 +33,4 @@ export default {
}
</script>

<style lang="sass" scoped>
.ui.dropdown .albums-list
width: $albumSourceSelectMenuWidth !important
</style>
<style lang="sass" scoped></style>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<BaseDropdownContainer
class="basic fluid pointing left scrolling button source-select"
class="basic pointing scrolling button source-select"
ref="dropdown"
:header="headerFormatted"
>
Expand Down Expand Up @@ -43,5 +43,6 @@ export default {

<style lang="sass" scoped>
.source-select
margin-bottom: 10px
width: 210px
margin-right: 1em
</style>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="menu sources-list">
<div class="menu">
<div class="header">
{{ streamableHeaderFormatted }}
</div>
Expand Down Expand Up @@ -71,7 +71,4 @@ export default {
}
</script>

<style lang="sass" scoped>
.ui.dropdown .sources-list
width: $albumSourceSelectMenuWidth !important
</style>
<style lang="sass" scoped></style>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<BaseDropdownContainer
class="basic fluid pointing left scrolling button"
class="basic pointing scrolling button"
:header="headerFormatted"
>
<TypesList
Expand Down Expand Up @@ -45,5 +45,6 @@ export default {

<style lang="sass" scoped>
.main-dropdown
margin-bottom: 10px
width: 150px
margin-right: 1em
</style>
13 changes: 3 additions & 10 deletions src/views/album/MainPage/LeftColumn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,18 @@
:artistName="artistName"
:scrollable="scrollable"
/>

<AlbumSourceSelect
:albumTitle="albumTitle"
:artistName="artistName"
/>
</div>
</template>

<script>
import AlbumImage from './LeftColumn/AlbumImage.vue'
import AlbumHeader from './LeftColumn/AlbumHeader.vue'
import AlbumSourceSelect from './LeftColumn/AlbumSourceSelect.vue'
export default {
name: 'LeftColumn',
components: {
AlbumImage,
AlbumHeader,
AlbumSourceSelect
AlbumHeader
},
props: {
albumData: {
Expand All @@ -51,8 +44,8 @@ export default {
<style lang="sass" scoped>
.left-column
@extend .sticky
width: 200px
width: 210px
margin-right: 1em
top: calc(#{$mainContainerTopPadding} + 1em)
top: calc(#{$mainContainerTopPadding})
align-self: flex-start
</style>

This file was deleted.

0 comments on commit 6362abd

Please sign in to comment.