From df87cd3d8df5ad379b359945b9cb2b4bd2a8724a Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 24 Nov 2022 09:59:59 +0100 Subject: [PATCH 1/4] Remove tokenfield typeahead --- .rubocop.yml | 1 - Gemfile | 3 - Gemfile.lock | 2 - app/assets/javascripts/application_old.js | 2 - app/assets/stylesheets/base.css.scss | 1 - app/assets/stylesheets/components.css.scss | 1 - .../components/table-toolbar.css.scss | 16 - .../components/tokenfield.css.scss | 281 ------------------ app/models/course.rb | 6 +- app/models/series.rb | 2 +- bin/build-css | 1 - config/deploy.rb | 2 +- db/schema.rb | 103 +++---- package.json | 1 - test/factories/courses.rb | 6 +- test/factories/series.rb | 2 +- test/fixtures/courses.yml | 6 +- test/models/course_test.rb | 6 +- test/models/series_test.rb | 2 +- tsconfig.json | 2 +- vendor/assets/stylesheets/.keep | 0 .../tokenfield-typeahead.css.scss | 141 --------- vendor/assets/stylesheets/vendor.scss | 2 - yarn.lock | 9 +- 24 files changed, 70 insertions(+), 528 deletions(-) delete mode 100644 app/assets/stylesheets/components/tokenfield.css.scss delete mode 100644 vendor/assets/stylesheets/.keep delete mode 100644 vendor/assets/stylesheets/bootstrap-tokenfield/tokenfield-typeahead.css.scss delete mode 100644 vendor/assets/stylesheets/vendor.scss diff --git a/.rubocop.yml b/.rubocop.yml index 27da4e1189..f4d1ca72c4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -10,7 +10,6 @@ AllCops: - "log/**/*" - "tmp/**/*" - "db/**/*" - - "vendor/**/*" - "node_modules/**/*" TargetRubyVersion: 3.1 NewCops: enable diff --git a/Gemfile b/Gemfile index 78113d477c..a212112b7b 100644 --- a/Gemfile +++ b/Gemfile @@ -120,9 +120,6 @@ gem 'has_scope', '~> 0.8.0' # generating zip files gem 'rubyzip', '~> 2.3.2' -# bootstrap tokenizer -gem 'bootstrap_tokenfield_rails', '~> 0.12.1' - # memcache gem 'dalli', '~> 3.2.3' diff --git a/Gemfile.lock b/Gemfile.lock index 35977f2fa5..38816fedf8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,7 +88,6 @@ GEM bindex (0.8.1) bootsnap (1.14.0) msgpack (~> 1.2) - bootstrap_tokenfield_rails (0.12.1) builder (3.2.4) byebug (11.1.3) capistrano (3.17.0) @@ -499,7 +498,6 @@ DEPENDENCIES autoprefixer-rails (~> 10.4.7) bcrypt_pbkdf bootsnap (~> 1.14.0) - bootstrap_tokenfield_rails (~> 0.12.1) builder (~> 3.2.4) byebug (~> 11.1.3) capistrano-passenger (~> 0.2.1) diff --git a/app/assets/javascripts/application_old.js b/app/assets/javascripts/application_old.js index 5c0536e0ce..f223c48d9c 100644 --- a/app/assets/javascripts/application_old.js +++ b/app/assets/javascripts/application_old.js @@ -14,5 +14,3 @@ //= require ace-rails-ap //= require ace/ext-language_tools -//= require bootstrap-tokenfield -//= require typeahead.js/dist/typeahead.bundle.js diff --git a/app/assets/stylesheets/base.css.scss b/app/assets/stylesheets/base.css.scss index ed13f57830..f7e9b01769 100644 --- a/app/assets/stylesheets/base.css.scss +++ b/app/assets/stylesheets/base.css.scss @@ -11,7 +11,6 @@ @import "bootstrap_variable_overrides.css.scss"; @import "mixins.css.scss"; -@import "vendor"; @import "theme/rouge.css.scss"; @import "theme/ace.css.scss"; diff --git a/app/assets/stylesheets/components.css.scss b/app/assets/stylesheets/components.css.scss index d5802f1d96..6492c9dcfe 100644 --- a/app/assets/stylesheets/components.css.scss +++ b/app/assets/stylesheets/components.css.scss @@ -19,7 +19,6 @@ @import "components/table.css.scss"; @import "components/table-toolbar.css.scss"; @import "components/toast.css.scss"; -@import "components/tokenfield.css.scss"; @import "components/tutor.css.scss"; @import "components/visualisations.css.scss"; @import "components/search_field.css.scss"; diff --git a/app/assets/stylesheets/components/table-toolbar.css.scss b/app/assets/stylesheets/components/table-toolbar.css.scss index f9138dd74a..860d29cd3c 100644 --- a/app/assets/stylesheets/components/table-toolbar.css.scss +++ b/app/assets/stylesheets/components/table-toolbar.css.scss @@ -80,22 +80,6 @@ background-color: inherit; } -.table-toolbar .table-toolbar-tools .search .tokenfield { - border: none; - box-shadow: none; - - .twitter-typeahead .token-input.tt-hint { - color: $on-surface-muted; - margin-top: 7px; - margin-bottom: 6px; - margin-left: 12px; - } - - input { - font-size: 18px; - } -} - .tt-header { padding-left: 5px; } diff --git a/app/assets/stylesheets/components/tokenfield.css.scss b/app/assets/stylesheets/components/tokenfield.css.scss deleted file mode 100644 index 5ec156ee13..0000000000 --- a/app/assets/stylesheets/components/tokenfield.css.scss +++ /dev/null @@ -1,281 +0,0 @@ -/*! - * this file was based on the following repository, but is heavily modified - * https://github.com/sliptree/bootstrap-tokenfield - * Copyright 2013-2014 Sliptree and other contributors; Licensed MIT - */ -@use "sass:math"; - -.tokenfield { - height: auto; - min-height: 34px; - padding-bottom: 0; - z-index: 1; -} - -.tokenfield.focus { - border-color: #66afe9; - outline: 0; - box-shadow: - inset 0 1px 1px rgba(0, 0, 0, 0.075), - 0 0 8px rgba(102, 175, 233, 0.6); -} - -.tokenfield .token-input { - background: none; - width: 60px; - min-width: 60px; - border: 0; - height: 20px; - padding: 0; - margin-bottom: 6px; - box-shadow: none; -} - -.tokenfield .token-input:focus { - border-color: transparent; - outline: 0; - box-shadow: none; -} - -.tokenfield.disabled { - cursor: not-allowed; - background-color: #eeeeee; -} - -.tokenfield.disabled .token-input { - cursor: not-allowed; -} - -.tokenfield.disabled .token:hover { - cursor: not-allowed; - border-color: #d9d9d9; -} - -.tokenfield.disabled .token:hover .close { - cursor: not-allowed; - opacity: 0.2; - filter: alpha(opacity=20); -} - -.has-warning .tokenfield.focus { - border-color: #66512c; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b; -} - -.has-error .tokenfield.focus { - border-color: #843534; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483; -} - -.has-success .tokenfield.focus { - border-color: #2b542c; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168; -} - -.tokenfield.form-control-sm, -.input-group-sm .tokenfield { - min-height: 30px; - padding-bottom: 0; -} - -.input-group-sm .token, -.tokenfield.form-control-sm .token { - height: 20px; - margin-bottom: 4px; -} - -.input-group-sm .token-input, -.tokenfield.form-control-sm .token-input { - height: 18px; - margin-bottom: 5px; -} - -.tokenfield.form-control-lg, -.input-group-lg .tokenfield { - height: auto; - min-height: 45px; - padding-bottom: 4px; -} - -.input-group-lg .token, -.tokenfield.form-control-lg .token { - height: 25px; -} - -.input-group-lg .token-label, -.tokenfield.form-control-lg .token-label { - line-height: 23px; -} - -.input-group-lg .token .close, -.tokenfield.form-control-lg .token .close { - line-height: 1.3em; -} - -.input-group-lg .token-input, -.tokenfield.form-control-lg .token-input { - height: 23px; - line-height: 23px; - margin-bottom: 6px; - vertical-align: top; -} - -.tokenfield.rtl { - direction: rtl; - text-align: right; -} - -.tokenfield.rtl .token { - margin: -1px 0 5px 5px; -} - -.tokenfield.rtl .token .token-label { - padding-left: 0; - padding-right: 4px; -} - -.tokenfield .token { - margin-bottom: 8px; - padding-right: 8px; -} - -.token { - font-size: 0.875rem; - font-weight: 400; - line-height: 1.3846153846; - $token-height: 32px; - - display: inline-flex; - align-items: center; - height: $token-height; - border-radius: 8px; - padding-left: 12px; - padding-right: 12px; - border-width: 0; - text-transform: capitalize; - white-space: nowrap; - cursor: default; - margin-right: 8px; -} - -.token .close { - font-size: 18px; - margin-left: 8px; - margin-right: -4px; // a token with a close button has a right padding of 8 instead of 12px - color: inherit; -} - -.token .close:hover { - color: $on-surface; - cursor: pointer; -} - -.token.accent-red { - color: $on-red-container; - background-color: $red-container; -} - -.token.accent-pink { - color: $on-pink-container; - background-color: $pink-container; -} - -.token.accent-purple { - color: $on-purple-container; - background-color: $purple-container; -} - -.token.accent-deep-purple { - color: $on-deep-purple-container; - background-color: $deep-purple-container; -} - -.token.accent-indigo { - color: $on-indigo-container; - background-color: $indigo-container; -} - -.token.accent-teal { - color: $on-teal-container; - background-color: $teal-container; -} - -.token.accent-orange { - color: $on-orange-container; - background-color: $orange-container; -} - -.token.accent-brown { - color: $on-brown-container; - background-color: $brown-container; -} - -.token.accent-blue-gray { - color: $on-blue-gray-container; - background-color: $blue-gray-container; -} - -/* stylelint-disable-next-line no-duplicate-selectors */ -.tokenfield { - .form-control { - height: auto; - } - - /* stylelint-disable-next-line selector-id-pattern */ - #course_membership_course_labels-tokenfield { - height: auto; - padding: 0; - } - - /* stylelint-disable-next-line selector-id-pattern */ - #exercise_labels-tokenfield { - height: auto; - padding: 0; - } - - .tt-menu { - width: 100%; - min-width: 160px; - margin-top: 2px; - padding: 5px 0; - background-color: $content-bg; - border: 1px solid $divider; - *border-right-width: 2px; - *border-bottom-width: 2px; - border-radius: $border-radius-base; - background-clip: padding-box; - } - - .tt-hint { - max-width: 100% !important; - width: unset !important; - } - - .tt-selectable { - cursor: pointer; - } - - .tokenfield-undeletable .btn-close { - display: none; - } - - /* Override inline styling of search bar */ - - .twitter-typeahead { - max-width: 100% !important; - width: 100% !important; - - input.token-input.tt-input { - max-width: 100% !important; - width: 100% !important; - } - } -} - -.tokenfield.form-control { - background-color: transparent; -} - -.search-tokens { - margin-left: 16px; -} diff --git a/app/models/course.rb b/app/models/course.rb index ffc4484179..c6eb617252 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -8,9 +8,9 @@ # secret :string(255) # created_at :datetime not null # updated_at :datetime not null -# description :text(4294967295) -# visibility :integer default("visible_for_all") -# registration :integer default("open_for_institutional_users") +# description :text(16777215) +# visibility :integer +# registration :integer # teacher :string(255) # institution_id :bigint # search :string(4096) diff --git a/app/models/series.rb b/app/models/series.rb index 9d7c708c94..aef59ed84e 100644 --- a/app/models/series.rb +++ b/app/models/series.rb @@ -5,7 +5,7 @@ # id :integer not null, primary key # course_id :integer # name :string(255) -# description :text(4294967295) +# description :text(16777215) # visibility :integer # order :integer default(0), not null # created_at :datetime not null diff --git a/bin/build-css b/bin/build-css index f6403ad44e..2fd27bd91e 100755 --- a/bin/build-css +++ b/bin/build-css @@ -7,6 +7,5 @@ --no-source-map \ --load-path=node_modules \ --load-path=./app/assets/stylesheets/ \ - --load-path=./vendor/assets/stylesheets/ \ --style compressed \ $@ diff --git a/config/deploy.rb b/config/deploy.rb index b719cf4f10..2cbbdf5ec0 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -29,7 +29,7 @@ set :linked_files, fetch(:linked_files, []).push('config/master.key') # Default value for linked_dirs is [] -set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'data/exercises', 'data/judges', 'data/storage', 'node_modules') +set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system', 'data/exercises', 'data/judges', 'data/storage', 'node_modules') set :passenger_restart_with_touch, true diff --git a/db/schema.rb b/db/schema.rb index 57253b0e6e..92d8dc51bc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -16,7 +16,7 @@ t.string "record_type", null: false t.bigint "record_id", null: false t.bigint "blob_id", null: false - t.datetime "created_at", precision: nil, null: false + t.datetime "created_at", null: false t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true end @@ -28,12 +28,12 @@ t.text "metadata", size: :medium t.bigint "byte_size", null: false t.string "checksum" - t.datetime "created_at", precision: nil, null: false + t.datetime "created_at", null: false t.string "service_name", null: false t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true end - create_table "active_storage_variant_records", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| + create_table "active_storage_variant_records", charset: "utf8mb4", force: :cascade do |t| t.bigint "blob_id", null: false t.string "variation_digest", null: false t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true @@ -42,8 +42,8 @@ create_table "activities", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.string "name_nl" t.string "name_en" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "path" t.string "description_format" t.integer "repository_id" @@ -90,7 +90,7 @@ t.boolean "accepted_before_deadline", default: false, null: false t.boolean "solved", default: false, null: false t.boolean "started", default: false, null: false - t.datetime "solved_at", precision: nil + t.datetime "solved_at" t.integer "activity_id", null: false t.integer "series_id" t.integer "user_id", null: false @@ -104,6 +104,7 @@ t.index ["activity_id"], name: "index_activity_statuses_on_activity_id" t.index ["series_id"], name: "fk_rails_1bc42c2178" t.index ["user_id", "series_id_non_nil", "activity_id"], name: "index_on_user_id_series_id_non_nil_activity_id", unique: true + t.index ["user_id"], name: "fk_rails_8a05a160e8" end create_table "annotations", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| @@ -127,7 +128,7 @@ t.index ["user_id"], name: "index_annotations_on_user_id" end - create_table "announcement_views", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| + create_table "announcement_views", charset: "utf8mb4", force: :cascade do |t| t.bigint "announcement_id", null: false t.integer "user_id", null: false t.datetime "created_at", null: false @@ -137,7 +138,7 @@ t.index ["user_id"], name: "index_announcement_views_on_user_id" end - create_table "announcements", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| + create_table "announcements", charset: "utf8mb4", force: :cascade do |t| t.text "text_nl", null: false t.text "text_en", null: false t.datetime "start_delivering_at" @@ -154,8 +155,8 @@ t.bigint "user_id" t.string "token_digest" t.string "description" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["token_digest"], name: "index_api_tokens_on_token_digest" t.index ["user_id", "description"], name: "index_api_tokens_on_user_id_and_description", unique: true t.index ["user_id"], name: "index_api_tokens_on_user_id" @@ -164,8 +165,8 @@ create_table "course_labels", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.integer "course_id", null: false t.string "name", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["course_id", "name"], name: "index_course_labels_on_course_id_and_name", unique: true end @@ -180,8 +181,8 @@ t.integer "course_id", null: false t.integer "user_id", null: false t.integer "status", default: 2, null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "favorite", default: false t.index ["course_id"], name: "index_course_memberships_on_course_id" t.index ["user_id", "course_id"], name: "index_course_memberships_on_user_id_and_course_id", unique: true @@ -199,11 +200,11 @@ t.string "name" t.string "year" t.string "secret" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false - t.text "description", size: :long - t.integer "visibility", default: 0 - t.integer "registration", default: 0 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "description", size: :medium + t.integer "visibility" + t.integer "registration" t.string "teacher" t.bigint "institution_id" t.string "search", limit: 4096 @@ -217,15 +218,15 @@ create_table "delayed_jobs", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.integer "priority", default: 0, null: false t.integer "attempts", default: 0, null: false - t.text "handler", size: :long, null: false - t.text "last_error", size: :long - t.datetime "run_at", precision: nil - t.datetime "locked_at", precision: nil - t.datetime "failed_at", precision: nil + t.text "handler", size: :medium, null: false + t.text "last_error", size: :medium + t.datetime "run_at" + t.datetime "locked_at" + t.datetime "failed_at" t.string "locked_by" t.string "queue" - t.datetime "created_at", precision: nil - t.datetime "updated_at", precision: nil + t.datetime "created_at" + t.datetime "updated_at" t.index ["priority", "run_at"], name: "delayed_jobs_priority" end @@ -253,7 +254,7 @@ create_table "evaluations", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.integer "series_id" t.boolean "released", default: false, null: false - t.datetime "deadline", precision: nil, null: false + t.datetime "deadline", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["series_id"], name: "index_evaluations_on_series_id" @@ -263,8 +264,8 @@ t.integer "event_type", null: false t.integer "user_id" t.string "message", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["event_type"], name: "index_events_on_event_type" t.index ["user_id"], name: "fk_rails_0cb5590091" end @@ -308,8 +309,8 @@ t.string "name" t.string "short_name" t.string "logo" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.boolean "generated_name", default: true, null: false t.integer "category", default: 0, null: false end @@ -318,8 +319,8 @@ t.string "name" t.string "image" t.string "path" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "renderer", null: false t.string "remote" t.integer "clone_status", default: 1, null: false @@ -348,8 +349,8 @@ t.string "name", null: false t.string "editor_name", null: false t.string "extension", null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "icon" t.string "renderer_name", null: false t.index ["name"], name: "index_programming_languages_on_name", unique: true @@ -379,8 +380,8 @@ t.string "remote" t.string "path" t.integer "judge_id" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "clone_status", default: 1, null: false t.index ["judge_id"], name: "index_repositories_on_judge_id" t.index ["name"], name: "index_repositories_on_name", unique: true @@ -394,7 +395,7 @@ t.index ["user_id"], name: "fk_rails_6b59ad362c" end - create_table "rights_requests", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| + create_table "rights_requests", charset: "utf8mb4", force: :cascade do |t| t.integer "user_id", null: false t.string "institution_name" t.text "context", null: false @@ -403,7 +404,7 @@ t.index ["user_id"], name: "index_rights_requests_on_user_id" end - create_table "saved_annotations", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| + create_table "saved_annotations", charset: "utf8mb4", force: :cascade do |t| t.string "title", null: false t.text "annotation_text", size: :medium t.integer "user_id", null: false @@ -445,12 +446,12 @@ create_table "series", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.integer "course_id" t.string "name" - t.text "description", size: :long + t.text "description", size: :medium t.integer "visibility" t.integer "order", default: 0, null: false - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false - t.datetime "deadline", precision: nil + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.datetime "deadline" t.string "access_token" t.string "indianio_token" t.boolean "progress_enabled", default: true, null: false @@ -469,8 +470,8 @@ t.integer "series_id" t.integer "activity_id" t.integer "order", default: 999 - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["activity_id"], name: "index_series_memberships_on_activity_id" t.index ["series_id", "activity_id"], name: "index_series_memberships_on_series_id_and_activity_id", unique: true t.index ["series_id"], name: "index_series_memberships_on_series_id" @@ -480,8 +481,8 @@ t.integer "exercise_id" t.integer "user_id" t.string "summary" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.integer "status" t.boolean "accepted", default: false t.integer "course_id" @@ -504,15 +505,15 @@ t.string "last_name" t.string "email" t.integer "permission", default: 0 - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.string "lang", default: "nl" t.string "token" t.string "time_zone", default: "Brussels" t.bigint "institution_id" t.string "search", limit: 4096 - t.datetime "seen_at", precision: nil - t.datetime "sign_in_at", precision: nil + t.datetime "seen_at" + t.datetime "sign_in_at" t.index ["email", "institution_id"], name: "index_users_on_email_and_institution_id", unique: true t.index ["institution_id"], name: "index_users_on_institution_id" t.index ["token"], name: "index_users_on_token" diff --git a/package.json b/package.json index f4bba9a0b7..64b15a6a62 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ "lit": "2.4.1", "node-polyglot": "^2.4.2", "sass": "^1.56.1", - "typeahead.js": "^0.11.1", "typescript": "^4.9.3", "webpack": "^5.75.0", "webpack-cli": "^4.9.2" diff --git a/test/factories/courses.rb b/test/factories/courses.rb index 85f08f73af..4e9ebf8e2d 100644 --- a/test/factories/courses.rb +++ b/test/factories/courses.rb @@ -8,9 +8,9 @@ # secret :string(255) # created_at :datetime not null # updated_at :datetime not null -# description :text(4294967295) -# visibility :integer default("visible_for_all") -# registration :integer default("open_for_institutional_users") +# description :text(16777215) +# visibility :integer +# registration :integer # teacher :string(255) # institution_id :bigint # search :string(4096) diff --git a/test/factories/series.rb b/test/factories/series.rb index 7c46b9ff63..d23216275c 100644 --- a/test/factories/series.rb +++ b/test/factories/series.rb @@ -5,7 +5,7 @@ # id :integer not null, primary key # course_id :integer # name :string(255) -# description :text(4294967295) +# description :text(16777215) # visibility :integer # order :integer default(0), not null # created_at :datetime not null diff --git a/test/fixtures/courses.yml b/test/fixtures/courses.yml index 6ae776b2fd..1da0126d5e 100644 --- a/test/fixtures/courses.yml +++ b/test/fixtures/courses.yml @@ -8,9 +8,9 @@ # secret :string(255) # created_at :datetime not null # updated_at :datetime not null -# description :text(4294967295) -# visibility :integer default("visible_for_all") -# registration :integer default("open_for_institutional_users") +# description :text(16777215) +# visibility :integer +# registration :integer # teacher :string(255) # institution_id :bigint # search :string(4096) diff --git a/test/models/course_test.rb b/test/models/course_test.rb index eba92f7274..d2237f3168 100644 --- a/test/models/course_test.rb +++ b/test/models/course_test.rb @@ -8,9 +8,9 @@ # secret :string(255) # created_at :datetime not null # updated_at :datetime not null -# description :text(4294967295) -# visibility :integer default("visible_for_all") -# registration :integer default("open_for_institutional_users") +# description :text(16777215) +# visibility :integer +# registration :integer # teacher :string(255) # institution_id :bigint # search :string(4096) diff --git a/test/models/series_test.rb b/test/models/series_test.rb index dcb77c8c60..a4218b2b2c 100644 --- a/test/models/series_test.rb +++ b/test/models/series_test.rb @@ -5,7 +5,7 @@ # id :integer not null, primary key # course_id :integer # name :string(255) -# description :text(4294967295) +# description :text(16777215) # visibility :integer # order :integer default(0), not null # created_at :datetime not null diff --git a/tsconfig.json b/tsconfig.json index 6b2d72b02b..88655c3235 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,6 +17,6 @@ "allowUmdGlobalAccess": true, "resolveJsonModule": true }, - "exclude": ["**/*.spec.ts", "node_modules", "vendor", "public", "data"], + "exclude": ["**/*.spec.ts", "node_modules", "public", "data"], "compileOnSave": false } diff --git a/vendor/assets/stylesheets/.keep b/vendor/assets/stylesheets/.keep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/vendor/assets/stylesheets/bootstrap-tokenfield/tokenfield-typeahead.css.scss b/vendor/assets/stylesheets/bootstrap-tokenfield/tokenfield-typeahead.css.scss deleted file mode 100644 index 4ad279b9bd..0000000000 --- a/vendor/assets/stylesheets/bootstrap-tokenfield/tokenfield-typeahead.css.scss +++ /dev/null @@ -1,141 +0,0 @@ -/*! - * bootstrap-tokenfield - * https://github.com/sliptree/bootstrap-tokenfield - * Copyright 2013-2014 Sliptree and other contributors; Licensed MIT - */ -/* General Typeahead styling, from http://jsfiddle.net/ragulka/Dy9au/1/ */ -.twitter-typeahead { - width: 100%; - position: relative; - vertical-align: top; -} -.twitter-typeahead .tt-input, -.twitter-typeahead .tt-hint { - margin: 0; - width: 100%; - vertical-align: middle; - background-color: #ffffff; -} -.twitter-typeahead .tt-hint { - color: #999999; - z-index: 1; - border: 1px solid transparent; -} -.twitter-typeahead .tt-input { - color: #555555; - z-index: 2; -} -.twitter-typeahead .tt-input, -.twitter-typeahead .tt-hint { - height: 34px; - padding: 6px 12px; - font-size: 14px; - line-height: 1.428571429; -} -.twitter-typeahead .form-control-sm.tt-input, -.twitter-typeahead .hint-sm.tt-hint { - border-radius: 3px; -} -.twitter-typeahead .form-control-lg.tt-input, -.twitter-typeahead .hint-lg.tt-hint { - border-radius: 6px; -} -.input-group .twitter-typeahead:first-child .tt-input, -.input-group .twitter-typeahead:first-child .tt-hint { - border-radius: 4px 0 0 4px !important; -} -.input-group .twitter-typeahead:last-child .tt-input, -.input-group .twitter-typeahead:last-child .tt-hint { - border-radius: 0 4px 4px 0 !important; -} -.input-group.input-group-sm .twitter-typeahead:first-child .tt-input, -.input-group.input-group-sm .twitter-typeahead:first-child .tt-hint { - border-radius: 3px 0 0 3px !important; -} -.input-group.input-group-sm .twitter-typeahead:last-child .tt-input, -.input-group.input-group-sm .twitter-typeahead:last-child .tt-hint { - border-radius: 0 3px 3px 0 !important; -} -.form-control-sm.tt-input, -.hint-sm.tt-hint, -.input-group.input-group-sm .tt-input, -.input-group.input-group-sm .tt-hint { - height: 30px; - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; -} -.input-group.input-group-lg .twitter-typeahead:first-child .tt-input, -.input-group.input-group-lg .twitter-typeahead:first-child .tt-hint { - border-radius: 6px 0 0 6px !important; -} -.input-group.input-group-lg .twitter-typeahead:last-child .tt-input, -.input-group.input-group-lg .twitter-typeahead:last-child .tt-hint { - border-radius: 0 6px 6px 0 !important; -} -.form-control-lg.tt-input, -.hint-lg.tt-hint, -.input-group.input-group-lg .tt-input, -.input-group.input-group-lg .tt-hint { - height: 45px; - padding: 10px 16px; - font-size: 18px; - line-height: 1.33; -} -.tt-dropdown-menu { - width: 100%; - min-width: 160px; - margin-top: 2px; - padding: 5px 0; - background-color: #ffffff; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.15); - *border-right-width: 2px; - *border-bottom-width: 2px; - border-radius: 6px; - -webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; -} -.tt-suggestion { - display: block; - padding: 3px 20px; -} -.tt-suggestion.tt-cursor { - color: #262626; - background-image: -webkit-linear-gradient(top, #f5f5f5 0%, #e8e8e8 100%); - background-image: linear-gradient(to bottom, #f5f5f5 0%, #e8e8e8 100%); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0); -} -.tt-suggestion.tt-cursor a { - color: #ffffff; -} -.tt-suggestion p { - margin: 0; -} -/* Tokenfield-specific Typeahead styling */ -.tokenfield .twitter-typeahead { - width: auto; -} -.tokenfield .twitter-typeahead .tt-hint { - padding: 0; - height: 20px; -} -.tokenfield.form-control-sm .twitter-typeahead .tt-input, -.tokenfield.form-control-sm .twitter-typeahead .tt-hint { - height: 18px; - font-size: 12px; - line-height: 1.5; -} -.tokenfield.form-control-lg .twitter-typeahead .tt-input, -.tokenfield.form-control-lg .twitter-typeahead .tt-hint { - height: 23px; - font-size: 18px; - line-height: 1.33; -} -.tokenfield .twitter-typeahead .tt-suggestions { - font-size: 14px; -} diff --git a/vendor/assets/stylesheets/vendor.scss b/vendor/assets/stylesheets/vendor.scss deleted file mode 100644 index 86c4c7370e..0000000000 --- a/vendor/assets/stylesheets/vendor.scss +++ /dev/null @@ -1,2 +0,0 @@ -// all pages -@import "bootstrap-tokenfield/tokenfield-typeahead.css.scss"; diff --git a/yarn.lock b/yarn.lock index 0b8c7d558e..7140dbf04f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5122,7 +5122,7 @@ jest@^26.6.3: import-local "^3.0.2" jest-cli "^26.6.3" -jquery@>=1.7, jquery@^3.6.1: +jquery@^3.6.1: version "3.6.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.6.1.tgz#fab0408f8b45fc19f956205773b62b292c147a16" integrity sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw== @@ -7012,13 +7012,6 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -typeahead.js@^0.11.1: - version "0.11.1" - resolved "https://registry.yarnpkg.com/typeahead.js/-/typeahead.js-0.11.1.tgz#4e64e671b22310a8606f4aec805924ba84b015b8" - integrity sha1-TmTmcbIjEKhgb0rsgFkkuoSwFbg= - dependencies: - jquery ">=1.7" - typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" From 5b94cf5a3bb4c90c85bea2da2cbd6399c9c7297d Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 24 Nov 2022 10:10:21 +0100 Subject: [PATCH 2/4] Re add token css --- app/assets/stylesheets/components.css.scss | 1 + .../stylesheets/components/token.css.scss | 79 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 app/assets/stylesheets/components/token.css.scss diff --git a/app/assets/stylesheets/components.css.scss b/app/assets/stylesheets/components.css.scss index 6492c9dcfe..06dc66ee61 100644 --- a/app/assets/stylesheets/components.css.scss +++ b/app/assets/stylesheets/components.css.scss @@ -19,6 +19,7 @@ @import "components/table.css.scss"; @import "components/table-toolbar.css.scss"; @import "components/toast.css.scss"; +@import "components/token.css.scss"; @import "components/tutor.css.scss"; @import "components/visualisations.css.scss"; @import "components/search_field.css.scss"; diff --git a/app/assets/stylesheets/components/token.css.scss b/app/assets/stylesheets/components/token.css.scss new file mode 100644 index 0000000000..c1cbc44f9f --- /dev/null +++ b/app/assets/stylesheets/components/token.css.scss @@ -0,0 +1,79 @@ +.token { + font-size: 0.875rem; + font-weight: 400; + line-height: 1.3846153846; + $token-height: 32px; + + display: inline-flex; + align-items: center; + height: $token-height; + border-radius: 8px; + padding-left: 12px; + padding-right: 12px; + border-width: 0; + text-transform: capitalize; + white-space: nowrap; + cursor: default; + margin-right: 8px; +} + +.token .close { + font-size: 18px; + margin-left: 8px; + margin-right: -4px; // a token with a close button has a right padding of 8 instead of 12px + color: inherit; +} + +.token .close:hover { + color: $on-surface; + cursor: pointer; +} + +.token.accent-red { + color: $on-red-container; + background-color: $red-container; +} + +.token.accent-pink { + color: $on-pink-container; + background-color: $pink-container; +} + +.token.accent-purple { + color: $on-purple-container; + background-color: $purple-container; +} + +.token.accent-deep-purple { + color: $on-deep-purple-container; + background-color: $deep-purple-container; +} + +.token.accent-indigo { + color: $on-indigo-container; + background-color: $indigo-container; +} + +.token.accent-teal { + color: $on-teal-container; + background-color: $teal-container; +} + +.token.accent-orange { + color: $on-orange-container; + background-color: $orange-container; +} + +.token.accent-brown { + color: $on-brown-container; + background-color: $brown-container; +} + +.token.accent-blue-gray { + color: $on-blue-gray-container; + background-color: $blue-gray-container; +} + +.search-tokens { + margin-left: 16px; +} From ee5f6d3883c88c9e55c8753189ff13cf473ea13b Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 24 Nov 2022 11:10:32 +0100 Subject: [PATCH 3/4] Undo schema changes --- app/models/course.rb | 6 +-- app/models/series.rb | 2 +- db/schema.rb | 103 ++++++++++++++++++------------------- test/factories/courses.rb | 6 +-- test/factories/series.rb | 2 +- test/fixtures/courses.yml | 6 +-- test/models/course_test.rb | 6 +-- test/models/series_test.rb | 2 +- 8 files changed, 66 insertions(+), 67 deletions(-) diff --git a/app/models/course.rb b/app/models/course.rb index c6eb617252..ffc4484179 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -8,9 +8,9 @@ # secret :string(255) # created_at :datetime not null # updated_at :datetime not null -# description :text(16777215) -# visibility :integer -# registration :integer +# description :text(4294967295) +# visibility :integer default("visible_for_all") +# registration :integer default("open_for_institutional_users") # teacher :string(255) # institution_id :bigint # search :string(4096) diff --git a/app/models/series.rb b/app/models/series.rb index aef59ed84e..9d7c708c94 100644 --- a/app/models/series.rb +++ b/app/models/series.rb @@ -5,7 +5,7 @@ # id :integer not null, primary key # course_id :integer # name :string(255) -# description :text(16777215) +# description :text(4294967295) # visibility :integer # order :integer default(0), not null # created_at :datetime not null diff --git a/db/schema.rb b/db/schema.rb index 92d8dc51bc..57253b0e6e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -16,7 +16,7 @@ t.string "record_type", null: false t.bigint "record_id", null: false t.bigint "blob_id", null: false - t.datetime "created_at", null: false + t.datetime "created_at", precision: nil, null: false t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true end @@ -28,12 +28,12 @@ t.text "metadata", size: :medium t.bigint "byte_size", null: false t.string "checksum" - t.datetime "created_at", null: false + t.datetime "created_at", precision: nil, null: false t.string "service_name", null: false t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true end - create_table "active_storage_variant_records", charset: "utf8mb4", force: :cascade do |t| + create_table "active_storage_variant_records", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.bigint "blob_id", null: false t.string "variation_digest", null: false t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true @@ -42,8 +42,8 @@ create_table "activities", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.string "name_nl" t.string "name_en" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "path" t.string "description_format" t.integer "repository_id" @@ -90,7 +90,7 @@ t.boolean "accepted_before_deadline", default: false, null: false t.boolean "solved", default: false, null: false t.boolean "started", default: false, null: false - t.datetime "solved_at" + t.datetime "solved_at", precision: nil t.integer "activity_id", null: false t.integer "series_id" t.integer "user_id", null: false @@ -104,7 +104,6 @@ t.index ["activity_id"], name: "index_activity_statuses_on_activity_id" t.index ["series_id"], name: "fk_rails_1bc42c2178" t.index ["user_id", "series_id_non_nil", "activity_id"], name: "index_on_user_id_series_id_non_nil_activity_id", unique: true - t.index ["user_id"], name: "fk_rails_8a05a160e8" end create_table "annotations", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| @@ -128,7 +127,7 @@ t.index ["user_id"], name: "index_annotations_on_user_id" end - create_table "announcement_views", charset: "utf8mb4", force: :cascade do |t| + create_table "announcement_views", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.bigint "announcement_id", null: false t.integer "user_id", null: false t.datetime "created_at", null: false @@ -138,7 +137,7 @@ t.index ["user_id"], name: "index_announcement_views_on_user_id" end - create_table "announcements", charset: "utf8mb4", force: :cascade do |t| + create_table "announcements", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.text "text_nl", null: false t.text "text_en", null: false t.datetime "start_delivering_at" @@ -155,8 +154,8 @@ t.bigint "user_id" t.string "token_digest" t.string "description" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["token_digest"], name: "index_api_tokens_on_token_digest" t.index ["user_id", "description"], name: "index_api_tokens_on_user_id_and_description", unique: true t.index ["user_id"], name: "index_api_tokens_on_user_id" @@ -165,8 +164,8 @@ create_table "course_labels", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.integer "course_id", null: false t.string "name", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["course_id", "name"], name: "index_course_labels_on_course_id_and_name", unique: true end @@ -181,8 +180,8 @@ t.integer "course_id", null: false t.integer "user_id", null: false t.integer "status", default: 2, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.boolean "favorite", default: false t.index ["course_id"], name: "index_course_memberships_on_course_id" t.index ["user_id", "course_id"], name: "index_course_memberships_on_user_id_and_course_id", unique: true @@ -200,11 +199,11 @@ t.string "name" t.string "year" t.string "secret" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.text "description", size: :medium - t.integer "visibility" - t.integer "registration" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.text "description", size: :long + t.integer "visibility", default: 0 + t.integer "registration", default: 0 t.string "teacher" t.bigint "institution_id" t.string "search", limit: 4096 @@ -218,15 +217,15 @@ create_table "delayed_jobs", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.integer "priority", default: 0, null: false t.integer "attempts", default: 0, null: false - t.text "handler", size: :medium, null: false - t.text "last_error", size: :medium - t.datetime "run_at" - t.datetime "locked_at" - t.datetime "failed_at" + t.text "handler", size: :long, null: false + t.text "last_error", size: :long + t.datetime "run_at", precision: nil + t.datetime "locked_at", precision: nil + t.datetime "failed_at", precision: nil t.string "locked_by" t.string "queue" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil t.index ["priority", "run_at"], name: "delayed_jobs_priority" end @@ -254,7 +253,7 @@ create_table "evaluations", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.integer "series_id" t.boolean "released", default: false, null: false - t.datetime "deadline", null: false + t.datetime "deadline", precision: nil, null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.index ["series_id"], name: "index_evaluations_on_series_id" @@ -264,8 +263,8 @@ t.integer "event_type", null: false t.integer "user_id" t.string "message", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["event_type"], name: "index_events_on_event_type" t.index ["user_id"], name: "fk_rails_0cb5590091" end @@ -309,8 +308,8 @@ t.string "name" t.string "short_name" t.string "logo" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.boolean "generated_name", default: true, null: false t.integer "category", default: 0, null: false end @@ -319,8 +318,8 @@ t.string "name" t.string "image" t.string "path" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "renderer", null: false t.string "remote" t.integer "clone_status", default: 1, null: false @@ -349,8 +348,8 @@ t.string "name", null: false t.string "editor_name", null: false t.string "extension", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "icon" t.string "renderer_name", null: false t.index ["name"], name: "index_programming_languages_on_name", unique: true @@ -380,8 +379,8 @@ t.string "remote" t.string "path" t.integer "judge_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "clone_status", default: 1, null: false t.index ["judge_id"], name: "index_repositories_on_judge_id" t.index ["name"], name: "index_repositories_on_name", unique: true @@ -395,7 +394,7 @@ t.index ["user_id"], name: "fk_rails_6b59ad362c" end - create_table "rights_requests", charset: "utf8mb4", force: :cascade do |t| + create_table "rights_requests", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.integer "user_id", null: false t.string "institution_name" t.text "context", null: false @@ -404,7 +403,7 @@ t.index ["user_id"], name: "index_rights_requests_on_user_id" end - create_table "saved_annotations", charset: "utf8mb4", force: :cascade do |t| + create_table "saved_annotations", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.string "title", null: false t.text "annotation_text", size: :medium t.integer "user_id", null: false @@ -446,12 +445,12 @@ create_table "series", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t| t.integer "course_id" t.string "name" - t.text "description", size: :medium + t.text "description", size: :long t.integer "visibility" t.integer "order", default: 0, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.datetime "deadline" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.datetime "deadline", precision: nil t.string "access_token" t.string "indianio_token" t.boolean "progress_enabled", default: true, null: false @@ -470,8 +469,8 @@ t.integer "series_id" t.integer "activity_id" t.integer "order", default: 999 - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["activity_id"], name: "index_series_memberships_on_activity_id" t.index ["series_id", "activity_id"], name: "index_series_memberships_on_series_id_and_activity_id", unique: true t.index ["series_id"], name: "index_series_memberships_on_series_id" @@ -481,8 +480,8 @@ t.integer "exercise_id" t.integer "user_id" t.string "summary" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "status" t.boolean "accepted", default: false t.integer "course_id" @@ -505,15 +504,15 @@ t.string "last_name" t.string "email" t.integer "permission", default: 0 - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "lang", default: "nl" t.string "token" t.string "time_zone", default: "Brussels" t.bigint "institution_id" t.string "search", limit: 4096 - t.datetime "seen_at" - t.datetime "sign_in_at" + t.datetime "seen_at", precision: nil + t.datetime "sign_in_at", precision: nil t.index ["email", "institution_id"], name: "index_users_on_email_and_institution_id", unique: true t.index ["institution_id"], name: "index_users_on_institution_id" t.index ["token"], name: "index_users_on_token" diff --git a/test/factories/courses.rb b/test/factories/courses.rb index 4e9ebf8e2d..85f08f73af 100644 --- a/test/factories/courses.rb +++ b/test/factories/courses.rb @@ -8,9 +8,9 @@ # secret :string(255) # created_at :datetime not null # updated_at :datetime not null -# description :text(16777215) -# visibility :integer -# registration :integer +# description :text(4294967295) +# visibility :integer default("visible_for_all") +# registration :integer default("open_for_institutional_users") # teacher :string(255) # institution_id :bigint # search :string(4096) diff --git a/test/factories/series.rb b/test/factories/series.rb index d23216275c..7c46b9ff63 100644 --- a/test/factories/series.rb +++ b/test/factories/series.rb @@ -5,7 +5,7 @@ # id :integer not null, primary key # course_id :integer # name :string(255) -# description :text(16777215) +# description :text(4294967295) # visibility :integer # order :integer default(0), not null # created_at :datetime not null diff --git a/test/fixtures/courses.yml b/test/fixtures/courses.yml index 1da0126d5e..6ae776b2fd 100644 --- a/test/fixtures/courses.yml +++ b/test/fixtures/courses.yml @@ -8,9 +8,9 @@ # secret :string(255) # created_at :datetime not null # updated_at :datetime not null -# description :text(16777215) -# visibility :integer -# registration :integer +# description :text(4294967295) +# visibility :integer default("visible_for_all") +# registration :integer default("open_for_institutional_users") # teacher :string(255) # institution_id :bigint # search :string(4096) diff --git a/test/models/course_test.rb b/test/models/course_test.rb index d2237f3168..eba92f7274 100644 --- a/test/models/course_test.rb +++ b/test/models/course_test.rb @@ -8,9 +8,9 @@ # secret :string(255) # created_at :datetime not null # updated_at :datetime not null -# description :text(16777215) -# visibility :integer -# registration :integer +# description :text(4294967295) +# visibility :integer default("visible_for_all") +# registration :integer default("open_for_institutional_users") # teacher :string(255) # institution_id :bigint # search :string(4096) diff --git a/test/models/series_test.rb b/test/models/series_test.rb index a4218b2b2c..dcb77c8c60 100644 --- a/test/models/series_test.rb +++ b/test/models/series_test.rb @@ -5,7 +5,7 @@ # id :integer not null, primary key # course_id :integer # name :string(255) -# description :text(16777215) +# description :text(4294967295) # visibility :integer # order :integer default(0), not null # created_at :datetime not null From c86d81e8a4f60c3a7c709638c53023e4b42d9ca2 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 24 Nov 2022 14:30:24 +0100 Subject: [PATCH 4/4] Ingnore vendor folder for rubocop --- .rubocop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.rubocop.yml b/.rubocop.yml index f4d1ca72c4..27da4e1189 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -10,6 +10,7 @@ AllCops: - "log/**/*" - "tmp/**/*" - "db/**/*" + - "vendor/**/*" - "node_modules/**/*" TargetRubyVersion: 3.1 NewCops: enable