Skip to content

Commit 3062a26

Browse files
authored
Merge branch 'develop' into 0valt/387/post-title-search
2 parents cd9c737 + 1633fd6 commit 3062a26

248 files changed

Lines changed: 6296 additions & 2522 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/.codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ component_management:
3535
name: models
3636
paths:
3737
- app/models/**
38+
- component_id: module_tasks
39+
name: tasks
40+
paths:
41+
- app/tasks/**

.github/workflows/ci-cd.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ env:
1212
RAILS_ENV: test
1313
RUBY_VERSION: 3.2
1414

15+
permissions:
16+
actions: write
17+
contents: read
18+
issues: read
19+
pull-requests: read
20+
1521
jobs:
1622
rubocop:
1723
name: Rubocop checking

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ node_modules
7575

7676
# YARD data
7777
.yardoc
78+
doc/

.prettierrc.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @type {import('prettier').Config}
3+
*/
4+
const config = {
5+
braceStyle: "stroustrup",
6+
plugins: ["prettier-plugin-brace-style"],
7+
printWidth: 120,
8+
singleQuote: true,
9+
tabWidth: 2,
10+
};
11+
12+
export default config;

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ gem 'counter_culture', '~> 3.2'
77
gem 'fastimage', '~> 2.2'
88
gem 'image_processing', '~> 1.12'
99
gem 'jquery-rails', '~> 4.5.0'
10+
gem 'mime-types', '~> 3.7'
1011
gem 'mysql2', '~> 0.5.4'
1112
gem 'puma', '~> 5.6'
1213
gem 'rails', '~> 7.2'

Gemfile.lock

Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (7.2.2.1)
5-
actionpack (= 7.2.2.1)
6-
activesupport (= 7.2.2.1)
4+
actioncable (7.2.2.2)
5+
actionpack (= 7.2.2.2)
6+
activesupport (= 7.2.2.2)
77
nio4r (~> 2.0)
88
websocket-driver (>= 0.6.1)
99
zeitwerk (~> 2.6)
10-
actionmailbox (7.2.2.1)
11-
actionpack (= 7.2.2.1)
12-
activejob (= 7.2.2.1)
13-
activerecord (= 7.2.2.1)
14-
activestorage (= 7.2.2.1)
15-
activesupport (= 7.2.2.1)
10+
actionmailbox (7.2.2.2)
11+
actionpack (= 7.2.2.2)
12+
activejob (= 7.2.2.2)
13+
activerecord (= 7.2.2.2)
14+
activestorage (= 7.2.2.2)
15+
activesupport (= 7.2.2.2)
1616
mail (>= 2.8.0)
17-
actionmailer (7.2.2.1)
18-
actionpack (= 7.2.2.1)
19-
actionview (= 7.2.2.1)
20-
activejob (= 7.2.2.1)
21-
activesupport (= 7.2.2.1)
17+
actionmailer (7.2.2.2)
18+
actionpack (= 7.2.2.2)
19+
actionview (= 7.2.2.2)
20+
activejob (= 7.2.2.2)
21+
activesupport (= 7.2.2.2)
2222
mail (>= 2.8.0)
2323
rails-dom-testing (~> 2.2)
24-
actionpack (7.2.2.1)
25-
actionview (= 7.2.2.1)
26-
activesupport (= 7.2.2.1)
24+
actionpack (7.2.2.2)
25+
actionview (= 7.2.2.2)
26+
activesupport (= 7.2.2.2)
2727
nokogiri (>= 1.8.5)
2828
racc
2929
rack (>= 2.2.4, < 3.2)
@@ -32,35 +32,35 @@ GEM
3232
rails-dom-testing (~> 2.2)
3333
rails-html-sanitizer (~> 1.6)
3434
useragent (~> 0.16)
35-
actiontext (7.2.2.1)
36-
actionpack (= 7.2.2.1)
37-
activerecord (= 7.2.2.1)
38-
activestorage (= 7.2.2.1)
39-
activesupport (= 7.2.2.1)
35+
actiontext (7.2.2.2)
36+
actionpack (= 7.2.2.2)
37+
activerecord (= 7.2.2.2)
38+
activestorage (= 7.2.2.2)
39+
activesupport (= 7.2.2.2)
4040
globalid (>= 0.6.0)
4141
nokogiri (>= 1.8.5)
42-
actionview (7.2.2.1)
43-
activesupport (= 7.2.2.1)
42+
actionview (7.2.2.2)
43+
activesupport (= 7.2.2.2)
4444
builder (~> 3.1)
4545
erubi (~> 1.11)
4646
rails-dom-testing (~> 2.2)
4747
rails-html-sanitizer (~> 1.6)
48-
activejob (7.2.2.1)
49-
activesupport (= 7.2.2.1)
48+
activejob (7.2.2.2)
49+
activesupport (= 7.2.2.2)
5050
globalid (>= 0.3.6)
51-
activemodel (7.2.2.1)
52-
activesupport (= 7.2.2.1)
53-
activerecord (7.2.2.1)
54-
activemodel (= 7.2.2.1)
55-
activesupport (= 7.2.2.1)
51+
activemodel (7.2.2.2)
52+
activesupport (= 7.2.2.2)
53+
activerecord (7.2.2.2)
54+
activemodel (= 7.2.2.2)
55+
activesupport (= 7.2.2.2)
5656
timeout (>= 0.4.0)
57-
activestorage (7.2.2.1)
58-
actionpack (= 7.2.2.1)
59-
activejob (= 7.2.2.1)
60-
activerecord (= 7.2.2.1)
61-
activesupport (= 7.2.2.1)
57+
activestorage (7.2.2.2)
58+
actionpack (= 7.2.2.2)
59+
activejob (= 7.2.2.2)
60+
activerecord (= 7.2.2.2)
61+
activesupport (= 7.2.2.2)
6262
marcel (~> 1.0)
63-
activesupport (7.2.2.1)
63+
activesupport (7.2.2.2)
6464
base64
6565
benchmark (>= 0.3)
6666
bigdecimal
@@ -294,20 +294,20 @@ GEM
294294
rackup (1.0.1)
295295
rack (< 3)
296296
webrick
297-
rails (7.2.2.1)
298-
actioncable (= 7.2.2.1)
299-
actionmailbox (= 7.2.2.1)
300-
actionmailer (= 7.2.2.1)
301-
actionpack (= 7.2.2.1)
302-
actiontext (= 7.2.2.1)
303-
actionview (= 7.2.2.1)
304-
activejob (= 7.2.2.1)
305-
activemodel (= 7.2.2.1)
306-
activerecord (= 7.2.2.1)
307-
activestorage (= 7.2.2.1)
308-
activesupport (= 7.2.2.1)
297+
rails (7.2.2.2)
298+
actioncable (= 7.2.2.2)
299+
actionmailbox (= 7.2.2.2)
300+
actionmailer (= 7.2.2.2)
301+
actionpack (= 7.2.2.2)
302+
actiontext (= 7.2.2.2)
303+
actionview (= 7.2.2.2)
304+
activejob (= 7.2.2.2)
305+
activemodel (= 7.2.2.2)
306+
activerecord (= 7.2.2.2)
307+
activestorage (= 7.2.2.2)
308+
activesupport (= 7.2.2.2)
309309
bundler (>= 1.15.0)
310-
railties (= 7.2.2.1)
310+
railties (= 7.2.2.2)
311311
rails-controller-testing (1.0.5)
312312
actionpack (>= 5.0.1.rc1)
313313
actionview (>= 5.0.1.rc1)
@@ -319,9 +319,9 @@ GEM
319319
rails-html-sanitizer (1.6.2)
320320
loofah (~> 2.21)
321321
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
322-
railties (7.2.2.1)
323-
actionpack (= 7.2.2.1)
324-
activesupport (= 7.2.2.1)
322+
railties (7.2.2.2)
323+
actionpack (= 7.2.2.2)
324+
activesupport (= 7.2.2.2)
325325
irb (~> 1.13)
326326
rackup (>= 1.0.0)
327327
rake (>= 12.2)
@@ -344,7 +344,7 @@ GEM
344344
railties (>= 5.2)
345345
reverse_markdown (2.1.1)
346346
nokogiri
347-
rexml (3.4.1)
347+
rexml (3.4.2)
348348
rmagick (5.5.0)
349349
observer (~> 0.1)
350350
pkg-config (~> 1.4)
@@ -493,6 +493,7 @@ DEPENDENCIES
493493
listen (~> 3.7)
494494
maintenance_tasks (~> 2.2)
495495
memory_profiler (~> 1.0)
496+
mime-types (~> 3.7)
496497
minitest (~> 5.16.0)
497498
minitest-ci (~> 3.4.0)
498499
msgpack (~> 1.8)

