diff --git a/src/components.d.ts b/src/components.d.ts index e6a93069112c46fd9150f9b0fc6e8822047a96c2..668ae9da32cd87c760bd51cfd83d49a86f0462a2 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -243,6 +243,7 @@ export namespace Components { variant: CheckboxVariants; } interface HyContentList { + creditsLabel: string; dataItems: string; linkLabel: string; } @@ -1528,6 +1529,7 @@ declare namespace LocalJSX { variant?: CheckboxVariants; } interface HyContentList { + creditsLabel?: string; dataItems?: string; linkLabel?: string; } diff --git a/src/components/courses/hy-content-list-item/hy-content-list-item.tsx b/src/components/courses/hy-content-list-item/hy-content-list-item.tsx index c08a3fe85af9c18b197cf5d36e300650b5202a39..3df481f1694ed8601f4e8f6f907b32b3a9729507 100644 --- a/src/components/courses/hy-content-list-item/hy-content-list-item.tsx +++ b/src/components/courses/hy-content-list-item/hy-content-list-item.tsx @@ -77,12 +77,9 @@ export class HyContentLstItem { <div class="hy-content-list-item--metadata--item hy-content-list-item--metadata--item--first"> <span>{this._dateValue}</span> </div> - <div class="hy-content-list-item--metadata--item"> + <div class="hy-content-list-item--metadata--item hy-content-list-item--metadata--item--last"> <span>{this.courseStudyFormat}</span> </div> - <div class="hy-content-list-item--metadata--item hy-content-list-item--metadata--item--last "> - <span>{this.courseCredits}</span> - </div> </div> {this._courseTags && ( <div class="hy-content-list-item--tags"> diff --git a/src/components/courses/hy-content-list/hy-content-list.tsx b/src/components/courses/hy-content-list/hy-content-list.tsx index 2555aaffdfafd835b027bec2c128cbaf246e2ccf..d4c8f947d5692d3116ffe4604d6d6743483f20ae 100644 --- a/src/components/courses/hy-content-list/hy-content-list.tsx +++ b/src/components/courses/hy-content-list/hy-content-list.tsx @@ -8,6 +8,7 @@ import {Component, ComponentInterface, Element, h, Host, Prop, State} from '@ste }) export class HyContentList implements ComponentInterface { @Prop() linkLabel: string = 'Go to course page'; + @Prop() creditsLabel: string = 'cr'; @Prop() dataItems: string; private _dataItems: []; private variant: CourseVariants = CourseVariants.default; @@ -34,8 +35,8 @@ export class HyContentList implements ComponentInterface { let courseItem = courseObject[courseProperty]; let courseCode = courseItem['code']; - let courseName = courseItem['name']; let courseCredits = courseItem['credits']; + let courseName = courseItem['name'] + ', ' + courseCredits + ' ' + this.creditsLabel; if (courseItem['tags']) { let tags = JSON.parse(JSON.stringify(courseItem['tags'])); diff --git a/src/components/courses/hy-content-list/readme.md b/src/components/courses/hy-content-list/readme.md index ec30e6a5df27c16594f22be476c698b8577b8913..53ab92fe3cb7ff82441d25c7630fedf0b6bebef2 100644 --- a/src/components/courses/hy-content-list/readme.md +++ b/src/components/courses/hy-content-list/readme.md @@ -4,10 +4,11 @@ ## Properties -| Property | Attribute | Description | Type | Default | -| ----------- | ------------ | ----------- | -------- | --------------------- | -| `dataItems` | `data-items` | | `string` | `undefined` | -| `linkLabel` | `link-label` | | `string` | `'Go to course page'` | +| Property | Attribute | Description | Type | Default | +| -------------- | --------------- | ----------- | -------- | --------------------- | +| `creditsLabel` | `credits-label` | | `string` | `'cr'` | +| `dataItems` | `data-items` | | `string` | `undefined` | +| `linkLabel` | `link-label` | | `string` | `'Go to course page'` | ## Dependencies