Skip to content

Commit

Permalink
Merge pull request #4150 from Coursemology/update-client-deps-2
Browse files Browse the repository at this point in the history
Update client dependencies
  • Loading branch information
zhuhanming authored Mar 6, 2022
2 parents 24901dd + 4da4784 commit aefea45
Show file tree
Hide file tree
Showing 386 changed files with 9,017 additions and 11,178 deletions.
18 changes: 9 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ commands:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm install v14.16.1
nvm alias default 14.16.1
nvm install v14.18.2
nvm alias default 14.18.2
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
# Restore cached Node dependencies
- restore_cache:
keys:
- v14.16.1-node-{{ checksum "client/yarn.lock" }}
- v14.18.2-node-{{ checksum "client/yarn.lock" }}
# Fallback to using the latest cache if no exact match is found
- v14.16.1-node-
- v14.18.2-node-

# Update Node dependencies
- run: cd client && yarn install && cd -
Expand All @@ -75,7 +75,7 @@ commands:
- save_cache:
paths:
- ./client/node_modules
key: v14.16.1-node-{{ checksum "client/yarn.lock" }}
key: v14.18.2-node-{{ checksum "client/yarn.lock" }}

build_client:
steps:
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
command: |
bundle exec rake db:setup
environment:
DATABASE_URL: "postgres://ubuntu@localhost:5432/coursemology_test"
DATABASE_URL: 'postgres://ubuntu@localhost:5432/coursemology_test'

# Run tests!
- run:
Expand All @@ -154,7 +154,7 @@ jobs:
--format progress \
$TEST_FILES
environment:
DATABASE_URL: "postgres://ubuntu@localhost:5432/coursemology_test"
DATABASE_URL: 'postgres://ubuntu@localhost:5432/coursemology_test'

# Collect reports
- store_test_results:
Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
command: |
bundle exec rake db:setup
environment:
DATABASE_URL: "postgres://ubuntu@localhost:5432/coursemology_test"
DATABASE_URL: 'postgres://ubuntu@localhost:5432/coursemology_test'

# Run i18n checks!
- run:
Expand All @@ -249,7 +249,7 @@ jobs:
bundle exec i18n-tasks missing
bundle exec rake factory_bot:lint
environment:
DATABASE_URL: "postgres://ubuntu@localhost:5432/coursemology_test"
DATABASE_URL: 'postgres://ubuntu@localhost:5432/coursemology_test'

workflows:
version: 2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

# Ignore installed node libraries and log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
node_modules

# Ignore generated js bundles
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,12 @@ gem 'simple_form'
gem 'simple_form-bootstrap', git: 'https://github.com/raymondtangsc/simple_form-bootstrap'
# Dynamic nested forms
gem 'cocoon'
gem 'momentjs-rails' # Needed for bootstrap3-datetimepicker-rails
gem 'bootstrap3-datetimepicker-rails'
gem 'bootstrap-select-rails'
gem 'bootstrap_tokenfield_rails'
gem 'twitter-typeahead-rails'
gem 'summernote-rails'
gem 'summernote-rails', git: 'https://github.com/noesya/summernote-rails'

# Using CarrierWave for file uploads
gem 'carrierwave'
Expand Down
20 changes: 13 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ GIT
specs:
rwordnet (2.0.0)

GIT
remote: https://github.com/noesya/summernote-rails
revision: 6dcff6c2a0e56492dbbcaf0a91ccc5898e6be922
specs:
summernote-rails (0.8.20.1)
railties (>= 3.1)

GIT
remote: https://github.com/raymondtangsc/rails_utils.git
revision: 5c8c0caacf08985ae14c5d007529a09d5f284da0
Expand Down Expand Up @@ -365,16 +372,16 @@ GEM
rake
mini_magick (4.11.0)
mini_mime (1.1.2)
mini_portile2 (2.6.1)
mini_portile2 (2.8.0)
minitest (5.15.0)
momentjs-rails (2.20.1)
railties (>= 3.1)
multi_json (1.15.0)
mustermann (1.1.1)
ruby2_keywords (~> 0.0.1)
nio4r (2.5.8)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
nokogiri (1.13.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
orm_adapter (0.5.0)
parallel (1.21.0)
Expand Down Expand Up @@ -580,8 +587,6 @@ GEM
sprockets (>= 3.0.0)
ssrf_filter (1.0.7)
stackprof (0.2.19)
summernote-rails (0.8.12.0)
railties (>= 3.1)
temple (0.8.2)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
Expand Down Expand Up @@ -691,6 +696,7 @@ DEPENDENCIES
loofah (>= 2.2.1)
mimemagic (= 0.3.10)
mini_magick
momentjs-rails
nokogiri (>= 1.8.1)
parallel_tests
pg
Expand Down Expand Up @@ -729,7 +735,7 @@ DEPENDENCIES
spring
sprockets (< 4.0.0)
stackprof
summernote-rails
summernote-rails!
themes_on_rails (>= 0.3.1)!
traceroute
twitter-typeahead-rails
Expand All @@ -745,4 +751,4 @@ DEPENDENCIES
yard

BUNDLED WITH
2.2.22
2.2.32
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//= require jquery_ujs
//= require i18n/translations
//= require js-routes
//= require moment
//= require bootstrap-sprockets
//= require bootstrap-datetimepicker
//= require bootstrap-select
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/course/discussion/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// TODO: Display error messages.
}

