From ce56b6929ff1615bfaa2c84c0d50427cae7c407e Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Fri, 11 Aug 2023 14:43:30 +0200 Subject: [PATCH] Remove saved annotations sidecard --- .../saved_annotations_sidecard.ts | 53 ------------------- .../stylesheets/models/submissions.css.scss | 4 -- app/javascript/packs/application_pack.js | 1 - app/views/feedbacks/show.html.erb | 7 --- app/views/submissions/show.html.erb | 13 +---- test/system/saved_annotation_test.rb | 11 ---- 6 files changed, 2 insertions(+), 87 deletions(-) delete mode 100644 app/assets/javascripts/components/saved_annotations/saved_annotations_sidecard.ts diff --git a/app/assets/javascripts/components/saved_annotations/saved_annotations_sidecard.ts b/app/assets/javascripts/components/saved_annotations/saved_annotations_sidecard.ts deleted file mode 100644 index d5fe7fc662..0000000000 --- a/app/assets/javascripts/components/saved_annotations/saved_annotations_sidecard.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { customElement, property } from "lit/decorators.js"; -import { ShadowlessLitElement } from "components/meta/shadowless_lit_element"; -import { html, TemplateResult } from "lit"; -import "./saved_annotation_list"; -import { savedAnnotationState } from "state/SavedAnnotations"; - -/** - * This component represents a list of saved annotations - * - * @element d-saved-annotations-sidecard - * - * @prop {Number} courseId - used to fetch saved annotations by course - * @prop {Number} exerciseId - used to fetch saved annotations by exercise - * @prop {Number} userId - used to fetch saved annotations by user - */ -@customElement("d-saved-annotations-sidecard") -export class SavedAnnotationList extends ShadowlessLitElement { - @property({ type: Number, attribute: "course-id" }) - courseId: number; - @property({ type: Number, attribute: "exercise-id" }) - exerciseId: number; - @property({ type: Number, attribute: "user-id" }) - userId: number; - - get potentialSavedAnnotationsExist(): boolean { - return savedAnnotationState.getList(new Map([ - ["course_id", this.courseId.toString()], - ["exercise_id", this.exerciseId.toString()], - ["user_id", this.userId.toString()] - ])).length > 0; - } - - render(): TemplateResult { - return this.potentialSavedAnnotationsExist ? html` -
-
-

- ${I18n.t("js.saved_annotation.sidecard.title")} -

- ${I18n.t("js.saved_annotation.sidecard.link")} -

-

- -
-
- ` : html``; - } -} diff --git a/app/assets/stylesheets/models/submissions.css.scss b/app/assets/stylesheets/models/submissions.css.scss index 666d8eba29..8376c6fa81 100644 --- a/app/assets/stylesheets/models/submissions.css.scss +++ b/app/assets/stylesheets/models/submissions.css.scss @@ -420,7 +420,3 @@ iframe.file { margin-right: 6px; } } - -d-saved-annotations-sidecard:empty { - display: none; -} diff --git a/app/javascript/packs/application_pack.js b/app/javascript/packs/application_pack.js index 6271fdeedf..99700abe56 100644 --- a/app/javascript/packs/application_pack.js +++ b/app/javascript/packs/application_pack.js @@ -37,7 +37,6 @@ import { initClipboard } from "copy"; import { FaviconManager } from "favicon"; import { themeState } from "state/Theme"; import "components/saved_annotations/saved_annotation_list"; -import "components/saved_annotations/saved_annotations_sidecard"; import "components/progress_bar"; import "components/theme_picker"; import { userState } from "../../assets/javascripts/state/Users"; diff --git a/app/views/feedbacks/show.html.erb b/app/views/feedbacks/show.html.erb index a9381fc701..ce35fcedfb 100644 --- a/app/views/feedbacks/show.html.erb +++ b/app/views/feedbacks/show.html.erb @@ -12,13 +12,6 @@
<%= render partial: 'feedback_actions', locals: { evaluation: @feedback.evaluation, feedback: @feedback } %>
- - <% if policy(SavedAnnotation).beta_course? @feedback.evaluation.series.course.id %> - - <% end %>