Skip to content
Snippets Groups Projects
Select Git revision
  • move-gl-dropdown
  • improve-table-pagination-spec
  • move-markdown-preview
  • winh-fix-merge-request-spec
  • master default
  • index-namespaces-lower-name
  • winh-single-karma-test
  • 10-3-stable
  • 36782-replace-team-user-role-with-add_role-user-in-specs
  • winh-modal-internal-state
  • tz-ide-file-icons
  • 38869-milestone-select
  • update-autodevops-template
  • jivl-activate-repo-cookie-preferences
  • qa-add-deploy-key
  • docs-move-article-ldap
  • 40780-choose-file
  • 22643-manual-job-page
  • refactor-cluster-show-page-conservative
  • dm-sidekiq-versioning
  • v10.4.0.pre
  • v10.3.0
  • v10.3.0-rc5
  • v10.3.0-rc4
  • v10.3.0-rc3
  • v10.3.0-rc2
  • v10.2.5
  • v10.3.0-rc1
  • v10.0.7
  • v10.1.5
  • v10.2.4
  • v10.2.3
  • v10.2.2
  • v10.2.1
  • v10.3.0.pre
  • v10.2.0
  • v10.2.0-rc4
  • v10.2.0-rc3
  • v10.1.4
  • v10.2.0-rc2
40 results

application.js

Forked from GitLab.org / GitLab FOSS
Source project has a limited visibility.
  • Jacob Schatz's avatar
    d97c8309
    Merge branch... · d97c8309
    Jacob Schatz authored
    Merge branch '3225-ace-editor-causing-404-errors-every-time-you-try-to-edit-a-file-in-the-webui' into 'master'
    
    Fix Ace syntax highlighting with compiled assets
    
    ## What does this MR do?
    
    Update ACE to 4.1.0 to allow modes (syntax highlighting files for particular languages) to be lazily loaded.
    
    ## Are there points in the code the reviewer needs to double check?
    
    Don't think so.
    
    ## Why was this MR needed?
    
    Syntax highlighting in the file editor only worked in development and test modes, not in production!
    
    ## What are the relevant issue numbers?
    
    Closes #3225.
    
    ## Screenshots (if relevant)
    
    First, the test setup - add these lines to `development.rb`:
    ```ruby
      config.assets.debug = false
      config.assets.compile = false
      config.assets.digest = true
    ```
    
    Then, before starting the server, run `bundle exec rake assets:clobber assets:precompile`.
    
    Before:
    
    ![image](/uploads/486198e273019f8969d2e90560d82928/image.png)
    
    There is an error in the console because `/assets/ace/mode-ruby.js` was not found (it's only available when assets are compiled on demand).
    
    After:
    
    ![image](/uploads/6aa0d69b7efdfd6fe6aa22b9a49e9716/image.png)
    
    This loads `/assets/ace/mode-ruby-3915f95a6cc47306b1305e4dcb7aca25b2ef9c49b18ec6011707135b6575d8f3.js`, which works because the precompile step included it and told ACE where to find it.
    
    ## Does this MR meet the acceptance criteria?
    
    - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
    - ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
    - ~~API support added~~
    - Tests
      - ~~Added for this feature/bug~~
      - [x] All builds are passing
    - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
    - [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
    - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
    
    See merge request !5501
    d97c8309
    History
    Merge branch...
    Jacob Schatz authored
    Merge branch '3225-ace-editor-causing-404-errors-every-time-you-try-to-edit-a-file-in-the-webui' into 'master'
    
    Fix Ace syntax highlighting with compiled assets
    
    ## What does this MR do?
    
    Update ACE to 4.1.0 to allow modes (syntax highlighting files for particular languages) to be lazily loaded.
    
    ## Are there points in the code the reviewer needs to double check?
    
    Don't think so.
    
    ## Why was this MR needed?
    
    Syntax highlighting in the file editor only worked in development and test modes, not in production!
    
    ## What are the relevant issue numbers?
    
    Closes #3225.
    
    ## Screenshots (if relevant)
    
    First, the test setup - add these lines to `development.rb`:
    ```ruby
      config.assets.debug = false
      config.assets.compile = false
      config.assets.digest = true
    ```
    
    Then, before starting the server, run `bundle exec rake assets:clobber assets:precompile`.
    
    Before:
    
    ![image](/uploads/486198e273019f8969d2e90560d82928/image.png)
    
    There is an error in the console because `/assets/ace/mode-ruby.js` was not found (it's only available when assets are compiled on demand).
    
    After:
    
    ![image](/uploads/6aa0d69b7efdfd6fe6aa22b9a49e9716/image.png)
    
    This loads `/assets/ace/mode-ruby-3915f95a6cc47306b1305e4dcb7aca25b2ef9c49b18ec6011707135b6575d8f3.js`, which works because the precompile step included it and told ACE where to find it.
    
    ## Does this MR meet the acceptance criteria?
    
    - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
    - ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
    - ~~API support added~~
    - Tests
      - ~~Added for this feature/bug~~
      - [x] All builds are passing
    - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
    - [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
    - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
    
    See merge request !5501