Merge branch 'master' into feature/multi-level-container-registry-images
* master: (192 commits) Implement new service for creating user Update sentry-raven 2.0.2 -> 2.4.0 Update webmock 1.21.0 -> 1.24.6 Update spring 1.7.2 -> 2.0.1 Update simplecov 0.12.0 -> 0.14.1 Update pry-rails 0.3.4 -> 0.3.5 Update pry-byebug 3.4.1 -> 3.4.2 Update flay 2.6.1 -> 2.8.1 Remove Tags filter from Projects Explore dropdown Update capybara-screenshot 1.0.11 -> 1.0.14 Update bullet 5.2.0 -> 5.5.1 Update brakeman 3.4.1 -> 3.6.1 Remove web-console gem Update better_errors 1.0.1 -> 2.1.1 Display flash message to unauthenticated user when creating new issue Fix up emoji tests that should have failed :/ Fix RSpec/DescribeSymbol cop violations Add event limit warning all tabs Cycle Analytics Adding non_archived scope for counting projects Resolve "Gitlab administrator cannot create projects in every group" ... Conflicts: db/schema.rb
This commit is contained in:
commit
1a4c60ef57
707 changed files with 6508 additions and 4020 deletions
|
@ -19,7 +19,7 @@ before_script:
|
|||
- source ./scripts/prepare_build.sh
|
||||
- cp config/gitlab.yml.example config/gitlab.yml
|
||||
- bundle --version
|
||||
- '[ "$USE_BUNDLE_INSTALL" != "true" ] || retry bundle install --without postgres production --jobs $(nproc) $FLAGS'
|
||||
- '[ "$USE_BUNDLE_INSTALL" != "true" ] || retry bundle install --without postgres production --jobs $(nproc) --clean $FLAGS'
|
||||
- retry gem install knapsack
|
||||
- '[ "$SETUP_DB" != "true" ] || bundle exec rake db:drop db:create db:schema:load db:migrate add_limits_mysql'
|
||||
|
||||
|
@ -206,10 +206,9 @@ rake ee_compat_check:
|
|||
- /^[\d-]+-stable(-ee)?$/
|
||||
allow_failure: yes
|
||||
cache:
|
||||
key: "ruby233-ee_compat_check_repo"
|
||||
key: "ee_compat_check_repo"
|
||||
paths:
|
||||
- ee_compat_check/repo/
|
||||
- vendor/ruby
|
||||
- ee_compat_check/ee-repo/
|
||||
artifacts:
|
||||
name: "${CI_JOB_NAME}_${CI_COMIT_REF_NAME}_${CI_COMMIT_SHA}"
|
||||
when: on_failure
|
||||
|
@ -281,6 +280,7 @@ rake karma:
|
|||
BABEL_ENV: "coverage"
|
||||
script:
|
||||
- bundle exec rake karma
|
||||
coverage: '/^Statements *: (\d+\.\d+%)/'
|
||||
artifacts:
|
||||
name: coverage-javascript
|
||||
expire_in: 31d
|
||||
|
@ -312,7 +312,7 @@ bundler:audit:
|
|||
- master@gitlab/gitlabhq
|
||||
- master@gitlab/gitlab-ee
|
||||
script:
|
||||
- "bundle exec bundle-audit check --update"
|
||||
- "bundle exec bundle-audit check --update --ignore CVE-2016-4658"
|
||||
|
||||
migration paths:
|
||||
stage: test
|
||||
|
@ -333,6 +333,7 @@ migration paths:
|
|||
- bundle install --without postgres production --jobs $(nproc) $FLAGS --retry=3
|
||||
- bundle exec rake db:drop db:create db:schema:load db:seed_fu
|
||||
- git checkout $CI_COMMIT_SHA
|
||||
- bundle install --without postgres production --jobs $(nproc) $FLAGS --retry=3
|
||||
- source scripts/prepare_build.sh
|
||||
- bundle exec rake db:migrate
|
||||
|
||||
|
@ -345,6 +346,7 @@ coverage:
|
|||
USE_BUNDLE_INSTALL: "true"
|
||||
script:
|
||||
- bundle exec scripts/merge-simplecov
|
||||
coverage: '/LOC \((\d+\.\d+%)\) covered.$/'
|
||||
artifacts:
|
||||
name: coverage
|
||||
expire_in: 31d
|
||||
|
|
283
CHANGELOG.md
283
CHANGELOG.md
|
@ -2,6 +2,289 @@
|
|||
documentation](doc/development/changelog.md) for instructions on adding your own
|
||||
entry.
|
||||
|
||||
## 9.0.0 (2017-03-22)
|
||||
|
||||
- Fix inconsistent naming for services that delete things. !5803 (dixpac)
|
||||
- UI: Allow a project variable to be set to an empty value. !6044 (Lukáš Nový)
|
||||
- Align task list checkboxes. !6487 (Jared Deckard <jared.deckard@gmail.com>)
|
||||
- SanitizationFilter allows html5 details and summary tags. !6568
|
||||
- on branch deletion show loading icon and disabled the button. !6761 (wendy0402)
|
||||
- Use an entity for RepoBranch commits and enhance RepoCommit. !7138 (Ben Boeckel)
|
||||
- Deleting a user doesn't delete issues they've created/are assigned to. !7393
|
||||
- Fix position of counter in milestone panels. !7842 (Andrew Smith (EspadaV8))
|
||||
- Added a feature to create a 'directly addressed' Todo when mentioned in the beginning of a line. !7926 (Ershad Kunnakkadan)
|
||||
- Implement OpenID Connect identity provider. !8018 (Markus Koller)
|
||||
- Show directory hierarchy when listing wiki pages. !8133 (Alex Braha Stoll)
|
||||
- Migrate SlackService and MattermostService from build_events to pipeline_events, and migrate BuildsEmailService to PipelinesEmailService. Update Hipchat to use pipeline events rather than build events. !8196
|
||||
- Execute web hooks for WikiPage delete operation. !8198
|
||||
- Added external environment link to web terminal view. !8303
|
||||
- Responsive title in diffs inline, side by side, with and without sidebar. !8475
|
||||
- Bypass email domain validation when a user is created by an admin. !8575 (Reza Mohammadi @remohammadi)
|
||||
- API: Paginate all endpoints that return an array. !8606 (Robert Schilling)
|
||||
- pass in current_user in MergeRequest and MergeRequestsHelper. !8624 (Dongqing Hu)
|
||||
- Add user & build links in Slack Notifications. !8641 (Poornima M)
|
||||
- Todo done clicking is kind of unusable. !8691 (Jacopo Beschi @jacopo-beschi)
|
||||
- Filter todos by manual add. !8691 (Jacopo Beschi @jacopo-beschi)
|
||||
- Add runner version to /admin/runners view. !8733 (Jonathon Reinhart)
|
||||
- API: remove `public` param for projects. !8736
|
||||
- Allow creating nested groups via UI. !8786
|
||||
- API: Add environment stop action. !8808
|
||||
- Add discussion events to contributions calendar. !8821
|
||||
- Unify issues search behavior by always filtering when ALL labels matches. !8849
|
||||
- V3 deprecated templates endpoints removal. !8853
|
||||
- Expose pipelines as PipelineBasic `api/v3/projects/:id/pipelines`. !8875
|
||||
- Alphabetically sort tags on runner list. !8922 (blackst0ne)
|
||||
- Added documentation for permalinks to most recent build artifacts. !8934 (Christian Godenschwager)
|
||||
- Standardize branch name params as branch on V4 API. !8936
|
||||
- Move /projects/fork/:id to /projects/:id/fork. !8940
|
||||
- Fix small height of activity header page. !8952 (Pavel Sorokin)
|
||||
- Optionally make users created via the API set their password. !8957 (Joost Rijneveld)
|
||||
- GitHub Importer - Find users based on GitHub email address. !8958
|
||||
- API: Consolidate /projects endpoint. !8962
|
||||
- Add filtered search visual tokens. !8969
|
||||
- Store group and project full name and full path in routes table. !8979
|
||||
- Add internal API to notify Gitaly of post receive. !8983
|
||||
- Remove inactive default email services. !8987
|
||||
- Option to prevent signing in from multiple ips. !8998
|
||||
- Download snippets with LF line-endings by default. !8999
|
||||
- Fixes dropdown width in admin project page. !9002
|
||||
- fixes issue number alignment problem in MR and issue list. !9020
|
||||
- Fix CI/CD pipeline retry and take stages order into account. !9021
|
||||
- Make stuck builds detection more performant. !9025
|
||||
- Filter by projects in the end of search. !9030
|
||||
- Add nested groups to the API. !9034
|
||||
- Use ETag to improve performance of issue notes polling. !9036
|
||||
- Add the oauth2_generic OmniAuth strategy. !9048 (Joe Marty)
|
||||
- Brand header logo for pipeline emails. !9049 (Alexis Reigel)
|
||||
- replace npm with yarn and add yarn.lock. !9055
|
||||
- Fix displaying error messages for create label dropdown. !9058 (Tom Koole)
|
||||
- Set dropdown height fixed to 250px and make it scrollable. !9063
|
||||
- Update API docs for new namespace format. !9073 (Markus Koller)
|
||||
- Replace static fixture for behaviors/quick_submit_spec.js. !9086 (winniehell)
|
||||
- Use iids as filter parameter. !9096
|
||||
- Manage user personal access tokens through api and add impersonation tokens. !9099 (Simon Vocella)
|
||||
- Added the ability to copy a branch name to the clipboard. !9103 (Glenn Sayers)
|
||||
- Rename Files::DeleteService to Files::DestroyService. !9110 (dixpac)
|
||||
- Fixes FE Doc broken link. !9120
|
||||
- Add git version to gitlab:env:info. !9128 (Semyon Pupkov)
|
||||
- Replace static fixture for new_branch_spec.js. !9131 (winniehell)
|
||||
- Reintroduce coverage report for JavaScript. !9133 (winniehell)
|
||||
- Fix MR widget jump. !9146
|
||||
- Avoid calling Build#trace_with_state for performance. !9149 (Takuya Noguchi)
|
||||
- fix background color for labels mention in todo. !9155 (mhasbini)
|
||||
- Replace static fixture for behaviors/requires_input_spec.js. !9162 (winniehell)
|
||||
- Added AsciiDoc Snippet to CI/CD Badges. !9164 (Jan Christophersen)
|
||||
- Make Karma output look nicer for CI. !9165 (winniehell)
|
||||
- show 99+ for large count in todos notification bell. !9171 (mhasbini)
|
||||
- Replace static fixture for header_spec.js. !9174 (winniehell)
|
||||
- Replace static fixture for project_title_spec.js. !9175 (winniehell)
|
||||
- Fixes markdown in activity-feed is gray. !9179
|
||||
- Show notifications settings dropdown even if repository feature is disabled. !9180
|
||||
- Fixes job dropdown action throws error in js console. !9182
|
||||
- Set maximum width for mini pipeline graph text so it is not truncated to early. !9188
|
||||
- Added 'Most Recent Activity' header to the User Profile page. !9189 (Jan Christophersen)
|
||||
- Show Issues mentioned / being closed from a Merge Requests title below the 'Accept Merge Request' button. !9194 (Jan Christophersen)
|
||||
- Stop linking to deleted Branches in Activity tabs. !9203 (Jan Christophersen)
|
||||
- Make it possible to pass coverage value to commit status API. !9214 (wendy0402)
|
||||
- Add admin setting for default artifacts expiration. !9219
|
||||
- add :iids param to IssuableFinder (resolve technical dept). !9222 (mhasbini)
|
||||
- Add Links to Branches in Calendar Activity. !9224 (Jan Christophersen)
|
||||
- Fix pipeline retry and cancel buttons on pipeline details page. !9225
|
||||
- Remove es6 file extension from JavaScript files. !9241 (winniehell)
|
||||
- Add Runner's registration/deletion v4 API. !9246
|
||||
- Add merge request count to each issue on issues list. !9252 (blackst0ne)
|
||||
- Fix error in MR widget after /merge slash command. !9259
|
||||
- Clean-up Project navigation order. !9272
|
||||
- Add Runner's jobs v4 API. !9273
|
||||
- Add pipeline trigger API with user permissions. !9277
|
||||
- Enhanced filter issues layout for better mobile experiance. !9280 (Pratik Borsadiya)
|
||||
- Move babel config for instanbul to karma config. !9286 (winniehell)
|
||||
- Document U2F limitations with multiple URLs. !9300
|
||||
- Wrap long Project and Group titles. !9301
|
||||
- Clean-up Groups navigation order. !9309
|
||||
- Truncate long Todo titles for non-mobile screens. !9311
|
||||
- add rake tasks to handle yarn dependencies and update documentation. !9316
|
||||
- API: - Make subscription API more RESTful. Use `post ":project_id/:subscribable_type/:subscribable_id/subscribe"` to subscribe and `post ":project_id/:subscribable_type/:subscribable_id/unsubscribe"` to unsubscribe from a resource. !9325 (Robert Schilling)
|
||||
- API: Moved `DELETE /projects/:id/star` to `POST /projects/:id/unstar`. !9328 (Robert Schilling)
|
||||
- API: Use `visibility` as string parameter everywhere. !9337
|
||||
- Add the Username to the HTTP(S) clone URL of a Repository. !9347 (Jan Christophersen)
|
||||
- Add spec for todo with target_type Commit. !9351 (George Andrinopoulos)
|
||||
- API: Remove `DELETE projects/:id/deploy_keys/:key_id/disable`. !9365 (Robert Schilling)
|
||||
- Fixes includes line number during unfold copy n paste in parallel diff view. !9365
|
||||
- API: Use POST to (un)block a user. !9371 (Robert Schilling)
|
||||
- Remove markup that was showing in tooltip for renamed files. !9374
|
||||
- Drop unused ci_projects table and some unused project_id columns, then rename gl_project_id to project_id. Stop exporting job trace when exporting projects. !9378 (David Wagner)
|
||||
- Adds remote logout functionality to the Authentiq OAuth provider. !9381 (Alexandros Keramidas)
|
||||
- Introduce /award slash command; Allow posting of just an emoji in comment. !9382 (mhasbini)
|
||||
- API: Remove deprecated fields Notes#upvotes and Notes#downvotes. !9384 (Robert Schilling)
|
||||
- Redo internals of Incoming Mail Support. !9385
|
||||
- update Vue to v2.1.10. !9386
|
||||
- Add button to create issue for failing build. !9391 (Alex Sanford)
|
||||
- test compiling production assets and generate webpack bundle report in CI. !9396
|
||||
- API: Return 204 for all delete endpoints. !9397 (Robert Schilling)
|
||||
- Add KUBE_CA_PEM_FILE, deprecate KUBE_CA_PEM. !9398
|
||||
- API: Use POST requests to mark todos as done. !9410 (Robert Schilling)
|
||||
- API project create: Make name or path required. !9416
|
||||
- Add housekeeping endpoint for Projects API. !9421
|
||||
- Fixes delimiter removes when todo marked as done. !9435
|
||||
- Document when current coverage configuration option was introduced. !9443
|
||||
- Uploaded files which content can change now require revalidation on each page load. !9453
|
||||
- Only add a newline in the Markdown Editor if the current line is not empty. !9455 (Jan Christophersen)
|
||||
- Rename builds to job for the v4 API. !9463
|
||||
- API: Remove /groups/owned endpoint. !9505 (Robert Schilling)
|
||||
- API: Return 400 for all validation erros in the mebers API. !9523 (Robert Schilling)
|
||||
- Fixes large file name tooltip cutoff in diff header. !9529
|
||||
- Keep consistent in handling indexOf results. !9531 (Takuya Noguchi)
|
||||
- Make documentation of list repository tree API call more detailed. !9532 (Marius Kleiner)
|
||||
- Fix Sort dropdown reflow issue. !9533 (Jarkko Tuunanen)
|
||||
- Improve grammar in GitLab flow documentation. !9552 (infogrind)
|
||||
- Change default project view for user from readme to files view. !9584
|
||||
- Make it possible to configure blocking manual actions. !9585
|
||||
- Show public RSS feeds to anonymous users. !9596 (Michael Kozono)
|
||||
- Update storage settings to allow extra values per repository storage. !9597
|
||||
- Enable filtering milestones by search criteria in the API. !9606
|
||||
- Ensure archive download is only one directory deep. !9616
|
||||
- Fix updaing commit status when using optional attributes. !9618
|
||||
- Add filter and sorting to dashboard groups page. !9619
|
||||
- Remove deprecated build status badge and related services. !9620
|
||||
- Remove the newrelic gem. !9622 (Robert Schilling)
|
||||
- Rename table ci_commits to ci_pipelines. !9638
|
||||
- Remove various unused CI tables and columns. !9639
|
||||
- Use webpack CommonsChunkPlugin to place common javascript libraries in their own bundles. !9647
|
||||
- CORS: Whitelist pagination headers. !9651 (Robert Schilling)
|
||||
- Remove "subscribed" field from API responses returning list of issues or merge requests. !9661
|
||||
- Highlight line number if specified on diff pages when page loads. !9664
|
||||
- Set default cache key to "default" for jobs. !9666
|
||||
- Set max height to screen height for Zen mode. !9667
|
||||
- GET 'projects/:id/repository/commits' endpoint improvements. !9679 (George Andrinopoulos, Jordan Ryan Reuter)
|
||||
- Restore keyboard shortcuts for "Activity" and "Charts". !9680
|
||||
- Added commit array to Syshook json. !9685 (Gabriele Pongelli)
|
||||
- Document ability to list issues with no labels using API. !9697 (Vignesh Ravichandran)
|
||||
- Fix typo in Gitlab config file. !9702 (medied)
|
||||
- Fix json response in branches controller. !9710 (George Andrinopoulos)
|
||||
- Refactor dropdown_assignee_spec. !9711 (George Andrinopoulos)
|
||||
- Delete artifacts for pages unless expiry date is specified. !9716
|
||||
- Use gitlab-workhorse 1.4.0. !9724
|
||||
- Add GET /projects/:id/pipelines/:pipeline_id/jobs endpoint. !9727
|
||||
- Restrict nested group names to prevent ambiguous routes. !9738
|
||||
- Rename job environment variables to new terminology. !9756
|
||||
- Deprecate usage of `types` configuration entry to describe CI/CD stages. !9766
|
||||
- Moved project settings from the gear drop-down menu to a tab. !9786
|
||||
- Fix "passed with warnings" stage status on MySQL installations. !9802
|
||||
- Fix for creating a project through API when import_url is nil. !9841
|
||||
- Use GitLab Pages v0.4.0. !9896
|
||||
- Reserve few project and nested group paths that have wildcard routes associated. !9898
|
||||
- Speed up project dashboard by caching pipeline status and eager loading routes. !9903
|
||||
- Fixes n+1 query for tags and branches index page. !9905
|
||||
- Hide ancestor groups in the share group dropdown list. !9965
|
||||
- Allow creating merge request even if target branch is not specified in query params. !9968
|
||||
- Removed d3 from the main application.js bundle. !10062
|
||||
- Return 404 in project issues API endpoint when project cannot be found. !10093
|
||||
- Fix positioning of `Scroll to top` button.
|
||||
- Add limit to the number of events showed in cycle analytics.
|
||||
- Only run timeago loops after rendering timeago components.
|
||||
- Increase right side of file header to button stays on same line.
|
||||
- Centers loading icon vertically and horizontally in pipelines table in commit view.
|
||||
- Fix issues mentioned but not closed for external issue trackers.
|
||||
- fix milestone does not automatically assign when create issue from milestone.
|
||||
- Re-add Assign to me link to Merge Request and Issues.
|
||||
- Format timeago date to short format.
|
||||
- Fix errors in slash commands matcher, add simple test coverage. (YarNayar)
|
||||
- Make Git history follow renames again by performing the --skip in Ruby.
|
||||
- Added option to update to owner for group members.
|
||||
- Pick up option from GDK to disable webpack dev server livereload.
|
||||
- Introduce Pipeline Triggers that are user-aware.
|
||||
- Fixed loading spinner position on issue template toggle.
|
||||
- Removed duplicate "Visibility Level" label on New Project page. (Robert Marcano)
|
||||
- Fix 'New Tag' layout on Tags page. (Robert Marcano)
|
||||
- Update API endpoints for raw files.
|
||||
- Fix issuable stale object error handler for js when updating tasklists.
|
||||
- Gather issuable metadata to avoid n+1 queries on index view.
|
||||
- Remove JIRA closed status icon.
|
||||
- Fix z index issues with sidebar.
|
||||
- Fixed long file names overflowing under action buttons.
|
||||
- Only show public emails in atom feeds.
|
||||
- Add Mock CI service/integration for development.
|
||||
- Move tag services to Tags namespace. (dixpac)
|
||||
- Set Auto-Submitted header to mails. (Semyon Pupkov)
|
||||
- Improved diff comment button UX.
|
||||
- Adds API endpoint to fetch all merge request for a single milestone. (Joren De Groof)
|
||||
- Only create unmergeable todos once when MR fails to merge.
|
||||
- Only yield valid references in ReferenceFilter.references_in.
|
||||
- Add member: Always return 409 when a member exists.
|
||||
- Remove plus icon from MR button on compare view.
|
||||
- Re-add the New Project button in nav bar.
|
||||
- Default to subtle MR mege button until CI status is available.
|
||||
- Rename priority sorting option to label priority.
|
||||
- Added headers to protected branch access dropdowns.
|
||||
- Hide issue info when project issues are disabled. (George Andrinopoulos)
|
||||
- removed unused parameter 'status_only: true'.
|
||||
- Left align logo.
|
||||
- Replaced jQuery UI datepicker.
|
||||
- Removed jQuery UI highlight & autocomplete.
|
||||
- Replaced jQuery UI sortable.
|
||||
- Remove readme-only project view preference.
|
||||
- Remove tooltips from label subscription buttons.
|
||||
- Rename retry failed button on pipeline page to just retry.
|
||||
- Align bulk update issues button to the right.
|
||||
- Remove remnants of git annex support.
|
||||
- Dispatch needed JS when creating a new MR in diff view.
|
||||
- Change project count limit from 10 to 100000.
|
||||
- Remove repeated routes.path check for postgresql database. (mhasbini)
|
||||
- Fixed RSS button alignment on activity pages.
|
||||
- Seed abuse reports for development.
|
||||
- Bump Hashie to 3.5.5 and omniauth to 1.4.2 to eliminate warning noise.
|
||||
- Add user deletion permission check in `Users::DestroyService`.
|
||||
- Fix snippets search result spacing.
|
||||
- Sort builds in stage dropdown.
|
||||
- SSH key field updates title after pasting key.
|
||||
- To protect against Server-side Request Forgery project import URLs are now prohibited against localhost or the server IP except for the assigned instance URL and port. Imports are also prohibited from ports below 1024 with the exception of ports 22, 80, and 443.
|
||||
- Remove fixed positioning from top nav.
|
||||
- Deduplicate markdown task lists.
|
||||
- update issue count when closing/reopening an issue.
|
||||
- Update code editor (ACE) to 1.2.6, to fix input problems with compose key.
|
||||
- Improves a11y in sidebar by adding aria-hidden attributes in i tags and by fixing two broken aria-hidden attributes.
|
||||
- Use redis channel to post notifications.
|
||||
- Removed top border from user contribution calendar.
|
||||
- Added user callouts to the projects dashboard and user profile.
|
||||
- Removes label when moving issue to another list that it is currently in.
|
||||
- Return 202 with JSON body on async removals on V4 API.
|
||||
- Add filtered search to MR page.
|
||||
- Add frequently used emojis back to awards menu.
|
||||
- don't animate logo when downloading files.
|
||||
- Stop setting Strict-Transport-Securty header from within the app.
|
||||
- Use "branch_name" instead "branch" on V3 branch creation API.
|
||||
- Fix archive prefix bug for refs containing dots.
|
||||
- ensure MR widget dropdown is same color as button.
|
||||
- Adds Pending and Finished tabs to pipelines page.
|
||||
- Decrease tanuki logo size.
|
||||
- Add all available statuses to scope filter for project builds endpoint. (George Andrinopoulos)
|
||||
- Add filter param for project membership for current_user in API v4.
|
||||
- Remove help link from right dropdown.
|
||||
- Fix jobs table header height.
|
||||
- Combined deploy keys, push rules, protect branches and mirror repository settings options into a single one called Repository.
|
||||
- Add storage class configuration option for Amazon S3 remote backups. (Jon Keys)
|
||||
- Specify in the documentation that only projects owners can transfer projects.
|
||||
- Use native unicode emojis.
|
||||
- Clear ActiveRecord connections before starting Sidekiq.
|
||||
- Update account view to display new username.
|
||||
- Narrow environment payload by using basic project details resource.
|
||||
- Creating a new branch from an issue will automatically initialize a repository if one doesn't already exist.
|
||||
- Dashboard project search keeps selected sort & filters.
|
||||
- Visually show expanded diff lines cant have comments.
|
||||
- Use full group name in GFM group reference title.
|
||||
- Make a default namespace of Kubernetes service to contain project ID.
|
||||
- Present GitLab version for each V3 to V4 API change on v3_to_v4.md.
|
||||
- Add badges to global dropdown.
|
||||
- Changed coverage reg expression placeholder text to be more like a placeholder.
|
||||
- Show members of parent groups on project members page.
|
||||
- Fix grammer issue in admin/runners.
|
||||
- Allow slashes in slash command arguments.
|
||||
- Adds paginationd and folders view to environments table.
|
||||
- hide loading spinners for server-rendered sidebar fields.
|
||||
- Change development tanuki favicon colors to match logo color order.
|
||||
- API issues - support filtering by iids.
|
||||
|
||||
## 8.17.4 (2017-03-19)
|
||||
|
||||
- Only show public emails in atom feeds.
|
||||
|
|
|
@ -82,7 +82,7 @@ If a contributor is no longer actively working on a submitted merge request
|
|||
we can decide that the merge request will be finished by one of our
|
||||
[Merge request coaches][team] or close the merge request. We make this decision
|
||||
based on how important the change is for our product vision. If a Merge request
|
||||
coach is going to finish the merge request we assign the
|
||||
coach is going to finish the merge request we assign the
|
||||
~"coach will finish" label.
|
||||
|
||||
## Helping others
|
||||
|
@ -479,8 +479,7 @@ merge request:
|
|||
1. [Rails](https://github.com/bbatsov/rails-style-guide)
|
||||
1. [Newlines styleguide][newlines-styleguide]
|
||||
1. [Testing](doc/development/testing.md)
|
||||
1. [JavaScript (ES6)](https://github.com/airbnb/javascript)
|
||||
1. [JavaScript (ES5)](https://github.com/airbnb/javascript/tree/es5-deprecated/es5)
|
||||
1. [JavaScript styleguide][js-styleguide]
|
||||
1. [SCSS styleguide][scss-styleguide]
|
||||
1. [Shell commands](doc/development/shell_commands.md) created by GitLab
|
||||
contributors to enhance security
|
||||
|
@ -549,7 +548,8 @@ available at [http://contributor-covenant.org/version/1/1/0/](http://contributor
|
|||
[rss-naming]: https://github.com/bbatsov/ruby-style-guide/blob/master/README.md#naming
|
||||
[changelog]: doc/development/changelog.md "Generate a changelog entry"
|
||||
[doc-styleguide]: doc/development/doc_styleguide.md "Documentation styleguide"
|
||||
[scss-styleguide]: doc/development/scss_styleguide.md "SCSS styleguide"
|
||||
[js-styleguide]: doc/development/fe_guide/style_guide_js.md "JavaScript styleguide"
|
||||
[scss-styleguide]: doc/development/fe_guide/style_guide_scss.md "SCSS styleguide"
|
||||
[newlines-styleguide]: doc/development/newlines_styleguide.md "Newlines styleguide"
|
||||
[UX Guide for GitLab]: http://docs.gitlab.com/ce/development/ux_guide/
|
||||
[license-finder-doc]: doc/development/licensing.md
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.3.0
|
||||
0.4.0
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.4.1
|
||||
1.4.2
|
||||
|
|
18
Gemfile
18
Gemfile
|
@ -244,7 +244,7 @@ gem 'net-ssh', '~> 3.0.1'
|
|||
gem 'base32', '~> 0.3.0'
|
||||
|
||||
# Sentry integration
|
||||
gem 'sentry-raven', '~> 2.0.0'
|
||||
gem 'sentry-raven', '~> 2.4.0'
|
||||
|
||||
gem 'premailer-rails', '~> 1.9.0'
|
||||
|
||||
|
@ -257,15 +257,14 @@ end
|
|||
|
||||
group :development do
|
||||
gem 'foreman', '~> 0.78.0'
|
||||
gem 'brakeman', '~> 3.4.0', require: false
|
||||
gem 'brakeman', '~> 3.6.0', require: false
|
||||
|
||||
gem 'letter_opener_web', '~> 1.3.0'
|
||||
gem 'bullet', '~> 5.2.0', require: false
|
||||
gem 'bullet', '~> 5.5.0', require: false
|
||||
gem 'rblineprof', '~> 0.3.6', platform: :mri, require: false
|
||||
gem 'web-console', '~> 2.0'
|
||||
|
||||
# Better errors handler
|
||||
gem 'better_errors', '~> 1.0.1'
|
||||
gem 'better_errors', '~> 2.1.0'
|
||||
gem 'binding_of_caller', '~> 0.7.2'
|
||||
|
||||
# thin instead webrick
|
||||
|
@ -297,7 +296,7 @@ group :development, :test do
|
|||
gem 'capybara-screenshot', '~> 1.0.0'
|
||||
gem 'poltergeist', '~> 1.9.0'
|
||||
|
||||
gem 'spring', '~> 1.7.0'
|
||||
gem 'spring', '~> 2.0.0'
|
||||
gem 'spring-commands-rspec', '~> 1.0.4'
|
||||
gem 'spring-commands-spinach', '~> 1.1.0'
|
||||
|
||||
|
@ -305,8 +304,8 @@ group :development, :test do
|
|||
gem 'rubocop-rspec', '~> 1.12.0', require: false
|
||||
gem 'scss_lint', '~> 0.47.0', require: false
|
||||
gem 'haml_lint', '~> 0.21.0', require: false
|
||||
gem 'simplecov', '0.12.0', require: false
|
||||
gem 'flay', '~> 2.6.1', require: false
|
||||
gem 'simplecov', '~> 0.14.0', require: false
|
||||
gem 'flay', '~> 2.8.0', require: false
|
||||
gem 'bundler-audit', '~> 0.5.0', require: false
|
||||
|
||||
gem 'benchmark-ips', '~> 2.3.0', require: false
|
||||
|
@ -323,10 +322,11 @@ group :test do
|
|||
gem 'shoulda-matchers', '~> 2.8.0', require: false
|
||||
gem 'email_spec', '~> 1.6.0'
|
||||
gem 'json-schema', '~> 2.6.2'
|
||||
gem 'webmock', '~> 1.21.0'
|
||||
gem 'webmock', '~> 1.24.0'
|
||||
gem 'test_after_commit', '~> 1.1'
|
||||
gem 'sham_rack', '~> 1.3.6'
|
||||
gem 'timecop', '~> 0.8.0'
|
||||
gem 'concurrent-ruby', '~> 1.0.5'
|
||||
end
|
||||
|
||||
gem 'octokit', '~> 4.6.2'
|
||||
|
|
64
Gemfile.lock
64
Gemfile.lock
|
@ -75,19 +75,20 @@ GEM
|
|||
base32 (0.3.2)
|
||||
bcrypt (3.1.11)
|
||||
benchmark-ips (2.3.0)
|
||||
better_errors (1.0.1)
|
||||
better_errors (2.1.1)
|
||||
coderay (>= 1.0.0)
|
||||
erubis (>= 2.6.6)
|
||||
rack (>= 0.9.0)
|
||||
bindata (2.3.5)
|
||||
binding_of_caller (0.7.2)
|
||||
debug_inspector (>= 0.0.1)
|
||||
bootstrap-sass (3.3.6)
|
||||
autoprefixer-rails (>= 5.2.1)
|
||||
sass (>= 3.3.4)
|
||||
brakeman (3.4.1)
|
||||
brakeman (3.6.1)
|
||||
browser (2.2.0)
|
||||
builder (3.2.3)
|
||||
bullet (5.2.0)
|
||||
bullet (5.5.1)
|
||||
activesupport (>= 3.0.0)
|
||||
uniform_notifier (~> 1.10.0)
|
||||
bundler-audit (0.5.0)
|
||||
|
@ -101,7 +102,7 @@ GEM
|
|||
rack (>= 1.0.0)
|
||||
rack-test (>= 0.5.4)
|
||||
xpath (~> 2.0)
|
||||
capybara-screenshot (1.0.11)
|
||||
capybara-screenshot (1.0.14)
|
||||
capybara (>= 1.0, < 3)
|
||||
launchy
|
||||
carrierwave (0.11.2)
|
||||
|
@ -117,7 +118,7 @@ GEM
|
|||
numerizer (~> 0.1.1)
|
||||
chunky_png (1.3.5)
|
||||
cliver (0.3.2)
|
||||
coderay (1.1.0)
|
||||
coderay (1.1.1)
|
||||
coercible (1.0.0)
|
||||
descendants_tracker (~> 0.0.1)
|
||||
coffee-rails (4.1.1)
|
||||
|
@ -128,7 +129,7 @@ GEM
|
|||
execjs
|
||||
coffee-script-source (1.10.0)
|
||||
colorize (0.7.7)
|
||||
concurrent-ruby (1.0.4)
|
||||
concurrent-ruby (1.0.5)
|
||||
connection_pool (2.2.1)
|
||||
crack (0.4.3)
|
||||
safe_yaml (~> 1.0.0)
|
||||
|
@ -200,7 +201,9 @@ GEM
|
|||
multi_json
|
||||
ffaker (2.4.0)
|
||||
ffi (1.9.10)
|
||||
flay (2.6.1)
|
||||
flay (2.8.1)
|
||||
erubis (~> 2.7.0)
|
||||
path_expander (~> 1.0)
|
||||
ruby_parser (~> 3.0)
|
||||
sexp_processor (~> 4.0)
|
||||
flowdock (0.7.1)
|
||||
|
@ -340,6 +343,7 @@ GEM
|
|||
temple (~> 0.7.6)
|
||||
thor
|
||||
tilt
|
||||
hashdiff (0.3.2)
|
||||
hashie (3.5.5)
|
||||
health_check (2.6.0)
|
||||
rails (>= 4.0)
|
||||
|
@ -518,6 +522,7 @@ GEM
|
|||
activerecord (>= 4.0, < 5.1)
|
||||
parser (2.4.0.0)
|
||||
ast (~> 2.2)
|
||||
path_expander (1.0.1)
|
||||
pg (0.18.4)
|
||||
poltergeist (1.9.0)
|
||||
capybara (~> 2.1)
|
||||
|
@ -532,14 +537,14 @@ GEM
|
|||
premailer-rails (1.9.2)
|
||||
actionmailer (>= 3, < 6)
|
||||
premailer (~> 1.7, >= 1.7.9)
|
||||
pry (0.10.3)
|
||||
pry (0.10.4)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.8.1)
|
||||
slop (~> 3.4)
|
||||
pry-byebug (3.4.1)
|
||||
pry-byebug (3.4.2)
|
||||
byebug (~> 9.0)
|
||||
pry (~> 0.10)
|
||||
pry-rails (0.3.4)
|
||||
pry-rails (0.3.5)
|
||||
pry (>= 0.9.10)
|
||||
pyu-ruby-sasl (0.0.3.3)
|
||||
rack (1.6.5)
|
||||
|
@ -671,7 +676,7 @@ GEM
|
|||
ruby-progressbar (1.8.1)
|
||||
ruby-saml (1.4.1)
|
||||
nokogiri (>= 1.5.10)
|
||||
ruby_parser (3.8.2)
|
||||
ruby_parser (3.8.4)
|
||||
sexp_processor (~> 4.1)
|
||||
rubyntlm (0.5.2)
|
||||
rubypants (0.2.0)
|
||||
|
@ -700,10 +705,10 @@ GEM
|
|||
activesupport (>= 3.1)
|
||||
select2-rails (3.5.9.3)
|
||||
thor (~> 0.14)
|
||||
sentry-raven (2.0.2)
|
||||
faraday (>= 0.7.6, < 0.10.x)
|
||||
sentry-raven (2.4.0)
|
||||
faraday (>= 0.7.6, < 1.0)
|
||||
settingslogic (2.0.9)
|
||||
sexp_processor (4.7.0)
|
||||
sexp_processor (4.8.0)
|
||||
sham_rack (1.3.6)
|
||||
rack
|
||||
shoulda-matchers (2.8.0)
|
||||
|
@ -724,7 +729,7 @@ GEM
|
|||
faraday (~> 0.9)
|
||||
jwt (~> 1.5)
|
||||
multi_json (~> 1.10)
|
||||
simplecov (0.12.0)
|
||||
simplecov (0.14.1)
|
||||
docile (~> 1.1.0)
|
||||
json (>= 1.8, < 3)
|
||||
simplecov-html (~> 0.10.0)
|
||||
|
@ -741,7 +746,8 @@ GEM
|
|||
spinach (>= 0.4)
|
||||
spinach-rerun-reporter (0.0.2)
|
||||
spinach (~> 0.8)
|
||||
spring (1.7.2)
|
||||
spring (2.0.1)
|
||||
activesupport (>= 4.2)
|
||||
spring-commands-rspec (1.0.4)
|
||||
spring (>= 0.9.1)
|
||||
spring-commands-spinach (1.1.0)
|
||||
|
@ -813,14 +819,10 @@ GEM
|
|||
vmstat (2.3.0)
|
||||
warden (1.2.6)
|
||||
rack (>= 1.0)
|
||||
web-console (2.3.0)
|
||||
activemodel (>= 4.0)
|
||||
binding_of_caller (>= 0.7.2)
|
||||
railties (>= 4.0)
|
||||
sprockets-rails (>= 2.0, < 4.0)
|
||||
webmock (1.21.0)
|
||||
webmock (1.24.6)
|
||||
addressable (>= 2.3.6)
|
||||
crack (>= 0.3.2)
|
||||
hashdiff
|
||||
webpack-rails (0.9.9)
|
||||
rails (>= 3.2.0)
|
||||
websocket-driver (0.6.3)
|
||||
|
@ -854,12 +856,12 @@ DEPENDENCIES
|
|||
babosa (~> 1.0.2)
|
||||
base32 (~> 0.3.0)
|
||||
benchmark-ips (~> 2.3.0)
|
||||
better_errors (~> 1.0.1)
|
||||
better_errors (~> 2.1.0)
|
||||
binding_of_caller (~> 0.7.2)
|
||||
bootstrap-sass (~> 3.3.0)
|
||||
brakeman (~> 3.4.0)
|
||||
brakeman (~> 3.6.0)
|
||||
browser (~> 2.2)
|
||||
bullet (~> 5.2.0)
|
||||
bullet (~> 5.5.0)
|
||||
bundler-audit (~> 0.5.0)
|
||||
capybara (~> 2.6.2)
|
||||
capybara-screenshot (~> 1.0.0)
|
||||
|
@ -868,6 +870,7 @@ DEPENDENCIES
|
|||
chronic (~> 0.10.2)
|
||||
chronic_duration (~> 0.10.6)
|
||||
coffee-rails (~> 4.1.0)
|
||||
concurrent-ruby (~> 1.0.5)
|
||||
connection_pool (~> 2.0)
|
||||
creole (~> 0.5.0)
|
||||
d3_rails (~> 3.5.0)
|
||||
|
@ -884,7 +887,7 @@ DEPENDENCIES
|
|||
email_spec (~> 1.6.0)
|
||||
factory_girl_rails (~> 4.7.0)
|
||||
ffaker (~> 2.4)
|
||||
flay (~> 2.6.1)
|
||||
flay (~> 2.8.0)
|
||||
fog-aws (~> 0.9)
|
||||
fog-core (~> 1.40)
|
||||
fog-google (~> 0.5)
|
||||
|
@ -990,18 +993,18 @@ DEPENDENCIES
|
|||
scss_lint (~> 0.47.0)
|
||||
seed-fu (~> 2.3.5)
|
||||
select2-rails (~> 3.5.9)
|
||||
sentry-raven (~> 2.0.0)
|
||||
sentry-raven (~> 2.4.0)
|
||||
settingslogic (~> 2.0.9)
|
||||
sham_rack (~> 1.3.6)
|
||||
shoulda-matchers (~> 2.8.0)
|
||||
sidekiq (~> 4.2.7)
|
||||
sidekiq-cron (~> 0.4.4)
|
||||
sidekiq-limit_fetch (~> 3.4)
|
||||
simplecov (= 0.12.0)
|
||||
simplecov (~> 0.14.0)
|
||||
slack-notifier (~> 1.5.1)
|
||||
spinach-rails (~> 0.2.1)
|
||||
spinach-rerun-reporter (~> 0.0.2)
|
||||
spring (~> 1.7.0)
|
||||
spring (~> 2.0.0)
|
||||
spring-commands-rspec (~> 1.0.4)
|
||||
spring-commands-spinach (~> 1.1.0)
|
||||
sprockets (~> 3.7.0)
|
||||
|
@ -1022,8 +1025,7 @@ DEPENDENCIES
|
|||
version_sorter (~> 2.1.0)
|
||||
virtus (~> 1.0.1)
|
||||
vmstat (~> 2.3.0)
|
||||
web-console (~> 2.0)
|
||||
webmock (~> 1.21.0)
|
||||
webmock (~> 1.24.0)
|
||||
webpack-rails (~> 0.9.9)
|
||||
wikicloth (= 0.8.1)
|
||||
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
# GitLab
|
||||
|
||||
[![Build status](https://gitlab.com/gitlab-org/gitlab-ce/badges/master/build.svg)](https://gitlab.com/gitlab-org/gitlab-ce/commits/master)
|
||||
[![CE coverage report](https://gitlab.com/gitlab-org/gitlab-ce/badges/master/coverage.svg?job=coverage)](https://gitlab-org.gitlab.io/gitlab-ce/coverage-ruby)
|
||||
[![Overall test coverage](https://gitlab.com/gitlab-org/gitlab-ce/badges/master/coverage.svg)](https://gitlab.com/gitlab-org/gitlab-ce/pipelines)
|
||||
[![Code Climate](https://codeclimate.com/github/gitlabhq/gitlabhq.svg)](https://codeclimate.com/github/gitlabhq/gitlabhq)
|
||||
[![Core Infrastructure Initiative Best Practices](https://bestpractices.coreinfrastructure.org/projects/42/badge)](https://bestpractices.coreinfrastructure.org/projects/42)
|
||||
|
||||
## Test coverage
|
||||
|
||||
- [![Ruby coverage](https://gitlab.com/gitlab-org/gitlab-ce/badges/master/coverage.svg?job=coverage)](https://gitlab-org.gitlab.io/gitlab-ce/coverage-ruby) Ruby
|
||||
- [![JavaScript coverage](https://gitlab.com/gitlab-org/gitlab-ce/badges/master/coverage.svg?job=rake+karma)](https://gitlab-org.gitlab.io/gitlab-ce/coverage-javascript) JavaScript
|
||||
|
||||
## Canonical source
|
||||
|
||||
The canonical source of GitLab Community Edition is [hosted on GitLab.com](https://gitlab.com/gitlab-org/gitlab-ce/).
|
||||
|
|
|
@ -1 +1 @@
|
|||
<svg width="12" height="15" viewBox="0 0 12 15" xmlns="http://www.w3.org/2000/svg"><path d="M10.267 11.028V5.167c-.028-.728-.318-1.372-.878-1.923-.56-.55-1.194-.85-1.922-.877h-.934V.5l-2.8 2.8 2.8 2.8V4.233h.934a.976.976 0 0 1 .644.29.88.88 0 0 1 .289.644v5.861a1.86 1.86 0 0 0 .933 3.472 1.86 1.86 0 0 0 .934-3.472zM3.733 3.3a1.86 1.86 0 0 0-1.866-1.867 1.86 1.86 0 0 0-.934 3.472v6.123a1.86 1.86 0 0 0 .933 3.472 1.86 1.86 0 0 0 .934-3.472V4.905c.55-.317.933-.914.933-1.605z" fill-rule="nonzero"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="m5 5.563v4.875c1.024.4 1.75 1.397 1.75 2.563 0 1.519-1.231 2.75-2.75 2.75-1.519 0-2.75-1.231-2.75-2.75 0-1.166.726-2.162 1.75-2.563v-4.875c-1.024-.4-1.75-1.397-1.75-2.563 0-1.519 1.231-2.75 2.75-2.75 1.519 0 2.75 1.231 2.75 2.75 0 1.166-.726 2.162-1.75 2.563m-1 8.687c.69 0 1.25-.56 1.25-1.25 0-.69-.56-1.25-1.25-1.25-.69 0-1.25.56-1.25 1.25 0 .69.56 1.25 1.25 1.25m0-10c.69 0 1.25-.56 1.25-1.25 0-.69-.56-1.25-1.25-1.25-.69 0-1.25.56-1.25 1.25 0 .69.56 1.25 1.25 1.25"/><path d="m10.501 2c1.381.001 2.499 1.125 2.499 2.506v5.931c1.024.4 1.75 1.397 1.75 2.563 0 1.519-1.231 2.75-2.75 2.75-1.519 0-2.75-1.231-2.75-2.75 0-1.166.726-2.162 1.75-2.563v-5.931c0-.279-.225-.506-.499-.506v.926c0 .346-.244.474-.569.271l-2.952-1.844c-.314-.196-.325-.507 0-.71l2.952-1.844c.314-.196.569-.081.569.271v.93m1.499 12.25c.69 0 1.25-.56 1.25-1.25 0-.69-.56-1.25-1.25-1.25-.69 0-1.25.56-1.25 1.25 0 .69.56 1.25 1.25 1.25"/></svg>
|
Before Width: | Height: | Size: 506 B After Width: | Height: | Size: 981 B |
|
@ -1,6 +1,7 @@
|
|||
/* eslint-disable no-param-reassign, class-methods-use-this */
|
||||
/* global Pager */
|
||||
/* global Cookies */
|
||||
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
class Activities {
|
||||
constructor() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* global Cookies */
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
import emojiMap from 'emojis/digests.json';
|
||||
import emojiAliases from 'emojis/aliases.json';
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
$('body').on('click', '.js-toggle-button', function(e) {
|
||||
toggleContainer($(this).closest('.js-toggle-container'));
|
||||
|
||||
const targetTag = e.target.tagName.toLowerCase();
|
||||
const targetTag = e.currentTarget.tagName.toLowerCase();
|
||||
if (targetTag === 'a' || targetTag === 'button') {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
/* eslint-disable no-param-reassign, comma-dangle */
|
||||
/* global Api */
|
||||
|
||||
require('./template_selector');
|
||||
|
||||
((global) => {
|
||||
class BlobCiYamlSelector extends gl.TemplateSelector {
|
||||
requestFile(query) {
|
||||
return Api.gitlabCiYml(query.name, this.requestFileSuccess.bind(this));
|
||||
}
|
||||
|
||||
requestFileSuccess(file) {
|
||||
return super.requestFileSuccess(file);
|
||||
}
|
||||
}
|
||||
|
||||
global.BlobCiYamlSelector = BlobCiYamlSelector;
|
||||
|
||||
class BlobCiYamlSelectors {
|
||||
constructor({ editor, $dropdowns } = {}) {
|
||||
this.editor = editor;
|
||||
this.$dropdowns = $dropdowns || $('.js-gitlab-ci-yml-selector');
|
||||
this.initSelectors();
|
||||
}
|
||||
|
||||
initSelectors() {
|
||||
const editor = this.editor;
|
||||
this.$dropdowns.each((i, dropdown) => {
|
||||
const $dropdown = $(dropdown);
|
||||
return new BlobCiYamlSelector({
|
||||
editor,
|
||||
pattern: /(.gitlab-ci.yml)/,
|
||||
data: $dropdown.data('data'),
|
||||
wrapper: $dropdown.closest('.js-gitlab-ci-yml-selector-wrap'),
|
||||
dropdown: $dropdown
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
global.BlobCiYamlSelectors = BlobCiYamlSelectors;
|
||||
})(window.gl || (window.gl = {}));
|
|
@ -1,19 +0,0 @@
|
|||
/* global Api */
|
||||
|
||||
require('./template_selector');
|
||||
|
||||
(() => {
|
||||
const global = window.gl || (window.gl = {});
|
||||
|
||||
class BlobDockerfileSelector extends gl.TemplateSelector {
|
||||
requestFile(query) {
|
||||
return Api.dockerfileYml(query.name, this.requestFileSuccess.bind(this));
|
||||
}
|
||||
|
||||
requestFileSuccess(file) {
|
||||
return super.requestFileSuccess(file);
|
||||
}
|
||||
}
|
||||
|
||||
global.BlobDockerfileSelector = BlobDockerfileSelector;
|
||||
})();
|
|
@ -1,27 +0,0 @@
|
|||
(() => {
|
||||
const global = window.gl || (window.gl = {});
|
||||
|
||||
class BlobDockerfileSelectors {
|
||||
constructor({ editor, $dropdowns } = {}) {
|
||||
this.editor = editor;
|
||||
this.$dropdowns = $dropdowns || $('.js-dockerfile-selector');
|
||||
this.initSelectors();
|
||||
}
|
||||
|
||||
initSelectors() {
|
||||
const editor = this.editor;
|
||||
this.$dropdowns.each((i, dropdown) => {
|
||||
const $dropdown = $(dropdown);
|
||||
return new gl.BlobDockerfileSelector({
|
||||
editor,
|
||||
pattern: /(Dockerfile)/,
|
||||
data: $dropdown.data('data'),
|
||||
wrapper: $dropdown.closest('.js-dockerfile-selector-wrap'),
|
||||
dropdown: $dropdown,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
global.BlobDockerfileSelectors = BlobDockerfileSelectors;
|
||||
})();
|
|
@ -1,66 +1,63 @@
|
|||
/* eslint-disable func-names, space-before-function-paren, wrap-iife, one-var, no-var, one-var-declaration-per-line, camelcase, object-shorthand, quotes, comma-dangle, prefer-arrow-callback, no-unused-vars, prefer-template, no-useless-escape, no-alert, max-len */
|
||||
/* eslint-disable func-names, object-shorthand, prefer-arrow-callback */
|
||||
/* global Dropzone */
|
||||
|
||||
(function() {
|
||||
this.BlobFileDropzone = (function() {
|
||||
function BlobFileDropzone(form, method) {
|
||||
var dropzone, form_dropzone, submitButton;
|
||||
form_dropzone = form.find('.dropzone');
|
||||
Dropzone.autoDiscover = false;
|
||||
dropzone = form_dropzone.dropzone({
|
||||
autoDiscover: false,
|
||||
autoProcessQueue: false,
|
||||
url: form.attr('action'),
|
||||
// Rails uses a hidden input field for PUT
|
||||
// http://stackoverflow.com/questions/21056482/how-to-set-method-put-in-form-tag-in-rails
|
||||
method: method,
|
||||
clickable: true,
|
||||
uploadMultiple: false,
|
||||
paramName: "file",
|
||||
maxFilesize: gon.max_file_size || 10,
|
||||
parallelUploads: 1,
|
||||
maxFiles: 1,
|
||||
addRemoveLinks: true,
|
||||
previewsContainer: '.dropzone-previews',
|
||||
headers: {
|
||||
"X-CSRF-Token": $("meta[name=\"csrf-token\"]").attr("content")
|
||||
},
|
||||
init: function() {
|
||||
this.on('addedfile', function(file) {
|
||||
$('.dropzone-alerts').html('').hide();
|
||||
});
|
||||
this.on('success', function(header, response) {
|
||||
window.location.href = response.filePath;
|
||||
});
|
||||
this.on('maxfilesexceeded', function(file) {
|
||||
this.removeFile(file);
|
||||
});
|
||||
return this.on('sending', function(file, xhr, formData) {
|
||||
formData.append('target_branch', form.find('input[name="target_branch"]').val());
|
||||
formData.append('create_merge_request', form.find('.js-create-merge-request').val());
|
||||
formData.append('commit_message', form.find('.js-commit-message').val());
|
||||
});
|
||||
},
|
||||
// Override behavior of adding error underneath preview
|
||||
error: function(file, errorMessage) {
|
||||
var stripped;
|
||||
stripped = $("<div/>").html(errorMessage).text();
|
||||
$('.dropzone-alerts').html('Error uploading file: \"' + stripped + '\"').show();
|
||||
this.removeFile(file);
|
||||
}
|
||||
});
|
||||
submitButton = form.find('#submit-all')[0];
|
||||
submitButton.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (dropzone[0].dropzone.getQueuedFiles().length === 0) {
|
||||
alert("Please select a file");
|
||||
}
|
||||
dropzone[0].dropzone.processQueue();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
export default class BlobFileDropzone {
|
||||
constructor(form, method) {
|
||||
const formDropzone = form.find('.dropzone');
|
||||
Dropzone.autoDiscover = false;
|
||||
|
||||
return BlobFileDropzone;
|
||||
})();
|
||||
}).call(window);
|
||||
const dropzone = formDropzone.dropzone({
|
||||
autoDiscover: false,
|
||||
autoProcessQueue: false,
|
||||
url: form.attr('action'),
|
||||
// Rails uses a hidden input field for PUT
|
||||
// http://stackoverflow.com/questions/21056482/how-to-set-method-put-in-form-tag-in-rails
|
||||
method: method,
|
||||
clickable: true,
|
||||
uploadMultiple: false,
|
||||
paramName: 'file',
|
||||
maxFilesize: gon.max_file_size || 10,
|
||||
parallelUploads: 1,
|
||||
maxFiles: 1,
|
||||
addRemoveLinks: true,
|
||||
previewsContainer: '.dropzone-previews',
|
||||
headers: {
|
||||
'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content'),
|
||||
},
|
||||
init: function () {
|
||||
this.on('addedfile', function () {
|
||||
$('.dropzone-alerts').html('').hide();
|
||||
});
|
||||
this.on('success', function (header, response) {
|
||||
window.location.href = response.filePath;
|
||||
});
|
||||
this.on('maxfilesexceeded', function (file) {
|
||||
this.removeFile(file);
|
||||
});
|
||||
this.on('sending', function (file, xhr, formData) {
|
||||
formData.append('target_branch', form.find('input[name="target_branch"]').val());
|
||||
formData.append('create_merge_request', form.find('.js-create-merge-request').val());
|
||||
formData.append('commit_message', form.find('.js-commit-message').val());
|
||||
});
|
||||
},
|
||||
// Override behavior of adding error underneath preview
|
||||
error: function (file, errorMessage) {
|
||||
const stripped = $('<div/>').html(errorMessage).text();
|
||||
$('.dropzone-alerts').html(`Error uploading file: "${stripped}"`).show();
|
||||
this.removeFile(file);
|
||||
},
|
||||
});
|
||||
|
||||
const submitButton = form.find('#submit-all')[0];
|
||||
submitButton.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (dropzone[0].dropzone.getQueuedFiles().length === 0) {
|
||||
// eslint-disable-next-line no-alert
|
||||
alert('Please select a file');
|
||||
}
|
||||
dropzone[0].dropzone.processQueue();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
/* eslint-disable func-names, space-before-function-paren, max-len, one-var, no-var, no-restricted-syntax, vars-on-top, no-use-before-define, no-param-reassign, new-cap, no-underscore-dangle, wrap-iife, prefer-rest-params */
|
||||
/* global Api */
|
||||
|
||||
require('./template_selector');
|
||||
|
||||
(function() {
|
||||
var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
this.BlobGitignoreSelector = (function(superClass) {
|
||||
extend(BlobGitignoreSelector, superClass);
|
||||
|
||||
function BlobGitignoreSelector() {
|
||||
return BlobGitignoreSelector.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
BlobGitignoreSelector.prototype.requestFile = function(query) {
|
||||
return Api.gitignoreText(query.name, this.requestFileSuccess.bind(this));
|
||||
};
|
||||
|
||||
return BlobGitignoreSelector;
|
||||
})(gl.TemplateSelector);
|
||||
}).call(window);
|
|
@ -1,26 +0,0 @@
|
|||
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-unused-expressions, no-cond-assign, no-sequences, comma-dangle, max-len */
|
||||
/* global BlobGitignoreSelector */
|
||||
|
||||
(function() {
|
||||
this.BlobGitignoreSelectors = (function() {
|
||||
function BlobGitignoreSelectors(opts) {
|
||||
var ref;
|
||||
this.$dropdowns = (ref = opts.$dropdowns) != null ? ref : $('.js-gitignore-selector'), this.editor = opts.editor;
|
||||
this.$dropdowns.each((function(_this) {
|
||||
return function(i, dropdown) {
|
||||
var $dropdown;
|
||||
$dropdown = $(dropdown);
|
||||
return new BlobGitignoreSelector({
|
||||
pattern: /(.gitignore)/,
|
||||
data: $dropdown.data('data'),
|
||||
wrapper: $dropdown.closest('.js-gitignore-selector-wrap'),
|
||||
dropdown: $dropdown,
|
||||
editor: _this.editor
|
||||
});
|
||||
};
|
||||
})(this));
|
||||
}
|
||||
|
||||
return BlobGitignoreSelectors;
|
||||
})();
|
||||
}).call(window);
|
|
@ -1,28 +0,0 @@
|
|||
/* eslint-disable func-names, space-before-function-paren, max-len, one-var, no-var, no-restricted-syntax, vars-on-top, no-use-before-define, no-param-reassign, new-cap, no-underscore-dangle, wrap-iife, prefer-rest-params, comma-dangle */
|
||||
/* global Api */
|
||||
|
||||
require('./template_selector');
|
||||
|
||||
(function() {
|
||||
var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
hasProp = {}.hasOwnProperty;
|
||||
|
||||
this.BlobLicenseSelector = (function(superClass) {
|
||||
extend(BlobLicenseSelector, superClass);
|
||||
|
||||
function BlobLicenseSelector() {
|
||||
return BlobLicenseSelector.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
BlobLicenseSelector.prototype.requestFile = function(query) {
|
||||
var data;
|
||||
data = {
|
||||
project: this.dropdown.data('project'),
|
||||
fullname: this.dropdown.data('fullname')
|
||||
};
|
||||
return Api.licenseText(query.id, data, this.requestFileSuccess.bind(this));
|
||||
};
|
||||
|
||||
return BlobLicenseSelector;
|
||||
})(gl.TemplateSelector);
|
||||
}).call(window);
|
|
@ -1,23 +0,0 @@
|
|||
/* eslint-disable no-unused-vars, no-param-reassign */
|
||||
/* global BlobLicenseSelector */
|
||||
|
||||
((global) => {
|
||||
class BlobLicenseSelectors {
|
||||
constructor({ $dropdowns, editor }) {
|
||||
this.$dropdowns = $('.js-license-selector');
|
||||
this.editor = editor;
|
||||
this.$dropdowns.each((i, dropdown) => {
|
||||
const $dropdown = $(dropdown);
|
||||
return new BlobLicenseSelector({
|
||||
editor,
|
||||
pattern: /^(.+\/)?(licen[sc]e|copying)($|\.)/i,
|
||||
data: $dropdown.data('data'),
|
||||
wrapper: $dropdown.closest('.js-license-selector-wrap'),
|
||||
dropdown: $dropdown,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
global.BlobLicenseSelectors = BlobLicenseSelectors;
|
||||
})(window.gl || (window.gl = {}));
|
|
@ -1,101 +0,0 @@
|
|||
/* eslint-disable comma-dangle, object-shorthand, func-names, space-before-function-paren, arrow-parens, no-unused-vars, class-methods-use-this, no-var, consistent-return, no-param-reassign, max-len */
|
||||
|
||||
((global) => {
|
||||
class TemplateSelector {
|
||||
constructor({ dropdown, data, pattern, wrapper, editor, fileEndpoint, $input } = {}) {
|
||||
this.onClick = this.onClick.bind(this);
|
||||
this.dropdown = dropdown;
|
||||
this.data = data;
|
||||
this.pattern = pattern;
|
||||
this.wrapper = wrapper;
|
||||
this.editor = editor;
|
||||
this.fileEndpoint = fileEndpoint;
|
||||
this.$input = $input || $('#file_name');
|
||||
this.dropdownIcon = $('.fa-chevron-down', this.dropdown);
|
||||
this.buildDropdown();
|
||||
this.bindEvents();
|
||||
this.onFilenameUpdate();
|
||||
|
||||
this.autosizeUpdateEvent = document.createEvent('Event');
|
||||
this.autosizeUpdateEvent.initEvent('autosize:update', true, false);
|
||||
}
|
||||
|
||||
buildDropdown() {
|
||||
return this.dropdown.glDropdown({
|
||||
data: this.data,
|
||||
filterable: true,
|
||||
selectable: true,
|
||||
toggleLabel: this.toggleLabel,
|
||||
search: {
|
||||
fields: ['name']
|
||||
},
|
||||
clicked: this.onClick,
|
||||
text: function(item) {
|
||||
return item.name;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bindEvents() {
|
||||
return this.$input.on('keyup blur', (e) => this.onFilenameUpdate());
|
||||
}
|
||||
|
||||
toggleLabel(item) {
|
||||
return item.name;
|
||||
}
|
||||
|
||||
onFilenameUpdate() {
|
||||
var filenameMatches;
|
||||
if (!this.$input.length) {
|
||||
return;
|
||||
}
|
||||
filenameMatches = this.pattern.test(this.$input.val().trim());
|
||||
if (!filenameMatches) {
|
||||
this.wrapper.addClass('hidden');
|
||||
return;
|
||||
}
|
||||
return this.wrapper.removeClass('hidden');
|
||||
}
|
||||
|
||||
onClick(item, el, e) {
|
||||
e.preventDefault();
|
||||
return this.requestFile(item);
|
||||
}
|
||||
|
||||
requestFile(item) {
|
||||
// This `requestFile` method is an abstract method that should
|
||||
// be added by all subclasses.
|
||||
}
|
||||
|
||||
// To be implemented on the extending class
|
||||
// e.g.
|
||||
// Api.gitignoreText item.name, @requestFileSuccess.bind(@)
|
||||
requestFileSuccess(file, { skipFocus } = {}) {
|
||||
if (!file) return;
|
||||
|
||||
const oldValue = this.editor.getValue();
|
||||
const newValue = file.content;
|
||||
|
||||
this.editor.setValue(newValue, 1);
|
||||
if (!skipFocus) this.editor.focus();
|
||||
|
||||
if (this.editor instanceof jQuery) {
|
||||
this.editor.get(0).dispatchEvent(this.autosizeUpdateEvent);
|
||||
}
|
||||
}
|
||||
|
||||
startLoadingSpinner() {
|
||||
this.dropdownIcon
|
||||
.addClass('fa-spinner fa-spin')
|
||||
.removeClass('fa-chevron-down');
|
||||
}
|
||||
|
||||
stopLoadingSpinner() {
|
||||
this.dropdownIcon
|
||||
.addClass('fa-chevron-down')
|
||||
.removeClass('fa-spinner fa-spin');
|
||||
}
|
||||
}
|
||||
|
||||
global.TemplateSelector = TemplateSelector;
|
||||
})(window.gl || (window.gl = {}));
|
|
@ -0,0 +1,9 @@
|
|||
/* global Api */
|
||||
|
||||
import TemplateSelector from './template_selector';
|
||||
|
||||
export default class BlobCiYamlSelector extends TemplateSelector {
|
||||
requestFile(query) {
|
||||
return Api.gitlabCiYml(query.name, (file, config) => this.setEditorContent(file, config));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
/* global Api */
|
||||
|
||||
import BlobCiYamlSelector from './blob_ci_yaml_selector';
|
||||
|
||||
export default class BlobCiYamlSelectors {
|
||||
constructor({ editor, $dropdowns }) {
|
||||
this.$dropdowns = $dropdowns || $('.js-gitlab-ci-yml-selector');
|
||||
this.initSelectors(editor);
|
||||
}
|
||||
|
||||
initSelectors(editor) {
|
||||
this.$dropdowns.each((i, dropdown) => {
|
||||
const $dropdown = $(dropdown);
|
||||
return new BlobCiYamlSelector({
|
||||
editor,
|
||||
pattern: /(.gitlab-ci.yml)/,
|
||||
data: $dropdown.data('data'),
|
||||
wrapper: $dropdown.closest('.js-gitlab-ci-yml-selector-wrap'),
|
||||
dropdown: $dropdown,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
/* global Api */
|
||||
|
||||
import TemplateSelector from './template_selector';
|
||||
|
||||
export default class BlobDockerfileSelector extends TemplateSelector {
|
||||
requestFile(query) {
|
||||
return Api.dockerfileYml(query.name, (file, config) => this.setEditorContent(file, config));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
import BlobDockerfileSelector from './blob_dockerfile_selector';
|
||||
|
||||
export default class BlobDockerfileSelectors {
|
||||
constructor({ editor, $dropdowns }) {
|
||||
this.editor = editor;
|
||||
this.$dropdowns = $dropdowns || $('.js-dockerfile-selector');
|
||||
this.initSelectors();
|
||||
}
|
||||
|
||||
initSelectors() {
|
||||
const editor = this.editor;
|
||||
this.$dropdowns.each((i, dropdown) => {
|
||||
const $dropdown = $(dropdown);
|
||||
return new BlobDockerfileSelector({
|
||||
editor,
|
||||
pattern: /(Dockerfile)/,
|
||||
data: $dropdown.data('data'),
|
||||
wrapper: $dropdown.closest('.js-dockerfile-selector-wrap'),
|
||||
dropdown: $dropdown,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
/* global Api */
|
||||
|
||||
import TemplateSelector from './template_selector';
|
||||
|
||||
export default class BlobGitignoreSelector extends TemplateSelector {
|
||||
requestFile(query) {
|
||||
return Api.gitignoreText(query.name, (file, config) => this.setEditorContent(file, config));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
import BlobGitignoreSelector from './blob_gitignore_selector';
|
||||
|
||||
export default class BlobGitignoreSelectors {
|
||||
constructor({ editor, $dropdowns }) {
|
||||
this.$dropdowns = $dropdowns || $('.js-gitignore-selector');
|
||||
this.editor = editor;
|
||||
this.initSelectors();
|
||||
}
|
||||
|
||||
initSelectors() {
|
||||
this.$dropdowns.each((i, dropdown) => {
|
||||
const $dropdown = $(dropdown);
|
||||
|
||||
return new BlobGitignoreSelector({
|
||||
pattern: /(.gitignore)/,
|
||||
data: $dropdown.data('data'),
|
||||
wrapper: $dropdown.closest('.js-gitignore-selector-wrap'),
|
||||
dropdown: $dropdown,
|
||||
editor: this.editor,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
/* global Api */
|
||||
|
||||
import TemplateSelector from './template_selector';
|
||||
|
||||
export default class BlobLicenseSelector extends TemplateSelector {
|
||||
requestFile(query) {
|
||||
const data = {
|
||||
project: this.dropdown.data('project'),
|
||||
fullname: this.dropdown.data('fullname'),
|
||||
};
|
||||
return Api.licenseText(query.id, data, (file, config) => this.setEditorContent(file, config));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
/* eslint-disable no-unused-vars, no-param-reassign */
|
||||
|
||||
import BlobLicenseSelector from './blob_license_selector';
|
||||
|
||||
export default class BlobLicenseSelectors {
|
||||
constructor({ $dropdowns, editor }) {
|
||||
this.$dropdowns = $dropdowns || $('.js-license-selector');
|
||||
this.initSelectors(editor);
|
||||
}
|
||||
|
||||
initSelectors(editor) {
|
||||
this.$dropdowns.each((i, dropdown) => {
|
||||
const $dropdown = $(dropdown);
|
||||
|
||||
return new BlobLicenseSelector({
|
||||
editor,
|
||||
pattern: /^(.+\/)?(licen[sc]e|copying)($|\.)/i,
|
||||
data: $dropdown.data('data'),
|
||||
wrapper: $dropdown.closest('.js-license-selector-wrap'),
|
||||
dropdown: $dropdown,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
/* eslint-disable class-methods-use-this, no-unused-vars */
|
||||
|
||||
export default class TemplateSelector {
|
||||
constructor({ dropdown, data, pattern, wrapper, editor, $input } = {}) {
|
||||
this.pattern = pattern;
|
||||
this.editor = editor;
|
||||
this.dropdown = dropdown;
|
||||
this.$dropdownContainer = wrapper;
|
||||
this.$filenameInput = $input || $('#file_name');
|
||||
this.$dropdownIcon = $('.fa-chevron-down', dropdown);
|
||||
|
||||
this.initDropdown(dropdown, data);
|
||||
this.listenForFilenameInput();
|
||||
this.renderMatchedDropdown();
|
||||
this.initAutosizeUpdateEvent();
|
||||
}
|
||||
|
||||
initDropdown(dropdown, data) {
|
||||
return $(dropdown).glDropdown({
|
||||
data,
|
||||
filterable: true,
|
||||
selectable: true,
|
||||
toggleLabel: item => item.name,
|
||||
search: {
|
||||
fields: ['name'],
|
||||
},
|
||||
clicked: (item, el, e) => this.fetchFileTemplate(item, el, e),
|
||||
text: item => item.name,
|
||||
});
|
||||
}
|
||||
|
||||
initAutosizeUpdateEvent() {
|
||||
this.autosizeUpdateEvent = document.createEvent('Event');
|
||||
this.autosizeUpdateEvent.initEvent('autosize:update', true, false);
|
||||
}
|
||||
|
||||
listenForFilenameInput() {
|
||||
return this.$filenameInput.on('keyup blur', e => this.renderMatchedDropdown(e));
|
||||
}
|
||||
|
||||
renderMatchedDropdown() {
|
||||
if (!this.$filenameInput.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const filenameMatches = this.pattern.test(this.$filenameInput.val().trim());
|
||||
|
||||
if (!filenameMatches) {
|
||||
return this.$dropdownContainer.addClass('hidden');
|
||||
}
|
||||
return this.$dropdownContainer.removeClass('hidden');
|
||||
}
|
||||
|
||||
fetchFileTemplate(item, el, e) {
|
||||
e.preventDefault();
|
||||
return this.requestFile(item);
|
||||
}
|
||||
|
||||
requestFile(item) {
|
||||
// This `requestFile` method is an abstract method that should
|
||||
// be added by all subclasses.
|
||||
}
|
||||
|
||||
// To be implemented on the extending class
|
||||
// e.g. Api.gitlabCiYml(query.name, file => this.setEditorContent(file));
|
||||
|
||||
setEditorContent(file, { skipFocus } = {}) {
|
||||
if (!file) return;
|
||||
|
||||
const newValue = file.content;
|
||||
|
||||
this.editor.setValue(newValue, 1);
|
||||
|
||||
if (!skipFocus) this.editor.focus();
|
||||
|
||||
if (this.editor instanceof jQuery) {
|
||||
this.editor.get(0).dispatchEvent(this.autosizeUpdateEvent);
|
||||
}
|
||||
}
|
||||
|
||||
startLoadingSpinner() {
|
||||
this.$dropdownIcon
|
||||
.addClass('fa-spinner fa-spin')
|
||||
.removeClass('fa-chevron-down');
|
||||
}
|
||||
|
||||
stopLoadingSpinner() {
|
||||
this.$dropdownIcon
|
||||
.addClass('fa-chevron-down')
|
||||
.removeClass('fa-spinner fa-spin');
|
||||
}
|
||||
}
|
32
app/assets/javascripts/blob_edit/blob_bundle.js
Normal file
32
app/assets/javascripts/blob_edit/blob_bundle.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
/* eslint-disable func-names, space-before-function-paren, prefer-arrow-callback, no-var, quotes, vars-on-top, no-unused-vars, no-new, max-len */
|
||||
/* global EditBlob */
|
||||
/* global NewCommitForm */
|
||||
|
||||
import EditBlob from './edit_blob';
|
||||
import BlobFileDropzone from '../blob/blob_file_dropzone';
|
||||
|
||||
$(() => {
|
||||
const editBlobForm = $('.js-edit-blob-form');
|
||||
const uploadBlobForm = $('.js-upload-blob-form');
|
||||
|
||||
if (editBlobForm.length) {
|
||||
const urlRoot = editBlobForm.data('relative-url-root');
|
||||
const assetsPath = editBlobForm.data('assets-prefix');
|
||||
const blobLanguage = editBlobForm.data('blob-language');
|
||||
|
||||
new EditBlob(`${urlRoot}${assetsPath}`, blobLanguage);
|
||||
new NewCommitForm(editBlobForm);
|
||||
}
|
||||
|
||||
if (uploadBlobForm.length) {
|
||||
const method = uploadBlobForm.data('method');
|
||||
|
||||
new BlobFileDropzone(uploadBlobForm, method);
|
||||
new NewCommitForm(uploadBlobForm);
|
||||
|
||||
window.gl.utils.disableButtonIfEmptyField(
|
||||
uploadBlobForm.find('.js-commit-message'),
|
||||
'.btn-upload-file',
|
||||
);
|
||||
}
|
||||
});
|
|
@ -1,15 +0,0 @@
|
|||
/* eslint-disable func-names, space-before-function-paren, prefer-arrow-callback, no-var, quotes, vars-on-top, no-unused-vars, no-new, max-len */
|
||||
/* global EditBlob */
|
||||
/* global NewCommitForm */
|
||||
|
||||
require('./edit_blob');
|
||||
|
||||
(function() {
|
||||
$(function() {
|
||||
var url = $(".js-edit-blob-form").data("relative-url-root");
|
||||
url += $(".js-edit-blob-form").data("assets-prefix");
|
||||
|
||||
var blob = new EditBlob(url, $('.js-edit-blob-form').data('blob-language'));
|
||||
new NewCommitForm($('.js-edit-blob-form'));
|
||||
});
|
||||
}).call(window);
|
|
@ -1,88 +1,99 @@
|
|||
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, camelcase, no-param-reassign, quotes, prefer-template, no-new, comma-dangle, one-var, one-var-declaration-per-line, prefer-arrow-callback, no-else-return, no-unused-vars, max-len */
|
||||
/* global ace */
|
||||
/* global BlobGitignoreSelectors */
|
||||
|
||||
(function() {
|
||||
var bind = function(fn, me) { return function() { return fn.apply(me, arguments); }; };
|
||||
import BlobLicenseSelectors from '../blob/template_selectors/blob_license_selectors';
|
||||
import BlobGitignoreSelectors from '../blob/template_selectors/blob_gitignore_selectors';
|
||||
import BlobCiYamlSelectors from '../blob/template_selectors/blob_ci_yaml_selectors';
|
||||
import BlobDockerfileSelectors from '../blob/template_selectors/blob_dockerfile_selectors';
|
||||
|
||||
this.EditBlob = (function() {
|
||||
function EditBlob(assets_path, ace_mode) {
|
||||
if (ace_mode == null) {
|
||||
ace_mode = null;
|
||||
}
|
||||
this.editModeLinkClickHandler = bind(this.editModeLinkClickHandler, this);
|
||||
ace.config.set("modePath", assets_path + "/ace");
|
||||
ace.config.loadModule("ace/ext/searchbox");
|
||||
this.editor = ace.edit("editor");
|
||||
this.editor.focus();
|
||||
if (ace_mode) {
|
||||
this.editor.getSession().setMode("ace/mode/" + ace_mode);
|
||||
}
|
||||
$('form').submit((function(_this) {
|
||||
return function() {
|
||||
return $("#file-content").val(_this.editor.getValue());
|
||||
};
|
||||
// Before a form submission, move the content from the Ace editor into the
|
||||
// submitted textarea
|
||||
})(this));
|
||||
this.initModePanesAndLinks();
|
||||
this.initSoftWrap();
|
||||
new gl.BlobLicenseSelectors({
|
||||
editor: this.editor
|
||||
});
|
||||
export default class EditBlob {
|
||||
constructor(assetsPath, aceMode) {
|
||||
this.configureAceEditor(aceMode, assetsPath);
|
||||
this.prepFileContentForSubmit();
|
||||
this.initModePanesAndLinks();
|
||||
this.initSoftWrap();
|
||||
this.initFileSelectors();
|
||||
}
|
||||
|
||||
configureAceEditor(aceMode, assetsPath) {
|
||||
ace.config.set('modePath', `${assetsPath}/ace`);
|
||||
ace.config.loadModule('ace/ext/searchbox');
|
||||
|
||||
this.editor = ace.edit('editor');
|
||||
this.editor.focus();
|
||||
|
||||
if (aceMode) {
|
||||
this.editor.getSession().setMode(`ace/mode/${aceMode}`);
|
||||
}
|
||||
}
|
||||
|
||||
prepFileContentForSubmit() {
|
||||
$('form').submit(() => {
|
||||
$('#file-content').val(this.editor.getValue());
|
||||
});
|
||||
}
|
||||
|
||||
initFileSelectors() {
|
||||
this.blobTemplateSelectors = [
|
||||
new BlobLicenseSelectors({
|
||||
editor: this.editor,
|
||||
}),
|
||||
new BlobGitignoreSelectors({
|
||||
editor: this.editor
|
||||
});
|
||||
new gl.BlobCiYamlSelectors({
|
||||
editor: this.editor
|
||||
});
|
||||
new gl.BlobDockerfileSelectors({
|
||||
editor: this.editor
|
||||
editor: this.editor,
|
||||
}),
|
||||
new BlobCiYamlSelectors({
|
||||
editor: this.editor,
|
||||
}),
|
||||
new BlobDockerfileSelectors({
|
||||
editor: this.editor,
|
||||
}),
|
||||
];
|
||||
}
|
||||
|
||||
initModePanesAndLinks() {
|
||||
this.$editModePanes = $('.js-edit-mode-pane');
|
||||
this.$editModeLinks = $('.js-edit-mode a');
|
||||
this.$editModeLinks.on('click', e => this.editModeLinkClickHandler(e));
|
||||
}
|
||||
|
||||
editModeLinkClickHandler(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const currentLink = $(e.target);
|
||||
const paneId = currentLink.attr('href');
|
||||
const currentPane = this.$editModePanes.filter(paneId);
|
||||
|
||||
this.$editModeLinks.parent().removeClass('active hover');
|
||||
|
||||
currentLink.parent().addClass('active hover');
|
||||
|
||||
this.$editModePanes.hide();
|
||||
|
||||
currentPane.fadeIn(200);
|
||||
|
||||
if (paneId === '#preview') {
|
||||
this.$toggleButton.hide();
|
||||
return $.post(currentLink.data('preview-url'), {
|
||||
content: this.editor.getValue(),
|
||||
}, (response) => {
|
||||
currentPane.empty().append(response);
|
||||
return currentPane.renderGFM();
|
||||
});
|
||||
}
|
||||
|
||||
EditBlob.prototype.initModePanesAndLinks = function() {
|
||||
this.$editModePanes = $(".js-edit-mode-pane");
|
||||
this.$editModeLinks = $(".js-edit-mode a");
|
||||
return this.$editModeLinks.click(this.editModeLinkClickHandler);
|
||||
};
|
||||
this.$toggleButton.show();
|
||||
|
||||
EditBlob.prototype.editModeLinkClickHandler = function(event) {
|
||||
var currentLink, currentPane, paneId;
|
||||
event.preventDefault();
|
||||
currentLink = $(event.target);
|
||||
paneId = currentLink.attr("href");
|
||||
currentPane = this.$editModePanes.filter(paneId);
|
||||
this.$editModeLinks.parent().removeClass("active hover");
|
||||
currentLink.parent().addClass("active hover");
|
||||
this.$editModePanes.hide();
|
||||
currentPane.fadeIn(200);
|
||||
if (paneId === "#preview") {
|
||||
this.$toggleButton.hide();
|
||||
return $.post(currentLink.data("preview-url"), {
|
||||
content: this.editor.getValue()
|
||||
}, function(response) {
|
||||
currentPane.empty().append(response);
|
||||
return currentPane.renderGFM();
|
||||
});
|
||||
} else {
|
||||
this.$toggleButton.show();
|
||||
return this.editor.focus();
|
||||
}
|
||||
};
|
||||
return this.editor.focus();
|
||||
}
|
||||
|
||||
EditBlob.prototype.initSoftWrap = function() {
|
||||
this.isSoftWrapped = false;
|
||||
this.$toggleButton = $('.soft-wrap-toggle');
|
||||
this.$toggleButton.on('click', this.toggleSoftWrap.bind(this));
|
||||
};
|
||||
initSoftWrap() {
|
||||
this.isSoftWrapped = false;
|
||||
this.$toggleButton = $('.soft-wrap-toggle');
|
||||
this.$toggleButton.on('click', () => this.toggleSoftWrap());
|
||||
}
|
||||
|
||||
EditBlob.prototype.toggleSoftWrap = function(e) {
|
||||
this.isSoftWrapped = !this.isSoftWrapped;
|
||||
this.$toggleButton.toggleClass('soft-wrap-active', this.isSoftWrapped);
|
||||
this.editor.getSession().setUseWrapMode(this.isSoftWrapped);
|
||||
};
|
||||
|
||||
return EditBlob;
|
||||
})();
|
||||
}).call(window);
|
||||
toggleSoftWrap() {
|
||||
this.isSoftWrapped = !this.isSoftWrapped;
|
||||
this.$toggleButton.toggleClass('soft-wrap-active', this.isSoftWrapped);
|
||||
this.editor.getSession().setUseWrapMode(this.isSoftWrapped);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
/* eslint-disable one-var, quote-props, comma-dangle, space-before-function-paren */
|
||||
/* global Vue */
|
||||
/* global BoardService */
|
||||
|
||||
import Vue from 'vue';
|
||||
import VueResource from 'vue-resource';
|
||||
import FilteredSearchBoards from './filtered_search_boards';
|
||||
import eventHub from './eventhub';
|
||||
|
||||
window.Vue = require('vue');
|
||||
window.Vue.use(require('vue-resource'));
|
||||
require('./models/issue');
|
||||
require('./models/label');
|
||||
require('./models/list');
|
||||
|
@ -24,6 +23,8 @@ require('./components/new_list_dropdown');
|
|||
require('./components/modal/index');
|
||||
require('../vue_shared/vue_resource_interceptor');
|
||||
|
||||
Vue.use(VueResource);
|
||||
|
||||
$(() => {
|
||||
const $boardApp = document.getElementById('board-app');
|
||||
const Store = gl.issueBoards.BoardsStore;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable comma-dangle, space-before-function-paren, one-var */
|
||||
/* global Vue */
|
||||
/* global Sortable */
|
||||
|
||||
import Vue from 'vue';
|
||||
import boardBlankState from './board_blank_state';
|
||||
|
||||
require('./board_delete');
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* global ListLabel */
|
||||
/* global Cookies */
|
||||
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
const Store = gl.issueBoards.BoardsStore;
|
||||
|
||||
export default {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* global Vue */
|
||||
require('./issue_card_inner');
|
||||
|
||||
const Store = gl.issueBoards.BoardsStore;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* eslint-disable comma-dangle, space-before-function-paren, no-alert */
|
||||
/* global Vue */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
window.gl = window.gl || {};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable comma-dangle, space-before-function-paren, max-len */
|
||||
/* global Vue */
|
||||
/* global Sortable */
|
||||
|
||||
import Vue from 'vue';
|
||||
import boardNewIssue from './board_new_issue';
|
||||
import boardCard from './board_card';
|
||||
|
||||
|
@ -48,7 +48,7 @@ import boardCard from './board_card';
|
|||
this.list.getIssues(false);
|
||||
}
|
||||
|
||||
if (this.scrollHeight() > this.listHeight()) {
|
||||
if (this.scrollHeight() > Math.ceil(this.listHeight())) {
|
||||
this.showCount = true;
|
||||
} else {
|
||||
this.showCount = false;
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
/* eslint-disable comma-dangle, space-before-function-paren, no-new */
|
||||
/* global Vue */
|
||||
/* global IssuableContext */
|
||||
/* global MilestoneSelect */
|
||||
/* global LabelsSelect */
|
||||
/* global Sidebar */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
require('./sidebar/remove_issue');
|
||||
|
||||
(() => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* global Vue */
|
||||
import Vue from 'vue';
|
||||
import eventHub from '../eventhub';
|
||||
|
||||
(() => {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* global Vue */
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
const ModalStore = gl.issueBoards.ModalStore;
|
||||
|
||||
|
|
|
@ -14,8 +14,10 @@ export default {
|
|||
|
||||
this.filteredSearch = new FilteredSearchBoards(this.store);
|
||||
this.filteredSearch.removeTokens();
|
||||
this.filteredSearch.handleInputPlaceholder();
|
||||
this.filteredSearch.toggleClearSearchButton();
|
||||
},
|
||||
beforeDestroy() {
|
||||
destroyed() {
|
||||
this.filteredSearch.cleanup();
|
||||
FilteredSearchContainer.container = document;
|
||||
this.store.path = '';
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* eslint-disable no-new */
|
||||
/* global Vue */
|
||||
/* global Flash */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
require('./lists_dropdown');
|
||||
|
||||
(() => {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* global Vue */
|
||||
/* global ListIssue */
|
||||
|
||||
import Vue from 'vue';
|
||||
import queryData from '../../utils/query_data';
|
||||
|
||||
require('./header');
|
||||
|
@ -64,8 +65,15 @@ require('./empty_state');
|
|||
},
|
||||
filter: {
|
||||
handler() {
|
||||
this.page = 1;
|
||||
this.loadIssues(true);
|
||||
if (this.$el.tagName) {
|
||||
this.page = 1;
|
||||
this.filterLoading = true;
|
||||
|
||||
this.loadIssues(true)
|
||||
.then(() => {
|
||||
this.filterLoading = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
|
@ -139,14 +147,14 @@ require('./empty_state');
|
|||
:image="blankStateImage"
|
||||
:issue-link-base="issueLinkBase"
|
||||
:root-path="rootPath"
|
||||
v-if="!loading && showList"></modal-list>
|
||||
v-if="!loading && showList && !filterLoading"></modal-list>
|
||||
<empty-state
|
||||
v-if="showEmptyState"
|
||||
:image="blankStateImage"
|
||||
:new-issue-path="newIssuePath"></empty-state>
|
||||
<section
|
||||
class="add-issues-list text-center"
|
||||
v-if="loading">
|
||||
v-if="loading || filterLoading">
|
||||
<div class="add-issues-list-loading">
|
||||
<i class="fa fa-spinner fa-spin"></i>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* global Vue */
|
||||
/* global ListIssue */
|
||||
/* global bp */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
const ModalStore = gl.issueBoards.ModalStore;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* global Vue */
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
const ModalStore = gl.issueBoards.ModalStore;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* global Vue */
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
const ModalStore = gl.issueBoards.ModalStore;
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
/* eslint-disable no-new */
|
||||
/* global Vue */
|
||||
/* global Flash */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
const Store = gl.issueBoards.BoardsStore;
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ export default class FilteredSearchBoards extends gl.FilteredSearchManager {
|
|||
[].forEach.call(tokens, (el) => {
|
||||
el.parentNode.removeChild(el);
|
||||
});
|
||||
|
||||
this.filteredSearchInput.value = '';
|
||||
}
|
||||
|
||||
updateTokens() {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* global Vue */
|
||||
/* global dateFormat */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
Vue.filter('due-date', (value) => {
|
||||
const date = new Date(value);
|
||||
return dateFormat(date, 'mmm d, yyyy', true);
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
/* eslint-disable no-unused-vars, space-before-function-paren, arrow-body-style, arrow-parens, comma-dangle, max-len */
|
||||
/* global Vue */
|
||||
/* global ListLabel */
|
||||
/* global ListMilestone */
|
||||
/* global ListUser */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
class ListIssue {
|
||||
constructor (obj) {
|
||||
this.globalId = obj.id;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* eslint-disable space-before-function-paren, comma-dangle, no-param-reassign, camelcase, max-len, no-unused-vars */
|
||||
/* global Vue */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
class BoardService {
|
||||
constructor (root, bulkUpdatePath, boardId) {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* eslint-disable comma-dangle, space-before-function-paren, one-var, no-shadow, dot-notation, max-len */
|
||||
/* global Cookies */
|
||||
/* global List */
|
||||
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
(() => {
|
||||
window.gl = window.gl || {};
|
||||
window.gl.issueBoards = window.gl.issueBoards || {};
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
searchTerm: '',
|
||||
loading: false,
|
||||
loadingNewPage: false,
|
||||
filterLoading: false,
|
||||
page: 1,
|
||||
perPage: 50,
|
||||
filter: {
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
|
||||
import Vue from 'vue';
|
||||
import VueResource from 'vue-resource';
|
||||
import CommitPipelinesTable from './pipelines_table';
|
||||
|
||||
window.Vue = require('vue');
|
||||
window.Vue.use(require('vue-resource'));
|
||||
Vue.use(VueResource);
|
||||
|
||||
/**
|
||||
* Commits View > Pipelines Tab > Pipelines Table.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/* eslint-disable no-new*/
|
||||
/* global Flash */
|
||||
import Vue from 'vue';
|
||||
import PipelinesTableComponent from '../../vue_shared/components/pipelines_table';
|
||||
import PipelinesService from '../../vue_pipelines_index/services/pipelines_service';
|
||||
import PipelineStore from '../../vue_pipelines_index/stores/pipelines_store';
|
||||
import eventHub from '../../vue_pipelines_index/event_hub';
|
||||
import EmptyState from '../../vue_pipelines_index/components/empty_state';
|
||||
import ErrorState from '../../vue_pipelines_index/components/error_state';
|
||||
import '../../lib/utils/common_utils';
|
||||
import '../../vue_shared/vue_resource_interceptor';
|
||||
|
||||
|
@ -22,6 +22,8 @@ import '../../vue_shared/vue_resource_interceptor';
|
|||
export default Vue.component('pipelines-table', {
|
||||
components: {
|
||||
'pipelines-table-component': PipelinesTableComponent,
|
||||
'error-state': ErrorState,
|
||||
'empty-state': EmptyState,
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -36,12 +38,24 @@ export default Vue.component('pipelines-table', {
|
|||
|
||||
return {
|
||||
endpoint: pipelinesTableData.endpoint,
|
||||
helpPagePath: pipelinesTableData.helpPagePath,
|
||||
store,
|
||||
state: store.state,
|
||||
isLoading: false,
|
||||
hasError: false,
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
shouldRenderErrorState() {
|
||||
return this.hasError && !this.isLoading;
|
||||
},
|
||||
|
||||
shouldRenderEmptyState() {
|
||||
return !this.state.pipelines.length && !this.isLoading;
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* When the component is about to be mounted, tell the service to fetch the data
|
||||
*
|
||||
|
@ -80,26 +94,25 @@ export default Vue.component('pipelines-table', {
|
|||
this.isLoading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.hasError = true;
|
||||
this.isLoading = false;
|
||||
new Flash('An error occurred while fetching the pipelines, please reload the page again.');
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
template: `
|
||||
<div class="pipelines">
|
||||
<div class="content-list pipelines">
|
||||
<div class="realtime-loading" v-if="isLoading">
|
||||
<i class="fa fa-spinner fa-spin"></i>
|
||||
</div>
|
||||
|
||||
<div class="blank-state blank-state-no-icon"
|
||||
v-if="!isLoading && state.pipelines.length === 0">
|
||||
<h2 class="blank-state-title js-blank-state-title">
|
||||
No pipelines to show
|
||||
</h2>
|
||||
</div>
|
||||
<empty-state
|
||||
v-if="shouldRenderEmptyState"
|
||||
:help-page-path="helpPagePath" />
|
||||
|
||||
<div class="table-holder pipelines"
|
||||
<error-state v-if="shouldRenderErrorState" />
|
||||
|
||||
<div class="table-holder"
|
||||
v-if="!isLoading && state.pipelines.length > 0">
|
||||
<pipelines-table-component
|
||||
:pipelines="state.pipelines"
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
// ECMAScript polyfills
|
||||
import 'core-js/fn/array/find';
|
||||
import 'core-js/fn/array/from';
|
||||
import 'core-js/fn/object/assign';
|
||||
import 'core-js/fn/promise';
|
||||
import 'core-js/fn/string/code-point-at';
|
||||
import 'core-js/fn/string/from-code-point';
|
||||
import 'core-js/fn/symbol';
|
||||
|
||||
// Browser polyfills
|
||||
import './polyfills/custom_event';
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
export default {
|
||||
props: {
|
||||
count: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
template: `
|
||||
<span v-if="count === 50" class="events-info pull-right">
|
||||
<i class="fa fa-warning has-tooltip"
|
||||
aria-hidden="true"
|
||||
title="Limited to showing 50 events at most"
|
||||
data-placement="top"></i>
|
||||
Showing 50 events
|
||||
</span>
|
||||
`,
|
||||
};
|
|
@ -1,5 +1,6 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
/* global Vue */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
((global) => {
|
||||
global.cycleAnalytics = global.cycleAnalytics || {};
|
||||
|
@ -13,6 +14,7 @@
|
|||
<div>
|
||||
<div class="events-description">
|
||||
{{ stage.description }}
|
||||
<limit-warning :count="items.length" />
|
||||
</div>
|
||||
<ul class="stage-event-list">
|
||||
<li v-for="mergeRequest in items" class="stage-event-item">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
/* global Vue */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
((global) => {
|
||||
global.cycleAnalytics = global.cycleAnalytics || {};
|
||||
|
@ -13,6 +14,7 @@
|
|||
<div>
|
||||
<div class="events-description">
|
||||
{{ stage.description }}
|
||||
<limit-warning :count="items.length" />
|
||||
</div>
|
||||
<ul class="stage-event-list">
|
||||
<li v-for="issue in items" class="stage-event-item">
|
||||
|
|
|
@ -19,12 +19,7 @@ import iconCommit from '../svg/icon_commit.svg';
|
|||
<div>
|
||||
<div class="events-description">
|
||||
{{ stage.description }}
|
||||
<span v-if="items.length === 50" class="events-info pull-right">
|
||||
<i class="fa fa-warning has-tooltip"
|
||||
title="Limited to showing 50 events at most"
|
||||
data-placement="top"></i>
|
||||
Showing 50 events
|
||||
</span>
|
||||
<limit-warning :count="items.length" />
|
||||
</div>
|
||||
<ul class="stage-event-list">
|
||||
<li v-for="commit in items" class="stage-event-item">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
/* global Vue */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
((global) => {
|
||||
global.cycleAnalytics = global.cycleAnalytics || {};
|
||||
|
@ -13,6 +14,7 @@
|
|||
<div>
|
||||
<div class="events-description">
|
||||
{{ stage.description }}
|
||||
<limit-warning :count="items.length" />
|
||||
</div>
|
||||
<ul class="stage-event-list">
|
||||
<li v-for="issue in items" class="stage-event-item">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
/* global Vue */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
((global) => {
|
||||
global.cycleAnalytics = global.cycleAnalytics || {};
|
||||
|
@ -13,6 +14,7 @@
|
|||
<div>
|
||||
<div class="events-description">
|
||||
{{ stage.description }}
|
||||
<limit-warning :count="items.length" />
|
||||
</div>
|
||||
<ul class="stage-event-list">
|
||||
<li v-for="mergeRequest in items" class="stage-event-item">
|
||||
|
|
|
@ -17,6 +17,7 @@ import iconBranch from '../svg/icon_branch.svg';
|
|||
<div>
|
||||
<div class="events-description">
|
||||
{{ stage.description }}
|
||||
<limit-warning :count="items.length" />
|
||||
</div>
|
||||
<ul class="stage-event-list">
|
||||
<li v-for="build in items" class="stage-event-item item-build-component">
|
||||
|
|
|
@ -18,6 +18,7 @@ import iconBranch from '../svg/icon_branch.svg';
|
|||
<div>
|
||||
<div class="events-description">
|
||||
{{ stage.description }}
|
||||
<limit-warning :count="items.length" />
|
||||
</div>
|
||||
<ul class="stage-event-list">
|
||||
<li v-for="build in items" class="stage-event-item item-build-component">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* eslint-disable no-param-reassign */
|
||||
/* global Vue */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
((global) => {
|
||||
global.cycleAnalytics = global.cycleAnalytics || {};
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/* global Vue */
|
||||
/* global Cookies */
|
||||
/* global Flash */
|
||||
|
||||
window.Vue = require('vue');
|
||||
window.Cookies = require('js-cookie');
|
||||
import Vue from 'vue';
|
||||
import Cookies from 'js-cookie';
|
||||
import LimitWarningComponent from './components/limit_warning_component';
|
||||
|
||||
require('./components/stage_code_component');
|
||||
require('./components/stage_issue_component');
|
||||
require('./components/stage_plan_component');
|
||||
|
@ -131,5 +131,6 @@ $(() => {
|
|||
});
|
||||
|
||||
// Register global components
|
||||
Vue.component('limit-warning', LimitWarningComponent);
|
||||
Vue.component('total-time', gl.cycleAnalytics.TotalTimeComponent);
|
||||
});
|
||||
|
|
|
@ -33,11 +33,7 @@ class Diff {
|
|||
|
||||
handleClickUnfold(e) {
|
||||
const $target = $(e.target);
|
||||
// current babel config relies on iterators implementation, so we cannot simply do:
|
||||
// const [oldLineNumber, newLineNumber] = this.lineNumbers($target.parent());
|
||||
const ref = this.lineNumbers($target.parent());
|
||||
const oldLineNumber = ref[0];
|
||||
const newLineNumber = ref[1];
|
||||
const [oldLineNumber, newLineNumber] = this.lineNumbers($target.parent());
|
||||
const offset = newLineNumber - oldLineNumber;
|
||||
const bottom = $target.hasClass('js-unfold-bottom');
|
||||
let since;
|
||||
|
@ -105,10 +101,11 @@ class Diff {
|
|||
}
|
||||
|
||||
lineNumbers(line) {
|
||||
if (!line.children().length) {
|
||||
const children = line.find('.diff-line-num').toArray();
|
||||
if (children.length !== 2) {
|
||||
return [0, 0];
|
||||
}
|
||||
return line.find('.diff-line-num').map((i, elm) => parseInt($(elm).data('linenumber'), 10));
|
||||
return children.map(elm => parseInt($(elm).data('linenumber'), 10) || 0);
|
||||
}
|
||||
|
||||
highlightSelectedLine() {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, quotes, no-lonely-if, max-len */
|
||||
/* global CommentsStore */
|
||||
const Vue = require('vue');
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
const CommentAndResolveBtn = Vue.extend({
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
/* global CommentsStore Cookies notes */
|
||||
/* global CommentsStore */
|
||||
/* global notes */
|
||||
|
||||
import Vue from 'vue';
|
||||
import collapseIcon from '../icons/collapse_icon.svg';
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, guard-for-in, no-restricted-syntax, one-var, space-before-function-paren, no-lonely-if, no-continue, brace-style, max-len, quotes */
|
||||
/* global DiscussionMixins */
|
||||
/* global CommentsStore */
|
||||
const Vue = require('vue');
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
const JumpToDiscussion = Vue.extend({
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* global Vue */
|
||||
/* global CommentsStore */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
const NewIssueForDiscussion = Vue.extend({
|
||||
props: {
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
/* global CommentsStore */
|
||||
/* global ResolveService */
|
||||
/* global Flash */
|
||||
const Vue = require('vue');
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
const ResolveBtn = Vue.extend({
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* eslint-disable comma-dangle, object-shorthand, func-names, no-param-reassign */
|
||||
/* global DiscussionMixins */
|
||||
/* global CommentsStore */
|
||||
const Vue = require('vue');
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
((w) => {
|
||||
w.ResolveCount = Vue.extend({
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/* global CommentsStore */
|
||||
/* global ResolveService */
|
||||
|
||||
const Vue = require('vue');
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
const ResolveDiscussionBtn = Vue.extend({
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* eslint-disable func-names, comma-dangle, new-cap, no-new, max-len */
|
||||
/* global Vue */
|
||||
/* global ResolveCount */
|
||||
|
||||
const Vue = require('vue');
|
||||
import Vue from 'vue';
|
||||
|
||||
require('./models/discussion');
|
||||
require('./models/note');
|
||||
require('./stores/comments');
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* eslint-disable space-before-function-paren, camelcase, guard-for-in, no-restricted-syntax, no-unused-vars, max-len */
|
||||
/* global Vue */
|
||||
/* global NoteModel */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
class DiscussionModel {
|
||||
constructor (discussionId) {
|
||||
this.id = discussionId;
|
||||
|
|
|
@ -2,10 +2,13 @@
|
|||
/* global Flash */
|
||||
/* global CommentsStore */
|
||||
|
||||
const Vue = window.Vue = require('vue');
|
||||
window.Vue.use(require('vue-resource'));
|
||||
import Vue from 'vue';
|
||||
import VueResource from 'vue-resource';
|
||||
|
||||
require('../../vue_shared/vue_resource_interceptor');
|
||||
|
||||
Vue.use(VueResource);
|
||||
|
||||
(() => {
|
||||
window.gl = window.gl || {};
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
/* eslint-disable object-shorthand, func-names, camelcase, no-restricted-syntax, guard-for-in, comma-dangle, max-len, no-param-reassign */
|
||||
/* global Vue */
|
||||
/* global DiscussionModel */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
((w) => {
|
||||
w.CommentsStore = {
|
||||
state: {},
|
||||
|
|
|
@ -41,9 +41,9 @@ import GroupsList from './groups_list';
|
|||
import ProjectsList from './projects_list';
|
||||
import MiniPipelineGraph from './mini_pipeline_graph_dropdown';
|
||||
import BlobLinePermalinkUpdater from './blob/blob_line_permalink_updater';
|
||||
import UserCallout from './user_callout';
|
||||
|
||||
const ShortcutsBlob = require('./shortcuts_blob');
|
||||
const UserCallout = require('./user_callout');
|
||||
|
||||
(function() {
|
||||
var Dispatcher;
|
||||
|
|
|
@ -56,10 +56,12 @@ require('../window')(function(w){
|
|||
|
||||
this.hookInput = hookInput;
|
||||
this.hookInput.trigger.addEventListener('keyup.dl', this.keydownWrapper);
|
||||
this.hookInput.trigger.addEventListener('mousedown.dl', this.keydownWrapper);
|
||||
},
|
||||
|
||||
destroy: function destroy(){
|
||||
this.hookInput.trigger.removeEventListener('keyup.dl', this.keydownWrapper);
|
||||
this.hookInput.trigger.removeEventListener('mousedown.dl', this.keydownWrapper);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
@ -384,7 +384,7 @@ import FilteredSearchContainer from './container';
|
|||
paths.push(`search=${sanitized}`);
|
||||
}
|
||||
|
||||
const parameterizedUrl = `?scope=all&utf8=✓&${paths.join('&')}`;
|
||||
const parameterizedUrl = `?scope=all&utf8=%E2%9C%93&${paths.join('&')}`;
|
||||
|
||||
if (this.updateObject) {
|
||||
this.updateObject(parameterizedUrl);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* global Vue */
|
||||
import Vue from 'vue';
|
||||
import stopwatchSvg from 'icons/_icon_stopwatch.svg';
|
||||
|
||||
require('../../../lib/utils/pretty_time');
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* global Vue */
|
||||
import Vue from 'vue';
|
||||
|
||||
require('../../../lib/utils/pretty_time');
|
||||
|
||||
(() => {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* global Vue */
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
Vue.component('time-tracking-estimate-only-pane', {
|
||||
name: 'time-tracking-estimate-only-pane',
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* global Vue */
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
Vue.component('time-tracking-help-state', {
|
||||
name: 'time-tracking-help-state',
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* global Vue */
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
Vue.component('time-tracking-no-tracking-pane', {
|
||||
name: 'time-tracking-no-tracking-pane',
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* global Vue */
|
||||
import Vue from 'vue';
|
||||
|
||||
(() => {
|
||||
Vue.component('time-tracking-spent-only-pane', {
|
||||
name: 'time-tracking-spent-only-pane',
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* global Vue */
|
||||
import Vue from 'vue';
|
||||
|
||||
require('./help_state');
|
||||
require('./collapsed_state');
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
/* global Vue */
|
||||
import Vue from 'vue';
|
||||
import VueResource from 'vue-resource';
|
||||
|
||||
window.Vue = require('vue');
|
||||
window.Vue.use(require('vue-resource'));
|
||||
require('./components/time_tracker');
|
||||
require('../../smart_interval');
|
||||
require('../../subbable_resource');
|
||||
|
||||
Vue.use(VueResource);
|
||||
|
||||
(() => {
|
||||
/* This Vue instance represents what will become the parent instance for the
|
||||
* sidebar. It will be responsible for managing `issuable` state and propagating
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-new, comma-dangle, quotes, prefer-arrow-callback, consistent-return, one-var, no-var, one-var-declaration-per-line, no-underscore-dangle, max-len */
|
||||
/* global UsersSelect */
|
||||
/* global Cookies */
|
||||
/* global bp */
|
||||
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
(function() {
|
||||
this.IssuableContext = (function() {
|
||||
function IssuableContext(currentUser) {
|
||||
|
|
73
app/assets/javascripts/lib/utils/poll.js
Normal file
73
app/assets/javascripts/lib/utils/poll.js
Normal file
|
@ -0,0 +1,73 @@
|
|||
import httpStatusCodes from './http_status';
|
||||
|
||||
/**
|
||||
* Polling utility for handling realtime updates.
|
||||
* Service for vue resouce and method need to be provided as props
|
||||
*
|
||||
* @example
|
||||
* new poll({
|
||||
* resource: resource,
|
||||
* method: 'name',
|
||||
* data: {page: 1, scope: 'all'},
|
||||
* successCallback: () => {},
|
||||
* errorCallback: () => {},
|
||||
* }).makeRequest();
|
||||
*
|
||||
* this.service = new BoardsService(endpoint);
|
||||
* new poll({
|
||||
* resource: this.service,
|
||||
* method: 'get',
|
||||
* data: {page: 1, scope: 'all'},
|
||||
* successCallback: () => {},
|
||||
* errorCallback: () => {},
|
||||
* }).makeRequest();
|
||||
*
|
||||
*
|
||||
* 1. Checks for response and headers before start polling
|
||||
* 2. Interval is provided by `Poll-Interval` header.
|
||||
* 3. If `Poll-Interval` is -1, we stop polling
|
||||
* 4. If HTTP response is 200, we poll.
|
||||
* 5. If HTTP response is different from 200, we stop polling.
|
||||
*
|
||||
*/
|
||||
export default class Poll {
|
||||
constructor(options = {}) {
|
||||
this.options = options;
|
||||
this.options.data = options.data || {};
|
||||
|
||||
this.intervalHeader = 'POLL-INTERVAL';
|
||||
this.timeoutID = null;
|
||||
this.canPoll = true;
|
||||
}
|
||||
|
||||
checkConditions(response) {
|
||||
const headers = gl.utils.normalizeHeaders(response.headers);
|
||||
const pollInterval = headers[this.intervalHeader];
|
||||
|
||||
if (pollInterval > 0 && response.status === httpStatusCodes.OK && this.canPoll) {
|
||||
this.timeoutID = setTimeout(() => {
|
||||
this.makeRequest();
|
||||
}, pollInterval);
|
||||
}
|
||||
|
||||
this.options.successCallback(response);
|
||||
}
|
||||
|
||||
makeRequest() {
|
||||
const { resource, method, data, errorCallback } = this.options;
|
||||
|
||||
return resource[method](data)
|
||||
.then(response => this.checkConditions(response))
|
||||
.catch(error => errorCallback(error));
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the polling recursive chain
|
||||
* and guarantees if the timeout is already running it won't make another request by
|
||||
* cancelling the previously established timeout.
|
||||
*/
|
||||
stop() {
|
||||
this.canPoll = false;
|
||||
clearTimeout(this.timeoutID);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
/* eslint-disable func-names, space-before-function-paren, no-var, quotes, consistent-return, prefer-arrow-callback, comma-dangle, object-shorthand, no-new, max-len, no-multi-spaces, import/newline-after-import, import/first */
|
||||
/* global bp */
|
||||
/* global Cookies */
|
||||
/* global Flash */
|
||||
/* global ConfirmDangerModal */
|
||||
/* global Aside */
|
||||
|
@ -24,7 +23,6 @@ import './extensions/array';
|
|||
window.jQuery = jQuery;
|
||||
window.$ = jQuery;
|
||||
window._ = _;
|
||||
window.Cookies = Cookies;
|
||||
window.Pikaday = Pikaday;
|
||||
window.Dropzone = Dropzone;
|
||||
window.Sortable = Sortable;
|
||||
|
@ -49,15 +47,6 @@ import { installGlEmojiElement } from './behaviors/gl_emoji';
|
|||
installGlEmojiElement();
|
||||
|
||||
// blob
|
||||
import './blob/blob_ci_yaml';
|
||||
import './blob/blob_dockerfile_selector';
|
||||
import './blob/blob_dockerfile_selectors';
|
||||
import './blob/blob_file_dropzone';
|
||||
import './blob/blob_gitignore_selector';
|
||||
import './blob/blob_gitignore_selectors';
|
||||
import './blob/blob_license_selector';
|
||||
import './blob/blob_license_selectors';
|
||||
import './blob/template_selector';
|
||||
import './blob/create_branch_dropdown';
|
||||
import './blob/target_branch_dropdown';
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
/* eslint-disable comma-dangle, quote-props, no-useless-computed-key, object-shorthand, no-new, no-param-reassign, max-len */
|
||||
/* global Vue */
|
||||
/* global ace */
|
||||
/* global Flash */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
((global) => {
|
||||
global.mergeConflicts = global.mergeConflicts || {};
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* eslint-disable no-param-reassign, comma-dangle */
|
||||
/* global Vue */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
((global) => {
|
||||
global.mergeConflicts = global.mergeConflicts || {};
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* eslint-disable no-param-reassign, comma-dangle */
|
||||
/* global Vue */
|
||||
|
||||
import Vue from 'vue';
|
||||
|
||||
((global) => {
|
||||
global.mergeConflicts = global.mergeConflicts || {};
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* eslint-disable comma-dangle, object-shorthand, no-param-reassign, camelcase, no-nested-ternary, no-continue, max-len */
|
||||
/* global Cookies */
|
||||
/* global Vue */
|
||||
|
||||
import Vue from 'vue';
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
((global) => {
|
||||
global.mergeConflicts = global.mergeConflicts || {};
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* eslint-disable new-cap, comma-dangle, no-new */
|
||||
/* global Vue */
|
||||
/* global Flash */
|
||||
|
||||
window.Vue = require('vue');
|
||||
import Vue from 'vue';
|
||||
|
||||
require('./merge_conflict_store');
|
||||
require('./merge_conflict_service');
|
||||
require('./mixins/line_conflict_utils');
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/* eslint-disable no-new, class-methods-use-this */
|
||||
/* global Breakpoints */
|
||||
/* global Cookies */
|
||||
/* global Flash */
|
||||
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
require('./breakpoints');
|
||||
window.Cookies = require('js-cookie');
|
||||
require('./flash');
|
||||
|
||||
/* eslint-disable max-len */
|
||||
|
@ -127,9 +127,6 @@ require('./flash');
|
|||
if (this.diffViewType() === 'parallel') {
|
||||
this.expandViewContainer();
|
||||
}
|
||||
$.scrollTo('.merge-request-details .merge-request-tabs', {
|
||||
offset: 0,
|
||||
});
|
||||
} else if (action === 'pipelines') {
|
||||
if (this.pipelinesLoaded) {
|
||||
return;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue