Merge branch 'master-ce' into drop-default-value-status-deployments

This commit is contained in:
Shinya Maeda 2018-11-19 14:21:35 +09:00
commit 291d744db2
605 changed files with 6416 additions and 3339 deletions

View file

@ -1,4 +1,4 @@
image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.4.5-golang-1.9-git-2.18-chrome-69.0-node-8.x-yarn-1.2-postgresql-9.6-graphicsmagick-1.3.29" image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.5.3-golang-1.9-git-2.18-chrome-69.0-node-10.x-yarn-1.12-postgresql-9.6-graphicsmagick-1.3.29"
.dedicated-runner: &dedicated-runner .dedicated-runner: &dedicated-runner
retry: 1 retry: 1
@ -6,7 +6,7 @@ image: "dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.4.5-golang-1.9-git
- gitlab-org - gitlab-org
.default-cache: &default-cache .default-cache: &default-cache
key: "ruby-2.4.5-debian-stretch-with-yarn" key: "debian-stretch-ruby-2.5.3-node-10.x"
paths: paths:
- vendor/ruby - vendor/ruby
- .yarn-cache/ - .yarn-cache/
@ -32,6 +32,7 @@ variables:
GET_SOURCES_ATTEMPTS: "3" GET_SOURCES_ATTEMPTS: "3"
KNAPSACK_RSPEC_SUITE_REPORT_PATH: knapsack/${CI_PROJECT_NAME}/rspec_report-master.json KNAPSACK_RSPEC_SUITE_REPORT_PATH: knapsack/${CI_PROJECT_NAME}/rspec_report-master.json
FLAKY_RSPEC_SUITE_REPORT_PATH: rspec_flaky/report-suite.json FLAKY_RSPEC_SUITE_REPORT_PATH: rspec_flaky/report-suite.json
BUILD_ASSETS_IMAGE: "false"
before_script: before_script:
- bundle --version - bundle --version
@ -75,15 +76,17 @@ stages:
- mysql:5.7 - mysql:5.7
- redis:alpine - redis:alpine
.rails5: &rails5 .rails4: &rails4
allow_failure: true allow_failure: false
only: except:
variables: variables:
- $CI_COMMIT_REF_NAME =~ /rails5/ - $CI_COMMIT_REF_NAME =~ /(^docs[\/-].*|.*-docs$)/
- $RAILS5_ENABLED - $CI_COMMIT_REF_NAME =~ /(^qa[\/-].*|.*-qa$)/
- $CI_COMMIT_REF_NAME =~ /norails4/
- $RAILS5_DISABLED
variables: variables:
BUNDLE_GEMFILE: "Gemfile.rails5" BUNDLE_GEMFILE: "Gemfile.rails4"
RAILS5: "true" RAILS5: "false"
# Skip all jobs except the ones that begin with 'docs/'. # Skip all jobs except the ones that begin with 'docs/'.
# Used for commits including ONLY documentation changes. # Used for commits including ONLY documentation changes.
@ -121,7 +124,7 @@ stages:
<<: *except-docs-and-qa <<: *except-docs-and-qa
.single-script-job: &single-script-job .single-script-job: &single-script-job
image: ruby:2.4-alpine image: ruby:2.5-alpine
stage: test stage: test
cache: {} cache: {}
dependencies: [] dependencies: []
@ -148,13 +151,12 @@ stages:
stage: test stage: test
script: script:
- JOB_NAME=( $CI_JOB_NAME ) - JOB_NAME=( $CI_JOB_NAME )
- export CI_NODE_INDEX=${JOB_NAME[-2]} - TEST_TOOL=${JOB_NAME[0]}
- export CI_NODE_TOTAL=${JOB_NAME[-1]} - export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${TEST_TOOL}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
- export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${JOB_NAME[0]}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
- export KNAPSACK_GENERATE_REPORT=true - export KNAPSACK_GENERATE_REPORT=true
- export SUITE_FLAKY_RSPEC_REPORT_PATH=${FLAKY_RSPEC_SUITE_REPORT_PATH} - export SUITE_FLAKY_RSPEC_REPORT_PATH=${FLAKY_RSPEC_SUITE_REPORT_PATH}
- export FLAKY_RSPEC_REPORT_PATH=rspec_flaky/all_${JOB_NAME[0]}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json - export FLAKY_RSPEC_REPORT_PATH=rspec_flaky/all_${TEST_TOOL}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
- export NEW_FLAKY_RSPEC_REPORT_PATH=rspec_flaky/new_${JOB_NAME[0]}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json - export NEW_FLAKY_RSPEC_REPORT_PATH=rspec_flaky/new_${TEST_TOOL}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
- export FLAKY_RSPEC_GENERATE_REPORT=true - export FLAKY_RSPEC_GENERATE_REPORT=true
- export CACHE_CLASSES=true - export CACHE_CLASSES=true
- cp ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH} - cp ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH}
@ -177,17 +179,17 @@ stages:
<<: *rspec-metadata <<: *rspec-metadata
<<: *use-pg <<: *use-pg
.rspec-metadata-pg-rails5: &rspec-metadata-pg-rails5 .rspec-metadata-pg-rails4: &rspec-metadata-pg-rails4
<<: *rspec-metadata-pg <<: *rspec-metadata-pg
<<: *rails5 <<: *rails4
.rspec-metadata-mysql: &rspec-metadata-mysql .rspec-metadata-mysql: &rspec-metadata-mysql
<<: *rspec-metadata <<: *rspec-metadata
<<: *use-mysql <<: *use-mysql
.rspec-metadata-mysql-rails5: &rspec-metadata-mysql-rails5 .rspec-metadata-mysql-rails4: &rspec-metadata-mysql-rails4
<<: *rspec-metadata-mysql <<: *rspec-metadata-mysql
<<: *rails5 <<: *rails4
.only-canonical-masters: &only-canonical-masters .only-canonical-masters: &only-canonical-masters
only: only:
@ -227,6 +229,8 @@ stages:
script: script:
- git fetch https://gitlab.com/gitlab-org/gitlab-ce.git v9.3.0 - git fetch https://gitlab.com/gitlab-org/gitlab-ce.git v9.3.0
- git checkout -f FETCH_HEAD - git checkout -f FETCH_HEAD
- sed -i "s/gem 'oj', '~> 2.17.4'//" Gemfile
- bundle update google-protobuf grpc
- bundle install $BUNDLE_INSTALL_FLAGS - bundle install $BUNDLE_INSTALL_FLAGS
- date - date
- cp config/gitlab.yml.example config/gitlab.yml - cp config/gitlab.yml.example config/gitlab.yml
@ -316,10 +320,10 @@ review-docs-cleanup:
# Trigger a docker image build in CNG (Cloud Native GitLab) repository # Trigger a docker image build in CNG (Cloud Native GitLab) repository
# #
cloud-native-image: cloud-native-image:
image: ruby:2.4-alpine image: ruby:2.5-alpine
before_script: [] before_script: []
dependencies: [] dependencies: []
stage: test stage: post-test
allow_failure: true allow_failure: true
variables: variables:
GIT_DEPTH: "1" GIT_DEPTH: "1"
@ -369,7 +373,7 @@ update-tests-metadata:
flaky-examples-check: flaky-examples-check:
<<: *dedicated-runner <<: *dedicated-runner
image: ruby:2.4-alpine image: ruby:2.5-alpine
services: [] services: []
before_script: [] before_script: []
variables: variables:
@ -427,7 +431,7 @@ setup-test-env:
script: script:
- bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init' - bundle exec ruby -Ispec -e 'require "spec_helper" ; TestEnv.init'
- scripts/gitaly-test-build # Do not use 'bundle exec' here - scripts/gitaly-test-build # Do not use 'bundle exec' here
- BUNDLE_GEMFILE=Gemfile.rails5 bundle install $BUNDLE_INSTALL_FLAGS - BUNDLE_GEMFILE=Gemfile.rails4 bundle install $BUNDLE_INSTALL_FLAGS
artifacts: artifacts:
expire_in: 7d expire_in: 7d
paths: paths:
@ -457,129 +461,21 @@ danger-review:
- yarn install --frozen-lockfile --cache-folder .yarn-cache - yarn install --frozen-lockfile --cache-folder .yarn-cache
- danger --fail-on-errors=true - danger --fail-on-errors=true
rspec-pg 0 30: *rspec-metadata-pg rspec-pg:
rspec-pg 1 30: *rspec-metadata-pg <<: *rspec-metadata-pg
rspec-pg 2 30: *rspec-metadata-pg parallel: 30
rspec-pg 3 30: *rspec-metadata-pg
rspec-pg 4 30: *rspec-metadata-pg
rspec-pg 5 30: *rspec-metadata-pg
rspec-pg 6 30: *rspec-metadata-pg
rspec-pg 7 30: *rspec-metadata-pg
rspec-pg 8 30: *rspec-metadata-pg
rspec-pg 9 30: *rspec-metadata-pg
rspec-pg 10 30: *rspec-metadata-pg
rspec-pg 11 30: *rspec-metadata-pg
rspec-pg 12 30: *rspec-metadata-pg
rspec-pg 13 30: *rspec-metadata-pg
rspec-pg 14 30: *rspec-metadata-pg
rspec-pg 15 30: *rspec-metadata-pg
rspec-pg 16 30: *rspec-metadata-pg
rspec-pg 17 30: *rspec-metadata-pg
rspec-pg 18 30: *rspec-metadata-pg
rspec-pg 19 30: *rspec-metadata-pg
rspec-pg 20 30: *rspec-metadata-pg
rspec-pg 21 30: *rspec-metadata-pg
rspec-pg 22 30: *rspec-metadata-pg
rspec-pg 23 30: *rspec-metadata-pg
rspec-pg 24 30: *rspec-metadata-pg
rspec-pg 25 30: *rspec-metadata-pg
rspec-pg 26 30: *rspec-metadata-pg
rspec-pg 27 30: *rspec-metadata-pg
rspec-pg 28 30: *rspec-metadata-pg
rspec-pg 29 30: *rspec-metadata-pg
rspec-mysql 0 30: *rspec-metadata-mysql rspec-mysql:
rspec-mysql 1 30: *rspec-metadata-mysql <<: *rspec-metadata-mysql
rspec-mysql 2 30: *rspec-metadata-mysql parallel: 30
rspec-mysql 3 30: *rspec-metadata-mysql
rspec-mysql 4 30: *rspec-metadata-mysql
rspec-mysql 5 30: *rspec-metadata-mysql
rspec-mysql 6 30: *rspec-metadata-mysql
rspec-mysql 7 30: *rspec-metadata-mysql
rspec-mysql 8 30: *rspec-metadata-mysql
rspec-mysql 9 30: *rspec-metadata-mysql
rspec-mysql 10 30: *rspec-metadata-mysql
rspec-mysql 11 30: *rspec-metadata-mysql
rspec-mysql 12 30: *rspec-metadata-mysql
rspec-mysql 13 30: *rspec-metadata-mysql
rspec-mysql 14 30: *rspec-metadata-mysql
rspec-mysql 15 30: *rspec-metadata-mysql
rspec-mysql 16 30: *rspec-metadata-mysql
rspec-mysql 17 30: *rspec-metadata-mysql
rspec-mysql 18 30: *rspec-metadata-mysql
rspec-mysql 19 30: *rspec-metadata-mysql
rspec-mysql 20 30: *rspec-metadata-mysql
rspec-mysql 21 30: *rspec-metadata-mysql
rspec-mysql 22 30: *rspec-metadata-mysql
rspec-mysql 23 30: *rspec-metadata-mysql
rspec-mysql 24 30: *rspec-metadata-mysql
rspec-mysql 25 30: *rspec-metadata-mysql
rspec-mysql 26 30: *rspec-metadata-mysql
rspec-mysql 27 30: *rspec-metadata-mysql
rspec-mysql 28 30: *rspec-metadata-mysql
rspec-mysql 29 30: *rspec-metadata-mysql
rspec-pg-rails5 0 30: *rspec-metadata-pg-rails5 rspec-pg-rails4:
rspec-pg-rails5 1 30: *rspec-metadata-pg-rails5 <<: *rspec-metadata-pg-rails4
rspec-pg-rails5 2 30: *rspec-metadata-pg-rails5 parallel: 30
rspec-pg-rails5 3 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 4 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 5 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 6 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 7 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 8 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 9 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 10 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 11 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 12 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 13 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 14 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 15 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 16 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 17 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 18 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 19 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 20 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 21 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 22 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 23 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 24 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 25 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 26 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 27 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 28 30: *rspec-metadata-pg-rails5
rspec-pg-rails5 29 30: *rspec-metadata-pg-rails5
rspec-mysql-rails5 0 30: *rspec-metadata-mysql-rails5 rspec-mysql-rails4:
rspec-mysql-rails5 1 30: *rspec-metadata-mysql-rails5 <<: *rspec-metadata-mysql-rails4
rspec-mysql-rails5 2 30: *rspec-metadata-mysql-rails5 parallel: 30
rspec-mysql-rails5 3 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 4 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 5 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 6 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 7 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 8 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 9 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 10 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 11 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 12 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 13 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 14 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 15 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 16 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 17 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 18 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 19 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 20 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 21 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 22 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 23 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 24 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 25 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 26 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 27 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 28 30: *rspec-metadata-mysql-rails5
rspec-mysql-rails5 29 30: *rspec-metadata-mysql-rails5
static-analysis: static-analysis:
<<: *dedicated-no-docs-no-db-pull-cache-job <<: *dedicated-no-docs-no-db-pull-cache-job
@ -589,7 +485,7 @@ static-analysis:
script: script:
- scripts/static-analysis - scripts/static-analysis
cache: cache:
key: "ruby-2.4.5-debian-stretch-with-yarn-and-rubocop" key: "debian-stretch-ruby-2.5.3-node-10.x-and-rubocop"
paths: paths:
- vendor/ruby - vendor/ruby
- .yarn-cache/ - .yarn-cache/
@ -625,11 +521,11 @@ downtime_check:
- /(^docs[\/-].*|.*-docs$)/ - /(^docs[\/-].*|.*-docs$)/
- /(^qa[\/-].*|.*-qa$)/ - /(^qa[\/-].*|.*-qa$)/
rails5_gemfile_lock_check: rails4_gemfile_lock_check:
<<: *dedicated-no-docs-no-db-pull-cache-job <<: *dedicated-no-docs-no-db-pull-cache-job
<<: *except-docs-and-qa <<: *except-docs-and-qa
script: script:
- scripts/rails5-gemfile-lock-check - scripts/rails4-gemfile-lock-check
ee_compat_check: ee_compat_check:
<<: *rake-exec <<: *rake-exec
@ -696,7 +592,7 @@ gitlab:setup-mysql:
# Frontend-related jobs # Frontend-related jobs
gitlab:assets:compile: gitlab:assets:compile:
<<: *dedicated-no-docs-and-no-qa-pull-cache-job <<: *dedicated-no-docs-and-no-qa-pull-cache-job
image: dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.4.4-git-2.18-chrome-69.0-node-8.x-yarn-1.2-graphicsmagick-1.3.29-docker-18.06.1 image: dev.gitlab.org:5005/gitlab/gitlab-build-images:ruby-2.5.3-git-2.18-chrome-69.0-node-8.x-yarn-1.2-graphicsmagick-1.3.29-docker-18.06.1
dependencies: [] dependencies: []
services: services:
- docker:stable-dind - docker:stable-dind
@ -776,7 +672,8 @@ code_quality:
--volume /var/run/docker.sock:/var/run/docker.sock --volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts: artifacts:
paths: [gl-code-quality-report.json] reports:
codequality: gl-code-quality-report.json
expire_in: 1 week expire_in: 1 week
sast: sast:
@ -800,7 +697,8 @@ sast:
--volume /var/run/docker.sock:/var/run/docker.sock --volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code "registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
artifacts: artifacts:
paths: [gl-sast-report.json] reports:
sast: gl-sast-report.json
dependency_scanning: dependency_scanning:
<<: *dedicated-no-docs-no-db-pull-cache-job <<: *dedicated-no-docs-no-db-pull-cache-job
@ -822,7 +720,8 @@ dependency_scanning:
--volume /var/run/docker.sock:/var/run/docker.sock --volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$SP_VERSION" /code "registry.gitlab.com/gitlab-org/security-products/dependency-scanning:$SP_VERSION" /code
artifacts: artifacts:
paths: [gl-dependency-scanning-report.json] reports:
dependency_scanning: gl-dependency-scanning-report.json
qa:internal: qa:internal:
<<: *dedicated-no-docs-no-db-pull-cache-job <<: *dedicated-no-docs-no-db-pull-cache-job
@ -840,6 +739,39 @@ qa:selectors:
- bundle install - bundle install
- bundle exec bin/qa Test::Sanity::Selectors - bundle exec bin/qa Test::Sanity::Selectors
.qa-frontend-node: &qa-frontend-node
stage: test
variables:
NODE_OPTIONS: --max_old_space_size=3584
cache:
key: "$CI_JOB_NAME"
paths:
- .yarn-cache/
dependencies: []
before_script: []
script:
- date
- yarn install --frozen-lockfile --cache-folder .yarn-cache
- date
- yarn run webpack-prod
qa-frontend-node:6:
<<: *qa-frontend-node
image: node:6-alpine
qa-frontend-node:8:
<<: *qa-frontend-node
image: node:8-alpine
qa-frontend-node:10:
<<: *qa-frontend-node
image: node:10-alpine
qa-frontend-node:latest:
<<: *qa-frontend-node
image: node:alpine
allow_failure: true
coverage: coverage:
# Don't include dedicated-no-docs-no-db-pull-cache-job here since we need to # Don't include dedicated-no-docs-no-db-pull-cache-job here since we need to
# download artifacts from all the rspec jobs instead of from setup-test-env only # download artifacts from all the rspec jobs instead of from setup-test-env only
@ -889,6 +821,8 @@ pages:
- mv coverage-javascript/ public/coverage-javascript/ || true - mv coverage-javascript/ public/coverage-javascript/ || true
- mv eslint-report.html public/ || true - mv eslint-report.html public/ || true
- mv webpack-report/ public/webpack-report/ || true - mv webpack-report/ public/webpack-report/ || true
- cp .public/assets/application-*.css public/application.css || true
- cp .public/assets/application-*.css.gz public/application.css.gz || true
artifacts: artifacts:
paths: paths:
- public - public

View file

@ -64,7 +64,7 @@ Some features might be simple enough that they only involve one Component, while
more complex features could involve multiple or even all. more complex features could involve multiple or even all.
Example (from https://gitlab.com/gitlab-org/gitlab-ce/issues/50353): Example (from https://gitlab.com/gitlab-org/gitlab-ce/issues/50353):
* Respository is * Repository is
* Intuitive * Intuitive
* It's easy to select the desired file template * It's easy to select the desired file template
* It doesn't require unnecessary actions to save the change * It doesn't require unnecessary actions to save the change

2
.nvmrc
View file

@ -1 +1 @@
8.11.3 10.13.0

View file

@ -1 +1 @@
2.4.5 2.5.3

View file

@ -1 +1 @@
0.129.0 0.132.0

View file

@ -1 +1 @@
7.1.0 7.1.1

10
Gemfile
View file

@ -1,6 +1,6 @@
# --- Special code for migrating to Rails 5.0 --- # --- Special code for migrating to Rails 5.0 ---
def rails5? def rails5?
%w[1 true].include?(ENV["RAILS5"]) !%w[0 false].include?(ENV["RAILS5"])
end end
gem_versions = {} gem_versions = {}
@ -315,7 +315,7 @@ group :development do
# Better errors handler # Better errors handler
gem 'better_errors', '~> 2.1.0' gem 'better_errors', '~> 2.1.0'
gem 'binding_of_caller', '~> 0.7.2' gem 'binding_of_caller', '~> 0.8.0'
# thin instead webrick # thin instead webrick
gem 'thin', '~> 1.7.0' gem 'thin', '~> 1.7.0'
@ -342,7 +342,7 @@ group :development, :test do
gem 'minitest', '~> 5.7.0' gem 'minitest', '~> 5.7.0'
# Generate Fake data # Generate Fake data
gem 'ffaker', '~> 2.4' gem 'ffaker', '~> 2.10'
gem 'capybara', '~> 2.15' gem 'capybara', '~> 2.15'
gem 'capybara-screenshot', '~> 1.0.0' gem 'capybara-screenshot', '~> 1.0.0'
@ -357,14 +357,14 @@ group :development, :test do
gem 'rubocop-rspec', '~> 1.22.1' gem 'rubocop-rspec', '~> 1.22.1'
gem 'scss_lint', '~> 0.56.0', require: false gem 'scss_lint', '~> 0.56.0', require: false
gem 'haml_lint', '~> 0.26.0', require: false gem 'haml_lint', '~> 0.28.0', require: false
gem 'simplecov', '~> 0.14.0', require: false gem 'simplecov', '~> 0.14.0', require: false
gem 'bundler-audit', '~> 0.5.0', require: false gem 'bundler-audit', '~> 0.5.0', require: false
gem 'benchmark-ips', '~> 2.3.0', require: false gem 'benchmark-ips', '~> 2.3.0', require: false
gem 'license_finder', '~> 5.4', require: false gem 'license_finder', '~> 5.4', require: false
gem 'knapsack', '~> 1.16' gem 'knapsack', '~> 1.17'
gem 'activerecord_sane_schema_dumper', gem_versions['activerecord_sane_schema_dumper'] gem 'activerecord_sane_schema_dumper', gem_versions['activerecord_sane_schema_dumper']

View file

@ -4,41 +4,44 @@ GEM
RedCloth (4.3.2) RedCloth (4.3.2)
abstract_type (0.0.7) abstract_type (0.0.7)
ace-rails-ap (4.1.2) ace-rails-ap (4.1.2)
actionmailer (4.2.10) actioncable (5.0.7)
actionpack (= 4.2.10) actionpack (= 5.0.7)
actionview (= 4.2.10) nio4r (>= 1.2, < 3.0)
activejob (= 4.2.10) websocket-driver (~> 0.6.1)
actionmailer (5.0.7)
actionpack (= 5.0.7)
actionview (= 5.0.7)
activejob (= 5.0.7)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5) rails-dom-testing (~> 2.0)
actionpack (4.2.10) actionpack (5.0.7)
actionview (= 4.2.10) actionview (= 5.0.7)
activesupport (= 4.2.10) activesupport (= 5.0.7)
rack (~> 1.6) rack (~> 2.0)
rack-test (~> 0.6.2) rack-test (~> 0.6.3)
rails-dom-testing (~> 1.0, >= 1.0.5) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.10) actionview (5.0.7)
activesupport (= 4.2.10) activesupport (= 5.0.7)
builder (~> 3.1) builder (~> 3.1)
erubis (~> 2.7.0) erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3) rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (4.2.10) activejob (5.0.7)
activesupport (= 4.2.10) activesupport (= 5.0.7)
globalid (>= 0.3.0) globalid (>= 0.3.6)
activemodel (4.2.10) activemodel (5.0.7)
activesupport (= 4.2.10) activesupport (= 5.0.7)
builder (~> 3.1) activerecord (5.0.7)
activerecord (4.2.10) activemodel (= 5.0.7)
activemodel (= 4.2.10) activesupport (= 5.0.7)
activesupport (= 4.2.10) arel (~> 7.0)
arel (~> 6.0) activerecord_sane_schema_dumper (1.0)
activerecord_sane_schema_dumper (0.2) rails (>= 5, < 6)
rails (>= 4, < 5) activesupport (5.0.7)
activesupport (4.2.10) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7) i18n (>= 0.7, < 2)
minitest (~> 5.1) minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1) tzinfo (~> 1.1)
acts-as-taggable-on (5.0.0) acts-as-taggable-on (5.0.0)
activerecord (>= 4.2.8) activerecord (>= 4.2.8)
@ -49,7 +52,7 @@ GEM
public_suffix (>= 2.0.2, < 4.0) public_suffix (>= 2.0.2, < 4.0)
aes_key_wrap (1.0.1) aes_key_wrap (1.0.1)
akismet (2.0.0) akismet (2.0.0)
arel (6.0.4) arel (7.1.4)
asana (0.6.0) asana (0.6.0)
faraday (~> 0.9) faraday (~> 0.9)
faraday_middleware (~> 0.9) faraday_middleware (~> 0.9)
@ -79,7 +82,7 @@ GEM
erubis (>= 2.6.6) erubis (>= 2.6.6)
rack (>= 0.9.0) rack (>= 0.9.0)
bindata (2.4.3) bindata (2.4.3)
binding_of_caller (0.7.2) binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1) debug_inspector (>= 0.0.1)
bootsnap (1.3.2) bootsnap (1.3.2)
msgpack (~> 1.0) msgpack (~> 1.0)
@ -137,14 +140,14 @@ GEM
addressable addressable
daemons (1.2.6) daemons (1.2.6)
database_cleaner (1.5.3) database_cleaner (1.5.3)
debug_inspector (0.0.2) debug_inspector (0.0.3)
debugger-ruby_core_source (1.3.8) debugger-ruby_core_source (1.3.8)
deckar01-task_list (2.0.0) deckar01-task_list (2.0.0)
html-pipeline html-pipeline
declarative (0.0.10) declarative (0.0.10)
declarative-option (0.1.0) declarative-option (0.1.0)
default_value_for (3.0.2) default_value_for (3.0.5)
activerecord (>= 3.2.0, < 5.1) activerecord (>= 3.2.0, < 5.2)
descendants_tracker (0.0.4) descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1) thread_safe (~> 0.3, >= 0.3.1)
device_detector (1.0.0) device_detector (1.0.0)
@ -202,7 +205,7 @@ GEM
multi_json multi_json
fast_blank (1.0.0) fast_blank (1.0.0)
fast_gettext (1.6.0) fast_gettext (1.6.0)
ffaker (2.4.0) ffaker (2.10.0)
ffi (1.9.25) ffi (1.9.25)
flipper (0.13.0) flipper (0.13.0)
flipper-active_record (0.13.0) flipper-active_record (0.13.0)
@ -337,11 +340,11 @@ GEM
haml (5.0.4) haml (5.0.4)
temple (>= 0.8.0) temple (>= 0.8.0)
tilt tilt
haml_lint (0.26.0) haml_lint (0.28.0)
haml (>= 4.0, < 5.1) haml (>= 4.0, < 5.1)
rainbow rainbow
rake (>= 10, < 13) rake (>= 10, < 13)
rubocop (>= 0.49.0) rubocop (>= 0.50.0)
sysexits (~> 1.1) sysexits (~> 1.1)
hamlit (2.8.8) hamlit (2.8.8)
temple (>= 0.8.0) temple (>= 0.8.0)
@ -376,7 +379,7 @@ GEM
json (~> 1.8) json (~> 1.8)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
httpclient (2.8.3) httpclient (2.8.3)
i18n (0.9.5) i18n (1.1.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
icalendar (2.4.1) icalendar (2.4.1)
ice_nine (0.11.2) ice_nine (0.11.2)
@ -412,7 +415,7 @@ GEM
kaminari-core (= 1.0.1) kaminari-core (= 1.0.1)
kaminari-core (1.0.1) kaminari-core (1.0.1)
kgio (2.10.0) kgio (2.10.0)
knapsack (1.16.0) knapsack (1.17.0)
rake rake
kubeclient (3.1.0) kubeclient (3.1.0)
http (~> 2.2.2) http (~> 2.2.2)
@ -470,6 +473,7 @@ GEM
net-ldap (0.16.0) net-ldap (0.16.0)
net-ssh (5.0.1) net-ssh (5.0.1)
netrc (0.11.0) netrc (0.11.0)
nio4r (2.3.1)
nokogiri (1.8.4) nokogiri (1.8.4)
mini_portile2 (~> 2.3.0) mini_portile2 (~> 2.3.0)
nokogumbo (1.5.0) nokogumbo (1.5.0)
@ -598,7 +602,7 @@ GEM
get_process_mem (~> 0.2) get_process_mem (~> 0.2)
puma (>= 2.7, < 4) puma (>= 2.7, < 4)
pyu-ruby-sasl (0.0.3.3) pyu-ruby-sasl (0.0.3.3)
rack (1.6.11) rack (2.0.5)
rack-accept (0.4.5) rack-accept (0.4.5)
rack (>= 0.4) rack (>= 0.4)
rack-attack (4.4.1) rack-attack (4.4.1)
@ -616,31 +620,36 @@ GEM
rack rack
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
rails (4.2.10) rails (5.0.7)
actionmailer (= 4.2.10) actioncable (= 5.0.7)
actionpack (= 4.2.10) actionmailer (= 5.0.7)
actionview (= 4.2.10) actionpack (= 5.0.7)
activejob (= 4.2.10) actionview (= 5.0.7)
activemodel (= 4.2.10) activejob (= 5.0.7)
activerecord (= 4.2.10) activemodel (= 5.0.7)
activesupport (= 4.2.10) activerecord (= 5.0.7)
bundler (>= 1.3.0, < 2.0) activesupport (= 5.0.7)
railties (= 4.2.10) bundler (>= 1.3.0)
sprockets-rails railties (= 5.0.7)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.2)
actionpack (~> 5.x, >= 5.0.1)
actionview (~> 5.x, >= 5.0.1)
activesupport (~> 5.x)
rails-deprecated_sanitizer (1.0.3) rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha) activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.9) rails-dom-testing (2.0.3)
activesupport (>= 4.2.0, < 5.0) activesupport (>= 4.2.0)
nokogiri (~> 1.6) nokogiri (>= 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.4) rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2) loofah (~> 2.2, >= 2.2.2)
rails-i18n (4.0.9) rails-i18n (5.1.1)
i18n (~> 0.7) i18n (>= 0.7, < 2)
railties (~> 4.0) railties (>= 5.0, < 6)
railties (4.2.10) railties (5.0.7)
actionpack (= 4.2.10) actionpack (= 5.0.7)
activesupport (= 4.2.10) activesupport (= 5.0.7)
method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
rainbow (3.0.0) rainbow (3.0.0)
@ -731,8 +740,7 @@ GEM
rspec-core rspec-core
rspec-set (0.1.3) rspec-set (0.1.3)
rspec-support (3.7.1) rspec-support (3.7.1)
rspec_junit_formatter (0.2.3) rspec_junit_formatter (0.4.1)
builder (< 4)
rspec-core (>= 2, < 4, != 2.12.0) rspec-core (>= 2, < 4, != 2.12.0)
rspec_profiling (0.0.5) rspec_profiling (0.0.5)
activerecord activerecord
@ -849,8 +857,6 @@ GEM
sysexits (1.2.0) sysexits (1.2.0)
temple (0.8.0) temple (0.8.0)
test-prof (0.2.5) test-prof (0.2.5)
test_after_commit (1.1.0)
activerecord (>= 3.2)
text (1.3.1) text (1.3.1)
thin (1.7.2) thin (1.7.2)
daemons (~> 1.0, >= 1.0.9) daemons (~> 1.0, >= 1.0.9)
@ -913,6 +919,9 @@ GEM
hashdiff hashdiff
webpack-rails (0.9.11) webpack-rails (0.9.11)
railties (>= 3.2.0) railties (>= 3.2.0)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
wikicloth (0.8.1) wikicloth (0.8.1)
builder builder
expression_parser expression_parser
@ -928,7 +937,7 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
RedCloth (~> 4.3.2) RedCloth (~> 4.3.2)
ace-rails-ap (~> 4.1.0) ace-rails-ap (~> 4.1.0)
activerecord_sane_schema_dumper (= 0.2) activerecord_sane_schema_dumper (= 1.0)
acts-as-taggable-on (~> 5.0) acts-as-taggable-on (~> 5.0)
addressable (~> 2.5.2) addressable (~> 2.5.2)
akismet (~> 2.0) akismet (~> 2.0)
@ -943,7 +952,7 @@ DEPENDENCIES
bcrypt_pbkdf (~> 1.0) bcrypt_pbkdf (~> 1.0)
benchmark-ips (~> 2.3.0) benchmark-ips (~> 2.3.0)
better_errors (~> 2.1.0) better_errors (~> 2.1.0)
binding_of_caller (~> 0.7.2) binding_of_caller (~> 0.8.0)
bootsnap (~> 1.3) bootsnap (~> 1.3)
bootstrap_form (~> 2.7.0) bootstrap_form (~> 2.7.0)
brakeman (~> 4.2) brakeman (~> 4.2)
@ -962,7 +971,7 @@ DEPENDENCIES
creole (~> 0.5.0) creole (~> 0.5.0)
database_cleaner (~> 1.5.0) database_cleaner (~> 1.5.0)
deckar01-task_list (= 2.0.0) deckar01-task_list (= 2.0.0)
default_value_for (~> 3.0.0) default_value_for (~> 3.0.5)
device_detector device_detector
devise (~> 4.4) devise (~> 4.4)
devise-two-factor (~> 3.0.0) devise-two-factor (~> 3.0.0)
@ -977,7 +986,7 @@ DEPENDENCIES
factory_bot_rails (~> 4.8.2) factory_bot_rails (~> 4.8.2)
faraday (~> 0.12) faraday (~> 0.12)
fast_blank fast_blank
ffaker (~> 2.4) ffaker (~> 2.10)
flipper (~> 0.13.0) flipper (~> 0.13.0)
flipper-active_record (~> 0.13.0) flipper-active_record (~> 0.13.0)
flipper-active_support_cache_store (~> 0.13.0) flipper-active_support_cache_store (~> 0.13.0)
@ -1013,7 +1022,7 @@ DEPENDENCIES
graphiql-rails (~> 1.4.10) graphiql-rails (~> 1.4.10)
graphql (~> 1.8.0) graphql (~> 1.8.0)
grpc (~> 1.15.0) grpc (~> 1.15.0)
haml_lint (~> 0.26.0) haml_lint (~> 0.28.0)
hamlit (~> 2.8.8) hamlit (~> 2.8.8)
hangouts-chat (~> 0.0.5) hangouts-chat (~> 0.0.5)
hashie-forbidden_attributes hashie-forbidden_attributes
@ -1030,7 +1039,7 @@ DEPENDENCIES
json-schema (~> 2.8.0) json-schema (~> 2.8.0)
jwt (~> 1.5.6) jwt (~> 1.5.6)
kaminari (~> 1.0) kaminari (~> 1.0)
knapsack (~> 1.16) knapsack (~> 1.17)
kubeclient (~> 3.1.0) kubeclient (~> 3.1.0)
letter_opener_web (~> 1.3.0) letter_opener_web (~> 1.3.0)
license_finder (~> 5.4) license_finder (~> 5.4)
@ -1080,9 +1089,10 @@ DEPENDENCIES
rack-cors (~> 1.0.0) rack-cors (~> 1.0.0)
rack-oauth2 (~> 1.2.1) rack-oauth2 (~> 1.2.1)
rack-proxy (~> 0.6.0) rack-proxy (~> 0.6.0)
rails (= 4.2.10) rails (= 5.0.7)
rails-controller-testing
rails-deprecated_sanitizer (~> 1.0.3) rails-deprecated_sanitizer (~> 1.0.3)
rails-i18n (~> 4.0.9) rails-i18n (~> 5.1)
rainbow (~> 3.0) rainbow (~> 3.0)
raindrops (~> 0.18) raindrops (~> 0.18)
rblineprof (~> 0.3.6) rblineprof (~> 0.3.6)
@ -1135,7 +1145,6 @@ DEPENDENCIES
state_machines-activerecord (~> 0.5.1) state_machines-activerecord (~> 0.5.1)
sys-filesystem (~> 1.1.6) sys-filesystem (~> 1.1.6)
test-prof (~> 0.2.5) test-prof (~> 0.2.5)
test_after_commit (~> 1.1)
thin (~> 1.7.0) thin (~> 1.7.0)
timecop (~> 0.8.0) timecop (~> 0.8.0)
toml-rb (~> 1.0.0) toml-rb (~> 1.0.0)

View file

@ -1,6 +1,6 @@
# BUNDLE_GEMFILE=Gemfile.rails5 bundle install # BUNDLE_GEMFILE=Gemfile.rails4 bundle install
ENV["RAILS5"] = "true" ENV["RAILS5"] = "false"
gemfile = File.expand_path("../Gemfile", __FILE__) gemfile = File.expand_path("../Gemfile", __FILE__)

View file

