Skip to content
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

Misc smaller patch release fixes for v2023.07.05 #4199

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@
channel() {
return this.getChannel(this.channelId);
},
name() {
return this.channel.name;
},
searchChannelEditorsLink() {
return {
name: RouteNames.USERS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</template>
<LoadingText v-if="loading" absolute />
<VCardText v-else>
<Banner error :value="channel.deleted" class="mb-4">
<Banner error :value="isDeleted" class="mb-4">
This channel has been deleted
</Banner>
<VTabsItems v-model="tab">
Expand Down Expand Up @@ -102,6 +102,9 @@
channel() {
return this.getChannel(this.channelId);
},
isDeleted() {
return this.channel && Boolean(this.channel?.deleted);
},
channelWithDetails() {
if (!this.channel || !this.details) {
return {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
v-on="on"
@click="clickItem(action)"
>
<Icon :color="iconColor(action)">
<Icon v-if="config[action] && config[action].icon" :color="iconColor(action)">
{{ config[action].icon }}
</Icon>
</VBtn>
Expand Down
6 changes: 6 additions & 0 deletions contentcuration/contentcuration/frontend/channelEdit/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const defaultCompletionCriteriaModels = {
[ContentKindsNames.DOCUMENT]: CompletionCriteriaModels.PAGES,
[ContentKindsNames.H5P]: CompletionCriteriaModels.DETERMINED_BY_RESOURCE,
[ContentKindsNames.HTML5]: CompletionCriteriaModels.APPROX_TIME,
[ContentKindsNames.ZIM]: CompletionCriteriaModels.APPROX_TIME,
[ContentKindsNames.EXERCISE]: CompletionCriteriaModels.MASTERY,
};

Expand Down Expand Up @@ -53,6 +54,11 @@ export const CompletionOptionsDropdownMap = {
CompletionDropdownMap.determinedByResource,
CompletionDropdownMap.reference,
],
[ContentKindsNames.ZIM]: [
CompletionDropdownMap.completeDuration,
CompletionDropdownMap.determinedByResource,
CompletionDropdownMap.reference,
],
[ContentKindsNames.H5P]: [
CompletionDropdownMap.determinedByResource,
CompletionDropdownMap.completeDuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<KFixedGridItem :key="`${kind}1`" span="3" class="row">
<span class="mr-2 pa-2" :style="{ backgroundColor: theme[kind] }">
<KIcon :icon="kind" :color="$themeTokens.textInverted" />
<KIcon :icon="kindIcon(kind)" :color="$themeTokens.textInverted" />
</span>

<span>{{ translateConstant(kind) }}</span>
Expand Down Expand Up @@ -89,6 +89,15 @@
const hiddenKinds = [ContentKindsNames.H5P, ContentKindsNames.TOPIC];
return ContentKindsList.filter(k => !hiddenKinds.includes(k));
},
kindIcon() {
return kind => {
// KIcon doesn't have an icon for ZIM, so we use the HTML5 icon instead
if (kind === ContentKindsNames.ZIM) {
return ContentKindsNames.HTML5;
}
return kind;
};
},
storageUsagePercentage() {
// Math.round to fix ParseInt issues for really small divisions to force the float to int
return Math.round((this.usedSpace / this.totalSpace) * 100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const kindToIconMap = {
slideshow: 'photo_library',
topic: 'folder',
video: 'theaters',
zim: 'widgets',
};

export const SharingPermissions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('ContentNodeIcon', () => {
{ value: 'exercise', icon: 'assignment' },
{ value: 'document', icon: 'class' },
{ value: 'html5', icon: 'widgets' },
{ value: 'zim', icon: 'widgets' },
];
it.each(testIcons)('should display the correct icon $value', kind => {
const wrapper = makeWrapper(kind.value);
Expand Down
Loading