From 70e065322fbd13462eecc2dc3d73968a6912dcfe Mon Sep 17 00:00:00 2001 From: Adrian Fish Date: Fri, 8 Nov 2024 18:37:58 +0000 Subject: [PATCH] SAK-50672 webcomponents Make definition of _i18n more consistent https://sakaiproject.atlassian.net/browse/SAK-50672 --- .../src/SakaiAnnouncements.js | 36 +-- .../packages/sakai-button/src/SakaiButton.js | 5 +- .../sakai-calendar/src/SakaiCalendar.js | 1 - .../conversations-options-menu.js | 3 - .../src/ConversationsOptionsMenu.js | 56 ---- .../src/ConversationsStatistics.js | 42 +-- .../sakai-conversations/src/SakaiAddTopic.js | 118 ++++---- .../sakai-conversations/src/SakaiComment.js | 1 - .../src/SakaiCommentEditor.js | 1 - .../src/SakaiConversations.js | 1 - .../src/SakaiConversationsGuidelines.js | 10 +- .../src/SakaiConversationsSettings.js | 1 - .../src/SakaiConversationsTagManager.js | 24 +- .../sakai-conversations/src/SakaiMenu.js | 42 --- .../sakai-conversations/src/SakaiPost.js | 1 - .../sakai-conversations/src/SakaiTopic.js | 1 - .../sakai-conversations/src/SakaiTopicList.js | 36 +-- .../src/SakaiTopicSummary.js | 44 +-- .../sakai-course-card/src/SakaiCourseCard.js | 3 - .../src/SakaiCourseDashboard.js | 13 +- .../src/SakaiCourseDashboardTemplatePicker.js | 1 - .../src/SakaiCourseHeader.js | 6 +- .../sakai-course-list/src/SakaiCourseList.js | 1 - .../sakai-date-picker/src/SakaiDatePicker.js | 2 +- .../src/SakaiDialogContent.js | 5 +- .../src/SakaiDocumentViewer.js | 1 - .../sakai-element/src/SakaiShadowElement.js | 1 + .../sakai-file-list/src/SakaiFileList.js | 7 +- .../packages/sakai-forums/src/SakaiForums.js | 2 - .../packages/sakai-grader/src/SakaiGrader.js | 20 +- .../sakai-grader/src/SakaiGraderFilePicker.js | 6 +- .../sakai-grader/src/SakaiGraderToggle.js | 1 - .../src/sakai-gradable-data-mixin.js | 6 +- .../src/sakai-grader-rendering-mixin.js | 270 +++++++++--------- .../packages/sakai-grades/src/SakaiGrades.js | 1 - .../src/SakaiGroupPicker.js | 1 - .../src/SakaiHomeDashboard.js | 1 - .../packages/sakai-icon/src/SakaiIcon.js | 5 +- .../src/SakaiImageEditor.js | 2 - .../sakai-lti-iframe/src/SakaiLTIIframe.js | 6 +- .../sakai-lti-popup/src/SakaiLTIPopup.js | 6 +- .../src/SakaiNotifications.js | 1 - .../packages/sakai-options-menu/LICENSE | 12 - .../packages/sakai-options-menu/README.md | 33 --- .../packages/sakai-options-menu/index.js | 1 - .../packages/sakai-options-menu/package.json | 36 --- .../sakai-options-menu/sakai-options-menu.js | 3 - .../src/SakaiOptionsMenu.js | 49 ---- .../packages/sakai-options-menu/test/data.js | 16 -- .../test/sakai-options-menu.test.js | 22 -- .../web-test-runner.config.mjs | 41 --- .../sakai-permissions/src/SakaiPermissions.js | 33 ++- .../src/SakaiPictureChanger.js | 1 - .../sakai-profile/src/SakaiProfile.js | 1 - .../src/SakaiPronunciationPlayer.js | 13 +- .../sakai-reorderer/src/SakaiReorderer.js | 7 +- .../sakai-rubrics/src/RubricsElement.js | 6 +- .../src/SakaiRubricAssociation.js | 2 +- .../sakai-rubrics/src/SakaiRubricStudent.js | 2 +- .../src/SakaiRubricStudentButton.js | 2 +- .../src/SakaiRubricStudentPreviewButton.js | 2 +- .../packages/sakai-search/src/SakaiSearch.js | 1 - .../sakai-site-picker/src/SakaiSitePicker.js | 1 - .../src/SakaiSubmissionMessager.js | 37 ++- .../packages/sakai-tasks/src/SakaiTasks.js | 74 ++--- .../sakai-tasks/src/SakaiTasksCreateTask.js | 1 - .../packages/sakai-toggle/src/SakaiToggle.js | 5 +- .../sakai-widgets/src/SakaiDashboardWidget.js | 1 - .../sakai-widgets/src/SakaiWidgetPanel.js | 10 +- 69 files changed, 431 insertions(+), 772 deletions(-) delete mode 100644 webcomponents/tool/src/main/frontend/packages/sakai-conversations/conversations-options-menu.js delete mode 100644 webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/ConversationsOptionsMenu.js delete mode 100644 webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiMenu.js delete mode 100644 webcomponents/tool/src/main/frontend/packages/sakai-options-menu/LICENSE delete mode 100644 webcomponents/tool/src/main/frontend/packages/sakai-options-menu/README.md delete mode 100644 webcomponents/tool/src/main/frontend/packages/sakai-options-menu/index.js delete mode 100644 webcomponents/tool/src/main/frontend/packages/sakai-options-menu/package.json delete mode 100644 webcomponents/tool/src/main/frontend/packages/sakai-options-menu/sakai-options-menu.js delete mode 100644 webcomponents/tool/src/main/frontend/packages/sakai-options-menu/src/SakaiOptionsMenu.js delete mode 100644 webcomponents/tool/src/main/frontend/packages/sakai-options-menu/test/data.js delete mode 100644 webcomponents/tool/src/main/frontend/packages/sakai-options-menu/test/sakai-options-menu.test.js delete mode 100644 webcomponents/tool/src/main/frontend/packages/sakai-options-menu/web-test-runner.config.mjs diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-announcements/src/SakaiAnnouncements.js b/webcomponents/tool/src/main/frontend/packages/sakai-announcements/src/SakaiAnnouncements.js index 6e25e8872875..f180e7c3f54a 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-announcements/src/SakaiAnnouncements.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-announcements/src/SakaiAnnouncements.js @@ -20,7 +20,7 @@ export class SakaiAnnouncements extends SakaiPageableElement { super(); this.showPager = true; - this.loadTranslations("announcements").then(r => this.i18n = r); + this.loadTranslations("announcements").then(r => this._i18n = r); } set data(value) { @@ -118,37 +118,37 @@ export class SakaiAnnouncements extends SakaiPageableElement { ` : nothing }
- + + + + + +
-
${this.i18n.viewing}
+
${this._i18n.viewing}
${!this.siteId || this.siteId === "home" ? html` ` : nothing} -
${this.i18n.view}
+
${this._i18n.view}
${this.dataPage.filter(a => a.visible).map((a, i) => html`
${a.highlighted ? html` @@ -161,8 +161,8 @@ export class SakaiAnnouncements extends SakaiPageableElement { ` : nothing} diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-button/src/SakaiButton.js b/webcomponents/tool/src/main/frontend/packages/sakai-button/src/SakaiButton.js index d6dccbfb3b37..cd400c83ff12 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-button/src/SakaiButton.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-button/src/SakaiButton.js @@ -1,6 +1,7 @@ -import { css, html, LitElement } from "lit"; +import { SakaiShadowElement } from "@sakai-ui/sakai-element"; +import { css, html } from "lit"; -export class SakaiButton extends LitElement { +export class SakaiButton extends SakaiShadowElement { static properties = { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-calendar/src/SakaiCalendar.js b/webcomponents/tool/src/main/frontend/packages/sakai-calendar/src/SakaiCalendar.js index 438d61f8b97f..437a62bbeaa3 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-calendar/src/SakaiCalendar.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-calendar/src/SakaiCalendar.js @@ -13,7 +13,6 @@ export class SakaiCalendar extends LionCalendar { userId: { attribute: "user-id", type: String }, siteId: { attribute: "site-id", type: String }, defer: { type: Boolean }, - _i18n: { state: true }, _daysEvents: { state: true }, _events: { state: true }, }; diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/conversations-options-menu.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/conversations-options-menu.js deleted file mode 100644 index f81fdd56ac88..000000000000 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/conversations-options-menu.js +++ /dev/null @@ -1,3 +0,0 @@ -import { ConversationsOptionsMenu } from './src/ConversationsOptionsMenu.js'; - -customElements.define('conversations-options-menu', ConversationsOptionsMenu); diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/ConversationsOptionsMenu.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/ConversationsOptionsMenu.js deleted file mode 100644 index b1ab90cbb6a3..000000000000 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/ConversationsOptionsMenu.js +++ /dev/null @@ -1,56 +0,0 @@ -import { css, html, LitElement } from "lit"; - -export class ConversationsOptionsMenu extends LitElement { - - static properties = { - placement: { type: String }, - _showing: { attribute: false, type: Boolean }, - _transform: { attribute: false, type: String }, - }; - - set placement(value) { - - this._placement = value; - switch (value) { - case "top": - this._transform = "translate(-50%, -130%);"; - break; - case "right": - this._transform = "translate(20px, -50%);"; - break; - case "bottom": - this._transform = "translateX(-50%);"; - break; - case "left": - this._transform = "translate(-100%, -50%);"; - break; - case "bottom-left": - this._transform = "translateX(-100%);"; - break; - default: - } - } - - get placement() { return this._placement; } - - _toggleShowing(e) { - - e.stopPropagation(); - this._showing = !this._showing; - } - - render() { - - return html` - - - `; - } - - static styles = css` - .content { - position: absolute; - transform: translateX(-50%); - } - `; -} diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/ConversationsStatistics.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/ConversationsStatistics.js index 8df9757fe9a0..313043f175e5 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/ConversationsStatistics.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/ConversationsStatistics.js @@ -20,7 +20,7 @@ export class ConversationsStatistics extends SakaiElement { this._sortByNameAscending = true; this._count = 0; - this.loadTranslations("conversations").then(r => this.i18n = r); + this.loadTranslations("conversations").then(r => this._i18n = r); } set statsUrl(value) { @@ -123,25 +123,25 @@ export class ConversationsStatistics extends SakaiElement { _setAllTime() { this.interval = ALL_TIME; } shouldUpdate() { - return this.i18n && this._stats; + return this._i18n && this._stats; } render() { return html`
-

${this.i18n.statistics}

+

${this._i18n.statistics}

-
${this.i18n.timeframe}
+
${this._i18n.timeframe}
${this.i18n.this_week} + checked>${this._i18n.this_week} ${this.i18n.all_time} + @click="${this._setAllTime}">${this._i18n.all_time}
@@ -151,11 +151,11 @@ export class ConversationsStatistics extends SakaiElement {
-
${this.i18n.name_header}
+
${this._i18n.name_header}
@@ -165,11 +165,11 @@ export class ConversationsStatistics extends SakaiElement {
-
${this.i18n.topics_created_header}
+
${this._i18n.topics_created_header}
@@ -179,11 +179,11 @@ export class ConversationsStatistics extends SakaiElement {
-
${this.i18n.topics_read_header}
+
${this._i18n.topics_read_header}
@@ -193,11 +193,11 @@ export class ConversationsStatistics extends SakaiElement {
-
${this.i18n.reactions_header}
+
${this._i18n.reactions_header}
@@ -207,11 +207,11 @@ export class ConversationsStatistics extends SakaiElement {
-
${this.i18n.posts_header}
+
${this._i18n.posts_header}
diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiAddTopic.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiAddTopic.js index 980fe38d2169..177ea5f25057 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiAddTopic.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiAddTopic.js @@ -43,7 +43,7 @@ export class SakaiAddTopic extends SakaiElement { this.new = true; - this.loadTranslations("conversations").then(r => this.i18n = r); + this.loadTranslations("conversations").then(r => this._i18n = r); } set aboutReference(value) { @@ -356,13 +356,13 @@ export class SakaiAddTopic extends SakaiElement { return html` ${this.canCreateQuestion && !this.canCreateDiscussion ? html` -

${this.new ? this.i18n.add_a_new_question : this.i18n.edit_question}

+

${this.new ? this._i18n.add_a_new_question : this._i18n.edit_question}

` : ""} ${this.canCreateDiscussion && !this.canCreateQuestion ? html` -

${this.new ? this.i18n.add_a_new_discussion : this.i18n.edit_discussion}

+

${this.new ? this._i18n.add_a_new_discussion : this._i18n.edit_discussion}

` : ""} ${this.canCreateDiscussion && this.canCreateQuestion ? html` -

${this.new ? this.i18n.add_a_new_topic : this.i18n.edit_topic}

+

${this.new ? this._i18n.add_a_new_topic : this._i18n.edit_topic}

` : ""} `; } @@ -377,17 +377,17 @@ export class SakaiAddTopic extends SakaiElement { } shouldUpdate() { - return this.i18n && this.tags && (this.topic || this.aboutReference); + return this._i18n && this.tags && (this.topic || this.aboutReference); } render() { return html` ${this.topic.beingEdited ? html` -
${this.i18n.editing_topic}
+
${this._i18n.editing_topic}
` : ""} ${this._lockDateInvalid ? html` -
${this.i18n.invalid_lock_date}
+
${this._i18n.invalid_lock_date}
` : ""}
${this._renderTitle()} @@ -395,7 +395,7 @@ export class SakaiAddTopic extends SakaiElement { ${this.disableDiscussions ? "" : html`
${this.canCreateQuestion && this.canCreateDiscussion ? html` -
${this.i18n.topic_type}
+
${this._i18n.topic_type}
-
${this.i18n.type_question}
+
${this._i18n.type_question}
-
${this.i18n.question_type_description}
+
${this._i18n.question_type_description}
-
${this.i18n.type_discussion}
+
${this._i18n.type_discussion}
-
${this.i18n.discussion_type_description}
+
${this._i18n.discussion_type_description}
` : ""} @@ -425,17 +425,17 @@ export class SakaiAddTopic extends SakaiElement { `}
-
${this.i18n.summary} *
+
${this._i18n.summary} *
- * ${this.i18n.required} - (${this.i18n.min_title_characters_info}) + * ${this._i18n.required} + (${this._i18n.min_title_characters_info})
-
${this.i18n.details}
+
${this._i18n.details}
-
${this.i18n.tag_topic}
+
${this._i18n.tag_topic}
${this.tags.length > 0 ? html`
-
${this.i18n.make_available_now}
-
${this.i18n.make_available_now_explanation}
+
${this._i18n.make_available_now}
+
${this._i18n.make_available_now_explanation}
@@ -551,8 +551,8 @@ export class SakaiAddTopic extends SakaiElement { @click=${this._setAvailableDated} ?checked=${this.topic.availability === AVAILABILITY_DATED} />
-
${this.i18n.make_available_dated}
-
${this.i18n.make_available_dated_explanation}
+
${this._i18n.make_available_dated}
+
${this._i18n.make_available_dated_explanation}
${this.topic.availability === AVAILABILITY_DATED ? html`
@@ -564,14 +564,14 @@ export class SakaiAddTopic extends SakaiElement { ?checked=${this.topic.showDate}>
-
${this.i18n.show}
+
${this._i18n.show}
${this._showShowDatePicker ? html`
- ${this.i18n.date} + ${this._i18n.date} + label="${this._i18n.showdate_picker_tooltip}">
` : ""} @@ -585,14 +585,14 @@ export class SakaiAddTopic extends SakaiElement { ?checked=${this.topic.lockDate}>
-
${this.i18n.lock}
+
${this._i18n.lock}
${this._showLockDatePicker ? html`
- ${this.i18n.date} + ${this._i18n.date} + label="${this._i18n.lockdate_picker_tooltip}">
` : ""} @@ -606,14 +606,14 @@ export class SakaiAddTopic extends SakaiElement { ?checked=${this.topic.hideDate}>
-
${this.i18n.hide}
+
${this._i18n.hide}
${this._showHideDatePicker ? html`
- ${this.i18n.date} + ${this._i18n.date} + label="${this._i18n.hidedate_picker_tooltip}">
` : ""} @@ -627,15 +627,15 @@ export class SakaiAddTopic extends SakaiElement { ${this.topic.canModerate ? html`
-
${this.i18n.grading_and_duedate}
+
${this._i18n.grading_and_duedate}
${this._dueDateInPast ? html` -
${this.i18n.duedate_in_past_warning}
+
${this._i18n.duedate_in_past_warning}
` : ""} ${this._showDateAfterDueDate ? html` -
${this.i18n.showdate_after_duedate_warning}
+
${this._i18n.showdate_after_duedate_warning}
` : ""} ${this._hideDateBeforeDueDate ? html` -
${this.i18n.hidedate_before_duedate_warning}
+
${this._i18n.hidedate_before_duedate_warning}
` : ""}
@@ -645,16 +645,16 @@ export class SakaiAddTopic extends SakaiElement {
- ${this.i18n.duedate} - ${this.i18n.duedate_explanation} + ${this._i18n.duedate} + ${this._i18n.duedate_explanation}
${this._showDue ? html`
- ${this.i18n.date} + ${this._i18n.date} + label="${this._i18n.duedate_picker_tooltip}">
@@ -664,16 +664,16 @@ export class SakaiAddTopic extends SakaiElement {
- ${this.i18n.acceptuntildate} - ${this.i18n.acceptuntildate_explanation} + ${this._i18n.acceptuntildate} + ${this._i18n.acceptuntildate_explanation}
${this._showAcceptUntil ? html`
- ${this.i18n.date} + ${this._i18n.date} + label="${this._i18n.acceptuntildate_picker_tooltip}">
` : ""} @@ -687,15 +687,15 @@ export class SakaiAddTopic extends SakaiElement { ` : ""}
-
${this.i18n.post_options}
+
${this._i18n.post_options}
${this.canPin ? html`
- ${this.i18n.pinned} - ${this.i18n.pinned_text} + ${this._i18n.pinned} + ${this._i18n.pinned_text}
` : ""} ${this.canAnonPost ? html` @@ -704,16 +704,16 @@ export class SakaiAddTopic extends SakaiElement { @click=${this._setAnonymous} ?checked=${this.topic.anonymous}> - ${this.i18n.anonymous} - ${this.i18n.anonymous_text} + ${this._i18n.anonymous} + ${this._i18n.anonymous_text}
- ${this.i18n.anonymous_posts} - ${this.i18n.anonymous_posts_text} + ${this._i18n.anonymous_posts} + ${this._i18n.anonymous_posts_text}
` : ""}
@@ -721,14 +721,14 @@ export class SakaiAddTopic extends SakaiElement { @click="${this._setMustPostBeforeViewing}" ?checked=${this.topic.mustPostBeforeViewing}> - ${this.i18n.post_before_viewing_label} + ${this._i18n.post_before_viewing_label}
- - - + + +
diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiComment.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiComment.js index fdccf9d4ec42..88a6ae93a5af 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiComment.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiComment.js @@ -12,7 +12,6 @@ export class SakaiComment extends SakaiElement { topicId: { attribute: "topic-id", type: String }, siteId: { attribute: "site-id", type: String }, _editing: { attribute: false, type: Boolean }, - _i18n: { attribute: false, type: Boolean }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiCommentEditor.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiCommentEditor.js index a2102734a026..5c1ed6c8b58c 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiCommentEditor.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiCommentEditor.js @@ -13,7 +13,6 @@ export class SakaiCommentEditor extends SakaiElement { siteId: { attribute: "site-id", type: String }, topicId: { attribute: "topic-id", type: String }, _editing: { state: true }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversations.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversations.js index 11f2a1bfdd86..50d63aa49f31 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversations.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversations.js @@ -30,7 +30,6 @@ export class SakaiConversations extends SakaiElement { _state: { state: true }, _loadingData: { state: true }, _searchEnabled: { state: true }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversationsGuidelines.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversationsGuidelines.js index 7cffaf9ba8cd..b31c15acb3e7 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversationsGuidelines.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversationsGuidelines.js @@ -10,19 +10,19 @@ export class SakaiConversationsGuidelines extends SakaiElement { super(); - this.loadTranslations("conversations").then(r => this.i18n = r); + this.loadTranslations("conversations").then(r => this._i18n = r); } shouldUpdate() { - return this.i18n; + return this._i18n; } render() { return html` -

${this.i18n.community_guidelines}

-
${this.i18n.community_guidelines_instruction}
-
${unsafeHTML(this.guidelines || this.i18n.no_guidelines_yet)}
+

${this._i18n.community_guidelines}

+
${this._i18n.community_guidelines_instruction}
+
${unsafeHTML(this.guidelines || this._i18n.no_guidelines_yet)}
`; } } diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversationsSettings.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversationsSettings.js index b1ec5c02b03e..748f05949540 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversationsSettings.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversationsSettings.js @@ -11,7 +11,6 @@ export class SakaiConversationsSettings extends SakaiElement { settings: { type: Object }, siteId: { attribute: "site-id", type: String }, _editingGuidelines: { state: true }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversationsTagManager.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversationsTagManager.js index 2e04aa437f71..3ad030bc1e8d 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversationsTagManager.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiConversationsTagManager.js @@ -18,7 +18,7 @@ export class SakaiConversationsTagManager extends SakaiElement { this._tagsBeingEdited = []; - this.loadTranslations("conversations").then(r => this.i18n = r); + this.loadTranslations("conversations").then(r => this._i18n = r); } _createTags() { @@ -139,26 +139,26 @@ export class SakaiConversationsTagManager extends SakaiElement { _setSaveable() { this._saveable = true; } shouldUpdate() { - return this.i18n; + return this._i18n; } render() { return html`
-

${this.i18n.manage_tags}

-
${this.i18n.tags}
+

${this._i18n.manage_tags}

+
${this._i18n.tags}
-
${this.i18n.add_new_tags_instruction}
+
${this._i18n.add_new_tags_instruction}
- - + +
${this.tags.map(tag => html` @@ -166,18 +166,18 @@ export class SakaiConversationsTagManager extends SakaiElement {
${tag.label}
- - + +
${this._tagsBeingEdited.includes(tag.id) ? html` -
${this.i18n.tag_name}
+
${this._i18n.tag_name}
- - + +
` : nothing } diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiMenu.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiMenu.js deleted file mode 100644 index ce444dba6a56..000000000000 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiMenu.js +++ /dev/null @@ -1,42 +0,0 @@ -import { html, LitElement } from "lit"; -import { OverlayMixin } from "@lion/overlays"; - -export class SakaiMenu extends OverlayMixin(LitElement) { - - _defineOverlayConfig() { - - return ({ - placementMode: "local", - }); - } - - _setupOpenCloseListeners() { - - super._setupOpenCloseListeners(); - - if (this._overlayInvokerNode) { - this._overlayInvokerNode.addEventListener("click", this.toggle); - } - } - - _teardownOpenCloseListeners() { - - super._teardownOpenCloseListeners(); - - if (this._overlayInvokerNode) { - this._overlayInvokerNode.removeEventListener("click", this.toggle); - } - } - - render() { - - return html` - - -
- -
-
popup is ${this.opened ? "opened" : "closed"}
- `; - } -} diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiPost.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiPost.js index 73ff12d0a4ff..e4d549fec6e4 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiPost.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiPost.js @@ -24,7 +24,6 @@ export class SakaiPost extends reactionsAndUpvotingMixin(SakaiElement) { _expanded: { state: true }, _editing: { state: true }, _replying: { state: true }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopic.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopic.js index 8661922af87a..6580b831d5e0 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopic.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopic.js @@ -21,7 +21,6 @@ export class SakaiTopic extends reactionsAndUpvotingMixin(SakaiElement) { _postEditorDisplayed: { state: true }, _replying: { state: true }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopicList.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopicList.js index 36f094a0ca0b..df3f5e964ab3 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopicList.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopicList.js @@ -44,7 +44,7 @@ export class SakaiTopicList extends SakaiElement { this._currentFilter = this.ANY; - this.loadTranslations("conversations").then(r => this.i18n = r); + this.loadTranslations("conversations").then(r => this._i18n = r); } set data(value) { @@ -165,7 +165,7 @@ export class SakaiTopicList extends SakaiElement { _toggleExpandTheRest() { this._expandTheRest = !this._expandTheRest; } shouldUpdate() { - return this.i18n && this.data; + return this._i18n && this.data; } render() { @@ -175,40 +175,40 @@ export class SakaiTopicList extends SakaiElement {
- ${!this._tagsInUse?.length ? html` ` : html` - + ${this._tagsInUse.map(tag => html` - + `)} `}
- + ${this._hasQuestions ? html` - + ` : nothing } ${this._hasAnsweredQuestions ? html` - + ` : nothing } ${this._hasDiscussions ? html` - + ` : nothing } ${this._hasDiscussionsWithPosts ? html` - + ` : nothing } ${this._hasBookmarked ? html` - + ` : nothing } ${this._hasModerated ? html` - + ` : nothing } ${this._hasUnviewed ? html` - + ` : nothing }
@@ -217,12 +217,12 @@ export class SakaiTopicList extends SakaiElement {
${!this.data?.topics?.length ? html` -
${this.i18n.no_topics_yet}
+
${this._i18n.no_topics_yet}
` : nothing } ${this._filteredPinnedTopics.length > 0 ? html`
-
${this.i18n.pinned}
+
${this._i18n.pinned}
${this._filteredPinnedTopics.map(t => html`
@@ -237,7 +237,7 @@ export class SakaiTopicList extends SakaiElement {
-
${this.i18n.draft}
+
${this._i18n.draft}
${this._expandDraft ? html` @@ -256,7 +256,7 @@ export class SakaiTopicList extends SakaiElement {
-
${this.i18n.all_topics}
+
${this._i18n.all_topics}
${this._expandTheRest ? html` diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopicSummary.js b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopicSummary.js index 4a20e12f1590..a5c046973cd5 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopicSummary.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-conversations/src/SakaiTopicSummary.js @@ -11,7 +11,7 @@ export class SakaiTopicSummary extends SakaiElement { super(); - this.loadTranslations("conversations").then(r => this.i18n = r); + this.loadTranslations("conversations").then(r => this._i18n = r); } _topicSelected(e) { @@ -22,7 +22,7 @@ export class SakaiTopicSummary extends SakaiElement { } shouldUpdate() { - return this.i18n && this.topic; + return this._i18n && this.topic; } render() { @@ -38,8 +38,8 @@ export class SakaiTopicSummary extends SakaiElement { + aria-label="${this._i18n.question_tooltip}" + title="${this._i18n.question_tooltip}"> ` : nothing } ${this.topic.type === DISCUSSION ? html` @@ -47,15 +47,15 @@ export class SakaiTopicSummary extends SakaiElement { + aria-label="${this._i18n.discussion_tooltip}" + title="${this._i18n.discussion_tooltip}">
` : nothing }
-
${this.topic.draft ? html`[${this.i18n.draft}]` : nothing } ${this.topic.title}
+
${this.topic.draft ? html`[${this._i18n.draft}]` : nothing } ${this.topic.title}
@@ -63,32 +63,32 @@ export class SakaiTopicSummary extends SakaiElement {
+ aria-label="${this._i18n.pinned_tooltip}" + title="${this._i18n.pinned_tooltip}">
` : nothing } ${this.topic.bookmarked ? html`
+ aria-label="${this._i18n.bookmarked_tooltip}" + title="${this._i18n.bookmarked_tooltip}">
` : nothing } ${this.topic.locked ? html`
` : nothing } ${this.topic.hidden ? html`
` : nothing } @@ -104,8 +104,8 @@ export class SakaiTopicSummary extends SakaiElement { ${this.topic.numberOfUnreadPosts > 0 ? html` + aria-label="${this._i18n.unread_tooltip}" + title="${this._i18n.unread_tooltip}"> ` : nothing }
@@ -122,13 +122,13 @@ export class SakaiTopicSummary extends SakaiElement { + title="${this._i18n.answered_tooltip}"> ` : html` + title="${this._i18n.unanswered_tooltip}"> `} ` : nothing } @@ -139,21 +139,21 @@ export class SakaiTopicSummary extends SakaiElement {
${this.topic.creatorDisplayName} ${this.topic.isInstructor ? html` - (${this.i18n.instructor}) + (${this._i18n.instructor}) ` : nothing }
${this.topic.formattedCreatedDate}
+ title="${this._i18n.numberposts_tooltip}">
${this.topic.numberOfPosts} ${this.topic.numberOfUnreadPosts > 0 ? html` - (${this.topic.numberOfUnreadPosts} ${this.i18n.new}) + (${this.topic.numberOfUnreadPosts} ${this._i18n.new}) ` : nothing }
diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-course-card/src/SakaiCourseCard.js b/webcomponents/tool/src/main/frontend/packages/sakai-course-card/src/SakaiCourseCard.js index 867b7be3313a..79a853b9bc92 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-course-card/src/SakaiCourseCard.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-course-card/src/SakaiCourseCard.js @@ -8,10 +8,7 @@ import "@sakai-ui/sakai-icon"; export class SakaiCourseCard extends SakaiElement { static properties = { - courseData: { type: Object }, - - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-course-dashboard/src/SakaiCourseDashboard.js b/webcomponents/tool/src/main/frontend/packages/sakai-course-dashboard/src/SakaiCourseDashboard.js index 44135059b3b7..a928ecd94b3e 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-course-dashboard/src/SakaiCourseDashboard.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-course-dashboard/src/SakaiCourseDashboard.js @@ -17,14 +17,13 @@ export class SakaiCourseDashboard extends SakaiElement { editing: { type: Boolean }, data: { state: true }, - i18n: { state: true }, }; constructor() { super(); - this.loadTranslations("dashboard").then(r => this.i18n = r); + this.loadTranslations("dashboard").then(r => this._i18n = r); } connectedCallback() { @@ -174,7 +173,7 @@ export class SakaiCourseDashboard extends SakaiElement { } shouldUpdate() { - return this.i18n && this.data; + return this._i18n && this.data; } titleBlock() { @@ -189,17 +188,17 @@ export class SakaiCourseDashboard extends SakaiElement { ${this.data.editable ? html` ${this.editing ? html`
- ${this.i18n.layout} + ${this._i18n.layout}
- ${this.i18n.save} + ${this._i18n.save}
- ${this.i18n.cancel} + ${this._i18n.cancel}
` : html`
- ${this.i18n.edit} + ${this._i18n.edit}
`} ` : nothing} diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-course-dashboard/src/SakaiCourseDashboardTemplatePicker.js b/webcomponents/tool/src/main/frontend/packages/sakai-course-dashboard/src/SakaiCourseDashboardTemplatePicker.js index 77f6fab2eb1a..ebb6fe9f8fcb 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-course-dashboard/src/SakaiCourseDashboardTemplatePicker.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-course-dashboard/src/SakaiCourseDashboardTemplatePicker.js @@ -9,7 +9,6 @@ export class SakaiCourseDashboardTemplatePicker extends SakaiDialogContent { data: { type: Object }, template: { type: Object }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-course-dashboard/src/SakaiCourseHeader.js b/webcomponents/tool/src/main/frontend/packages/sakai-course-dashboard/src/SakaiCourseHeader.js index e00ccc1d81c6..1716e16b6c60 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-course-dashboard/src/SakaiCourseHeader.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-course-dashboard/src/SakaiCourseHeader.js @@ -1,16 +1,16 @@ -import { LitElement, css, html, nothing } from "lit"; +import { SakaiShadowElement } from "@sakai-ui/sakai-element"; +import { css, html, nothing } from "lit"; import "@sakai-ui/sakai-button/sakai-button.js"; import "@lion/dialog/define"; import "@sakai-ui/sakai-image-editor/sakai-image-editor.js"; import { loadProperties } from "@sakai-ui/sakai-i18n"; -export class SakaiCourseHeader extends LitElement { +export class SakaiCourseHeader extends SakaiShadowElement { static properties = { site: { type: Object }, editing: { type: Boolean }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-course-list/src/SakaiCourseList.js b/webcomponents/tool/src/main/frontend/packages/sakai-course-list/src/SakaiCourseList.js index 8255c9f91446..736899c8ef8e 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-course-list/src/SakaiCourseList.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-course-list/src/SakaiCourseList.js @@ -14,7 +14,6 @@ export class SakaiCourseList extends SakaiElement { _availableTerms: { state: true }, _currentFilter: { state: true }, _currentTermFilter: { state: true }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-date-picker/src/SakaiDatePicker.js b/webcomponents/tool/src/main/frontend/packages/sakai-date-picker/src/SakaiDatePicker.js index 7f092e824d43..7fb485141828 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-date-picker/src/SakaiDatePicker.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-date-picker/src/SakaiDatePicker.js @@ -13,7 +13,7 @@ import { Temporal } from "temporal-polyfill"; * * sakaiDatePicker.addEventListener("datetime-selected", e => console.log(e.detail.epochMillis)); * - * @extends LitElement + * @extends SakaiElement * @property {number} [epochMillis] The milliseconds since the unix epoch to set this datetime to * @property {string} [isoDate] The ISO8601 string to set this datetime to * @property {boolean} [_disabled] Disable the date controls diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-dialog-content/src/SakaiDialogContent.js b/webcomponents/tool/src/main/frontend/packages/sakai-dialog-content/src/SakaiDialogContent.js index 99ad849056c9..30fd80834b3d 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-dialog-content/src/SakaiDialogContent.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-dialog-content/src/SakaiDialogContent.js @@ -1,9 +1,10 @@ -import { LitElement, html, css } from "lit"; +import { SakaiShadowElement } from "@sakai-ui/sakai-element"; +import { html, css } from "lit"; import "@sakai-ui/sakai-icon/sakai-icon.js"; import "@sakai-ui/sakai-button/sakai-button.js"; import { loadProperties as lp } from "@sakai-ui/sakai-i18n"; -export class SakaiDialogContent extends LitElement { +export class SakaiDialogContent extends SakaiShadowElement { static properties = { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-document-viewer/src/SakaiDocumentViewer.js b/webcomponents/tool/src/main/frontend/packages/sakai-document-viewer/src/SakaiDocumentViewer.js index e66b9a4b535c..56c6bdae8bdb 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-document-viewer/src/SakaiDocumentViewer.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-document-viewer/src/SakaiDocumentViewer.js @@ -30,7 +30,6 @@ export class SakaiDocumentViewer extends SakaiElement { height: { type: String }, _documentMarkup: { state: true }, - _i18n: { state: true }, _noMargins: { state: true }, }; diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-element/src/SakaiShadowElement.js b/webcomponents/tool/src/main/frontend/packages/sakai-element/src/SakaiShadowElement.js index 41ae2f285575..896fc04cb1d1 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-element/src/SakaiShadowElement.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-element/src/SakaiShadowElement.js @@ -6,6 +6,7 @@ export class SakaiShadowElement extends LitElement { static properties = { _online: { state: true }, + _i18n: { state: true }, }; connectedCallback() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-file-list/src/SakaiFileList.js b/webcomponents/tool/src/main/frontend/packages/sakai-file-list/src/SakaiFileList.js index ae6e3c47b32e..8e7b0eef2589 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-file-list/src/SakaiFileList.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-file-list/src/SakaiFileList.js @@ -1,13 +1,12 @@ -import { css, html, LitElement } from "lit"; +import { SakaiShadowElement } from "@sakai-ui/sakai-element"; +import { css, html } from "lit"; import { loadProperties } from "@sakai-ui/sakai-i18n"; import "@sakai-ui/sakai-icon"; -export class SakaiFileList extends LitElement { +export class SakaiFileList extends SakaiShadowElement { static properties = { - files: { type: Array }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-forums/src/SakaiForums.js b/webcomponents/tool/src/main/frontend/packages/sakai-forums/src/SakaiForums.js index 9a46de527c8d..7c645251dab5 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-forums/src/SakaiForums.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-forums/src/SakaiForums.js @@ -6,8 +6,6 @@ import "@sakai-ui/sakai-site-picker/sakai-site-picker.js"; export class SakaiForums extends SakaiPageableElement { - static properties = { _i18n: { state: true } }; - constructor() { super(); diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/SakaiGrader.js b/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/SakaiGrader.js index 7018a46a3618..8f01e03573c5 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/SakaiGrader.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/SakaiGrader.js @@ -62,8 +62,8 @@ export class SakaiGrader extends graderRenderingMixin(gradableDataMixin(SakaiEle this.rubricParams = new Map(); this._submissions = []; this.resubmitNumber = "1"; - this.i18nPromise = this.loadTranslations("grader"); - this.i18nPromise.then(t => this.i18n = t); + this._i18nPromise = this.loadTranslations("grader"); + this._i18nPromise.then(t => this._i18n = t); if (typeof MathJax !== "undefined") { MathJax.Hub.Queue([ "Typeset", MathJax.Hub ]); @@ -144,7 +144,7 @@ export class SakaiGrader extends graderRenderingMixin(gradableDataMixin(SakaiEle this.modified = false; this.rubricParams = new Map(); this._showResubmission = this.__submission.resubmitsAllowed === -1 || this.__submission.resubmitsAllowed > 0; - this._isChecked = newValue.grade === this.i18n["gen.checked"] || newValue.grade === GRADE_CHECKED; + this._isChecked = newValue.grade === this._i18n["gen.checked"] || newValue.grade === GRADE_CHECKED; this._allowExtension = this.__submission.extensionAllowed; this._submittedTextMode = this.__submission.submittedText; this._feedbackCommentEditorShowing = false; @@ -184,13 +184,13 @@ export class SakaiGrader extends graderRenderingMixin(gradableDataMixin(SakaiEle _loadData(gradableId, submissionId) { - this.i18nPromise.then(() => { + this._i18nPromise.then(() => { this._loadGradableData(gradableId, submissionId).then(() => this._setup()); }); } shouldUpdate() { - return this.i18n; + return this._i18n; } _setup() { @@ -503,7 +503,7 @@ export class SakaiGrader extends graderRenderingMixin(gradableDataMixin(SakaiEle }) .then(r => r.json()).then(data => { - const submission = new Submission(data.submission, this.groups, this.i18n, data.assignmentCloseTime); + const submission = new Submission(data.submission, this.groups, this._i18n, data.assignmentCloseTime); submission.grade = formData.get("grade"); this._hasGraded = true; this.querySelector("sakai-grader-file-picker").reset(); @@ -567,7 +567,7 @@ export class SakaiGrader extends graderRenderingMixin(gradableDataMixin(SakaiEle } case CHECK_GRADE_TYPE: { const input = document.getElementById("check-grade-input"); - input && (input.checked = this._submission.grade === this.i18n["gen.checked"] || this._submission.grade === GRADE_CHECKED); + input && (input.checked = this._submission.grade === this._i18n["gen.checked"] || this._submission.grade === GRADE_CHECKED); break; } default: @@ -732,7 +732,7 @@ export class SakaiGrader extends graderRenderingMixin(gradableDataMixin(SakaiEle e.stopPropagation(); e.preventDefault(); - if (confirm(this.i18n.confirm_remove_attachment)) { + if (confirm(this._i18n.confirm_remove_attachment)) { const ref = e.target.dataset.ref; fetch(`/direct/assignment/removeFeedbackAttachment?gradableId=${this.gradableId}&submissionId=${this._submission.id}&ref=${encodeURIComponent(ref)}`) .then(r => { @@ -804,7 +804,7 @@ export class SakaiGrader extends graderRenderingMixin(gradableDataMixin(SakaiEle _removePrivateNotes() { - if (!confirm(this.i18n.confirm_remove_private_notes)) return false; + if (!confirm(this._i18n.confirm_remove_private_notes)) return false; this._submission.privateNotes = ""; this.privateNotesEditor?.setData(""); @@ -815,7 +815,7 @@ export class SakaiGrader extends graderRenderingMixin(gradableDataMixin(SakaiEle _removeFeedbackComment() { - if (!confirm(this.i18n.confirm_remove_feedback_comment)) return false; + if (!confirm(this._i18n.confirm_remove_feedback_comment)) return false; this._submission.feedbackComment = ""; this.feedbackCommentEditor?.setData(""); diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/SakaiGraderFilePicker.js b/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/SakaiGraderFilePicker.js index e89c00ced674..6f3ae3f5f2cc 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/SakaiGraderFilePicker.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/SakaiGraderFilePicker.js @@ -14,7 +14,7 @@ export class SakaiGraderFilePicker extends SakaiElement { super(); this._files = []; - this.loadTranslations("file-picker").then(t => this.i18n = t); + this.loadTranslations("file-picker").then(t => this._i18n = t); } getFiles() { return this._files; } @@ -33,12 +33,12 @@ export class SakaiGraderFilePicker extends SakaiElement {
${this._files.length > 0 ? html` -
${this.i18n.to_be_added}
+
${this._i18n.to_be_added}
${this._files.map(f => html` `)} diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/SakaiGraderToggle.js b/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/SakaiGraderToggle.js index cf6dce5427f9..5fe89b5736f5 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/SakaiGraderToggle.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/SakaiGraderToggle.js @@ -9,7 +9,6 @@ export class SakaiGraderToggle extends SakaiElement { checked: { type: Boolean }, uncheckedByDefault: { attribute: "unchecked-by-default", type: Boolean }, tool: { type: String }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/sakai-gradable-data-mixin.js b/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/sakai-gradable-data-mixin.js index 10f235d6b8b1..0c4d2e4ab345 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/sakai-gradable-data-mixin.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/sakai-gradable-data-mixin.js @@ -50,8 +50,8 @@ export const gradableDataMixin = Base => class extends Base { } }); - this.originalSubmissions = gradableData.submissions.map(s => new Submission(s, gradableData.groups, this.i18n, gradableData.gradable.closeTime)); - this._submissions = gradableData.submissions.map(s => new Submission(s, gradableData.groups, this.i18n, gradableData.gradable.closeTime)); + this.originalSubmissions = gradableData.submissions.map(s => new Submission(s, gradableData.groups, this._i18n, gradableData.gradable.closeTime)); + this._submissions = gradableData.submissions.map(s => new Submission(s, gradableData.groups, this._i18n, gradableData.gradable.closeTime)); this._submissions.sort((a, b) => a.firstSubmitterName.localeCompare(b.firstSubmitterName)); @@ -91,7 +91,7 @@ export const gradableDataMixin = Base => class extends Base { }) .then(data => { - const submissions = data.submissions.map(s => new Submission(s, data.groups, this.i18n, data.assignmentCloseTime)); + const submissions = data.submissions.map(s => new Submission(s, data.groups, this._i18n, data.assignmentCloseTime)); submissions.forEach(hydratedSubmission => { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/sakai-grader-rendering-mixin.js b/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/sakai-grader-rendering-mixin.js index 1eaed8ba6a04..6404c43931f9 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/sakai-grader-rendering-mixin.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-grader/src/sakai-grader-rendering-mixin.js @@ -26,26 +26,26 @@ export const graderRenderingMixin = Base => class extends Base {
- ${this._submission.late ? html`
${this.i18n["grades.lateness.late"]}
` : ""} + ${this._submission.late ? html`
${this._i18n["grades.lateness.late"]}
` : ""} ${this._submission.returned ? html` -
+
` : nothing }
${this._submission.groupId && this._submission.submittedTime ? html`
${this._submission.groupMembers}
` : nothing } @@ -813,7 +813,7 @@ export const graderRenderingMixin = Base => class extends Base {
` : nothing} @@ -824,7 +824,7 @@ export const graderRenderingMixin = Base => class extends Base { data-bs-target="#grader-submission-history" aria-controls="grader-submission_history" aria-expanded="false"> - ${this.i18n.submission_history} + ${this._i18n.submission_history}
@@ -841,14 +841,14 @@ export const graderRenderingMixin = Base => class extends Base { data-ref="${r.ref}" @click=${this._previewAttachment}> - ${r.name} (${r.contentLength} ${this.i18n.at} ${r.creationDate}) + ${r.name} (${r.contentLength} ${this._i18n.at} ${r.creationDate})
`)}
${this._submission.submitters?.length > 0 && this._submission.submitters[0].timeSpent ? html` - ${this.i18n["gen.assign.spent"]} + ${this._i18n["gen.assign.spent"]} ${this._submission.submitters[0].timeSpent} ` : nothing}
diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-grades/src/SakaiGrades.js b/webcomponents/tool/src/main/frontend/packages/sakai-grades/src/SakaiGrades.js index a58678bf380a..ccb1f221be72 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-grades/src/SakaiGrades.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-grades/src/SakaiGrades.js @@ -11,7 +11,6 @@ export class SakaiGrades extends SakaiPageableElement { static properties = { secret: { type: Boolean }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-group-picker/src/SakaiGroupPicker.js b/webcomponents/tool/src/main/frontend/packages/sakai-group-picker/src/SakaiGroupPicker.js index e567e3fb6a60..71a637afc3b0 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-group-picker/src/SakaiGroupPicker.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-group-picker/src/SakaiGroupPicker.js @@ -10,7 +10,6 @@ export class SakaiGroupPicker extends SakaiElement { groupRef: { attribute: "group-ref", type: String }, multiple: { type: Boolean }, selectedGroups: { attribute: "selected-groups", type: Array }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-home-dashboard/src/SakaiHomeDashboard.js b/webcomponents/tool/src/main/frontend/packages/sakai-home-dashboard/src/SakaiHomeDashboard.js index 61fb7c9f6fc7..f026303c5f49 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-home-dashboard/src/SakaiHomeDashboard.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-home-dashboard/src/SakaiHomeDashboard.js @@ -16,7 +16,6 @@ export class SakaiHomeDashboard extends SakaiElement { userId: { attribute: "user-id", type: String }, showSites: { attribute: "show-sites", type: Boolean }, _data: { state: true }, - _i18n: { state: true }, _showMotd: { state: true }, _editing: { state: true }, }; diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-icon/src/SakaiIcon.js b/webcomponents/tool/src/main/frontend/packages/sakai-icon/src/SakaiIcon.js index 49206ddc5a7a..f9418e313984 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-icon/src/SakaiIcon.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-icon/src/SakaiIcon.js @@ -1,11 +1,12 @@ -import { html, css, nothing, LitElement } from "lit"; +import { SakaiShadowElement } from "@sakai-ui/sakai-element"; +import { html, css, nothing } from "lit"; import { icon, library } from "@fortawesome/fontawesome-svg-core"; import { faCompressArrowsAlt, faVideo, faEyeSlash, faChalkboardTeacher, faExpandArrowsAlt, faLock, faStar, faEllipsisV, faBell, faCircle, faCog, faChevronUp, faChevronDown, faList, faThumbsUp, faThumbtack, faTimes, faCheckSquare, faCheckCircle, faComment, faComments, faBook, faFile, faFileAlt, faGripVertical, faLightbulb, faHeart, faUsers, faUserSecret, faMinus, faMicrophone, faPlus, faQuestion, faQuestionCircle, faFlag, faAngleRight, faAngleLeft, faHourglass, faFileWord, faSync, faSmile, faTrash, faTrashRestore, faEdit, faKey, faArrowDown, faArrowLeft, faArrowRight, faArrowUp, faPlay, faVolumeUp, faSearch } from "@fortawesome/free-solid-svg-icons"; -export class SakaiIcon extends LitElement { +export class SakaiIcon extends SakaiShadowElement { static properties = { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-image-editor/src/SakaiImageEditor.js b/webcomponents/tool/src/main/frontend/packages/sakai-image-editor/src/SakaiImageEditor.js index b2c2844f81e8..20272c58e40c 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-image-editor/src/SakaiImageEditor.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-image-editor/src/SakaiImageEditor.js @@ -6,9 +6,7 @@ import { cropperStyles } from "./cropperStyles.js"; export class SakaiImageEditor extends SakaiDialogContent { static properties = { - imageUrl: { attribute: "image-url", type: String }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-lti-iframe/src/SakaiLTIIframe.js b/webcomponents/tool/src/main/frontend/packages/sakai-lti-iframe/src/SakaiLTIIframe.js index 045e30abbd18..d0d245634e76 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-lti-iframe/src/SakaiLTIIframe.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-lti-iframe/src/SakaiLTIIframe.js @@ -20,8 +20,8 @@ export class SakaiLTIIframe extends SakaiElement { this.loadTranslations("lti").then(t => { - this.i18n = t; - if ( this.newWindowText == null ) this.newWindowText = this.i18n.new_window_text; + this._i18n = t; + if ( this.newWindowText == null ) this.newWindowText = this._i18n.new_window_text; this.requestUpdate(); }); @@ -101,7 +101,7 @@ export class SakaiLTIIframe extends SakaiElement { } shouldUpdate() { - return this.i18n && this.newWindowText && this.launchUrl; + return this._i18n && this.newWindowText && this.launchUrl; } launchPopup() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-lti-popup/src/SakaiLTIPopup.js b/webcomponents/tool/src/main/frontend/packages/sakai-lti-popup/src/SakaiLTIPopup.js index 07dae5e35d5b..8543453a0e80 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-lti-popup/src/SakaiLTIPopup.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-lti-popup/src/SakaiLTIPopup.js @@ -22,9 +22,9 @@ export class SakaiLTIPopup extends SakaiElement { this.auto = false; this.loadTranslations("lti").then(t => { - this.i18n = t; - if ( this.preLaunchText == null ) this.preLaunchText = this.i18n.pre_launch_text; - if ( this.postLaunchText == null ) this.postLaunchText = this.i18n.post_launch_text; + this._i18n = t; + if ( this.preLaunchText == null ) this.preLaunchText = this._i18n.pre_launch_text; + if ( this.postLaunchText == null ) this.postLaunchText = this._i18n.post_launch_text; }); } diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-notifications/src/SakaiNotifications.js b/webcomponents/tool/src/main/frontend/packages/sakai-notifications/src/SakaiNotifications.js index 796f0f71a0cc..9a65ec83144b 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-notifications/src/SakaiNotifications.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-notifications/src/SakaiNotifications.js @@ -18,7 +18,6 @@ export class SakaiNotifications extends SakaiElement { edgeInfoUrl: { attribute: "edge-info-url", type: String }, _state: { state: true }, _highlightTestButton: { state: true }, - _i18n: { state: true }, _browserInfoUrl: { state: true }, }; diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/LICENSE b/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/LICENSE deleted file mode 100644 index 3c489448ad24..000000000000 --- a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -Copyright 2022 The Apereo Foundation Licensed under the -Educational Community License, Version 2.0 (the "License"); you may -not use this file except in compliance with the License. You may -obtain a copy of the License at - -http://www.osedu.org/licenses/ECL-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an "AS IS" -BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express -or implied. See the License for the specific language governing -permissions and limitations under the License. diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/README.md b/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/README.md deleted file mode 100644 index 8cc6af7a43d3..000000000000 --- a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# sakai-file-list - -A file list component for Sakai - -## Installation - -```bash -npm i @sakai-ui/sakai-file-list -``` - -## Usage - -```html - - - -``` - -## Linting and formatting - -To scan the project for linting and formatting errors, run - -```bash -npm run lint -``` - -## Testing with Web Test Runner - -To execute a single test run: - -```bash -npm run test -``` diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/index.js b/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/index.js deleted file mode 100644 index 9d28f38bc864..000000000000 --- a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/index.js +++ /dev/null @@ -1 +0,0 @@ -export { SakaiOptionsMenu } from './src/SakaiOptionsMenu.js'; diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/package.json b/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/package.json deleted file mode 100644 index f4cacfc937fa..000000000000 --- a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "@sakai-ui/sakai-options-menu", - "version": "3.0.7", - "description": "The Sakai options menu", - "main": "index.js", - "module": "index.js", - "scripts": { - "lint:fix": "eslint src --fix", - "test": "web-test-runner --coverage" - }, - "files": [ - "*.js", - "src" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/sakaiproject/sakai-ui.git", - "directory": "packages/sakai-options-menu" - }, - "keywords": [ - "sakai", - "permissions" - ], - "author": "The Sakai Project ", - "license": "ECL-2.0", - "publishConfig": { - "access": "public" - }, - "bugs": { - "url": "https://github.com/sakaiproject/sakai-ui/issues" - }, - "homepage": "https://github.com/sakaiproject/sakai-ui#readme", - "exports": { - ".": "./index.js" - } -} diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/sakai-options-menu.js b/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/sakai-options-menu.js deleted file mode 100644 index c13a3a8f90a6..000000000000 --- a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/sakai-options-menu.js +++ /dev/null @@ -1,3 +0,0 @@ -import { SakaiOptionsMenu } from './src/SakaiOptionsMenu.js'; - -customElements.define('sakai-options-menu', SakaiOptionsMenu); diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/src/SakaiOptionsMenu.js b/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/src/SakaiOptionsMenu.js deleted file mode 100644 index ac2c71fc08e1..000000000000 --- a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/src/SakaiOptionsMenu.js +++ /dev/null @@ -1,49 +0,0 @@ -import { css, html, LitElement } from "lit"; -import "@lion/dialog/define"; - -export class SakaiOptionsMenu extends LitElement { - - static properties = { placement: { type: String } }; - - constructor() { - - super(); - - this.placementModeLocalConfig = { placementMode: "local", popperConfig: { placement: "right" } }; - } - - set placement(value) { - - this._placement = value; - this.placementModeLocalConfig.popperConfig.placement = value; - } - - get placement() { return this._placement; } - - render() { - - return html` - - - - -
- -
-
- `; - } - - static styles = css` - .overlay { - background-color: var(--sakai-options-menu-background-color, white); - border: 1px solid var(--sakai-options-menu-border-color, #F1F2F3); - border-radius: var(--sakai-options-menu-border-radius, 4px); - width: 200px; - } - a { - text-decoration: none; - color: var(--sakai-options-menu-color, black); - } - `; -} diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/test/data.js b/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/test/data.js deleted file mode 100644 index e69686e0b5af..000000000000 --- a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/test/data.js +++ /dev/null @@ -1,16 +0,0 @@ -export const userId = "xyz"; -export const courselistI18nUrl = "/sakai-ws/rest/i18n/getI18nProperties?locale=en_GB&resourceclass=org.sakaiproject.i18n.InternationalizedMessages&resourcebundle=courselist"; -export const courselistI18n = ` -view_all_sites=View All Sites -favourites=Favourites -all_projects=All Projects -all_courses=All Courses -new_activity=New Activity -title_a_to_z=Title: A-Z -title_z_to_a=Title: Z-A -code_a_to_z=Code: A-Z -code_z_to_a=Code: Z-A -`; -export courseListUrl = `/api/users/${userId}/sites`; -export const courseList = [ -]; diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/test/sakai-options-menu.test.js b/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/test/sakai-options-menu.test.js deleted file mode 100644 index 24e550f98ba8..000000000000 --- a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/test/sakai-options-menu.test.js +++ /dev/null @@ -1,22 +0,0 @@ -import "../sakai-options-menu.js"; -import { expect, fixture } from "@open-wc/testing"; -import { html } from "lit"; - -describe("sakai-options-menu tests", () => { - - it ("renders correctly", async () => { - - const el = await fixture(html`
Eggs
`); - - expect(el.shadowRoot.querySelector("lion-dialog")).to.exist; - }); - - it ("is accessible", async () => { - - let el = await fixture(html``); - await expect(el).to.not.be.accessible(); - - el = await fixture(html`
Eggs
`); - await expect(el).to.be.accessible(); - }); -}); diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/web-test-runner.config.mjs b/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/web-test-runner.config.mjs deleted file mode 100644 index be213a54cf01..000000000000 --- a/webcomponents/tool/src/main/frontend/packages/sakai-options-menu/web-test-runner.config.mjs +++ /dev/null @@ -1,41 +0,0 @@ -// import { playwrightLauncher } from '@web/test-runner-playwright'; - -const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode']; - -export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({ - /** Test files to run */ - files: 'test/**/*.test.js', - - /** Resolve bare module imports */ - nodeResolve: { - exportConditions: ['browser', 'development'], - }, - - /** Filter out lit dev mode logs */ - filterBrowserLogs(log) { - for (const arg of log.args) { - if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) { - return false; - } - } - return true; - }, - - /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */ - // esbuildTarget: 'auto', - - /** Amount of browsers to run concurrently */ - // concurrentBrowsers: 2, - - /** Amount of test files per browser to test concurrently */ - // concurrency: 1, - - /** Browsers to run tests on */ - // browsers: [ - // playwrightLauncher({ product: 'chromium' }), - // playwrightLauncher({ product: 'firefox' }), - // playwrightLauncher({ product: 'webkit' }), - // ], - - // See documentation for all available options -}); diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-permissions/src/SakaiPermissions.js b/webcomponents/tool/src/main/frontend/packages/sakai-permissions/src/SakaiPermissions.js index d5e6fd31abba..49327d15cec6 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-permissions/src/SakaiPermissions.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-permissions/src/SakaiPermissions.js @@ -17,7 +17,6 @@ export class SakaiPermissions extends SakaiElement { roles: { state: true }, groups: { state: true }, error: { state: true }, - i18n: { state: true }, }; constructor() { @@ -29,7 +28,7 @@ export class SakaiPermissions extends SakaiElement { this.loadTranslations(this.bundleKey ? this.bundleKey : this.tool).then(tool => { Object.keys(tool).filter(k => k.startsWith("perm-")).forEach(k => i18n[k.substring(5)] = tool[k]); - this.i18n = i18n; + this._i18n = i18n; }); }); } @@ -107,7 +106,7 @@ export class SakaiPermissions extends SakaiElement { } shouldUpdate() { - return this.i18n; + return this._i18n; } render() { @@ -117,7 +116,7 @@ export class SakaiPermissions extends SakaiElement { ${!this.reference && this.groups?.length > 0 ? html`
- + @@ -126,9 +125,9 @@ export class SakaiPermissions extends SakaiElement { ` : nothing }
@@ -136,9 +135,9 @@ export class SakaiPermissions extends SakaiElement {
${this.roles.map(role => html` @@ -147,7 +146,7 @@ export class SakaiPermissions extends SakaiElement { @mouseenter=${this._handleRoleMouseEnter} @mouseleave=${this._handleRoleMouseLeave}>
${this.roles.map(role => html`
- - - + + +
`; } else if (this.error) { - return html`
${this.i18n.alert_permission}
`; + return html`
${this._i18n.alert_permission}
`; } return html`Waiting for permissions`; diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-picture-changer/src/SakaiPictureChanger.js b/webcomponents/tool/src/main/frontend/packages/sakai-picture-changer/src/SakaiPictureChanger.js index a7dd344abce8..d323a96e259e 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-picture-changer/src/SakaiPictureChanger.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-picture-changer/src/SakaiPictureChanger.js @@ -14,7 +14,6 @@ export class SakaiPictureChanger extends SakaiElement { _uploadError: { state: true }, _removeError: { state: true }, _needsSave: { state: true }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-profile/src/SakaiProfile.js b/webcomponents/tool/src/main/frontend/packages/sakai-profile/src/SakaiProfile.js index ee295cb9852d..e6a726362208 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-profile/src/SakaiProfile.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-profile/src/SakaiProfile.js @@ -16,7 +16,6 @@ export class SakaiProfile extends SakaiShadowElement { tool: { type: String }, _profile: { state: true }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-pronunciation-player/src/SakaiPronunciationPlayer.js b/webcomponents/tool/src/main/frontend/packages/sakai-pronunciation-player/src/SakaiPronunciationPlayer.js index e3fc0c67cf3c..61082ae095e6 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-pronunciation-player/src/SakaiPronunciationPlayer.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-pronunciation-player/src/SakaiPronunciationPlayer.js @@ -1,4 +1,5 @@ -import { html, LitElement } from "lit"; +import { SakaiShadowElement } from "@sakai-ui/sakai-element"; +import { html } from "lit"; import { ifDefined } from "lit/directives/if-defined.js"; import { loadProperties } from "@sakai-ui/sakai-i18n"; import "@sakai-ui/sakai-icon/sakai-icon.js"; @@ -8,7 +9,7 @@ import "@sakai-ui/sakai-icon/sakai-icon.js"; * * Usage: */ -export class SakaiPronunciationPlayer extends LitElement { +export class SakaiPronunciationPlayer extends SakaiShadowElement { static properties = { @@ -21,7 +22,7 @@ export class SakaiPronunciationPlayer extends LitElement { super(); - loadProperties("pronunciation-player").then(r => { this.i18n = r; this.requestUpdate(); }); + loadProperties("pronunciation-player").then(r => { this._i18n = r; this.requestUpdate(); }); } @@ -34,7 +35,7 @@ export class SakaiPronunciationPlayer extends LitElement { get userId() { return this._userId; } shouldUpdate() { - return this.i18n && this._src; + return this._i18n && this._src; } render() { @@ -43,8 +44,8 @@ export class SakaiPronunciationPlayer extends LitElement {
${this.title}
- ${this.i18n.subject} + ${this._i18n.subject} this.subject = e.target.value} - placeholder="${this.i18n.subject_placeholder}"/> -
${this.i18n.message}
+ placeholder="${this._i18n.subject_placeholder}"/> +
${this._i18n.message}
- ${this.i18n.select_action} + ${this._i18n.select_action}
-
-
+
+
- ${this.i18n.select_group} + ${this._i18n.select_group}
- + ${this.recipientsToCheck.length > 0 ? html` -
${this.i18n.recipients}
+
${this._i18n.recipients}
${this.recipientsToCheck.map(r => html`
${r.displayName}
`)}
` : nothing }
- + ${this.sending ? html`
` : nothing } - ${this.success ? html`${this.i18n.success}` : nothing} - ${this.error ? html`${this.i18n.error}` : nothing } + ${this.success ? html`${this._i18n.success}` : nothing} + ${this.error ? html`${this._i18n.error}` : nothing }
`; diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-tasks/src/SakaiTasks.js b/webcomponents/tool/src/main/frontend/packages/sakai-tasks/src/SakaiTasks.js index 254f445546af..123c9cafdd9e 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-tasks/src/SakaiTasks.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-tasks/src/SakaiTasks.js @@ -24,7 +24,7 @@ export class SakaiTasks extends SakaiPageableElement { this.showPager = true; this._canUpdateSite = false; this._currentFilter = constants.CURRENT; - this.loadTranslations("tasks").then(r => this.i18n = r); + this.loadTranslations("tasks").then(r => this._i18n = r); } set data(value) { @@ -171,7 +171,7 @@ export class SakaiTasks extends SakaiPageableElement { deleteTask(e) { - if (!confirm(`${this.i18n.alert_want_to_delete}`)) { + if (!confirm(`${this._i18n.alert_want_to_delete}`)) { return false; } @@ -268,7 +268,7 @@ export class SakaiTasks extends SakaiPageableElement { } shouldUpdate() { - return this.i18n && this.dataPage; + return this._i18n && this.dataPage; } content() { @@ -294,7 +294,7 @@ export class SakaiTasks extends SakaiPageableElement {
@@ -305,35 +305,35 @@ export class SakaiTasks extends SakaiPageableElement {
${this.dataPage.filter(t => t.visible).length > 0 ? html`
-
${this.i18n.priority}
-
${this.i18n.task}
- +
${this._i18n.priority}
+
${this._i18n.task}
+ ${this.dataPage.filter(t => t.visible).map((t, i) => html` @@ -371,8 +371,8 @@ export class SakaiTasks extends SakaiPageableElement { + title="${this._i18n.hard_delete}" + aria-label="${this._i18n.hard_delete}">
@@ -380,8 +380,8 @@ export class SakaiTasks extends SakaiPageableElement { + title="${this._i18n.restore}" + aria-label="${this._i18n.restore}">
@@ -390,8 +390,8 @@ export class SakaiTasks extends SakaiPageableElement { + title="${this._i18n.soft_delete}" + aria-label="${this._i18n.soft_delete}">
@@ -401,8 +401,8 @@ export class SakaiTasks extends SakaiPageableElement { ${t.url ? html` @@ -411,7 +411,7 @@ export class SakaiTasks extends SakaiPageableElement {
`)}
- ` : html`
${this.i18n.no_tasks}
` + ` : html`
${this._i18n.no_tasks}
` } `; } diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-tasks/src/SakaiTasksCreateTask.js b/webcomponents/tool/src/main/frontend/packages/sakai-tasks/src/SakaiTasksCreateTask.js index 1ee30559fbd4..1eea96210a6f 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-tasks/src/SakaiTasksCreateTask.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-tasks/src/SakaiTasksCreateTask.js @@ -26,7 +26,6 @@ export class SakaiTasksCreateTask extends SakaiDialogContent { deliverTasks: { attribute: "deliver-tasks", type: Boolean }, groups: { type: Array }, - _i18n: { state: true }, _error: { state: true }, _assignationType: { state: true }, _selectedGroups: { state: true }, diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-toggle/src/SakaiToggle.js b/webcomponents/tool/src/main/frontend/packages/sakai-toggle/src/SakaiToggle.js index d064dbbea9ed..be445727230b 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-toggle/src/SakaiToggle.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-toggle/src/SakaiToggle.js @@ -1,6 +1,7 @@ -import { css, html, LitElement } from "lit"; +import { SakaiShadowElement } from "@sakai-ui/sakai-element"; +import { css, html } from "lit"; -export class SakaiToggle extends LitElement { +export class SakaiToggle extends SakaiShadowElement { static properties = { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-widgets/src/SakaiDashboardWidget.js b/webcomponents/tool/src/main/frontend/packages/sakai-widgets/src/SakaiDashboardWidget.js index 61478f39974b..48deab4c9d5b 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-widgets/src/SakaiDashboardWidget.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-widgets/src/SakaiDashboardWidget.js @@ -16,7 +16,6 @@ export class SakaiDashboardWidget extends SakaiShadowElement { disableLeftAndUp: { attribute: "disable-left-and-up", type: Boolean }, disableRightAndDown: { attribute: "disable-right-and-down", type: Boolean }, _baseI18n: { state: true }, - _i18n: { state: true }, }; constructor() { diff --git a/webcomponents/tool/src/main/frontend/packages/sakai-widgets/src/SakaiWidgetPanel.js b/webcomponents/tool/src/main/frontend/packages/sakai-widgets/src/SakaiWidgetPanel.js index 2a7b06bbd919..10659a297b33 100644 --- a/webcomponents/tool/src/main/frontend/packages/sakai-widgets/src/SakaiWidgetPanel.js +++ b/webcomponents/tool/src/main/frontend/packages/sakai-widgets/src/SakaiWidgetPanel.js @@ -28,7 +28,7 @@ export class SakaiWidgetPanel extends SakaiShadowElement { super(); this.state = "view"; - loadProperties("widgetpanel").then(r => this.i18n = r); + loadProperties("widgetpanel").then(r => this._i18n = r); } set widgetIds(value) { @@ -61,7 +61,7 @@ export class SakaiWidgetPanel extends SakaiShadowElement { get layout() { return this._layout; } shouldUpdate() { - return this.i18n; + return this._i18n; } fireChanged() { @@ -272,10 +272,10 @@ export class SakaiWidgetPanel extends SakaiShadowElement {
` : nothing}