app/assets/javascripts/categories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ $(() => {
4343
$topic.val(union).trigger('change');
4444
});
4545

46-
$('.js-category-change-select').each((_i, el) => {
46+
$('.js-category-select').each((_i, el) => {
4747
const $tgt = $(el);
4848
$tgt.select2({
4949
ajax: {

app/assets/javascripts/character_count.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,18 @@ $(() => {
6262
const $button = $form.find('input[type="submit"],.js-suggested-edit-approve');
6363
const $count = $counter.find('.js-character-count__count');
6464
const $icon = $counter.find('.js-character-count__icon');
65+
const $info = $counter.find('.js-character-count__info');
66+
const omitMarkdown = $tgt.data('markdown') === 'strip';
67+
68+
const fullCount = $tgt.val().trim().length;
69+
const count = omitMarkdown ?
70+
QPixel.MD.stripMarkdown($tgt.val().trim(), { removeLeadingQuote: true }).length :
71+
fullCount;
72+
73+
$info.toggleClass('hide', fullCount === count)
74+
.attr('title', 'Markdown will be stripped away and does not count towards the limit');
75+
$icon.toggleClass('hide', fullCount !== count);
6576

66-
const count = $tgt.val().length;
6777
const max = parseInt($counter.attr('data-max'), 10);
6878
const min = parseInt($counter.attr('data-min'), 10);
6979
const threshold = parseFloat($counter.attr('data-threshold'));

app/assets/javascripts/closure.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,12 @@ document.addEventListener('DOMContentLoaded', async () => {
4444
QPixel.createNotification('danger', `<strong>Failed:</strong> ${req.status}`);
4545
}
4646
});
47+
48+
QPixel.DOM?.watchClass('.js-close-box.is-active', (target) => {
49+
const reasonInput = target.querySelector('input[name="close-reason"]');
50+
51+
if (QPixel.DOM?.isHTMLElement(reasonInput)) {
52+
reasonInput.focus();
53+
}
54+
});
4755
});

0 commit comments

Comments
 (0)