From 7b50af8411f4ecaa8167aa20b50ab973ccf4ac7d Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 21 Sep 2023 10:35:48 +0200 Subject: [PATCH 1/2] Remove beta modifiers --- .../components/annotations/annotation_form.ts | 3 +- .../components/annotations/user_annotation.ts | 3 +- .../saved_annotation_icon.ts | 3 +- .../javascripts/saved_annotation_beta.ts | 9 ----- .../javascripts/state/UserAnnotations.ts | 2 - app/policies/saved_annotation_policy.rb | 37 ++++--------------- .../saved_annotation_controller_test.rb | 2 +- test/javascript/code_listing.test.ts | 6 --- 8 files changed, 11 insertions(+), 54 deletions(-) delete mode 100644 app/assets/javascripts/saved_annotation_beta.ts diff --git a/app/assets/javascripts/components/annotations/annotation_form.ts b/app/assets/javascripts/components/annotations/annotation_form.ts index 82bc9b11c9..83950888b9 100644 --- a/app/assets/javascripts/components/annotations/annotation_form.ts +++ b/app/assets/javascripts/components/annotations/annotation_form.ts @@ -1,7 +1,6 @@ import { customElement, property } from "lit/decorators.js"; import { html, TemplateResult } from "lit"; import { ShadowlessLitElement } from "components/meta/shadowless_lit_element"; -import { isBetaCourse } from "saved_annotation_beta"; import { watchMixin } from "components/meta/watch_mixin"; import { createRef, Ref, ref } from "lit/directives/ref.js"; import "components/saved_annotations/saved_annotation_input"; @@ -223,7 +222,7 @@ export class AnnotationForm extends watchMixin(ShadowlessLitElement) { } get canSaveAnnotation(): boolean { - return !annotationState.isQuestionMode && /* REMOVE AFTER CLOSED BETA */ isBetaCourse(); + return !annotationState.isQuestionMode; } get potentialSavedAnnotationsExist(): boolean { diff --git a/app/assets/javascripts/components/annotations/user_annotation.ts b/app/assets/javascripts/components/annotations/user_annotation.ts index e981ee5ff0..2cc376d3f9 100644 --- a/app/assets/javascripts/components/annotations/user_annotation.ts +++ b/app/assets/javascripts/components/annotations/user_annotation.ts @@ -11,7 +11,6 @@ import { initTooltips } from "utilities"; import "components/saved_annotations/saved_annotation_icon"; import { annotationState } from "state/Annotations"; import { savedAnnotationState } from "state/SavedAnnotations"; -import { isBetaCourse } from "saved_annotation_beta"; /** * This component represents a single user annotation. @@ -153,7 +152,7 @@ export class UserAnnotationComponent extends i18nMixin(ShadowlessLitElement) { `); } - if (this.data.permission.save && isBetaCourse() && !this.data.saved_annotation_id) { + if (this.data.permission.save && !this.data.saved_annotation_id) { options.push(html`
  • { "created_at": "2023-03-02T15:15:48.776+01:00", "url": "http://dodona.localhost:3000/nl/annotations/1.json", "last_updated_by": { "name": "Zeus Kronosson" }, - "course_id": 1, "responses": [], "type": "question", "annotation_text": "This could be shorter", @@ -236,7 +235,6 @@ test("annotations should be transmitted into view", async () => { "created_at": "2023-03-02T15:15:48.776+01:00", "url": "http://dodona.localhost:3000/nl/annotations/1.json", "last_updated_by": { "name": "Zeus Kronosson" }, - "course_id": 1, "responses": [], "type": "question", "annotation_text": "This should be faster", @@ -264,7 +262,6 @@ test("feedback table should support more than 1 annotation per row", async () => "created_at": "2023-03-02T15:15:48.776+01:00", "url": "http://dodona.localhost:3000/nl/annotations/1.json", "last_updated_by": { "name": "Zeus Kronosson" }, - "course_id": 1, "responses": [], "type": "question", "annotation_text": "This could be shorter", @@ -287,7 +284,6 @@ test("feedback table should support more than 1 annotation per row", async () => "created_at": "2023-03-02T15:15:48.776+01:00", "url": "http://dodona.localhost:3000/nl/annotations/1.json", "last_updated_by": { "name": "Zeus Kronosson" }, - "course_id": 1, "responses": [], "type": "question", "annotation_text": "This should be faster", @@ -315,7 +311,6 @@ test("feedback table should be able to contain both machine annotations and user "created_at": "2023-03-02T15:15:48.776+01:00", "url": "http://dodona.localhost:3000/nl/annotations/1.json", "last_updated_by": { "name": "Zeus Kronosson" }, - "course_id": 1, "responses": [], "type": "question", "annotation_text": "This could be shorter", @@ -338,7 +333,6 @@ test("feedback table should be able to contain both machine annotations and user "created_at": "2023-03-02T15:15:48.776+01:00", "url": "http://dodona.localhost:3000/nl/annotations/1.json", "last_updated_by": { "name": "Zeus Kronosson" }, - "course_id": 1, "responses": [], "type": "question", "annotation_text": "This should be faster", From ee410bdbced5b02d89c9b20b6b031f33ab1155fd Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 21 Sep 2023 13:21:24 +0200 Subject: [PATCH 2/2] Fix linting --- app/policies/saved_annotation_policy.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/policies/saved_annotation_policy.rb b/app/policies/saved_annotation_policy.rb index 33a80011b1..8c52159cf3 100644 --- a/app/policies/saved_annotation_policy.rb +++ b/app/policies/saved_annotation_policy.rb @@ -1,5 +1,4 @@ class SavedAnnotationPolicy < ApplicationPolicy - class Scope < ApplicationPolicy::Scope def resolve if user&.zeus?