@ -4,44 +4,41 @@ GEM
RedCloth (4.3.2) RedCloth (4.3.2)
abstract_type (0.0.7) abstract_type (0.0.7)
ace-rails-ap (4.1.2) ace-rails-ap (4.1.2)
actioncable (5.0.7) actionmailer (4.2.10)
actionpack (= 5.0.7) actionpack (= 4.2.10)
nio4r (>= 1.2, < 3.0) actionview (= 4.2.10)
websocket-driver (~> 0.6.1) activejob (= 4.2.10)
actionmailer (5.0.7)
actionpack (= 5.0.7)
actionview (= 5.0.7)
activejob (= 5.0.7)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (5.0.7) actionpack (4.2.10)
actionview (= 5.0.7) actionview (= 4.2.10)
activesupport (= 5.0.7) activesupport (= 4.2.10)
rack (~> 2.0) rack (~> 1.6)
rack-test (~> 0.6.3) rack-test (~> 0.6.2)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.7) actionview (4.2.10)
activesupport (= 5.0.7) activesupport (= 4.2.10)
builder (~> 3.1) builder (~> 3.1)
erubis (~> 2.7.0) erubis (~> 2.7.0)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.3) rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.0.7) activejob (4.2.10)
activesupport (= 5.0.7) activesupport (= 4.2.10)
globalid (>= 0.3.6) globalid (>= 0.3.0)
activemodel (5.0.7) activemodel (4.2.10)
activesupport (= 5.0.7) activesupport (= 4.2.10)
activerecord (5.0.7) builder (~> 3.1)
activemodel (= 5.0.7) activerecord (4.2.10)
activesupport (= 5.0.7) activemodel (= 4.2.10)
arel (~> 7.0) activesupport (= 4.2.10)
activerecord_sane_schema_dumper (1.0) arel (~> 6.0)
rails (>= 5, < 6) activerecord_sane_schema_dumper (0.2)
activesupport (5.0.7) rails (>= 4, < 5)
concurrent-ruby (~> 1.0, >= 1.0.2) activesupport (4.2.10)
i18n (>= 0.7, < 2) i18n (~> 0.7)
minitest (~> 5.1) minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1) tzinfo (~> 1.1)
acts-as-taggable-on (5.0.0) acts-as-taggable-on (5.0.0)
activerecord (>= 4.2.8) activerecord (>= 4.2.8)
@ -52,7 +49,7 @@ GEM
public_suffix (>= 2.0.2, < 4.0) public_suffix (>= 2.0.2, < 4.0)
aes_key_wrap (1.0.1) aes_key_wrap (1.0.1)
akismet (2.0.0) akismet (2.0.0)
arel (7.1.4) arel (6.0.4)
asana (0.6.0) asana (0.6.0)
faraday (~> 0.9) faraday (~> 0.9)
faraday_middleware (~> 0.9) faraday_middleware (~> 0.9)
@ -82,7 +79,7 @@ GEM
erubis (>= 2.6.6) erubis (>= 2.6.6)
rack (>= 0.9.0) rack (>= 0.9.0)
bindata (2.4.3) bindata (2.4.3)
binding_of_caller (0.7.2) binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1) debug_inspector (>= 0.0.1)
bootsnap (1.3.2) bootsnap (1.3.2)
msgpack (~> 1.0) msgpack (~> 1.0)
@ -140,14 +137,14 @@ GEM
addressable addressable
daemons (1.2.6) daemons (1.2.6)
database_cleaner (1.5.3) database_cleaner (1.5.3)
debug_inspector (0.0.2) debug_inspector (0.0.3)
debugger-ruby_core_source (1.3.8) debugger-ruby_core_source (1.3.8)
deckar01-task_list (2.0.0) deckar01-task_list (2.0.0)
html-pipeline html-pipeline
declarative (0.0.10) declarative (0.0.10)
declarative-option (0.1.0) declarative-option (0.1.0)
default_value_for (3.0.5) default_value_for (3.0.2)
activerecord (>= 3.2.0, < 5.2) activerecord (>= 3.2.0, < 5.1)
descendants_tracker (0.0.4) descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1) thread_safe (~> 0.3, >= 0.3.1)
device_detector (1.0.0) device_detector (1.0.0)
@ -205,7 +202,7 @@ GEM
multi_json multi_json
fast_blank (1.0.0) fast_blank (1.0.0)
fast_gettext (1.6.0) fast_gettext (1.6.0)
ffaker (2.4.0) ffaker (2.10.0)
ffi (1.9.25) ffi (1.9.25)
flipper (0.13.0) flipper (0.13.0)
flipper-active_record (0.13.0) flipper-active_record (0.13.0)
@ -340,11 +337,11 @@ GEM
haml (5.0.4) haml (5.0.4)
temple (>= 0.8.0) temple (>= 0.8.0)
tilt tilt
haml_lint (0.26.0) haml_lint (0.28.0)
haml (>= 4.0, < 5.1) haml (>= 4.0, < 5.1)
rainbow rainbow
rake (>= 10, < 13) rake (>= 10, < 13)
rubocop (>= 0.49.0) rubocop (>= 0.50.0)
sysexits (~> 1.1) sysexits (~> 1.1)
hamlit (2.8.8) hamlit (2.8.8)
temple (>= 0.8.0) temple (>= 0.8.0)
@ -379,7 +376,7 @@ GEM
json (~> 1.8) json (~> 1.8)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
httpclient (2.8.3) httpclient (2.8.3)
i18n (1.1.0) i18n (0.9.5)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
icalendar (2.4.1) icalendar (2.4.1)
ice_nine (0.11.2) ice_nine (0.11.2)
@ -415,7 +412,7 @@ GEM
kaminari-core (= 1.0.1) kaminari-core (= 1.0.1)
kaminari-core (1.0.1) kaminari-core (1.0.1)
kgio (2.10.0) kgio (2.10.0)
knapsack (1.16.0) knapsack (1.17.0)
rake rake
kubeclient (3.1.0) kubeclient (3.1.0)
http (~> 2.2.2) http (~> 2.2.2)
@ -454,9 +451,9 @@ GEM
memoizable (0.4.2) memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1) thread_safe (~> 0.3, >= 0.3.1)
method_source (0.9.0) method_source (0.9.0)
mime-types (3.1) mime-types (3.2.2)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521) mime-types-data (3.2018.0812)
mimemagic (0.3.0) mimemagic (0.3.0)
mini_magick (4.8.0) mini_magick (4.8.0)
mini_mime (1.0.1) mini_mime (1.0.1)
@ -473,7 +470,6 @@ GEM
net-ldap (0.16.0) net-ldap (0.16.0)
net-ssh (5.0.1) net-ssh (5.0.1)
netrc (0.11.0) netrc (0.11.0)
nio4r (2.3.1)
nokogiri (1.8.4) nokogiri (1.8.4)
mini_portile2 (~> 2.3.0) mini_portile2 (~> 2.3.0)
nokogumbo (1.5.0) nokogumbo (1.5.0)
@ -602,7 +598,7 @@ GEM
get_process_mem (~> 0.2) get_process_mem (~> 0.2)
puma (>= 2.7, < 4) puma (>= 2.7, < 4)
pyu-ruby-sasl (0.0.3.3) pyu-ruby-sasl (0.0.3.3)
rack (2.0.5) rack (1.6.11)
rack-accept (0.4.5) rack-accept (0.4.5)
rack (>= 0.4) rack (>= 0.4)
rack-attack (4.4.1) rack-attack (4.4.1)
@ -620,36 +616,31 @@ GEM
rack rack
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
rails (5.0.7) rails (4.2.10)
actioncable (= 5.0.7) actionmailer (= 4.2.10)
actionmailer (= 5.0.7) actionpack (= 4.2.10)
actionpack (= 5.0.7) actionview (= 4.2.10)
actionview (= 5.0.7) activejob (= 4.2.10)
activejob (= 5.0.7) activemodel (= 4.2.10)
activemodel (= 5.0.7) activerecord (= 4.2.10)
activerecord (= 5.0.7) activesupport (= 4.2.10)
activesupport (= 5.0.7) bundler (>= 1.3.0, < 2.0)
bundler (>= 1.3.0) railties (= 4.2.10)
railties (= 5.0.7) sprockets-rails
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.2)
actionpack (~> 5.x, >= 5.0.1)
actionview (~> 5.x, >= 5.0.1)
activesupport (~> 5.x)
rails-deprecated_sanitizer (1.0.3) rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha) activesupport (>= 4.2.0.alpha)
rails-dom-testing (2.0.3) rails-dom-testing (1.0.9)
activesupport (>= 4.2.0) activesupport (>= 4.2.0, < 5.0)
nokogiri (>= 1.6) nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.4) rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2) loofah (~> 2.2, >= 2.2.2)
rails-i18n (5.1.1) rails-i18n (4.0.9)
i18n (>= 0.7, < 2) i18n (~> 0.7)
railties (>= 5.0, < 6) railties (~> 4.0)
railties (5.0.7) railties (4.2.10)
actionpack (= 5.0.7) actionpack (= 4.2.10)
activesupport (= 5.0.7) activesupport (= 4.2.10)
method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
rainbow (3.0.0) rainbow (3.0.0)
@ -740,7 +731,8 @@ GEM
rspec-core rspec-core
rspec-set (0.1.3) rspec-set (0.1.3)
rspec-support (3.7.1) rspec-support (3.7.1)
rspec_junit_formatter (0.4.1) rspec_junit_formatter (0.2.3)
builder (< 4)
rspec-core (>= 2, < 4, != 2.12.0) rspec-core (>= 2, < 4, != 2.12.0)
rspec_profiling (0.0.5) rspec_profiling (0.0.5)
activerecord activerecord
@ -857,6 +849,8 @@ GEM
sysexits (1.2.0) sysexits (1.2.0)
temple (0.8.0) temple (0.8.0)
test-prof (0.2.5) test-prof (0.2.5)
test_after_commit (1.1.0)
activerecord (>= 3.2)
text (1.3.1) text (1.3.1)
thin (1.7.2) thin (1.7.2)
daemons (~> 1.0, >= 1.0.9) daemons (~> 1.0, >= 1.0.9)
@ -919,9 +913,6 @@ GEM
hashdiff hashdiff
webpack-rails (0.9.11) webpack-rails (0.9.11)
railties (>= 3.2.0) railties (>= 3.2.0)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
wikicloth (0.8.1) wikicloth (0.8.1)
builder builder
expression_parser expression_parser
@ -937,7 +928,7 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
RedCloth (~> 4.3.2) RedCloth (~> 4.3.2)
ace-rails-ap (~> 4.1.0) ace-rails-ap (~> 4.1.0)
activerecord_sane_schema_dumper (= 1.0) activerecord_sane_schema_dumper (= 0.2)
acts-as-taggable-on (~> 5.0) acts-as-taggable-on (~> 5.0)
addressable (~> 2.5.2) addressable (~> 2.5.2)
akismet (~> 2.0) akismet (~> 2.0)
@ -952,7 +943,7 @@ DEPENDENCIES
bcrypt_pbkdf (~> 1.0) bcrypt_pbkdf (~> 1.0)
benchmark-ips (~> 2.3.0) benchmark-ips (~> 2.3.0)
better_errors (~> 2.1.0) better_errors (~> 2.1.0)
binding_of_caller (~> 0.7.2) binding_of_caller (~> 0.8.0)
bootsnap (~> 1.3) bootsnap (~> 1.3)
bootstrap_form (~> 2.7.0) bootstrap_form (~> 2.7.0)
brakeman (~> 4.2) brakeman (~> 4.2)
@ -971,7 +962,7 @@ DEPENDENCIES
creole (~> 0.5.0) creole (~> 0.5.0)
database_cleaner (~> 1.5.0) database_cleaner (~> 1.5.0)
deckar01-task_list (= 2.0.0) deckar01-task_list (= 2.0.0)
default_value_for (~> 3.0.5) default_value_for (~> 3.0.0)
device_detector device_detector
devise (~> 4.4) devise (~> 4.4)
devise-two-factor (~> 3.0.0) devise-two-factor (~> 3.0.0)
@ -986,7 +977,7 @@ DEPENDENCIES
factory_bot_rails (~> 4.8.2) factory_bot_rails (~> 4.8.2)
faraday (~> 0.12) faraday (~> 0.12)
fast_blank fast_blank
ffaker (~> 2.4) ffaker (~> 2.10)
flipper (~> 0.13.0) flipper (~> 0.13.0)
flipper-active_record (~> 0.13.0) flipper-active_record (~> 0.13.0)
flipper-active_support_cache_store (~> 0.13.0) flipper-active_support_cache_store (~> 0.13.0)
@ -1022,7 +1013,7 @@ DEPENDENCIES
graphiql-rails (~> 1.4.10) graphiql-rails (~> 1.4.10)
graphql (~> 1.8.0) graphql (~> 1.8.0)
grpc (~> 1.15.0) grpc (~> 1.15.0)
haml_lint (~> 0.26.0) haml_lint (~> 0.28.0)
hamlit (~> 2.8.8) hamlit (~> 2.8.8)
hangouts-chat (~> 0.0.5) hangouts-chat (~> 0.0.5)
hashie-forbidden_attributes hashie-forbidden_attributes
@ -1039,7 +1030,7 @@ DEPENDENCIES
json-schema (~> 2.8.0) json-schema (~> 2.8.0)
jwt (~> 1.5.6) jwt (~> 1.5.6)
kaminari (~> 1.0) kaminari (~> 1.0)
knapsack (~> 1.16) knapsack (~> 1.17)
kubeclient (~> 3.1.0) kubeclient (~> 3.1.0)
letter_opener_web (~> 1.3.0) letter_opener_web (~> 1.3.0)
license_finder (~> 5.4) license_finder (~> 5.4)
@ -1089,10 +1080,9 @@ DEPENDENCIES
rack-cors (~> 1.0.0) rack-cors (~> 1.0.0)
rack-oauth2 (~> 1.2.1) rack-oauth2 (~> 1.2.1)
rack-proxy (~> 0.6.0) rack-proxy (~> 0.6.0)
rails (= 5.0.7) rails (= 4.2.10)
rails-controller-testing
rails-deprecated_sanitizer (~> 1.0.3) rails-deprecated_sanitizer (~> 1.0.3)
rails-i18n (~> 5.1) rails-i18n (~> 4.0.9)
rainbow (~> 3.0) rainbow (~> 3.0)
raindrops (~> 0.18) raindrops (~> 0.18)
rblineprof (~> 0.3.6) rblineprof (~> 0.3.6)
@ -1145,6 +1135,7 @@ DEPENDENCIES
state_machines-activerecord (~> 0.5.1) state_machines-activerecord (~> 0.5.1)
sys-filesystem (~> 1.1.6) sys-filesystem (~> 1.1.6)
test-prof (~> 0.2.5) test-prof (~> 0.2.5)
test_after_commit (~> 1.1)
thin (~> 1.7.0) thin (~> 1.7.0)
timecop (~> 0.8.0) timecop (~> 0.8.0)
toml-rb (~> 1.0.0) toml-rb (~> 1.0.0)

View file

