-
Notifications
You must be signed in to change notification settings - Fork 907
Remote Content Browsing: Clean the library page when displaying other available libraries #10216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c4f6751
8db2f32
73f4ca3
fee35c9
9d0a53f
8c80ef3
fe83049
d30b27f
a2a9d5d
4b9edf3
f18797d
c62027b
93c1bd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,14 +48,18 @@ | |
| :value="numCoachContents" | ||
| :isTopic="true" | ||
| /> | ||
|
|
||
| <div | ||
| v-if="version" | ||
| class="version-wrapper" | ||
| :style="versionStyle" | ||
| > | ||
| <p>{{ $tr('version', { version: version }) }}</p> | ||
| </div> | ||
| <div | ||
| style="text-align:right;margin-right:10px;margin-top:10px" | ||
| > | ||
| <KIcon v-if="isPinned" icon="wifi" /> | ||
| </div> | ||
|
|
||
| </router-link> | ||
|
|
||
|
|
@@ -113,6 +117,11 @@ | |
| required: false, | ||
| default: null, | ||
| }, | ||
| isPinned: { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this prop is misleading. I think the wifi icon is meant to specify whether the resource is available or not. @jtamiace , @marcellamaki ? |
||
| type: Boolean, | ||
| required: true, | ||
| default: false, | ||
| }, | ||
| }, | ||
| computed: { | ||
| ...mapGetters(['isLearner', 'isUserLoggedIn']), | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should be deleted as its no longer used in light of the discussion here |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,23 @@ | ||
| <template> | ||
|
|
||
| <KGrid> | ||
| <KGrid v-if="pinnedDevices !== null"> | ||
| <KGridItem | ||
| v-for="group in groups" | ||
| :key="group.id" | ||
| v-for="device in pinnedDevices" | ||
| :key="device.id" | ||
| > | ||
| <KGridItem> | ||
| <h2> | ||
| <KIcon icon="device" /> | ||
| <span class="device-name">{{ group.deviceName }}</span> | ||
| <KIcon :icon="getDeviceIcon(device)" /> | ||
| <span class="device-name">{{ device.device_name }}</span> | ||
| </h2> | ||
| </KGridItem> | ||
| <KGridItem | ||
| v-for="item in group.content" | ||
| :key="item.id" | ||
| :layout="{ span: cardColumnSpan, alignment: 'auto' }" | ||
| > | ||
| <CardContent | ||
| :content="item.title" | ||
| :body="item.body" | ||
| /> | ||
| </KGridItem> | ||
|
|
||
| <ChannelCardGroupGrid | ||
| data-test="channel-cards" | ||
| class="grid" | ||
| :contents="device.channels" | ||
| :isPinned="true" | ||
| /> | ||
| </KGridItem> | ||
| </KGrid> | ||
|
|
||
|
|
@@ -30,66 +27,43 @@ | |
| <script> | ||
|
|
||
| import useKResponsiveWindow from 'kolibri.coreVue.composables.useKResponsiveWindow'; | ||
| import CardContent from './CardContent'; | ||
| import useDevices from './../../composables/useDevices'; | ||
| import ChannelCardGroupGrid from './../ChannelCardGroupGrid'; | ||
|
|
||
| export default { | ||
| name: 'PinnedNetworkResources', | ||
| components: { | ||
| CardContent, | ||
| ChannelCardGroupGrid, | ||
| }, | ||
| setup() { | ||
| const { windowBreakpoint } = useKResponsiveWindow(); | ||
| const { baseurl, fetchDevices } = useDevices(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please see my general comment on the |
||
| return { | ||
| windowBreakpoint, | ||
| fetchDevices, | ||
| baseurl, | ||
| }; | ||
| }, | ||
| props: { | ||
| pinnedDevices: { | ||
| type: Array, | ||
| required: true, | ||
| }, | ||
| }, | ||
| data() { | ||
| return { | ||
| groups: [ | ||
| { | ||
| id: 1, | ||
| deviceName: 'Samson`s MacBook-Pro', | ||
| content: [ | ||
| { | ||
| id: 1, | ||
| title: 'Card 1', | ||
| body: ' ', | ||
| }, | ||
| { | ||
| id: 2, | ||
| title: 'Card 2', | ||
| body: 'Explore', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| id: 2, | ||
| deviceName: 'Marcella MBP', | ||
| content: [ | ||
| { | ||
| id: 1, | ||
| title: 'Card 1', | ||
| body: ' ', | ||
| }, | ||
| { | ||
| id: 2, | ||
| title: 'Card 2', | ||
| body: ' ', | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }; | ||
| return {}; | ||
| }, | ||
| computed: { | ||
| cardColumnSpan() { | ||
| if (this.windowBreakpoint <= 2) return 4; | ||
| if (this.windowBreakpoint <= 3) return 6; | ||
| if (this.windowBreakpoint <= 6) return 4; | ||
| return 3; | ||
| methods: { | ||
| getDeviceIcon(device) { | ||
| if (device['operating_system'] === 'Android') { | ||
| return 'device'; | ||
| } else if (!device['subset_of_users_device']) { | ||
| return 'cloud'; | ||
| } else { | ||
| return 'laptop'; | ||
| } | ||
| }, | ||
| }, | ||
| created() {}, | ||
| }; | ||
|
|
||
| </script> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,10 +4,16 @@ | |
| class="card-main-wrapper" | ||
| :style="cardStyle" | ||
| > | ||
| <div class="" style="width:250px;height:100px;"> | ||
|
|
||
| <KRouterLink | ||
| v-if="allDevices !== null" | ||
| :text="allDevices.nickname.length ? allDevices.nickname : allDevices.device_name" | ||
| :to="{ name: 'LIBRARY', params: { deviceId: allDevices.id } }" | ||
| style="text-decoration:none;" | ||
| > | ||
| <h2 class="device-name"> | ||
| <span> | ||
| <KIcon icon="device" /> | ||
| <KIcon :icon="getDeviceIcon()" /> | ||
| </span> | ||
| <span> | ||
| <TextTruncator | ||
|
|
@@ -16,10 +22,11 @@ | |
| /> | ||
| </span> | ||
| </h2> | ||
| <p class="channels"> | ||
| {{ $tr('channels', { count: channels }) }} | ||
|
|
||
| <p v-if="channels" class="channels"> | ||
| {{ channels }} {{ $tr('channels', { count: channels }) }} | ||
| </p> | ||
| </div> | ||
| </KRouterLink> | ||
| </div> | ||
|
|
||
| </template> | ||
|
|
@@ -50,8 +57,16 @@ | |
| }, | ||
| channels: { | ||
| type: Number, | ||
| required: true, | ||
| }, | ||
| allDevices: { | ||
| type: Object, | ||
| required: true, | ||
| }, | ||
| operatingSystem: { | ||
| type: String, | ||
| required: false, | ||
| default: 0, | ||
| default: null, | ||
| }, | ||
| }, | ||
|
|
||
|
|
@@ -62,12 +77,26 @@ | |
| color: this.$themeTokens.text, | ||
| marginBottom: `${this.windowGutter}px`, | ||
| minHeight: `${this.overallHeight}px`, | ||
| textAlign: 'center', | ||
| }; | ||
| }, | ||
| }, | ||
| mounted() {}, | ||
|
|
||
| methods: { | ||
| getDeviceIcon() { | ||
| if (this.operatingSystem === 'Android') { | ||
| return 'device'; | ||
| } else if (!this.allDevices.subset_of_users_device) { | ||
| return 'cloud'; | ||
| } else { | ||
| return 'laptop'; | ||
| } | ||
| }, | ||
| }, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to add another |
||
| $trs: { | ||
| channels: { | ||
| message: '{count, plural, one {channel} other {channels}', | ||
| message: '{count, plural, one {channel} other {channels} }', | ||
| context: 'Indicates the number of channels', | ||
| }, | ||
| }, | ||
|
|
@@ -111,6 +140,8 @@ | |
| } | ||
|
|
||
| .channels { | ||
| justify-content: center; | ||
| width: 100%; | ||
| color: #616161; | ||
| text-align: center; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the
v-if="isPinned"directive should be moved to the parent(div) as hiding just theKIconwill leave additional margins that may not be desirable. Also, see my comments below regarding theisPinnedprop