diff --git a/Gemfile b/Gemfile index 78471f6852..80bed30fe2 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ gem 'rails', '~> 7.0.4' # Use mysql as the database for Active Record gem 'mysql2', '~> 0.5.5' # Use Puma as the app server -gem 'puma', '~> 6.1.0' +gem 'puma', '~> 6.1.1' # Use dart-sass for stylesheets gem 'cssbundling-rails', '~> 1.1.2' @@ -63,7 +63,7 @@ gem 'diff-lcs', '~>1.5' gem 'ace-rails-ap', '~>4.5' # auto css prefixer -gem 'autoprefixer-rails', '~>10.4.7' +gem 'autoprefixer-rails', '~>10.4.13' # saml authentication gem 'devise', '~>4.9.0' diff --git a/Gemfile.lock b/Gemfile.lock index bc730d95af..0d580ae1db 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -80,7 +80,7 @@ GEM rake (>= 10.4, < 14.0) ast (2.4.2) attr_required (1.0.1) - autoprefixer-rails (10.4.7.0) + autoprefixer-rails (10.4.13.0) execjs (~> 2) bcrypt (3.1.18) bcrypt_pbkdf (1.1.0) @@ -335,7 +335,7 @@ GEM pretender (0.4.0) actionpack (>= 5.2) public_suffix (5.0.1) - puma (6.1.0) + puma (6.1.1) nio4r (~> 2.0) pundit (2.3.0) activesupport (>= 3.0.0) @@ -502,7 +502,7 @@ DEPENDENCIES ace-rails-ap (~> 4.5) after_commit_everywhere (~> 1.3.0) annotate (~> 3.2.0) - autoprefixer-rails (~> 10.4.7) + autoprefixer-rails (~> 10.4.13) bcrypt_pbkdf bootsnap (~> 1.16.0) builder (~> 3.2.4) @@ -556,7 +556,7 @@ DEPENDENCIES omniauth_openid_connect (~> 0.6.1) premailer-rails (~> 1.12.0) pretender (~> 0.4.0) - puma (~> 6.1.0) + puma (~> 6.1.1) pundit (~> 2.3.0) rack-mini-profiler (~> 3.0.0) rails (~> 7.0.4) diff --git a/app/assets/images/seasonal/series_status_overlays/mario.svg b/app/assets/images/seasonal/series_status_overlays/mario.svg new file mode 100644 index 0000000000..6839ab753c --- /dev/null +++ b/app/assets/images/seasonal/series_status_overlays/mario.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/assets/stylesheets/base.css.scss b/app/assets/stylesheets/base.css.scss index b86ddb82c3..04c3bf163d 100644 --- a/app/assets/stylesheets/base.css.scss +++ b/app/assets/stylesheets/base.css.scss @@ -80,6 +80,7 @@ // 6. Seasonal css sheets @import "seasonal/christmas.css.scss"; @import "seasonal/valentine.css.scss"; +@import "seasonal/mario-day.css.scss"; /* stylelint-disable-next-line selector-class-pattern */ .field_with_errors input { diff --git a/app/assets/stylesheets/seasonal/mario-day.css.scss b/app/assets/stylesheets/seasonal/mario-day.css.scss new file mode 100644 index 0000000000..f44d9657cf --- /dev/null +++ b/app/assets/stylesheets/seasonal/mario-day.css.scss @@ -0,0 +1,22 @@ +.series-icon.mario-day { + .overlay { + overflow: visible; + } + + .overlay div { + content: ""; + position: absolute; + width: 48px; + height: 48px; + margin-left: -4px; + background-size: contain; + background-repeat: no-repeat; + top: -21px; + } + + &.completed:not(.deadline-missed) { + .overlay div { + content: url("seasonal/series_status_overlays/mario.svg"); + } + } +} diff --git a/app/helpers/seasonal_helper.rb b/app/helpers/seasonal_helper.rb index 7fad00050e..5e74b4b694 100644 --- a/app/helpers/seasonal_helper.rb +++ b/app/helpers/seasonal_helper.rb @@ -7,12 +7,17 @@ def valentine(current_time) current_time.month == 2 && current_time.day == 14 end + def mario_day(current_time) + current_time.month == 3 && current_time.day == 10 + end + # returns seasonal class def series_status_overlay current_time = Time.now.in_time_zone(config.time_zone) return 'christmas' if christmas(current_time) return 'valentine' if valentine(current_time) + return 'mario-day' if mario_day(current_time) nil end diff --git a/config/initializers/00_version.rb b/config/initializers/00_version.rb index df5b50d985..d58f9302df 100644 --- a/config/initializers/00_version.rb +++ b/config/initializers/00_version.rb @@ -3,7 +3,7 @@ class Application module Version MAJOR = 6 MINOR = 6 - PATCH = 4 + PATCH = 5 STRING = [MAJOR, MINOR, PATCH].compact.join('.') end diff --git a/config/webpack/webpack.config.js b/config/webpack/webpack.config.js index 05dcaf5774..25300e3b0f 100644 --- a/config/webpack/webpack.config.js +++ b/config/webpack/webpack.config.js @@ -1,5 +1,12 @@ const path = require("path"); -const glob = require("glob"); +const fs = require("fs"); + +// https://stackoverflow.com/questions/34907999/best-way-to-have-all-files-in-a-directory-be-entry-points-in-webpack +const sourceDirectory = "./app/javascript/packs"; +const sourceFiles = fs.readdirSync(sourceDirectory) + .filter(v => v.endsWith(".js") || v.endsWith(".ts")) + .reduce((acc, v) => ({ ...acc, [v.slice(0, -3)]: `${sourceDirectory}/${v}` }), {}); + const config = { mode: "production", @@ -30,11 +37,7 @@ const config = { }, }, }, - // https://stackoverflow.com/questions/34907999/best-way-to-have-all-files-in-a-directory-be-entry-points-in-webpack - entry: glob.sync("./app/javascript/packs/**.{js,ts}").reduce(function (obj, el) { - obj[path.parse(el).name] = el; - return obj; - }, {}), + entry: sourceFiles, output: { filename: "[name].js", sourceMapFilename: "[name].js.map", diff --git a/package.json b/package.json index 17a778b2d1..f6bd4ade87 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,7 @@ "flatpickr": "^4.6.13", "fscreen": "^1.2.0", "glightbox": "^3.2.0", - "glob": "^8.1.0", - "iframe-resizer": "^4.3.4", + "iframe-resizer": "^4.3.5", "jquery": "^3.6.3", "lit": "2.6.1", "node-polyglot": "^2.5.0", @@ -49,7 +48,7 @@ "@types/dragula": "^3.7.1", "@types/iframe-resizer": "^3.5.9", "@types/jest": "^27.5.0", - "@types/serviceworker": "^0.0.62", + "@types/serviceworker": "^0.0.64", "@typescript-eslint/eslint-plugin": "^5.54.0", "@typescript-eslint/parser": "^5.54.0", "eslint": "^8.35.0", diff --git a/yarn.lock b/yarn.lock index 4a18d153b6..2875a516b4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1958,10 +1958,10 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.12.tgz#920447fdd78d76b19de0438b7f60df3c4a80bf1c" integrity sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A== -"@types/serviceworker@^0.0.62": - version "0.0.62" - resolved "https://registry.yarnpkg.com/@types/serviceworker/-/serviceworker-0.0.62.tgz#814e603f373314bc2b08332a306b0a76af68857f" - integrity sha512-DVoelQjcHaPshqyg0duirwuuaZ/teG4E3QGiQXbzso8akd12VRtgGYCao8viRFXHVLJOlo/Elh1nfbMsRQJXVA== +"@types/serviceworker@^0.0.64": + version "0.0.64" + resolved "https://registry.yarnpkg.com/@types/serviceworker/-/serviceworker-0.0.64.tgz#48c4bdf0882d754bbecf183ba7c998580359815f" + integrity sha512-zDywAaAAOvYdCAQomyaMlW/D5u74mAHMfSOO5V67jYKhE68tE9da6tRHJFpFzkUlDVvHQ/4inBKvqWdXBc4vSg== "@types/sizzle@*": version "2.3.3" @@ -2585,13 +2585,6 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" @@ -4134,17 +4127,6 @@ glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" - integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^5.0.1" - once "^1.3.0" - global-modules@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-2.0.0.tgz#997605ad2345f27f51539bea26574421215c7780" @@ -4390,10 +4372,10 @@ iconv-lite@0.6: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" -iframe-resizer@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/iframe-resizer/-/iframe-resizer-4.3.4.tgz#6395c4bc8264db3f28eb1e6776c2570be28def80" - integrity sha512-l4tLVWLrK87+i/0/63XpOJIOHHYC+f4P/QNsS1zZm5JHcldR7krohBZLV7tVyAAsZ8sa1bmiDUjK4YRhyu7NBg== +iframe-resizer@^4.3.5: + version "4.3.5" + resolved "https://registry.yarnpkg.com/iframe-resizer/-/iframe-resizer-4.3.5.tgz#d8bdc843f36eaebe2dd7b258e7234f438073cf8b" + integrity sha512-pziqOCczYtbVFgzU3KcjQDS+pMhj4QgL7JutUVazt73xeIWtx+CSRlFQp7aJ2i1bUSZwgbjSP2dez4yelV76yw== ignore@^5.2.0, ignore@^5.2.1: version "5.2.1" @@ -5646,13 +5628,6 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" - integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== - dependencies: - brace-expansion "^2.0.1" - minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619"