@ -1,7 +1,7 @@
<script> <script>
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import Tooltip from '~/vue_shared/directives/tooltip'; import Tooltip from '~/vue_shared/directives/tooltip';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
export default { export default {
name: 'Badge', name: 'Badge',

View file

@ -4,7 +4,7 @@ import { mapActions, mapState } from 'vuex';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { s__, sprintf } from '~/locale'; import { s__, sprintf } from '~/locale';
import LoadingButton from '~/vue_shared/components/loading_button.vue'; import LoadingButton from '~/vue_shared/components/loading_button.vue';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import createEmptyBadge from '../empty_badge'; import createEmptyBadge from '../empty_badge';
import Badge from './badge.vue'; import Badge from './badge.vue';

View file

@ -1,6 +1,6 @@
<script> <script>
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import BadgeListRow from './badge_list_row.vue'; import BadgeListRow from './badge_list_row.vue';
import { GROUP_BADGE } from '../constants'; import { GROUP_BADGE } from '../constants';

View file

@ -2,7 +2,7 @@
import { mapActions, mapState } from 'vuex'; import { mapActions, mapState } from 'vuex';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import { PROJECT_BADGE } from '../constants'; import { PROJECT_BADGE } from '../constants';
import Badge from './badge.vue'; import Badge from './badge.vue';

View file

@ -1,6 +1,6 @@
<script> <script>
import Sortable from 'sortablejs'; import Sortable from 'sortablejs';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import boardNewIssue from './board_new_issue.vue'; import boardNewIssue from './board_new_issue.vue';
import boardCard from './board_card.vue'; import boardCard from './board_card.vue';
import eventHub from '../eventhub'; import eventHub from '../eventhub';

View file

@ -1,6 +1,6 @@
<script> <script>
import $ from 'jquery'; import $ from 'jquery';
import { GlButton } from '@gitlab-org/gitlab-ui'; import { GlButton } from '@gitlab/ui';
import eventHub from '../eventhub'; import eventHub from '../eventhub';
import ProjectSelect from './project_select.vue'; import ProjectSelect from './project_select.vue';
import ListIssue from '../models/issue'; import ListIssue from '../models/issue';

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlTooltipDirective } from '@gitlab-org/gitlab-ui'; import { GlTooltipDirective } from '@gitlab/ui';
import { sprintf, __ } from '~/locale'; import { sprintf, __ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue'; import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue';

View file

@ -1,6 +1,6 @@
<script> <script>
import dateFormat from 'dateformat'; import dateFormat from 'dateformat';
import { GlTooltip } from '@gitlab-org/gitlab-ui'; import { GlTooltip } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { __ } from '~/locale'; import { __ } from '~/locale';
import { getDayDifference, getTimeago, dateInWords } from '~/lib/utils/datetime_utility'; import { getDayDifference, getTimeago, dateInWords } from '~/lib/utils/datetime_utility';

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlTooltip } from '@gitlab-org/gitlab-ui'; import { GlTooltip } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { parseSeconds, stringifyTime } from '~/lib/utils/datetime_utility'; import { parseSeconds, stringifyTime } from '~/lib/utils/datetime_utility';

View file

@ -6,7 +6,7 @@ import ModalList from './list.vue';
import ModalFooter from './footer.vue'; import ModalFooter from './footer.vue';
import EmptyState from './empty_state.vue'; import EmptyState from './empty_state.vue';
import ModalStore from '../../stores/modal_store'; import ModalStore from '../../stores/modal_store';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
export default { export default {
components: { components: {

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlLink } from '@gitlab-org/gitlab-ui'; import { GlLink } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import ModalStore from '../../stores/modal_store'; import ModalStore from '../../stores/modal_store';
import boardsStore from '../../stores/boards_store'; import boardsStore from '../../stores/boards_store';

View file

@ -2,7 +2,7 @@
import $ from 'jquery'; import $ from 'jquery';
import _ from 'underscore'; import _ from 'underscore';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import eventHub from '../eventhub'; import eventHub from '../eventhub';
import Api from '../../api'; import Api from '../../api';

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import eventHub from '../eventhub'; import eventHub from '../eventhub';
export default { export default {

View file

@ -6,7 +6,7 @@ import eventHub from '../eventhub';
import DeployKeysService from '../service'; import DeployKeysService from '../service';
import DeployKeysStore from '../store'; import DeployKeysStore from '../store';
import KeysPanel from './keys_panel.vue'; import KeysPanel from './keys_panel.vue';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
export default { export default {
components: { components: {

View file

@ -3,7 +3,7 @@ import { mapState, mapGetters, mapActions } from 'vuex';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { __ } from '~/locale'; import { __ } from '~/locale';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import eventHub from '../../notes/event_hub'; import eventHub from '../../notes/event_hub';
import CompareVersions from './compare_versions.vue'; import CompareVersions from './compare_versions.vue';
import DiffFile from './diff_file.vue'; import DiffFile from './diff_file.vue';
@ -94,7 +94,7 @@ export default {
return __('Show latest version'); return __('Show latest version');
}, },
canCurrentUserFork() { canCurrentUserFork() {
return this.currentUser.canFork === true && this.currentUser.canCreateMergeRequest; return this.currentUser.can_fork === true && this.currentUser.can_create_merge_request;
}, },
showCompareVersions() { showCompareVersions() {
return this.mergeRequestDiffs && this.mergeRequestDiff; return this.mergeRequestDiffs && this.mergeRequestDiff;

View file

@ -40,15 +40,17 @@ export default {
}, },
computed: { computed: {
authorName() { authorName() {
return (this.commit.author && this.commit.author.name) || this.commit.authorName; return (this.commit.author && this.commit.author.name) || this.commit.author_name;
}, },
authorUrl() { authorUrl() {
return ( return (
(this.commit.author && this.commit.author.webUrl) || `mailto:${this.commit.authorEmail}` (this.commit.author && this.commit.author.web_url) || `mailto:${this.commit.author_email}`
); );
}, },
authorAvatar() { authorAvatar() {
return (this.commit.author && this.commit.author.avatarUrl) || this.commit.authorGravatarUrl; return (
(this.commit.author && this.commit.author.avatar_url) || this.commit.author_gravatar_url
);
}, },
}, },
}; };
@ -66,18 +68,18 @@ export default {
<div class="commit-detail flex-list"> <div class="commit-detail flex-list">
<div class="commit-content qa-commit-content"> <div class="commit-content qa-commit-content">
<a <a
:href="commit.commitUrl" :href="commit.commit_url"
class="commit-row-message item-title" class="commit-row-message item-title"
v-html="commit.titleHtml" v-html="commit.title_html"
></a> ></a>
<span class="commit-row-message d-block d-sm-none"> <span class="commit-row-message d-block d-sm-none">
&middot; &middot;
{{ commit.shortId }} {{ commit.short_id }}
</span> </span>
<button <button
v-if="commit.descriptionHtml" v-if="commit.description_html"
class="text-expander js-toggle-button" class="text-expander js-toggle-button"
type="button" type="button"
:aria-label="__('Toggle commit description')" :aria-label="__('Toggle commit description')"
@ -95,29 +97,29 @@ export default {
></a> ></a>
{{ s__('CommitWidget|authored') }} {{ s__('CommitWidget|authored') }}
<time-ago-tooltip <time-ago-tooltip
:time="commit.authoredDate" :time="commit.authored_date"
/> />
</div> </div>
<pre <pre
v-if="commit.descriptionHtml" v-if="commit.description_html"
class="commit-row-description js-toggle-content append-bottom-8" class="commit-row-description js-toggle-content append-bottom-8"
v-html="commit.descriptionHtml" v-html="commit.description_html"
></pre> ></pre>
</div> </div>
<div class="commit-actions flex-row d-none d-sm-flex"> <div class="commit-actions flex-row d-none d-sm-flex">
<div <div
v-if="commit.signatureHtml" v-if="commit.signature_html"
v-html="commit.signatureHtml" v-html="commit.signature_html"
></div> ></div>
<commit-pipeline-status <commit-pipeline-status
v-if="commit.pipelineStatusPath" v-if="commit.pipeline_status_path"
:endpoint="commit.pipelineStatusPath" :endpoint="commit.pipeline_status_path"
/> />
<div class="commit-sha-group"> <div class="commit-sha-group">
<div <div
class="label label-monospace" class="label label-monospace"
v-text="commit.shortId" v-text="commit.short_id"
></div> ></div>
<clipboard-button <clipboard-button
:text="commit.id" :text="commit.id"

View file

@ -1,6 +1,6 @@
<script> <script>
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import Tooltip from '@gitlab-org/gitlab-ui/dist/directives/tooltip'; import Tooltip from '@gitlab/ui/dist/directives/tooltip';
import { __ } from '~/locale'; import { __ } from '~/locale';
import { getParameterValues, mergeUrlParams } from '~/lib/utils/url_utility'; import { getParameterValues, mergeUrlParams } from '~/lib/utils/url_utility';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';

View file

@ -56,16 +56,16 @@ export default {
methods: { methods: {
commitsText(version) { commitsText(version) {
return n__( return n__(
`${version.commitsCount} commit,`, `${version.commits_count} commit,`,
`${version.commitsCount} commits,`, `${version.commits_count} commits,`,
version.commitsCount, version.commits_count,
); );
}, },
href(version) { href(version) {
if (this.showCommitCount) { if (this.showCommitCount) {
return version.versionPath; return version.version_path;
} }
return version.comparePath; return version.compare_path;
}, },
versionName(version) { versionName(version) {
if (this.isLatest(version)) { if (this.isLatest(version)) {
@ -74,7 +74,7 @@ export default {
if (this.targetBranch && (this.isBase(version) || !version)) { if (this.targetBranch && (this.isBase(version) || !version)) {
return this.targetBranch.branchName; return this.targetBranch.branchName;
} }
return `version ${version.versionIndex}`; return `version ${version.version_index}`;
}, },
isActive(version) { isActive(version) {
if (!version) { if (!version) {
@ -84,11 +84,11 @@ export default {
if (this.targetBranch) { if (this.targetBranch) {
return ( return (
(this.isBase(version) && !this.startVersion) || (this.isBase(version) && !this.startVersion) ||
(this.startVersion && this.startVersion.versionIndex === version.versionIndex) (this.startVersion && this.startVersion.version_index === version.version_index)
); );
} }
return version.versionIndex === this.mergeRequestVersion.versionIndex; return version.version_index === this.mergeRequestVersion.version_index;
}, },
isBase(version) { isBase(version) {
if (!version || !this.targetBranch) { if (!version || !this.targetBranch) {
@ -98,7 +98,7 @@ export default {
}, },
isLatest(version) { isLatest(version) {
return ( return (
this.mergeRequestVersion && version.versionIndex === this.targetVersions[0].versionIndex this.mergeRequestVersion && version.version_index === this.targetVersions[0].version_index
); );
}, },
}, },
@ -142,7 +142,7 @@ export default {
</div> </div>
<div> <div>
<small class="commit-sha"> <small class="commit-sha">
{{ version.truncatedCommitSha }} {{ version.truncated_commit_sha }}
</small> </small>
</div> </div>
<div> <div>
@ -151,8 +151,8 @@ export default {
{{ commitsText(version) }} {{ commitsText(version) }}
</template> </template>
<time-ago <time-ago
v-if="version.createdAt" v-if="version.created_at"
:time="version.createdAt" :time="version.created_at"
class="js-timeago js-timeago-render" class="js-timeago js-timeago-render"
/> />
</small> </small>

View file

@ -39,7 +39,7 @@ export default {
return this.diffFile.viewer.name === 'text'; return this.diffFile.viewer.name === 'text';
}, },
diffFileCommentForm() { diffFileCommentForm() {
return this.getCommentFormForDiffFile(this.diffFile.fileHash); return this.getCommentFormForDiffFile(this.diffFile.file_hash);
}, },
showNotesContainer() { showNotesContainer() {
return this.diffFile.discussions.length || this.diffFileCommentForm; return this.diffFile.discussions.length || this.diffFileCommentForm;
@ -73,28 +73,28 @@ export default {
<inline-diff-view <inline-diff-view
v-if="isInlineView" v-if="isInlineView"
:diff-file="diffFile" :diff-file="diffFile"
:diff-lines="diffFile.highlightedDiffLines || []" :diff-lines="diffFile.highlighted_diff_lines || []"
/> />
<parallel-diff-view <parallel-diff-view
v-if="isParallelView" v-if="isParallelView"
:diff-file="diffFile" :diff-file="diffFile"
:diff-lines="diffFile.parallelDiffLines || []" :diff-lines="diffFile.parallel_diff_lines || []"
/> />
</template> </template>
<diff-viewer <diff-viewer
v-else v-else
:diff-mode="diffMode" :diff-mode="diffMode"
:new-path="diffFile.newPath" :new-path="diffFile.new_path"
:new-sha="diffFile.diffRefs.headSha" :new-sha="diffFile.diff_refs.head_sha"
:old-path="diffFile.oldPath" :old-path="diffFile.old_path"
:old-sha="diffFile.diffRefs.baseSha" :old-sha="diffFile.diff_refs.base_sha"
:file-hash="diffFile.fileHash" :file-hash="diffFile.file_hash"
:project-path="projectPath" :project-path="projectPath"
> >
<image-diff-overlay <image-diff-overlay
slot="image-overlay" slot="image-overlay"
:discussions="diffFile.discussions" :discussions="diffFile.discussions"
:file-hash="diffFile.fileHash" :file-hash="diffFile.file_hash"
:can-comment="getNoteableData.current_user.can_create_note" :can-comment="getNoteableData.current_user.can_create_note"
/> />
<div <div
@ -115,7 +115,7 @@ export default {
:save-button-title="__('Comment')" :save-button-title="__('Comment')"
class="diff-comment-form new-note discussion-form discussion-form-container" class="diff-comment-form new-note discussion-form discussion-form-container"
@handleFormUpdate="handleSaveNote" @handleFormUpdate="handleSaveNote"
@cancelForm="closeDiffFileCommentForm(diffFile.fileHash)" @cancelForm="closeDiffFileCommentForm(diffFile.file_hash)"
/> />
</div> </div>
</diff-viewer> </diff-viewer>

View file

@ -3,7 +3,7 @@ import { mapActions, mapGetters, mapState } from 'vuex';
import _ from 'underscore'; import _ from 'underscore';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import DiffFileHeader from './diff_file_header.vue'; import DiffFileHeader from './diff_file_header.vue';
import DiffContent from './diff_content.vue'; import DiffContent from './diff_content.vue';
@ -32,6 +32,7 @@ export default {
computed: { computed: {
...mapState('diffs', ['currentDiffFileId']), ...mapState('diffs', ['currentDiffFileId']),
...mapGetters(['isNotesFetched']), ...mapGetters(['isNotesFetched']),
...mapGetters('diffs', ['getDiffFileDiscussions']),
isCollapsed() { isCollapsed() {
return this.file.collapsed || false; return this.file.collapsed || false;
}, },
@ -39,7 +40,7 @@ export default {
return sprintf( return sprintf(
__('You can %{linkStart}view the blob%{linkEnd} instead.'), __('You can %{linkStart}view the blob%{linkEnd} instead.'),
{ {
linkStart: `<a href="${_.escape(this.file.viewPath)}">`, linkStart: `<a href="${_.escape(this.file.view_path)}">`,
linkEnd: '</a>', linkEnd: '</a>',
}, },
false, false,
@ -48,21 +49,34 @@ export default {
showExpandMessage() { showExpandMessage() {
return ( return (
this.isCollapsed || this.isCollapsed ||
(!this.file.highlightedDiffLines && (!this.file.highlighted_diff_lines &&
!this.isLoadingCollapsedDiff && !this.isLoadingCollapsedDiff &&
!this.file.tooLarge && !this.file.too_large &&
this.file.text) this.file.text)
); );
}, },
showLoadingIcon() { showLoadingIcon() {
return this.isLoadingCollapsedDiff || (!this.file.renderIt && !this.isCollapsed); return this.isLoadingCollapsedDiff || (!this.file.renderIt && !this.isCollapsed);
}, },
hasDiffLines() {
return (
this.file.highlighted_diff_lines &&
this.file.parallel_diff_lines &&
this.file.parallel_diff_lines.length > 0
);
},
},
watch: {
'file.collapsed': function fileCollapsedWatch(newVal, oldVal) {
if (!newVal && oldVal && !this.hasDiffLines) {
this.handleLoadCollapsedDiff();
}
},
}, },
methods: { methods: {
...mapActions('diffs', ['loadCollapsedDiff', 'assignDiscussionsToDiff']), ...mapActions('diffs', ['loadCollapsedDiff', 'assignDiscussionsToDiff']),
handleToggle() { handleToggle() {
const { highlightedDiffLines, parallelDiffLines } = this.file; if (!this.hasDiffLines) {
if (!highlightedDiffLines && parallelDiffLines !== undefined && !parallelDiffLines.length) {
this.handleLoadCollapsedDiff(); this.handleLoadCollapsedDiff();
} else { } else {
this.file.collapsed = !this.file.collapsed; this.file.collapsed = !this.file.collapsed;
@ -81,7 +95,7 @@ export default {
.then(() => { .then(() => {
requestIdleCallback( requestIdleCallback(
() => { () => {
this.assignDiscussionsToDiff(); this.assignDiscussionsToDiff(this.getDiffFileDiscussions(this.file));
}, },
{ timeout: 1000 }, { timeout: 1000 },
); );
@ -103,9 +117,9 @@ export default {
<template> <template>
<div <div
:id="file.fileHash" :id="file.file_hash"
:class="{ :class="{
'is-active': currentDiffFileId === file.fileHash 'is-active': currentDiffFileId === file.file_hash
}" }"
class="diff-file file-holder" class="diff-file file-holder"
> >
@ -129,7 +143,7 @@ export default {
make your changes there, and submit a merge request. make your changes there, and submit a merge request.
</span> </span>
<a <a
:href="file.forkPath" :href="file.fork_path"
class="js-fork-suggestion-button btn btn-grouped btn-inverted btn-success" class="js-fork-suggestion-button btn btn-grouped btn-inverted btn-success"
> >
Fork Fork
@ -145,7 +159,7 @@ export default {
<diff-content <diff-content
v-if="!isCollapsed && file.renderIt" v-if="!isCollapsed && file.renderIt"
:class="{ hidden: isCollapsed || file.tooLarge }" :class="{ hidden: isCollapsed || file.too_large }"
:diff-file="file" :diff-file="file"
/> />
<gl-loading-icon <gl-loading-icon
@ -166,7 +180,7 @@ export default {
</a> </a>
</div> </div>
<div <div
v-if="file.tooLarge" v-if="file.too_large"
class="nothing-here-block diff-collapsed js-too-large-diff" class="nothing-here-block diff-collapsed js-too-large-diff"
> >
{{ __('This source diff could not be displayed because it is too large.') }} {{ __('This source diff could not be displayed because it is too large.') }}

View file

@ -68,32 +68,32 @@ export default {
}, },
titleLink() { titleLink() {
if (this.diffFile.submodule) { if (this.diffFile.submodule) {
return this.diffFile.submoduleTreeUrl || this.diffFile.submoduleLink; return this.diffFile.submodule_tree_url || this.diffFile.submodule_link;
} }
return this.discussionPath; return this.discussionPath;
}, },
filePath() { filePath() {
if (this.diffFile.submodule) { if (this.diffFile.submodule) {
return `${this.diffFile.filePath} @ ${truncateSha(this.diffFile.blob.id)}`; return `${this.diffFile.file_path} @ ${truncateSha(this.diffFile.blob.id)}`;
} }
if (this.diffFile.deletedFile) { if (this.diffFile.deleted_file) {
return sprintf(__('%{filePath} deleted'), { filePath: this.diffFile.filePath }, false); return sprintf(__('%{filePath} deleted'), { filePath: this.diffFile.file_path }, false);
} }
return this.diffFile.filePath; return this.diffFile.file_path;
}, },
titleTag() { titleTag() {
return this.diffFile.fileHash ? 'a' : 'span'; return this.diffFile.file_hash ? 'a' : 'span';
}, },
isUsingLfs() { isUsingLfs() {
return this.diffFile.storedExternally && this.diffFile.externalStorage === 'lfs'; return this.diffFile.stored_externally && this.diffFile.external_storage === 'lfs';
}, },
collapseIcon() { collapseIcon() {
return this.expanded ? 'chevron-down' : 'chevron-right'; return this.expanded ? 'chevron-down' : 'chevron-right';
}, },
viewFileButtonText() { viewFileButtonText() {
const truncatedContentSha = _.escape(truncateSha(this.diffFile.contentSha)); const truncatedContentSha = _.escape(truncateSha(this.diffFile.content_sha));
return sprintf( return sprintf(
s__('MergeRequests|View file @ %{commitId}'), s__('MergeRequests|View file @ %{commitId}'),
{ {
@ -103,7 +103,7 @@ export default {
); );
}, },
viewReplacedFileButtonText() { viewReplacedFileButtonText() {
const truncatedBaseSha = _.escape(truncateSha(this.diffFile.diffRefs.baseSha)); const truncatedBaseSha = _.escape(truncateSha(this.diffFile.diff_refs.base_sha));
return sprintf( return sprintf(
s__('MergeRequests|View replaced file @ %{commitId}'), s__('MergeRequests|View replaced file @ %{commitId}'),
{ {
@ -113,7 +113,7 @@ export default {
); );
}, },
gfmCopyText() { gfmCopyText() {
return `\`${this.diffFile.filePath}\``; return `\`${this.diffFile.file_path}\``;
}, },
}, },
methods: { methods: {
@ -164,21 +164,21 @@ export default {
aria-hidden="true" aria-hidden="true"
css-classes="js-file-icon append-right-5" css-classes="js-file-icon append-right-5"
/> />
<span v-if="diffFile.renamedFile"> <span v-if="diffFile.renamed_file">
<strong <strong
v-tooltip v-tooltip
:title="diffFile.oldPath" :title="diffFile.old_path"
class="file-title-name" class="file-title-name"
data-container="body" data-container="body"
v-html="diffFile.oldPathHtml" v-html="diffFile.old_path_html"
></strong> ></strong>
<strong <strong
v-tooltip v-tooltip
:title="diffFile.newPath" :title="diffFile.new_path"
class="file-title-name" class="file-title-name"
data-container="body" data-container="body"
v-html="diffFile.newPathHtml" v-html="diffFile.new_path_html"
></strong> ></strong>
</span> </span>
@ -195,16 +195,16 @@ export default {
<clipboard-button <clipboard-button
:title="__('Copy file path to clipboard')" :title="__('Copy file path to clipboard')"
:text="diffFile.filePath" :text="diffFile.file_path"
:gfm="gfmCopyText" :gfm="gfmCopyText"
css-class="btn-default btn-transparent btn-clipboard" css-class="btn-default btn-transparent btn-clipboard"
/> />
<small <small
v-if="diffFile.modeChanged" v-if="diffFile.mode_changed"
ref="fileMode" ref="fileMode"
> >
{{ diffFile.aMode }} {{ diffFile.bMode }} {{ diffFile.a_mode }} {{ diffFile.b_mode }}
</small> </small>
<span <span
@ -220,7 +220,7 @@ export default {
class="file-actions d-none d-sm-block" class="file-actions d-none d-sm-block"
> >
<template <template
v-if="diffFile.blob && diffFile.blob.readableText" v-if="diffFile.blob && diffFile.blob.readable_text"
> >
<button <button
:disabled="!diffHasDiscussions(diffFile)" :disabled="!diffHasDiscussions(diffFile)"
@ -234,33 +234,33 @@ export default {
</button> </button>
<edit-button <edit-button
v-if="!diffFile.deletedFile" v-if="!diffFile.deleted_file"
:can-current-user-fork="canCurrentUserFork" :can-current-user-fork="canCurrentUserFork"
:edit-path="diffFile.editPath" :edit-path="diffFile.edit_path"
:can-modify-blob="diffFile.canModifyBlob" :can-modify-blob="diffFile.can_modify_blob"
@showForkMessage="showForkMessage" @showForkMessage="showForkMessage"
/> />
</template> </template>
<a <a
v-if="diffFile.replacedViewPath" v-if="diffFile.replaced_view_path"
:href="diffFile.replacedViewPath" :href="diffFile.replaced_view_path"
class="btn view-file js-view-file" class="btn view-file js-view-file"
v-html="viewReplacedFileButtonText" v-html="viewReplacedFileButtonText"
> >
</a> </a>
<a <a
:href="diffFile.viewPath" :href="diffFile.view_path"
class="btn view-file js-view-file" class="btn view-file js-view-file"
v-html="viewFileButtonText" v-html="viewFileButtonText"
> >
</a> </a>
<a <a
v-if="diffFile.externalUrl" v-if="diffFile.external_url"
v-tooltip v-tooltip
:href="diffFile.externalUrl" :href="diffFile.external_url"
:title="`View on ${diffFile.formattedExternalUrl}`" :title="`View on ${diffFile.formatted_external_url}`"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
class="btn btn-file-option" class="btn btn-file-option"

View file

@ -3,7 +3,7 @@ import { mapActions } from 'vuex';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { pluralize, truncate } from '~/lib/utils/text_utility'; import { pluralize, truncate } from '~/lib/utils/text_utility';
import UserAvatarImage from '~/vue_shared/components/user_avatar/user_avatar_image.vue'; import UserAvatarImage from '~/vue_shared/components/user_avatar/user_avatar_image.vue';
import { GlTooltipDirective } from '@gitlab-org/gitlab-ui'; import { GlTooltipDirective } from '@gitlab/ui';
import { COUNT_OF_AVATARS_IN_GUTTER, LENGTH_OF_AVATAR_TOOLTIP } from '../constants'; import { COUNT_OF_AVATARS_IN_GUTTER, LENGTH_OF_AVATAR_TOOLTIP } from '../constants';
export default { export default {

View file

@ -73,7 +73,7 @@ export default {
}), }),
...mapGetters(['isLoggedIn']), ...mapGetters(['isLoggedIn']),
lineHref() { lineHref() {
return `#${this.line.lineCode || ''}`; return `#${this.line.line_code || ''}`;
}, },
shouldShowCommentButton() { shouldShowCommentButton() {
return ( return (
@ -99,7 +99,7 @@ export default {
methods: { methods: {
...mapActions('diffs', ['loadMoreLines', 'showCommentForm']), ...mapActions('diffs', ['loadMoreLines', 'showCommentForm']),
handleCommentButton() { handleCommentButton() {
this.showCommentForm({ lineCode: this.line.lineCode }); this.showCommentForm({ lineCode: this.line.line_code });
}, },
handleLoadMoreLines() { handleLoadMoreLines() {
if (this.isRequesting) { if (this.isRequesting) {
@ -108,8 +108,8 @@ export default {
this.isRequesting = true; this.isRequesting = true;
const endpoint = this.contextLinesPath; const endpoint = this.contextLinesPath;
const oldLineNumber = this.line.metaData.oldPos || 0; const oldLineNumber = this.line.meta_data.old_pos || 0;
const newLineNumber = this.line.metaData.newPos || 0; const newLineNumber = this.line.meta_data.new_pos || 0;
const offset = newLineNumber - oldLineNumber; const offset = newLineNumber - oldLineNumber;
const bottom = this.isBottom; const bottom = this.isBottom;
const { fileHash } = this; const { fileHash } = this;
@ -125,12 +125,12 @@ export default {
to = lineNumber + UNFOLD_COUNT; to = lineNumber + UNFOLD_COUNT;
} else { } else {
const diffFile = utils.findDiffFile(this.diffFiles, this.fileHash); const diffFile = utils.findDiffFile(this.diffFiles, this.fileHash);
const indexForInline = utils.findIndexInInlineLines(diffFile.highlightedDiffLines, { const indexForInline = utils.findIndexInInlineLines(diffFile.highlighted_diff_lines, {
oldLineNumber, oldLineNumber,
newLineNumber, newLineNumber,
}); });
const prevLine = diffFile.highlightedDiffLines[indexForInline - 2]; const prevLine = diffFile.highlighted_diff_lines[indexForInline - 2];
const prevLineNumber = (prevLine && prevLine.newLine) || 0; const prevLineNumber = (prevLine && prevLine.new_line) || 0;
if (since <= prevLineNumber + 1) { if (since <= prevLineNumber + 1) {
since = prevLineNumber + 1; since = prevLineNumber + 1;

View file

@ -53,7 +53,7 @@ export default {
this.noteableData.diff_head_sha, this.noteableData.diff_head_sha,
DIFF_NOTE_TYPE, DIFF_NOTE_TYPE,
this.noteableData.source_project_id, this.noteableData.source_project_id,
this.line.lineCode, this.line.line_code,
]; ];
this.initAutoSave(this.noteableData, keys); this.initAutoSave(this.noteableData, keys);
@ -72,7 +72,7 @@ export default {
} }
this.cancelCommentForm({ this.cancelCommentForm({
lineCode: this.line.lineCode, lineCode: this.line.line_code,
}); });
this.$nextTick(() => { this.$nextTick(() => {
this.resetAutoSave(); this.resetAutoSave();
@ -94,7 +94,7 @@ export default {
<note-form <note-form
ref="noteForm" ref="noteForm"
:is-editing="true" :is-editing="true"
:line-code="line.lineCode" :line-code="line.line_code"
save-button-title="Comment" save-button-title="Comment"
class="diff-comment-form" class="diff-comment-form"
@cancelForm="handleCancelCommentForm" @cancelForm="handleCancelCommentForm"

View file

@ -96,9 +96,7 @@ export default {
}; };
}, },
lineNumber() { lineNumber() {
const { lineType } = this; return this.lineType === OLD_LINE_TYPE ? this.line.old_line : this.line.new_line;
return lineType === OLD_LINE_TYPE ? this.line.oldLine : this.line.newLine;
}, },
}, },
}; };

View file

@ -48,7 +48,7 @@ export default {
:discussions="line.discussions" :discussions="line.discussions"
/> />
<diff-line-note-form <diff-line-note-form
v-if="diffLineCommentForms[line.lineCode]" v-if="diffLineCommentForms[line.line_code]"
:diff-file-hash="diffFileHash" :diff-file-hash="diffFileHash"
:line="line" :line="line"
:note-target-line="line" :note-target-line="line"

View file

@ -52,9 +52,7 @@ export default {
}; };
}, },
inlineRowId() { inlineRowId() {
const { lineCode, oldLine, newLine } = this.line; return this.line.line_code || `${this.fileHash}_${this.line.old_line}_${this.line.new_line}`;
return lineCode || `${this.fileHash}_${oldLine}_${newLine}`;
}, },
}, },
created() { created() {
@ -107,7 +105,7 @@ export default {
<td <td
:class="line.type" :class="line.type"
class="line_content" class="line_content"
v-html="line.richText" v-html="line.rich_text"
> >
</td> </td>
</tr> </tr>

View file

@ -43,16 +43,16 @@ export default {
v-for="(line, index) in diffLines" v-for="(line, index) in diffLines"
> >
<inline-diff-table-row <inline-diff-table-row
:key="line.lineCode" :key="line.line_code"
:file-hash="diffFile.fileHash" :file-hash="diffFile.file_hash"
:context-lines-path="diffFile.contextLinesPath" :context-lines-path="diffFile.context_lines_path"
:line="line" :line="line"
:is-bottom="index + 1 === diffLinesLength" :is-bottom="index + 1 === diffLinesLength"
/> />
<inline-diff-comment-row <inline-diff-comment-row
v-if="shouldRenderInlineCommentRow(line)" v-if="shouldRenderInlineCommentRow(line)"
:key="index" :key="index"
:diff-file-hash="diffFile.fileHash" :diff-file-hash="diffFile.file_hash"
:line="line" :line="line"
:line-index="index" :line-index="index"
/> />

View file

@ -27,10 +27,10 @@ export default {
diffLineCommentForms: state => state.diffs.diffLineCommentForms, diffLineCommentForms: state => state.diffs.diffLineCommentForms,
}), }),
leftLineCode() { leftLineCode() {
return this.line.left && this.line.left.lineCode; return this.line.left && this.line.left.line_code;
}, },
rightLineCode() { rightLineCode() {
return this.line.right && this.line.right.lineCode; return this.line.right && this.line.right.line_code;
}, },
hasExpandedDiscussionOnLeft() { hasExpandedDiscussionOnLeft() {
return this.line.left && this.line.left.discussions return this.line.left && this.line.left.discussions

View file

@ -120,11 +120,11 @@ export default {
class="diff-line-num old_line" class="diff-line-num old_line"
/> />
<td <td
:id="line.left.lineCode" :id="line.left.line_code"
:class="parallelViewLeftLineType" :class="parallelViewLeftLineType"
class="line_content parallel left-side" class="line_content parallel left-side"
@mousedown.native="handleParallelLineMouseDown" @mousedown.native="handleParallelLineMouseDown"
v-html="line.left.richText" v-html="line.left.rich_text"
> >
</td> </td>
</template> </template>
@ -146,11 +146,11 @@ export default {
class="diff-line-num new_line" class="diff-line-num new_line"
/> />
<td <td
:id="line.right.lineCode" :id="line.right.line_code"
:class="line.right.type" :class="line.right.type"
class="line_content parallel right-side" class="line_content parallel right-side"
@mousedown.native="handleParallelLineMouseDown" @mousedown.native="handleParallelLineMouseDown"
v-html="line.right.richText" v-html="line.right.rich_text"
> >
</td> </td>
</template> </template>

View file

@ -46,8 +46,8 @@ export default {
> >
<parallel-diff-table-row <parallel-diff-table-row
:key="index" :key="index"
:file-hash="diffFile.fileHash" :file-hash="diffFile.file_hash"
:context-lines-path="diffFile.contextLinesPath" :context-lines-path="diffFile.context_lines_path"
:line="line" :line="line"
:is-bottom="index + 1 === diffLinesLength" :is-bottom="index + 1 === diffLinesLength"
/> />
@ -55,7 +55,7 @@ export default {
v-if="shouldRenderParallelCommentRow(line)" v-if="shouldRenderParallelCommentRow(line)"
:key="`dcr-${index}`" :key="`dcr-${index}`"
:line="line" :line="line"
:diff-file-hash="diffFile.fileHash" :diff-file-hash="diffFile.file_hash"
:line-index="index" :line-index="index"
/> />
</template> </template>

View file

@ -1,6 +1,6 @@
<script> <script>
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { GlTooltipDirective } from '@gitlab-org/gitlab-ui'; import { GlTooltipDirective } from '@gitlab/ui';
import { convertPermissionToBoolean } from '~/lib/utils/common_utils'; import { convertPermissionToBoolean } from '~/lib/utils/common_utils';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import FileRow from '~/vue_shared/components/file_row.vue'; import FileRow from '~/vue_shared/components/file_row.vue';

View file

@ -1,6 +1,5 @@
import Vue from 'vue'; import Vue from 'vue';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import diffsApp from './components/app.vue'; import diffsApp from './components/app.vue';
export default function initDiffsApp(store) { export default function initDiffsApp(store) {
@ -17,9 +16,7 @@ export default function initDiffsApp(store) {
return { return {
endpoint: dataset.endpoint, endpoint: dataset.endpoint,
projectPath: dataset.projectPath, projectPath: dataset.projectPath,
currentUser: convertObjectPropsToCamelCase(JSON.parse(dataset.currentUserData), { currentUser: JSON.parse(dataset.currentUserData) || {},
deep: true,
}),
}; };
}, },
computed: { computed: {

View file

@ -50,8 +50,8 @@ export const assignDiscussionsToDiff = (
}; };
export const removeDiscussionsFromDiff = ({ commit }, removeDiscussion) => { export const removeDiscussionsFromDiff = ({ commit }, removeDiscussion) => {
const { fileHash, line_code, id } = removeDiscussion; const { file_hash, line_code, id } = removeDiscussion;
commit(types.REMOVE_LINE_DISCUSSIONS_FOR_FILE, { fileHash, lineCode: line_code, id }); commit(types.REMOVE_LINE_DISCUSSIONS_FOR_FILE, { fileHash: file_hash, lineCode: line_code, id });
}; };
export const startRenderDiffsQueue = ({ state, commit }) => { export const startRenderDiffsQueue = ({ state, commit }) => {
@ -167,7 +167,7 @@ export const expandAllFiles = ({ commit }) => {
export const toggleFileDiscussions = ({ getters, dispatch }, diff) => { export const toggleFileDiscussions = ({ getters, dispatch }, diff) => {
const discussions = getters.getDiffFileDiscussions(diff); const discussions = getters.getDiffFileDiscussions(diff);
const shouldCloseAll = getters.diffHasAllExpandedDiscussions(diff); const shouldCloseAll = getters.diffHasAllExpandedDiscussions(diff);
const shouldExpandAll = getters.diffHasAllCollpasedDiscussions(diff); const shouldExpandAll = getters.diffHasAllCollapsedDiscussions(diff);
discussions.forEach(discussion => { discussions.forEach(discussion => {
const data = { discussionId: discussion.id }; const data = { discussionId: discussion.id };
@ -189,7 +189,7 @@ export const saveDiffDiscussion = ({ dispatch }, { note, formData }) => {
return dispatch('saveNote', postData, { root: true }) return dispatch('saveNote', postData, { root: true })
.then(result => dispatch('updateDiscussion', result.discussion, { root: true })) .then(result => dispatch('updateDiscussion', result.discussion, { root: true }))
.then(discussion => dispatch('assignDiscussionsToDiff', [discussion])) .then(discussion => dispatch('assignDiscussionsToDiff', [discussion]))
.then(() => dispatch('closeDiffFileCommentForm', formData.diffFile.fileHash)) .then(() => dispatch('closeDiffFileCommentForm', formData.diffFile.file_hash))
.then(() => dispatch('startTaskList', null, { root: true })) .then(() => dispatch('startTaskList', null, { root: true }))
.catch(() => createFlash(s__('MergeRequests|Saving the comment failed'))); .catch(() => createFlash(s__('MergeRequests|Saving the comment failed')));
}; };

View file

@ -1,4 +1,3 @@
import _ from 'underscore';
import { PARALLEL_DIFF_VIEW_TYPE, INLINE_DIFF_VIEW_TYPE } from '../constants'; import { PARALLEL_DIFF_VIEW_TYPE, INLINE_DIFF_VIEW_TYPE } from '../constants';
export const isParallelView = state => state.diffViewType === PARALLEL_DIFF_VIEW_TYPE; export const isParallelView = state => state.diffViewType === PARALLEL_DIFF_VIEW_TYPE;
@ -28,7 +27,7 @@ export const diffHasAllExpandedDiscussions = (state, getters) => diff => {
* @param {Object} diff * @param {Object} diff
* @returns {Boolean} * @returns {Boolean}
*/ */
export const diffHasAllCollpasedDiscussions = (state, getters) => diff => { export const diffHasAllCollapsedDiscussions = (state, getters) => diff => {
const discussions = getters.getDiffFileDiscussions(diff); const discussions = getters.getDiffFileDiscussions(diff);
return ( return (
@ -68,8 +67,7 @@ export const diffHasDiscussions = (state, getters) => diff =>
*/ */
export const getDiffFileDiscussions = (state, getters, rootState, rootGetters) => diff => export const getDiffFileDiscussions = (state, getters, rootState, rootGetters) => diff =>
rootGetters.discussions.filter( rootGetters.discussions.filter(
discussion => discussion => discussion.diff_discussion && discussion.diff_file.file_hash === diff.file_hash,
discussion.diff_discussion && _.isEqual(discussion.diff_file.file_hash, diff.fileHash),
) || []; ) || [];
export const shouldRenderParallelCommentRow = state => line => { export const shouldRenderParallelCommentRow = state => line => {
@ -90,14 +88,14 @@ export const shouldRenderParallelCommentRow = state => line => {
return true; return true;
} }
const hasCommentFormOnLeft = line.left && state.diffLineCommentForms[line.left.lineCode]; const hasCommentFormOnLeft = line.left && state.diffLineCommentForms[line.left.line_code];
const hasCommentFormOnRight = line.right && state.diffLineCommentForms[line.right.lineCode]; const hasCommentFormOnRight = line.right && state.diffLineCommentForms[line.right.line_code];
return hasCommentFormOnLeft || hasCommentFormOnRight; return hasCommentFormOnLeft || hasCommentFormOnRight;
}; };
export const shouldRenderInlineCommentRow = state => line => { export const shouldRenderInlineCommentRow = state => line => {
if (state.diffLineCommentForms[line.lineCode]) return true; if (state.diffLineCommentForms[line.line_code]) return true;
if (!line.discussions || line.discussions.length === 0) { if (!line.discussions || line.discussions.length === 0) {
return false; return false;
@ -108,7 +106,7 @@ export const shouldRenderInlineCommentRow = state => line => {
// prevent babel-plugin-rewire from generating an invalid default during karma∂ tests // prevent babel-plugin-rewire from generating an invalid default during karma∂ tests
export const getDiffFileByHash = state => fileHash => export const getDiffFileByHash = state => fileHash =>
state.diffFiles.find(file => file.fileHash === fileHash); state.diffFiles.find(file => file.file_hash === fileHash);
export const allBlobs = state => Object.values(state.treeEntries).filter(f => f.type === 'blob'); export const allBlobs = state => Object.values(state.treeEntries).filter(f => f.type === 'blob');

View file

@ -23,12 +23,11 @@ export default {
}, },
[types.SET_DIFF_DATA](state, data) { [types.SET_DIFF_DATA](state, data) {
const diffData = convertObjectPropsToCamelCase(data, { deep: true }); prepareDiffData(data);
prepareDiffData(diffData); const { tree, treeEntries } = generateTreeList(data.diff_files);
const { tree, treeEntries } = generateTreeList(diffData.diffFiles);
Object.assign(state, { Object.assign(state, {
...diffData, ...convertObjectPropsToCamelCase(data),
tree: sortTree(tree), tree: sortTree(tree),
treeEntries, treeEntries,
}); });
@ -42,7 +41,7 @@ export default {
[types.SET_MERGE_REQUEST_DIFFS](state, mergeRequestDiffs) { [types.SET_MERGE_REQUEST_DIFFS](state, mergeRequestDiffs) {
Object.assign(state, { Object.assign(state, {
mergeRequestDiffs: convertObjectPropsToCamelCase(mergeRequestDiffs, { deep: true }), mergeRequestDiffs,
}); });
}, },
@ -62,19 +61,18 @@ export default {
const { lineNumbers, contextLines, fileHash } = options; const { lineNumbers, contextLines, fileHash } = options;
const { bottom } = options.params; const { bottom } = options.params;
const diffFile = findDiffFile(state.diffFiles, fileHash); const diffFile = findDiffFile(state.diffFiles, fileHash);
const { highlightedDiffLines, parallelDiffLines } = diffFile;
removeMatchLine(diffFile, lineNumbers, bottom); removeMatchLine(diffFile, lineNumbers, bottom);
const lines = addLineReferences(contextLines, lineNumbers, bottom).map(line => ({ const lines = addLineReferences(contextLines, lineNumbers, bottom).map(line => ({
...line, ...line,
lineCode: line.lineCode || `${fileHash}_${line.oldLine}_${line.newLine}`, line_code: line.line_code || `${fileHash}_${line.old_line}_${line.new_line}`,
discussions: line.discussions || [], discussions: line.discussions || [],
})); }));
addContextLines({ addContextLines({
inlineLines: highlightedDiffLines, inlineLines: diffFile.highlighted_diff_lines,
parallelLines: parallelDiffLines, parallelLines: diffFile.parallel_diff_lines,
contextLines: lines, contextLines: lines,
bottom, bottom,
lineNumbers, lineNumbers,
@ -82,10 +80,9 @@ export default {
}, },
[types.ADD_COLLAPSED_DIFFS](state, { file, data }) { [types.ADD_COLLAPSED_DIFFS](state, { file, data }) {
const normalizedData = convertObjectPropsToCamelCase(data, { deep: true }); prepareDiffData(data);
prepareDiffData(normalizedData); const [newFileData] = data.diff_files.filter(f => f.file_hash === file.file_hash);
const [newFileData] = normalizedData.diffFiles.filter(f => f.fileHash === file.fileHash); const selectedFile = state.diffFiles.find(f => f.file_hash === file.file_hash);
const selectedFile = state.diffFiles.find(f => f.fileHash === file.fileHash);
Object.assign(selectedFile, { ...newFileData }); Object.assign(selectedFile, { ...newFileData });
}, },
@ -101,20 +98,20 @@ export default {
const discussionLineCode = discussion.line_code; const discussionLineCode = discussion.line_code;
const fileHash = discussion.diff_file.file_hash; const fileHash = discussion.diff_file.file_hash;
const lineCheck = ({ lineCode }) => const lineCheck = line =>
lineCode === discussionLineCode && line.line_code === discussionLineCode &&
isDiscussionApplicableToLine({ isDiscussionApplicableToLine({
discussion, discussion,
diffPosition: diffPositionByLineCode[lineCode], diffPosition: diffPositionByLineCode[line.line_code],
latestDiff, latestDiff,
}); });
state.diffFiles = state.diffFiles.map(diffFile => { state.diffFiles = state.diffFiles.map(diffFile => {
if (diffFile.fileHash === fileHash) { if (diffFile.file_hash === fileHash) {
const file = { ...diffFile }; const file = { ...diffFile };
if (file.highlightedDiffLines) { if (file.highlighted_diff_lines) {
file.highlightedDiffLines = file.highlightedDiffLines.map(line => { file.highlighted_diff_lines = file.highlighted_diff_lines.map(line => {
if (lineCheck(line)) { if (lineCheck(line)) {
return { return {
...line, ...line,
@ -126,8 +123,8 @@ export default {
}); });
} }
if (file.parallelDiffLines) { if (file.parallel_diff_lines) {
file.parallelDiffLines = file.parallelDiffLines.map(line => { file.parallel_diff_lines = file.parallel_diff_lines.map(line => {
const left = line.left && lineCheck(line.left); const left = line.left && lineCheck(line.left);
const right = line.right && lineCheck(line.right); const right = line.right && lineCheck(line.right);
@ -148,7 +145,7 @@ export default {
}); });
} }
if (!file.parallelDiffLines || !file.highlightedDiffLines) { if (!file.parallel_diff_lines || !file.highlighted_diff_lines) {
file.discussions = file.discussions.concat(discussion); file.discussions = file.discussions.concat(discussion);
} }
@ -160,16 +157,16 @@ export default {
}, },
[types.REMOVE_LINE_DISCUSSIONS_FOR_FILE](state, { fileHash, lineCode, id }) { [types.REMOVE_LINE_DISCUSSIONS_FOR_FILE](state, { fileHash, lineCode, id }) {
const selectedFile = state.diffFiles.find(f => f.fileHash === fileHash); const selectedFile = state.diffFiles.find(f => f.file_hash === fileHash);
if (selectedFile) { if (selectedFile) {
if (selectedFile.parallelDiffLines) { if (selectedFile.parallel_diff_lines) {
const targetLine = selectedFile.parallelDiffLines.find( const targetLine = selectedFile.parallel_diff_lines.find(
line => line =>
(line.left && line.left.lineCode === lineCode) || (line.left && line.left.line_code === lineCode) ||
(line.right && line.right.lineCode === lineCode), (line.right && line.right.line_code === lineCode),
); );
if (targetLine) { if (targetLine) {
const side = targetLine.left && targetLine.left.lineCode === lineCode ? 'left' : 'right'; const side = targetLine.left && targetLine.left.line_code === lineCode ? 'left' : 'right';
Object.assign(targetLine[side], { Object.assign(targetLine[side], {
discussions: [], discussions: [],
@ -177,9 +174,9 @@ export default {
} }
} }
if (selectedFile.highlightedDiffLines) { if (selectedFile.highlighted_diff_lines) {
const targetInlineLine = selectedFile.highlightedDiffLines.find( const targetInlineLine = selectedFile.highlighted_diff_lines.find(
line => line.lineCode === lineCode, line => line.line_code === lineCode,
); );
if (targetInlineLine) { if (targetInlineLine) {

View file

@ -1,5 +1,4 @@
import _ from 'underscore'; import _ from 'underscore';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { diffModes } from '~/ide/constants'; import { diffModes } from '~/ide/constants';
import { import {
LINE_POSITION_LEFT, LINE_POSITION_LEFT,
@ -15,7 +14,7 @@ import {
} from '../constants'; } from '../constants';
export function findDiffFile(files, hash) { export function findDiffFile(files, hash) {
return files.filter(file => file.fileHash === hash)[0]; return files.filter(file => file.file_hash === hash)[0];
} }
export const getReversePosition = linePosition => { export const getReversePosition = linePosition => {
@ -39,14 +38,14 @@ export function getFormData(params) {
} = params; } = params;
const position = JSON.stringify({ const position = JSON.stringify({
base_sha: diffFile.diffRefs.baseSha, base_sha: diffFile.diff_refs.base_sha,
start_sha: diffFile.diffRefs.startSha, start_sha: diffFile.diff_refs.start_sha,
head_sha: diffFile.diffRefs.headSha, head_sha: diffFile.diff_refs.head_sha,
old_path: diffFile.oldPath, old_path: diffFile.old_path,
new_path: diffFile.newPath, new_path: diffFile.new_path,
position_type: positionType || TEXT_DIFF_POSITION_TYPE, position_type: positionType || TEXT_DIFF_POSITION_TYPE,
old_line: noteTargetLine ? noteTargetLine.oldLine : null, old_line: noteTargetLine ? noteTargetLine.old_line : null,
new_line: noteTargetLine ? noteTargetLine.newLine : null, new_line: noteTargetLine ? noteTargetLine.new_line : null,
x: params.x, x: params.x,
y: params.y, y: params.y,
width: params.width, width: params.width,
@ -56,7 +55,7 @@ export function getFormData(params) {
const postData = { const postData = {
view: diffViewType, view: diffViewType,
line_type: linePosition === LINE_POSITION_RIGHT ? NEW_LINE_TYPE : OLD_LINE_TYPE, line_type: linePosition === LINE_POSITION_RIGHT ? NEW_LINE_TYPE : OLD_LINE_TYPE,
merge_request_diff_head_sha: diffFile.diffRefs.headSha, merge_request_diff_head_sha: diffFile.diff_refs.head_sha,
in_reply_to_discussion_id: '', in_reply_to_discussion_id: '',
note_project_id: '', note_project_id: '',
target_type: noteableData.targetType, target_type: noteableData.targetType,
@ -69,10 +68,10 @@ export function getFormData(params) {
noteable_id: noteableData.id, noteable_id: noteableData.id,
commit_id: '', commit_id: '',
type: type:
diffFile.diffRefs.startSha && diffFile.diffRefs.headSha diffFile.diff_refs.start_sha && diffFile.diff_refs.head_sha
? DIFF_NOTE_TYPE ? DIFF_NOTE_TYPE
: LEGACY_DIFF_NOTE_TYPE, : LEGACY_DIFF_NOTE_TYPE,
line_code: noteTargetLine ? noteTargetLine.lineCode : null, line_code: noteTargetLine ? noteTargetLine.line_code : null,
}, },
}; };
@ -93,7 +92,7 @@ export const findIndexInInlineLines = (lines, lineNumbers) => {
return _.findIndex( return _.findIndex(
lines, lines,
line => line.oldLine === oldLineNumber && line.newLine === newLineNumber, line => line.old_line === oldLineNumber && line.new_line === newLineNumber,
); );
}; };
@ -105,18 +104,18 @@ export const findIndexInParallelLines = (lines, lineNumbers) => {
line => line =>
line.left && line.left &&
line.right && line.right &&
line.left.oldLine === oldLineNumber && line.left.old_line === oldLineNumber &&
line.right.newLine === newLineNumber, line.right.new_line === newLineNumber,
); );
}; };
export function removeMatchLine(diffFile, lineNumbers, bottom) { export function removeMatchLine(diffFile, lineNumbers, bottom) {
const indexForInline = findIndexInInlineLines(diffFile.highlightedDiffLines, lineNumbers); const indexForInline = findIndexInInlineLines(diffFile.highlighted_diff_lines, lineNumbers);
const indexForParallel = findIndexInParallelLines(diffFile.parallelDiffLines, lineNumbers); const indexForParallel = findIndexInParallelLines(diffFile.parallel_diff_lines, lineNumbers);
const factor = bottom ? 1 : -1; const factor = bottom ? 1 : -1;
diffFile.highlightedDiffLines.splice(indexForInline + factor, 1); diffFile.highlighted_diff_lines.splice(indexForInline + factor, 1);
diffFile.parallelDiffLines.splice(indexForParallel + factor, 1); diffFile.parallel_diff_lines.splice(indexForParallel + factor, 1);
} }
export function addLineReferences(lines, lineNumbers, bottom) { export function addLineReferences(lines, lineNumbers, bottom) {
@ -125,18 +124,16 @@ export function addLineReferences(lines, lineNumbers, bottom) {
let matchLineIndex = -1; let matchLineIndex = -1;
const linesWithNumbers = lines.map((l, index) => { const linesWithNumbers = lines.map((l, index) => {
const line = convertObjectPropsToCamelCase(l); if (l.type === MATCH_LINE_TYPE) {
if (line.type === MATCH_LINE_TYPE) {
matchLineIndex = index; matchLineIndex = index;
} else { } else {
Object.assign(line, { Object.assign(l, {
oldLine: bottom ? oldLineNumber + index + 1 : oldLineNumber + index - lineCount, old_line: bottom ? oldLineNumber + index + 1 : oldLineNumber + index - lineCount,
newLine: bottom ? newLineNumber + index + 1 : newLineNumber + index - lineCount, new_line: bottom ? newLineNumber + index + 1 : newLineNumber + index - lineCount,
}); });
} }
return line; return l;
}); });
if (matchLineIndex > -1) { if (matchLineIndex > -1) {
@ -146,9 +143,9 @@ export function addLineReferences(lines, lineNumbers, bottom) {
: linesWithNumbers[matchLineIndex + 1]; : linesWithNumbers[matchLineIndex + 1];
Object.assign(line, { Object.assign(line, {
metaData: { meta_data: {
oldPos: targetLine.oldLine, old_pos: targetLine.old_line,
newPos: targetLine.newLine, new_pos: targetLine.new_line,
}, },
}); });
} }
@ -187,11 +184,11 @@ export function trimFirstCharOfLineContent(line = {}) {
const parsedLine = Object.assign({}, line); const parsedLine = Object.assign({}, line);
if (line.richText) { if (line.rich_text) {
const firstChar = parsedLine.richText.charAt(0); const firstChar = parsedLine.rich_text.charAt(0);
if (firstChar === ' ' || firstChar === '+' || firstChar === '-') { if (firstChar === ' ' || firstChar === '+' || firstChar === '-') {
parsedLine.richText = line.richText.substring(1); parsedLine.rich_text = line.rich_text.substring(1);
} }
} }
@ -201,15 +198,15 @@ export function trimFirstCharOfLineContent(line = {}) {
// This prepares and optimizes the incoming diff data from the server // This prepares and optimizes the incoming diff data from the server
// by setting up incremental rendering and removing unneeded data // by setting up incremental rendering and removing unneeded data
export function prepareDiffData(diffData) { export function prepareDiffData(diffData) {
const filesLength = diffData.diffFiles.length; const filesLength = diffData.diff_files.length;
let showingLines = 0; let showingLines = 0;
for (let i = 0; i < filesLength; i += 1) { for (let i = 0; i < filesLength; i += 1) {
const file = diffData.diffFiles[i]; const file = diffData.diff_files[i];
if (file.parallelDiffLines) { if (file.parallel_diff_lines) {
const linesLength = file.parallelDiffLines.length; const linesLength = file.parallel_diff_lines.length;
for (let u = 0; u < linesLength; u += 1) { for (let u = 0; u < linesLength; u += 1) {
const line = file.parallelDiffLines[u]; const line = file.parallel_diff_lines[u];
if (line.left) { if (line.left) {
line.left = trimFirstCharOfLineContent(line.left); line.left = trimFirstCharOfLineContent(line.left);
} }
@ -219,13 +216,13 @@ export function prepareDiffData(diffData) {
} }
} }
if (file.highlightedDiffLines) { if (file.highlighted_diff_lines) {
const linesLength = file.highlightedDiffLines.length; const linesLength = file.highlighted_diff_lines.length;
for (let u = 0; u < linesLength; u += 1) { for (let u = 0; u < linesLength; u += 1) {
const line = file.highlightedDiffLines[u]; const line = file.highlighted_diff_lines[u];
Object.assign(line, { ...trimFirstCharOfLineContent(line) }); Object.assign(line, { ...trimFirstCharOfLineContent(line) });
} }
showingLines += file.parallelDiffLines.length; showingLines += file.parallel_diff_lines.length;
} }
Object.assign(file, { Object.assign(file, {
@ -238,26 +235,21 @@ export function prepareDiffData(diffData) {
export function getDiffPositionByLineCode(diffFiles) { export function getDiffPositionByLineCode(diffFiles) {
return diffFiles.reduce((acc, diffFile) => { return diffFiles.reduce((acc, diffFile) => {
const { baseSha, headSha, startSha } = diffFile.diffRefs;
const { newPath, oldPath } = diffFile;
// We can only use highlightedDiffLines to create the map of diff lines because // We can only use highlightedDiffLines to create the map of diff lines because
// highlightedDiffLines will also include every parallel diff line in it. // highlightedDiffLines will also include every parallel diff line in it.
if (diffFile.highlightedDiffLines) { if (diffFile.highlighted_diff_lines) {
diffFile.highlightedDiffLines.forEach(line => { diffFile.highlighted_diff_lines.forEach(line => {
const { lineCode, oldLine, newLine } = line; if (line.line_code) {
acc[line.line_code] = {
if (lineCode) { base_sha: diffFile.diff_refs.base_sha,
acc[lineCode] = { head_sha: diffFile.diff_refs.head_sha,
baseSha, start_sha: diffFile.diff_refs.start_sha,
headSha, new_path: diffFile.new_path,
startSha, old_path: diffFile.old_path,
newPath, old_line: line.old_line,
oldPath, new_line: line.new_line,
oldLine, line_code: line.line_code,
newLine, position_type: 'text',
lineCode,
positionType: 'text',
}; };
} }
}); });
@ -270,30 +262,30 @@ export function getDiffPositionByLineCode(diffFiles) {
// This method will check whether the discussion is still applicable // This method will check whether the discussion is still applicable
// to the diff line in question regarding different versions of the MR // to the diff line in question regarding different versions of the MR
export function isDiscussionApplicableToLine({ discussion, diffPosition, latestDiff }) { export function isDiscussionApplicableToLine({ discussion, diffPosition, latestDiff }) {
const { lineCode, ...diffPositionCopy } = diffPosition; const { line_code, ...diffPositionCopy } = diffPosition;
if (discussion.original_position && discussion.position) { if (discussion.original_position && discussion.position) {
const originalRefs = convertObjectPropsToCamelCase(discussion.original_position); const originalRefs = discussion.original_position;
const refs = convertObjectPropsToCamelCase(discussion.position); const refs = discussion.position;
return _.isEqual(refs, diffPositionCopy) || _.isEqual(originalRefs, diffPositionCopy); return _.isEqual(refs, diffPositionCopy) || _.isEqual(originalRefs, diffPositionCopy);
} }
return latestDiff && discussion.active && lineCode === discussion.line_code; // eslint-disable-next-line
return latestDiff && discussion.active && line_code === discussion.line_code;
} }
export const generateTreeList = files => export const generateTreeList = files =>
files.reduce( files.reduce(
(acc, file) => { (acc, file) => {
const { fileHash, addedLines, removedLines, newFile, deletedFile, newPath } = file; const split = file.new_path.split('/');
const split = newPath.split('/');
split.forEach((name, i) => { split.forEach((name, i) => {
const parent = acc.treeEntries[split.slice(0, i).join('/')]; const parent = acc.treeEntries[split.slice(0, i).join('/')];
const path = `${parent ? `${parent.path}/` : ''}${name}`; const path = `${parent ? `${parent.path}/` : ''}${name}`;
if (!acc.treeEntries[path]) { if (!acc.treeEntries[path]) {
const type = path === newPath ? 'blob' : 'tree'; const type = path === file.new_path ? 'blob' : 'tree';
acc.treeEntries[path] = { acc.treeEntries[path] = {
key: path, key: path,
path, path,
@ -307,11 +299,11 @@ export const generateTreeList = files =>
if (type === 'blob') { if (type === 'blob') {
Object.assign(entry, { Object.assign(entry, {
changed: true, changed: true,
tempFile: newFile, tempFile: file.new_file,
deleted: deletedFile, deleted: file.deleted_file,
fileHash, fileHash: file.file_hash,
addedLines, addedLines: file.added_lines,
removedLines, removedLines: file.removed_lines,
}); });
} else { } else {
Object.assign(entry, { Object.assign(entry, {
@ -329,6 +321,6 @@ export const generateTreeList = files =>
); );
export const getDiffMode = diffFile => { export const getDiffMode = diffFile => {
const diffModeKey = Object.keys(diffModes).find(key => diffFile[`${key}File`]); const diffModeKey = Object.keys(diffModes).find(key => diffFile[`${key}_file`]);
return diffModes[diffModeKey] || diffModes.replaced; return diffModes[diffModeKey] || diffModes.replaced;
}; };

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import tablePagination from '../../vue_shared/components/table_pagination.vue'; import tablePagination from '../../vue_shared/components/table_pagination.vue';
import environmentTable from '../components/environments_table.vue'; import environmentTable from '../components/environments_table.vue';

View file

@ -4,7 +4,7 @@ import { formatTime } from '~/lib/utils/datetime_utility';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
import tooltip from '../../vue_shared/directives/tooltip'; import tooltip from '../../vue_shared/directives/tooltip';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
export default { export default {
directives: { directives: {

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlTooltipDirective } from '@gitlab-org/gitlab-ui'; import { GlTooltipDirective } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { s__ } from '~/locale'; import { s__ } from '~/locale';

View file

@ -1,7 +1,7 @@
<script> <script>
import Timeago from 'timeago.js'; import Timeago from 'timeago.js';
import _ from 'underscore'; import _ from 'underscore';
import { GlTooltipDirective } from '@gitlab-org/gitlab-ui'; import { GlTooltipDirective } from '@gitlab/ui';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue'; import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import { humanize } from '~/lib/utils/text_utility'; import { humanize } from '~/lib/utils/text_utility';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';

View file

@ -2,7 +2,7 @@
/** /**
* Renders the Monitoring (Metrics) link in environments table. * Renders the Monitoring (Metrics) link in environments table.
*/ */
import { GlButton, GlTooltipDirective } from '@gitlab-org/gitlab-ui'; import { GlButton, GlTooltipDirective } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
export default { export default {

View file

@ -6,7 +6,7 @@
* Makes a post request when the button is clicked. * Makes a post request when the button is clicked.
*/ */
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import { GlTooltipDirective, GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlTooltipDirective, GlLoadingIcon } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import eventHub from '../event_hub'; import eventHub from '../event_hub';

View file

@ -5,7 +5,7 @@
*/ */
import $ from 'jquery'; import $ from 'jquery';
import { GlTooltipDirective } from '@gitlab-org/gitlab-ui'; import { GlTooltipDirective } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import eventHub from '../event_hub'; import eventHub from '../event_hub';

View file

@ -3,7 +3,7 @@
* Renders a terminal button to open a web terminal. * Renders a terminal button to open a web terminal.
* Used in environments table. * Used in environments table.
*/ */
import { GlTooltipDirective } from '@gitlab-org/gitlab-ui'; import { GlTooltipDirective } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
export default { export default {

View file

@ -2,7 +2,7 @@
/** /**
* Render environments table. * Render environments table.
*/ */
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import environmentItem from './environment_item.vue'; import environmentItem from './environment_item.vue';
export default { export default {

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlTooltipDirective } from '@gitlab-org/gitlab-ui'; import { GlTooltipDirective } from '@gitlab/ui';
import GlModal from '~/vue_shared/components/gl_modal.vue'; import GlModal from '~/vue_shared/components/gl_modal.vue';
import { s__, sprintf } from '~/locale'; import { s__, sprintf } from '~/locale';
import LoadingButton from '~/vue_shared/components/loading_button.vue'; import LoadingButton from '~/vue_shared/components/loading_button.vue';

View file

@ -1,5 +1,5 @@
/* Developer beware! Do not add logic to showButton or hideButton /* Developer beware! Do not add logic to showButton or hideButton
* that will force a reflow. Doing so will create a signficant performance * that will force a reflow. Doing so will create a significant performance
* bottleneck for pages with large diffs. For a comprehensive list of what * bottleneck for pages with large diffs. For a comprehensive list of what
* causes reflows, visit https://gist.github.com/paulirish/5d52fb081b3570c81e3a * causes reflows, visit https://gist.github.com/paulirish/5d52fb081b3570c81e3a
*/ */

View file

@ -135,10 +135,6 @@ export default class FilteredSearchVisualTokens {
} }
static updateUserTokenAppearance(tokenValueContainer, tokenValueElement, tokenValue) { static updateUserTokenAppearance(tokenValueContainer, tokenValueElement, tokenValue) {
if (tokenValue === 'none') {
return Promise.resolve();
}
const username = tokenValue.replace(/^@/, ''); const username = tokenValue.replace(/^@/, '');
return ( return (
UsersCache.retrieve(username) UsersCache.retrieve(username)
@ -184,7 +180,12 @@ export default class FilteredSearchVisualTokens {
const tokenValueElement = tokenValueContainer.querySelector('.value'); const tokenValueElement = tokenValueContainer.querySelector('.value');
tokenValueElement.innerText = tokenValue; tokenValueElement.innerText = tokenValue;
if (tokenValue === 'none' || tokenValue === 'any') {
return;
}
const tokenType = tokenName.toLowerCase(); const tokenType = tokenName.toLowerCase();
if (tokenType === 'label') { if (tokenType === 'label') {
FilteredSearchVisualTokens.updateLabelTokenColor(tokenValueContainer, tokenValue); FilteredSearchVisualTokens.updateLabelTokenColor(tokenValueContainer, tokenValue);
} else if (tokenType === 'author' || tokenType === 'assignee') { } else if (tokenType === 'author' || tokenType === 'assignee') {

View file

@ -1,7 +1,7 @@
<script> <script>
import { mapState, mapActions, mapGetters } from 'vuex'; import { mapState, mapActions, mapGetters } from 'vuex';
import AccessorUtilities from '~/lib/utils/accessor'; import AccessorUtilities from '~/lib/utils/accessor';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
import store from '../store/'; import store from '../store/';
import { FREQUENT_ITEMS, STORAGE_KEY } from '../constants'; import { FREQUENT_ITEMS, STORAGE_KEY } from '../constants';

View file

@ -8,7 +8,7 @@ import { HIDDEN_CLASS } from '~/lib/utils/constants';
import { getParameterByName } from '~/lib/utils/common_utils'; import { getParameterByName } from '~/lib/utils/common_utils';
import { mergeUrlParams } from '~/lib/utils/url_utility'; import { mergeUrlParams } from '~/lib/utils/url_utility';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
import { COMMON_STR, CONTENT_LIST_CLASS } from '../constants'; import { COMMON_STR, CONTENT_LIST_CLASS } from '../constants';
import groupsComponent from './groups.vue'; import groupsComponent from './groups.vue';

View file

@ -2,7 +2,7 @@
import { mapActions, mapState } from 'vuex'; import { mapActions, mapState } from 'vuex';
import _ from 'underscore'; import _ from 'underscore';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import Item from './item.vue'; import Item from './item.vue';
export default { export default {

View file

@ -1,6 +1,6 @@
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
export default { export default {
components: { components: {

View file

@ -2,7 +2,7 @@
import $ from 'jquery'; import $ from 'jquery';
import { mapActions, mapState } from 'vuex'; import { mapActions, mapState } from 'vuex';
import DropdownButton from '~/vue_shared/components/dropdown/dropdown_button.vue'; import DropdownButton from '~/vue_shared/components/dropdown/dropdown_button.vue';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
export default { export default {
components: { components: {

View file

@ -1,6 +1,6 @@
<script> <script>
import { mapState, mapGetters } from 'vuex'; import { mapState, mapGetters } from 'vuex';
import { GlSkeletonLoading } from '@gitlab-org/gitlab-ui'; import { GlSkeletonLoading } from '@gitlab/ui';
import IdeTree from './ide_tree.vue'; import IdeTree from './ide_tree.vue';
import ResizablePanel from './resizable_panel.vue'; import ResizablePanel from './resizable_panel.vue';
import ActivityBar from './activity_bar.vue'; import ActivityBar from './activity_bar.vue';

View file

@ -1,7 +1,7 @@
<script> <script>
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { GlSkeletonLoading } from '@gitlab-org/gitlab-ui'; import { GlSkeletonLoading } from '@gitlab/ui';
import FileRow from '~/vue_shared/components/file_row.vue'; import FileRow from '~/vue_shared/components/file_row.vue';
import NavDropdown from './nav_dropdown.vue'; import NavDropdown from './nav_dropdown.vue';
import FileRowExtra from './file_row_extra.vue'; import FileRowExtra from './file_row_extra.vue';

View file

@ -1,6 +1,6 @@
<script> <script>
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import Stage from './stage.vue'; import Stage from './stage.vue';
export default { export default {

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import tooltip from '../../../vue_shared/directives/tooltip'; import tooltip from '../../../vue_shared/directives/tooltip';
import Icon from '../../../vue_shared/components/icon.vue'; import Icon from '../../../vue_shared/components/icon.vue';
import CiIcon from '../../../vue_shared/components/ci_icon.vue'; import CiIcon from '../../../vue_shared/components/ci_icon.vue';

View file

@ -3,7 +3,7 @@ import { mapActions, mapState } from 'vuex';
import _ from 'underscore'; import _ from 'underscore';
import { __ } from '~/locale'; import { __ } from '~/locale';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import Item from './item.vue'; import Item from './item.vue';
import TokenedInput from '../shared/tokened_input.vue'; import TokenedInput from '../shared/tokened_input.vue';

View file

@ -1,7 +1,7 @@
<script> <script>
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import _ from 'underscore'; import _ from 'underscore';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import { sprintf, __ } from '../../../locale'; import { sprintf, __ } from '../../../locale';
import Icon from '../../../vue_shared/components/icon.vue'; import Icon from '../../../vue_shared/components/icon.vue';
import CiIcon from '../../../vue_shared/components/ci_icon.vue'; import CiIcon from '../../../vue_shared/components/ci_icon.vue';

View file

@ -3,7 +3,7 @@ import { mapActions, mapGetters, mapState } from 'vuex';
import _ from 'underscore'; import _ from 'underscore';
import { Manager } from 'smooshpack'; import { Manager } from 'smooshpack';
import { listen } from 'codesandbox-api'; import { listen } from 'codesandbox-api';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import Navigator from './navigator.vue'; import Navigator from './navigator.vue';
import { packageJsonPath } from '../../constants'; import { packageJsonPath } from '../../constants';
import { createPathWithExt } from '../../utils'; import { createPathWithExt } from '../../utils';

View file

@ -1,7 +1,7 @@
<script> <script>
import { listen } from 'codesandbox-api'; import { listen } from 'codesandbox-api';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
export default { export default {
components: { components: {

View file

@ -28,7 +28,7 @@ export const receiveLatestPipelineError = ({ commit, dispatch }, err) => {
dispatch( dispatch(
'setErrorMessage', 'setErrorMessage',
{ {
text: __('An error occured whilst fetching the latest pipline.'), text: __('An error occured whilst fetching the latest pipeline.'),
action: () => action: () =>
dispatch('forcePipelineRequest').then(() => dispatch('forcePipelineRequest').then(() =>
dispatch('setErrorMessage', null, { root: true }), dispatch('setErrorMessage', null, { root: true }),

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlLink } from '@gitlab-org/gitlab-ui'; import { GlLink } from '@gitlab/ui';
import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import timeagoMixin from '~/vue_shared/mixins/timeago'; import timeagoMixin from '~/vue_shared/mixins/timeago';

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlLink } from '@gitlab-org/gitlab-ui'; import { GlLink } from '@gitlab/ui';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
export default { export default {

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlLink } from '@gitlab-org/gitlab-ui'; import { GlLink } from '@gitlab/ui';
export default { export default {
components: { components: {

View file

@ -1,6 +1,6 @@
<script> <script>
import _ from 'underscore'; import _ from 'underscore';
import { GlLink } from '@gitlab-org/gitlab-ui'; import { GlLink } from '@gitlab/ui';
import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
export default { export default {

View file

@ -1,7 +1,7 @@
<script> <script>
import _ from 'underscore'; import _ from 'underscore';
import { mapGetters, mapState, mapActions } from 'vuex'; import { mapGetters, mapState, mapActions } from 'vuex';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import { isScrolledToBottom } from '~/lib/utils/scroll_utils'; import { isScrolledToBottom } from '~/lib/utils/scroll_utils';
import { polyfillSticky } from '~/lib/utils/sticky'; import { polyfillSticky } from '~/lib/utils/sticky';
import bp from '~/breakpoints'; import bp from '~/breakpoints';

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlLink } from '@gitlab-org/gitlab-ui'; import { GlLink } from '@gitlab/ui';
import tooltip from '~/vue_shared/directives/tooltip'; import tooltip from '~/vue_shared/directives/tooltip';
import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlTooltipDirective, GlLink, GlButton } from '@gitlab-org/gitlab-ui'; import { GlTooltipDirective, GlLink, GlButton } from '@gitlab/ui';
import { polyfillSticky } from '~/lib/utils/sticky'; import { polyfillSticky } from '~/lib/utils/sticky';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import { numberToHumanSize } from '~/lib/utils/number_utils'; import { numberToHumanSize } from '~/lib/utils/number_utils';

View file

@ -1,7 +1,7 @@
<script> <script>
import _ from 'underscore'; import _ from 'underscore';
import { mapActions, mapState } from 'vuex'; import { mapActions, mapState } from 'vuex';
import { GlLink, GlButton } from '@gitlab-org/gitlab-ui'; import { GlLink, GlButton } from '@gitlab/ui';
import timeagoMixin from '~/vue_shared/mixins/timeago'; import timeagoMixin from '~/vue_shared/mixins/timeago';
import { timeIntervalInWords } from '~/lib/utils/datetime_utility'; import { timeIntervalInWords } from '~/lib/utils/datetime_utility';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlLink } from '@gitlab-org/gitlab-ui'; import { GlLink } from '@gitlab/ui';
export default { export default {
name: 'SidebarDetailRow', name: 'SidebarDetailRow',

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlLink } from '@gitlab-org/gitlab-ui'; import { GlLink } from '@gitlab/ui';
/** /**
* Renders Stuck Runners block for job's view. * Renders Stuck Runners block for job's view.
*/ */

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlButton } from '@gitlab-org/gitlab-ui'; import { GlButton } from '@gitlab/ui';
export default { export default {
components: { components: {

View file

@ -80,8 +80,8 @@ export const fetchJob = ({ state, dispatch }) => {
export const receiveJobSuccess = ({ commit }, data = {}) => { export const receiveJobSuccess = ({ commit }, data = {}) => {
commit(types.RECEIVE_JOB_SUCCESS, data); commit(types.RECEIVE_JOB_SUCCESS, data);
if (data.favicon) { if (data.status && data.status.favicon) {
setFaviconOverlay(data.favicon); setFaviconOverlay(data.status.favicon);
} else { } else {
resetFavicon(); resetFavicon();
} }

View file

@ -42,7 +42,7 @@ export const emptyStateIllustration = state =>
(state.job && state.job.status && state.job.status.illustration) || {}; (state.job && state.job.status && state.job.status.illustration) || {};
export const emptyStateAction = state => export const emptyStateAction = state =>
(state.job && state.job.status && state.job.status.action) || {}; (state.job && state.job.status && state.job.status.action) || null;
export const isScrollingDown = state => isScrolledToBottom() && !state.isTraceComplete; export const isScrollingDown = state => isScrolledToBottom() && !state.isTraceComplete;

View file

@ -16,7 +16,7 @@ import 'vendor/jquery.atwho';
import AjaxCache from '~/lib/utils/ajax_cache'; import AjaxCache from '~/lib/utils/ajax_cache';
import Vue from 'vue'; import Vue from 'vue';
import syntaxHighlight from '~/syntax_highlight'; import syntaxHighlight from '~/syntax_highlight';
import { GlSkeletonLoading } from '@gitlab-org/gitlab-ui'; import { GlSkeletonLoading } from '@gitlab/ui';
import axios from './lib/utils/axios_utils'; import axios from './lib/utils/axios_utils';
import { getLocationHash } from './lib/utils/url_utility'; import { getLocationHash } from './lib/utils/url_utility';
import Flash from './flash'; import Flash from './flash';

View file

@ -1,10 +1,9 @@
<script> <script>
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from 'vuex';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import DiffFileHeader from '~/diffs/components/diff_file_header.vue'; import DiffFileHeader from '~/diffs/components/diff_file_header.vue';
import DiffViewer from '~/vue_shared/components/diff_viewer/diff_viewer.vue'; import DiffViewer from '~/vue_shared/components/diff_viewer/diff_viewer.vue';
import ImageDiffOverlay from '~/diffs/components/image_diff_overlay.vue'; import ImageDiffOverlay from '~/diffs/components/image_diff_overlay.vue';
import { GlSkeletonLoading } from '@gitlab-org/gitlab-ui'; import { GlSkeletonLoading } from '@gitlab/ui';
import { trimFirstCharOfLineContent, getDiffMode } from '~/diffs/store/utils'; import { trimFirstCharOfLineContent, getDiffMode } from '~/diffs/store/utils';
export default { export default {
@ -34,7 +33,9 @@ export default {
return getDiffMode(this.diffFile); return getDiffMode(this.diffFile);
}, },
hasTruncatedDiffLines() { hasTruncatedDiffLines() {
return this.discussion.truncatedDiffLines && this.discussion.truncatedDiffLines.length !== 0; return (
this.discussion.truncated_diff_lines && this.discussion.truncated_diff_lines.length !== 0
);
}, },
isDiscussionsExpanded() { isDiscussionsExpanded() {
return true; // TODO: @fatihacet - Fix this. return true; // TODO: @fatihacet - Fix this.
@ -50,19 +51,17 @@ export default {
return text ? 'text-file' : 'js-image-file'; return text ? 'text-file' : 'js-image-file';
}, },
diffFile() { diffFile() {
return convertObjectPropsToCamelCase(this.discussion.diffFile, { deep: true }); return this.discussion.diff_file;
}, },
imageDiffHtml() { imageDiffHtml() {
return this.discussion.imageDiffHtml; return this.discussion.image_diff_html;
}, },
userColorScheme() { userColorScheme() {
return window.gon.user_color_scheme; return window.gon.user_color_scheme;
}, },
normalizedDiffLines() { normalizedDiffLines() {
if (this.discussion.truncatedDiffLines) { if (this.discussion.truncated_diff_lines) {
return this.discussion.truncatedDiffLines.map(line => return this.discussion.truncated_diff_lines.map(line => trimFirstCharOfLineContent(line));
trimFirstCharOfLineContent(convertObjectPropsToCamelCase(line)),
);
} }
return []; return [];
@ -97,7 +96,7 @@ export default {
class="diff-file file-holder" class="diff-file file-holder"
> >
<diff-file-header <diff-file-header
:discussion-path="discussion.discussionPath" :discussion-path="discussion.discussion_path"
:diff-file="diffFile" :diff-file="diffFile"
:can-current-user-fork="false" :can-current-user-fork="false"
:discussions-expanded="isDiscussionsExpanded" :discussions-expanded="isDiscussionsExpanded"
@ -111,15 +110,15 @@ export default {
<table> <table>
<tr <tr
v-for="line in normalizedDiffLines" v-for="line in normalizedDiffLines"
:key="line.lineCode" :key="line.line_code"
class="line_holder" class="line_holder"
> >
<td class="diff-line-num old_line">{{ line.oldLine }}</td> <td class="diff-line-num old_line">{{ line.old_line }}</td>
<td class="diff-line-num new_line">{{ line.newLine }}</td> <td class="diff-line-num new_line">{{ line.new_line }}</td>
<td <td
:class="line.type" :class="line.type"
class="line_content" class="line_content"
v-html="line.richText" v-html="line.rich_text"
> >
</td> </td>
</tr> </tr>
@ -165,17 +164,17 @@ export default {
> >
<diff-viewer <diff-viewer
:diff-mode="diffMode" :diff-mode="diffMode"
:new-path="diffFile.newPath" :new-path="diffFile.new_path"
:new-sha="diffFile.diffRefs.headSha" :new-sha="diffFile.diff_refs.head_sha"
:old-path="diffFile.oldPath" :old-path="diffFile.old_path"
:old-sha="diffFile.diffRefs.baseSha" :old-sha="diffFile.diff_refs.base_sha"
:file-hash="diffFile.fileHash" :file-hash="diffFile.file_hash"
:project-path="projectPath" :project-path="projectPath"
> >
<image-diff-overlay <image-diff-overlay
slot="image-overlay" slot="image-overlay"
:discussions="discussion" :discussions="discussion"
:file-hash="diffFile.fileHash" :file-hash="diffFile.file_hash"
:show-comment-icon="true" :show-comment-icon="true"
:should-toggle-discussion="false" :should-toggle-discussion="false"
badge-class="image-comment-badge" badge-class="image-comment-badge"

View file

@ -2,7 +2,7 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import tooltip from '~/vue_shared/directives/tooltip'; import tooltip from '~/vue_shared/directives/tooltip';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
export default { export default {
name: 'NoteActions', name: 'NoteActions',

View file

@ -1,6 +1,5 @@
<script> <script>
import { mapActions, mapGetters } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import { truncateSha } from '~/lib/utils/text_utility'; import { truncateSha } from '~/lib/utils/text_utility';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import systemNote from '~/vue_shared/components/notes/system_note.vue'; import systemNote from '~/vue_shared/components/notes/system_note.vue';
@ -88,17 +87,16 @@ export default {
transformedDiscussion() { transformedDiscussion() {
return { return {
...this.discussion.notes[0], ...this.discussion.notes[0],
truncatedDiffLines: this.discussion.truncated_diff_lines || [], truncated_diff_lines: this.discussion.truncated_diff_lines || [],
truncatedDiffLinesPath: this.discussion.truncated_diff_lines_path, truncated_diff_lines_path: this.discussion.truncated_diff_lines_path,
diffFile: this.discussion.diff_file, diff_file: this.discussion.diff_file,
diffDiscussion: this.discussion.diff_discussion, diff_discussion: this.discussion.diff_discussion,
imageDiffHtml: this.discussion.image_diff_html,
active: this.discussion.active, active: this.discussion.active,
discussionPath: this.discussion.discussion_path, discussion_path: this.discussion.discussion_path,
resolved: this.discussion.resolved, resolved: this.discussion.resolved,
resolvedBy: this.discussion.resolved_by, resolved_by: this.discussion.resolved_by,
resolvedByPush: this.discussion.resolved_by_push, resolved_by_push: this.discussion.resolved_by_push,
resolvedAt: this.discussion.resolved_at, resolved_at: this.discussion.resolved_at,
}; };
}, },
author() { author() {
@ -138,7 +136,7 @@ export default {
return null; return null;
}, },
resolvedText() { resolvedText() {
return this.transformedDiscussion.resolvedByPush ? 'Automatically resolved' : 'Resolved'; return this.transformedDiscussion.resolved_by_push ? 'Automatically resolved' : 'Resolved';
}, },
hasMultipleUnresolvedDiscussions() { hasMultipleUnresolvedDiscussions() {
return this.unresolvedDiscussions.length > 1; return this.unresolvedDiscussions.length > 1;
@ -150,12 +148,14 @@ export default {
); );
}, },
shouldRenderDiffs() { shouldRenderDiffs() {
const { diffDiscussion, diffFile } = this.transformedDiscussion; return (
this.transformedDiscussion.diff_discussion &&
return diffDiscussion && diffFile && this.renderDiffFile; this.transformedDiscussion.diff_file &&
this.renderDiffFile
);
}, },
shouldGroupReplies() { shouldGroupReplies() {
return !this.shouldRenderDiffs && !this.transformedDiscussion.diffDiscussion; return !this.shouldRenderDiffs && !this.transformedDiscussion.diff_discussion;
}, },
shouldRenderHeader() { shouldRenderHeader() {
return this.shouldRenderDiffs; return this.shouldRenderDiffs;
@ -165,7 +165,7 @@ export default {
}, },
wrapperComponentProps() { wrapperComponentProps() {
if (this.shouldRenderDiffs) { if (this.shouldRenderDiffs) {
return { discussion: convertObjectPropsToCamelCase(this.discussion) }; return { discussion: this.discussion };
} }
return {}; return {};
@ -184,8 +184,8 @@ export default {
}, },
shouldShowDiscussions() { shouldShowDiscussions() {
const isExpanded = this.discussion.expanded; const isExpanded = this.discussion.expanded;
const { diffDiscussion, resolved } = this.transformedDiscussion; const { resolved } = this.transformedDiscussion;
const isResolvedNonDiffDiscussion = !diffDiscussion && resolved; const isResolvedNonDiffDiscussion = !this.transformedDiscussion.diff_discussion && resolved;
return isExpanded || this.alwaysExpanded || isResolvedNonDiffDiscussion; return isExpanded || this.alwaysExpanded || isResolvedNonDiffDiscussion;
}, },
@ -333,9 +333,9 @@ Please check your network connection and try again.`;
:expanded="discussion.expanded" :expanded="discussion.expanded"
@toggleHandler="toggleDiscussionHandler" @toggleHandler="toggleDiscussionHandler"
> >
<template v-if="transformedDiscussion.diffDiscussion"> <template v-if="transformedDiscussion.diff_discussion">
started a discussion on started a discussion on
<a :href="transformedDiscussion.discussionPath"> <a :href="transformedDiscussion.discussion_path">
<template v-if="transformedDiscussion.active"> <template v-if="transformedDiscussion.active">
the diff the diff
</template> </template>
@ -356,8 +356,8 @@ Please check your network connection and try again.`;
</note-header> </note-header>
<note-edited-text <note-edited-text
v-if="transformedDiscussion.resolved" v-if="transformedDiscussion.resolved"
:edited-at="transformedDiscussion.resolvedAt" :edited-at="transformedDiscussion.resolved_at"
:edited-by="transformedDiscussion.resolvedBy" :edited-by="transformedDiscussion.resolved_by"
:action-text="resolvedText" :action-text="resolvedText"
class-name="discussion-headline-light js-discussion-headline" class-name="discussion-headline-light js-discussion-headline"
/> />

View file

@ -341,7 +341,7 @@ export const scrollToNoteIfNeeded = (context, el) => {
}; };
export const fetchDiscussionDiffLines = ({ commit }, discussion) => export const fetchDiscussionDiffLines = ({ commit }, discussion) =>
axios.get(discussion.truncatedDiffLinesPath).then(({ data }) => { axios.get(discussion.truncated_diff_lines_path).then(({ data }) => {
commit(types.SET_DISCUSSION_DIFF_LINES, { commit(types.SET_DISCUSSION_DIFF_LINES, {
discussionId: discussion.id, discussionId: discussion.id,
diffLines: data.truncated_diff_lines, diffLines: data.truncated_diff_lines,

View file

@ -102,7 +102,7 @@ export default {
discussionsData.forEach(discussion => { discussionsData.forEach(discussion => {
if (discussion.diff_file) { if (discussion.diff_file) {
Object.assign(discussion, { Object.assign(discussion, {
fileHash: discussion.diff_file.file_hash, file_hash: discussion.diff_file.file_hash,
truncated_diff_lines: discussion.truncated_diff_lines || [], truncated_diff_lines: discussion.truncated_diff_lines || [],
}); });
} }
@ -195,7 +195,7 @@ export default {
const selectedDiscussion = state.discussions.find(disc => disc.id === note.id); const selectedDiscussion = state.discussions.find(disc => disc.id === note.id);
note.expanded = true; // override expand flag to prevent collapse note.expanded = true; // override expand flag to prevent collapse
if (note.diff_file) { if (note.diff_file) {
Object.assign(note, { fileHash: note.diff_file.file_hash }); Object.assign(note, { file_hash: note.diff_file.file_hash });
} }
Object.assign(selectedDiscussion, { ...note }); Object.assign(selectedDiscussion, { ...note });
}, },

View file

@ -1,7 +1,7 @@
<script> <script>
import _ from 'underscore'; import _ from 'underscore';
import { s__, sprintf } from '~/locale'; import { s__, sprintf } from '~/locale';
import { GlModal, GlModalDirective } from '@gitlab-org/gitlab-ui'; import { GlModal, GlModalDirective } from '@gitlab/ui';
export default { export default {
components: { components: {

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlButton } from '@gitlab-org/gitlab-ui'; import { GlButton } from '@gitlab/ui';
export default { export default {
name: 'PipelinesEmptyState', name: 'PipelinesEmptyState',

View file

@ -1,10 +1,9 @@
<script> <script>
import $ from 'jquery'; import { GlTooltipDirective, GlButton } from '@gitlab/ui';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
import { dasherize } from '~/lib/utils/text_utility'; import { dasherize } from '~/lib/utils/text_utility';
import { __ } from '~/locale'; import { __ } from '~/locale';
import createFlash from '~/flash'; import createFlash from '~/flash';
import tooltip from '~/vue_shared/directives/tooltip';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
/** /**
@ -20,23 +19,20 @@ import Icon from '~/vue_shared/components/icon.vue';
export default { export default {
components: { components: {
Icon, Icon,
GlButton,
}, },
directives: { directives: {
tooltip, GlTooltip: GlTooltipDirective,
}, },
props: { props: {
tooltipText: { tooltipText: {
type: String, type: String,
required: true, required: true,
}, },
link: { link: {
type: String, type: String,
required: true, required: true,
}, },
actionIcon: { actionIcon: {
type: String, type: String,
required: true, required: true,
@ -47,7 +43,6 @@ export default {
isDisabled: false, isDisabled: false,
}; };
}, },
computed: { computed: {
cssClass() { cssClass() {
const actionIconDash = dasherize(this.actionIcon); const actionIconDash = dasherize(this.actionIcon);
@ -62,8 +57,7 @@ export default {
* *
*/ */
onClickAction() { onClickAction() {
$(this.$el).tooltip('hide'); this.$root.$emit('bv::hide::tooltip', `js-ci-action-${this.link}`);
this.isDisabled = true; this.isDisabled = true;
axios axios
@ -82,18 +76,16 @@ export default {
}; };
</script> </script>
<template> <template>
<button <gl-button
v-tooltip :id="`js-ci-action-${link}`"
v-gl-tooltip="{ boundary: 'viewport' }"
:title="tooltipText" :title="tooltipText"
:class="cssClass" :class="cssClass"
:disabled="isDisabled" :disabled="isDisabled"
type="button"
class="js-ci-action btn btn-blank class="js-ci-action btn btn-blank
btn-transparent ci-action-icon-container ci-action-icon-wrapper" btn-transparent ci-action-icon-container ci-action-icon-wrapper"
data-container="body"
data-boundary="viewport"
@click="onClickAction" @click="onClickAction"
> >
<icon :name="actionIcon"/> <icon :name="actionIcon"/>
</button> </gl-button>
</template> </template>

View file

@ -1,6 +1,6 @@
<script> <script>
import _ from 'underscore'; import _ from 'underscore';
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import StageColumnComponent from './stage_column_component.vue'; import StageColumnComponent from './stage_column_component.vue';
export default { export default {

View file

@ -1,8 +1,8 @@
<script> <script>
import $ from 'jquery'; import $ from 'jquery';
import { GlTooltipDirective } from '@gitlab/ui';
import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
import JobItem from './job_item.vue'; import JobItem from './job_item.vue';
import tooltip from '../../../vue_shared/directives/tooltip';
/** /**
* Renders the dropdown for the pipeline graph. * Renders the dropdown for the pipeline graph.
@ -12,32 +12,27 @@ import tooltip from '../../../vue_shared/directives/tooltip';
*/ */
export default { export default {
directives: { directives: {
tooltip, GlTooltip: GlTooltipDirective,
}, },
components: { components: {
JobItem, JobItem,
CiIcon, CiIcon,
}, },
props: { props: {
group: { group: {
type: Object, type: Object,
required: true, required: true,
}, },
}, },
computed: { computed: {
tooltipText() { tooltipText() {
const { name, status } = this.group; const { name, status } = this.group;
return `${name} - ${status.label}`; return `${name} - ${status.label}`;
}, },
}, },
mounted() { mounted() {
this.stopDropdownClickPropagation(); this.stopDropdownClickPropagation();
}, },
methods: { methods: {
/** /**
* When the user right clicks or cmd/ctrl + click in the group name or the action icon * When the user right clicks or cmd/ctrl + click in the group name or the action icon
@ -65,12 +60,10 @@ export default {
<template> <template>
<div class="ci-job-dropdown-container dropdown dropright"> <div class="ci-job-dropdown-container dropdown dropright">
<button <button
v-tooltip v-gl-tooltip.hover="{ boundary: 'viewport' }"
:title="tooltipText" :title="tooltipText"
type="button" type="button"
data-toggle="dropdown" data-toggle="dropdown"
data-container="body"
data-boundary="viewport"
data-display="static" data-display="static"
class="dropdown-menu-toggle build-content" class="dropdown-menu-toggle build-content"
> >

View file

@ -1,7 +1,7 @@
<script> <script>
import ActionComponent from './action_component.vue'; import ActionComponent from './action_component.vue';
import JobNameComponent from './job_name_component.vue'; import JobNameComponent from './job_name_component.vue';
import tooltip from '../../../vue_shared/directives/tooltip'; import { GlTooltipDirective, GlLink } from '@gitlab/ui';
import { sprintf } from '~/locale'; import { sprintf } from '~/locale';
import delayedJobMixin from '~/jobs/mixins/delayed_job_mixin'; import delayedJobMixin from '~/jobs/mixins/delayed_job_mixin';
@ -34,9 +34,10 @@ export default {
components: { components: {
ActionComponent, ActionComponent,
JobNameComponent, JobNameComponent,
GlLink,
}, },
directives: { directives: {
tooltip, GlTooltip: GlTooltipDirective,
}, },
mixins: [delayedJobMixin], mixins: [delayedJobMixin],
props: { props: {
@ -55,7 +56,6 @@ export default {
default: Infinity, default: Infinity,
}, },
}, },
computed: { computed: {
status() { status() {
return this.job && this.job.status ? this.job.status : {}; return this.job && this.job.status ? this.job.status : {};
@ -88,7 +88,6 @@ export default {
tooltipBoundary() { tooltipBoundary() {
return this.dropdownLength < 5 ? 'viewport' : null; return this.dropdownLength < 5 ? 'viewport' : null;
}, },
/** /**
* Verifies if the provided job has an action path * Verifies if the provided job has an action path
* *
@ -98,7 +97,6 @@ export default {
return this.job.status && this.job.status.action && this.job.status.action.path; return this.job.status && this.job.status.action && this.job.status.action.path;
}, },
}, },
methods: { methods: {
pipelineActionRequestComplete() { pipelineActionRequestComplete() {
this.$emit('pipelineActionRequestComplete'); this.$emit('pipelineActionRequestComplete');
@ -108,30 +106,26 @@ export default {
</script> </script>
<template> <template>
<div class="ci-job-component"> <div class="ci-job-component">
<a <gl-link
v-if="status.has_details" v-if="status.has_details"
v-tooltip v-gl-tooltip="{ boundary: tooltipBoundary }"
:href="status.details_path" :href="status.details_path"
:title="tooltipText" :title="tooltipText"
:class="cssClassJobName" :class="cssClassJobName"
:data-boundary="tooltipBoundary"
data-container="body"
class="js-pipeline-graph-job-link" class="js-pipeline-graph-job-link"
> >
<job-name-component <job-name-component
:name="job.name" :name="job.name"
:status="job.status" :status="job.status"
/> />
</a> </gl-link>
<div <div
v-else v-else
v-tooltip v-gl-tooltip
:title="tooltipText" :title="tooltipText"
:class="cssClassJobName" :class="cssClassJobName"
class="js-job-component-tooltip non-details-job-component" class="js-job-component-tooltip non-details-job-component"
data-container="body"
> >
<job-name-component <job-name-component

View file

@ -13,34 +13,28 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
groups: { groups: {
type: Array, type: Array,
required: true, required: true,
}, },
isFirstColumn: { isFirstColumn: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false, default: false,
}, },
stageConnectorClass: { stageConnectorClass: {
type: String, type: String,
required: false, required: false,
default: '', default: '',
}, },
}, },
methods: { methods: {
groupId(group) { groupId(group) {
return `ci-badge-${_.escape(group.name)}`; return `ci-badge-${_.escape(group.name)}`;
}, },
buildConnnectorClass(index) { buildConnnectorClass(index) {
return index === 0 && !this.isFirstColumn ? 'left-connector' : ''; return index === 0 && !this.isFirstColumn ? 'left-connector' : '';
}, },
pipelineActionRequestComplete() { pipelineActionRequestComplete() {
this.$emit('refreshPipelineGraph'); this.$emit('refreshPipelineGraph');
}, },
@ -50,7 +44,8 @@ export default {
<template> <template>
<li <li
:class="stageConnectorClass" :class="stageConnectorClass"
class="stage-column"> class="stage-column"
>
<div class="stage-name"> <div class="stage-name">
{{ title }} {{ title }}
</div> </div>
@ -78,7 +73,6 @@ export default {
:group="group" :group="group"
@pipelineActionRequestComplete="pipelineActionRequestComplete" @pipelineActionRequestComplete="pipelineActionRequestComplete"
/> />
</li> </li>
</ul> </ul>
</div> </div>

View file

@ -1,5 +1,5 @@
<script> <script>
import { GlLoadingIcon } from '@gitlab-org/gitlab-ui'; import { GlLoadingIcon } from '@gitlab/ui';
import ciHeader from '../../vue_shared/components/header_ci_component.vue'; import ciHeader from '../../vue_shared/components/header_ci_component.vue';
import eventHub from '../event_hub'; import eventHub from '../event_hub';

Some files were not shown because too many files have changed in this diff Show more