Skip to content

Commit

Permalink
Merge branch 'WikiEducationFoundation:master' into feat/new-editors-f…
Browse files Browse the repository at this point in the history
…ilter
  • Loading branch information
shishiro26 authored Jan 31, 2025
2 parents 1bcf1b5 + 83c1473 commit 9262f4b
Show file tree
Hide file tree
Showing 136 changed files with 2,573 additions and 1,044 deletions.
36 changes: 35 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,32 @@ jobs:
with:
pandoc-version: '2.9.2.1'

- name: install ImageMagick
uses: mfinelli/setup-imagemagick@v6
with:
cache: true

# Cache ImageMagick binaries
- name: Cache Latest ImageMagick
uses: actions/cache@v3
with:
path: /home/runner/bin/magick
key: ${{ runner.os }}-imagemagick-latest
restore-keys: |
${{ runner.os }}-imagemagick-latest
# Update PATH for ImageMagick
- name: Update PATH for ImageMagick
run: echo "/home/runner/bin" >> $GITHUB_PATH

- name: Create symlink for identify and convert
run: |
for cmd in identify convert; do
if ! [ -x "$(command -v $cmd)" ]; then
sudo ln -s $(which magick) /usr/bin/$cmd
fi
done
- name: setup Redis
uses: supercharge/[email protected]

Expand Down Expand Up @@ -81,6 +107,14 @@ jobs:
coverageCommand: bundle exec rspec spec/ --color --profile --format documentation
coverageLocations: |
${{github.workspace}}/public/js_coverage/lcov.info:lcov
- name: Archive capybara failure screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: dist-without-markdown
path: tmp/screenshots/*.png
if-no-files-found: ignore

- name: Ruby linting
run: bundle exec rubocop
run: bundle exec rubocop
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
/config/newrelic.yml
/config/secrets.yml
/dockerAuth.json
/fixtures
/fixtures/vcr_cassettes/*
!/fixtures/vcr_cassettes/cached/
!/fixtures/vcr_cassettes/cached/*
/node_modules
/js_coverage
/vendor/*
Expand Down
2 changes: 0 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ Rails/FilePath:
Enabled: false
Performance/UnfreezeString:
Enabled: false
Style/GuardClause:
Enabled: false
Rails/HasManyOrHasOneDependent:
Enabled: false
Rails/InverseOf:
Expand Down
26 changes: 14 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ GEM
launchy
chartkick (4.2.1)
choice (0.2.0)
climate_control (0.2.0)
climate_control (1.2.0)
coderay (1.1.3)
concurrent-ruby (1.2.0)
concurrent-ruby (1.3.4)
connection_pool (2.3.0)
crack (0.4.5)
rexml
Expand Down Expand Up @@ -301,7 +301,7 @@ GEM
http-cookie (1.0.5)
domain_name (~> 0.5)
http_accept_language (2.1.1)
i18n (1.12.0)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
i18n-js (4.2.2)
glob (>= 0.4.0)
Expand All @@ -311,17 +311,18 @@ GEM
activesupport (>= 5.0.0)
json (2.6.2)
jwt (2.5.0)
kt-paperclip (7.2.0)
kt-paperclip (7.2.2)
activemodel (>= 4.2.0)
activesupport (>= 4.2.0)
marcel (~> 1.0.1)
mime-types
terrapin (~> 0.6.0)
terrapin (>= 0.6.0, < 2.0)
launchy (2.5.0)
addressable (~> 2.7)
listen (3.7.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.5)
loofah (2.19.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
Expand All @@ -330,15 +331,16 @@ GEM
mini_mime (>= 0.1.1)
mailgun-ruby (1.2.8)
rest-client (>= 2.0.2)
marcel (1.0.2)
marcel (1.0.4)
matrix (0.4.2)
memory_profiler (1.0.0)
method_source (1.0.0)
mime-types (3.4.1)
mime-types (3.6.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2022.0105)
mime-types-data (3.2025.0107)
mini_mime (1.1.2)
minitest (5.17.0)
minitest (5.25.4)
msgpack (1.5.4)
multipart-post (2.2.3)
mysql2 (0.5.4)
Expand Down Expand Up @@ -576,12 +578,12 @@ GEM
stackprof (0.2.23)
strscan (3.0.1)
temple (0.8.2)
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
terrapin (1.0.1)
climate_control
thor (1.2.1)
tilt (2.0.10)
timeout (0.3.0)
tzinfo (2.0.5)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unf (0.1.4)
unf_ext
Expand Down
14 changes: 10 additions & 4 deletions app/assets/javascripts/actions/revisions_actions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import {
RECEIVE_REVISIONS,
REVISIONS_LOADING,
Expand Down Expand Up @@ -35,12 +34,19 @@ const fetchAllArticles = async (course) => {

const fetchRevisionsPromise = async (course, users, last_date, dispatch) => {
const { revisions, last_date: new_last_date } = await fetchRevisionsFromUsers(course, users, 7, last_date);
course.revisions = sortRevisionsByDate(revisions);

// we don't await this. When the assessments/references get laoded, the action is dispatched
// Create a new course object with updated revisions
const updatedCourse = {
...course,
revisions: sortRevisionsByDate(revisions),
};

// we don't await this. When the assessments/references get loaded, the action is dispatched
fetchRevisionsAndReferences(revisions, dispatch);
return { course, last_date: new_last_date };

return { course: updatedCourse, last_date: new_last_date };
};

const fetchRevisionsCourseSpecificPromise = async (course, users, last_date, dispatch, articles) => {
const trackedArticles = new Set(
articles.filter(article => article.tracked).map(article => article.title)
Expand Down
27 changes: 18 additions & 9 deletions app/assets/javascripts/actions/uploads_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,34 @@ const fetchUploads = (courseId) => {
if (res.ok && res.status === 200) {
return res.json();
}
return Promise.reject(res);
return Promise.reject(new Error(`Failed to fetch uploads. Status: ${res.status}`));
})
.catch((error) => {
logErrorMessage(error);
return { error: 'Failed to fetch uploads', status: error.status || 500 };
});
};

export const receiveUploads = courseId => (dispatch) => {
return (
fetchUploads(courseId)
.then(resp => dispatch({
return fetchUploads(courseId)
.then((resp) => {
if (!resp) {
return dispatch({
type: API_FAIL,
data: { error: 'No response received' },
});
}
return dispatch({
type: RECEIVE_UPLOADS,
data: resp,
}))
.catch(resp => dispatch({
});
})
.catch((resp) => {
dispatch({
type: API_FAIL,
data: resp
}))
);
data: resp,
});
});
};

const fetchUploadMetadata = (uploads) => {
Expand Down
123 changes: 0 additions & 123 deletions app/assets/javascripts/components/activity/activity_table.jsx

This file was deleted.

Loading

0 comments on commit 9262f4b

Please sign in to comment.