$(document).ready(function () {
$(function () {
showCommentBoxes();
DISCUSSION_POST_HELPERS.initializeToolbar(document, DOCUMENT_SELECTOR);
});
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/helpers/discussion/post_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var DISCUSSION_POST_HELPERS = (function (
* @param {String} selector The selector for the specific discussion posts.
*/
function initializeToolbar(element, selector) {
$(document).ready(function () {
$(function () {
showCommentToolbar(element, selector);
});
EVENT_HELPERS.onNodesInserted($(element), function (insertedElement) {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
//
// This prevents missing definitions for things like Ace themes, which are loaded after the
// application script.
$(document).ready(function () {
$(function () {
initializeComponents(document);

EVENT_HELPERS.onNodesInserted($(document), initializeComponents);
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/patches/dropdown_mobile_fix.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
});
}

$(document).ready(function () {
$(function () {
initializeDropdownEventListener();
});
})(jQuery);
23 changes: 23 additions & 0 deletions app/assets/stylesheets/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ textarea.code {
.note-editor {
@extend .note-editor, .note-frame;
@extend .panel;

.note-popover .popover-content {
line-height: 2.5;
padding: 5px;
padding-right: 0;
}
}

table.codehilite {
Expand Down Expand Up @@ -76,3 +82,20 @@ table.codehilite {
.attachment-uploader {
margin-bottom: 1em;
}

// Summernote defaults
$summernote-border-color: #e4e4e4;
$summernote-font-color: #000000;

.note-editor,
.note-editor.note-airframe {
border: 1px solid $summernote-border-color;
overflow: visible;
}

.note-editor.note-airframe .note-editing-area .note-editable,
.note-editor.note-frame .note-editing-area .note-editable,
.note-editor .note-editing-area .note-editable {
color: $summernote-font-color;
padding: 10px;
}
7 changes: 6 additions & 1 deletion client/.babelrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react",
[
"@babel/preset-react",
{
"runtime": "automatic"
}
]
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
Expand Down
69 changes: 64 additions & 5 deletions client/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
module.exports = {
parser: 'babel-eslint',
plugins: ['jest'],
extends: [
'airbnb',
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:import/recommended',
'prettier',
],
settings: {
'import/resolver': {
node: {},
webpack: {},
alias: {
map: [
['lib', './app/lib'],
['api', './app/api'],
['course', './app/bundles/course'],
['testUtils', './app/__test__/utils'],
],
extensions: ['.js', '.jsx'],
},
},
react: {
// TODO: Update this to 'detect' once React is upgraded >=16.9
version: '16.8.6',
version: 'detect',
},
},
rules: {
Expand All @@ -34,7 +43,7 @@ module.exports = {
'jsx-a11y/mouse-events-have-key-events': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'max-len': ['warn', 120],
camelcase: ['warn', { properties: 'never' }],
camelcase: ['warn', { properties: 'never', allow: ['^UNSAFE_'] }],
'comma-dangle': ['error', 'always-multiline'],
'func-names': 'off',
'no-multi-str': 'off',
Expand All @@ -55,4 +64,54 @@ module.exports = {
File: true,
FileReader: true,
},
overrides: [
{
files: [
'**/__test__/**/*.js',
'**/__test__/**/*.jsx',
'**/*.test.js',
'**/*.test.jsx',
'**/*.spec.js',
'**/*.spec.jsx',
],
env: {
jest: true,
},
globals: {
courseId: true,
intl: true,
intlShape: true,
sleep: true,
buildContextOptions: true,
localStorage: true,
},
rules: {
'jest/no-disabled-tests': 'error',
'jest/no-focused-tests': 'error',
'jest/no-alias-methods': 'error',
'jest/no-identical-title': 'error',
'jest/no-jasmine-globals': 'error',
'jest/no-jest-import': 'error',
'jest/no-test-prefixes': 'error',
'jest/no-done-callback': 'error',
'jest/no-test-return-statement': 'error',
'jest/prefer-to-be': 'error',
'jest/prefer-to-contain': 'error',
'jest/prefer-to-have-length': 'error',
'jest/prefer-spy-on': 'error',
'jest/valid-expect': 'error',
'jest/no-deprecated-functions': 'error',
'react/no-find-dom-node': 'off',
'react/jsx-filename-extension': 'off',
'import/no-extraneous-dependencies': 'off',
'import/extensions': 'off',
'import/no-unresolved': [
'error',
{
ignore: ['utils/'],
},
],
},
},
],
};
26 changes: 0 additions & 26 deletions client/.eslintrc.test

This file was deleted.

9 changes: 7 additions & 2 deletions client/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
module.exports = {
semi: true,
trailingComma: 'all',
arrowParens: 'always',
endOfLine: 'lf',
jsxSingleQuote: false,
quoteProps: 'as-needed',
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
useTabs: false,
};
Loading

0 comments on commit aefea45

Please sign in to comment.