Commit 921d1612 authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent d88843f3
...@@ -118,8 +118,6 @@ export default class FileTemplateMediator { ...@@ -118,8 +118,6 @@ export default class FileTemplateMediator {
} }
}); });
this.setFilename(item.name);
if (this.editor.getValue() !== '') { if (this.editor.getValue() !== '') {
this.setTypeSelectorToggleText(item.name); this.setTypeSelectorToggleText(item.name);
} }
...@@ -133,14 +131,16 @@ export default class FileTemplateMediator { ...@@ -133,14 +131,16 @@ export default class FileTemplateMediator {
selectTemplateFile(selector, query, data) { selectTemplateFile(selector, query, data) {
const self = this; const self = this;
const { name } = selector.config;
selector.renderLoading(); selector.renderLoading();
this.fetchFileTemplate(selector.config.type, query, data) this.fetchFileTemplate(selector.config.type, query, data)
.then(file => { .then(file => {
this.setEditorContent(file); this.setEditorContent(file);
this.setFilename(name);
selector.renderLoaded(); selector.renderLoaded();
this.typeSelector.setToggleText(selector.config.name); this.typeSelector.setToggleText(name);
toast(__(`${query} template applied`), { toast(__(`${query} template applied`), {
action: { action: {
text: __('Undo'), text: __('Undo'),
......
---
title: Added installation commands for npm and yarn packages to package detail page
merge_request: 18999
author:
type: added
---
title: Fix template selector filename bug
merge_request: 19376
author:
type: fixed
---
title: Remove var from merge_request_tabs_spec.js
merge_request: 20087
author: Lee Tickett
type: other
---
title: Remove var from syntax_highlight_spec.js
merge_request: 20086
author: Lee Tickett
type: other
This diff is collapsed.
# Feature Flags API **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/9566) in [GitLab Premium](https://about.gitlab.com/pricing/) 12.5.
API for accessing resources of [GitLab Feature Flags](../user/project/operations/feature_flags.md).
Users with Developer or higher [permissions](../user/permissions.md) can access Feature Flag API.
## Feature Flags pagination
By default, `GET` requests return 20 results at a time because the API results
are [paginated](README.md#pagination).
## List feature flags for a project
Gets all feature flags of the requested project.
```
GET /projects/:id/feature_flags
```
| Attribute | Type | Required | Description |
| ------------------- | ---------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). |
| `scope` | string | no | The condition of feature flags, one of: `enabled`, `disabled`. |
```bash
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flags
```
Example response:
```json
[
{
"name":"merge_train",
"description":"This feature is about merge train",
"created_at":"2019-11-04T08:13:51.423Z",
"updated_at":"2019-11-04T08:13:51.423Z",
"scopes":[
{
"id":82,
"active":false,
"environment_scope":"*",
"strategies":[
{
"name":"default",
"parameters":{
}
}
],
"created_at":"2019-11-04T08:13:51.425Z",
"updated_at":"2019-11-04T08:13:51.425Z"
},
{
"id":83,
"active":true,
"environment_scope":"review/*",
"strategies":[
{
"name":"default",
"parameters":{
}
}
],
"created_at":"2019-11-04T08:13:51.427Z",
"updated_at":"2019-11-04T08:13:51.427Z"
},
{
"id":84,
"active":false,
"environment_scope":"production",
"strategies":[
{
"name":"default",
"parameters":{
}
}
],
"created_at":"2019-11-04T08:13:51.428Z",
"updated_at":"2019-11-04T08:13:51.428Z"
}
]
},
{
"name":"new_live_trace",
"description":"This is a new live trace feature",
"created_at":"2019-11-04T08:13:10.507Z",
"updated_at":"2019-11-04T08:13:10.507Z",
"scopes":[
{
"id":79,
"active":false,
"environment_scope":"*",
"strategies":[
{
"name":"default",
"parameters":{
}
}
],
"created_at":"2019-11-04T08:13:10.516Z",
"updated_at":"2019-11-04T08:13:10.516Z"
},
{
"id":80,
"active":true,
"environment_scope":"staging",
"strategies":[
{
"name":"default",
"parameters":{
}
}
],
"created_at":"2019-11-04T08:13:10.525Z",
"updated_at":"2019-11-04T08:13:10.525Z"
},
{
"id":81,
"active":false,
"environment_scope":"production",
"strategies":[
{
"name":"default",
"parameters":{
}
}
],
"created_at":"2019-11-04T08:13:10.527Z",
"updated_at":"2019-11-04T08:13:10.527Z"
}
]
}
]
```
## New feature flag
Creates a new feature flag.
```
POST /projects/:id/feature_flags
```
| Attribute | Type | Required | Description |
| ------------------- | ---------------- | ---------- | ---------------------------------------------------------------------------------------|
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). |
| `name` | string | yes | The name of the feature flag. |
| `description` | string | no | The description of the feature flag. |
| `scopes` | JSON | no | The [feature flag specs](../user/project/operations/feature_flags.md#define-environment-specs) of the feature flag. |
| `scopes:environment_scope` | string | no | The [environment spec](../ci/environments.md#scoping-environments-with-specs). |
| `scopes:active` | boolean | no | Whether the spec is active. |
| `scopes:strategies` | JSON | no | The [strategies](../user/project/operations/feature_flags.md#feature-flag-strategies) of the feature flag spec. |
```bash
curl https://gitlab.example.com/api/v4/projects/1/feature_flags \
--header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-type: application/json" \
--data @- << EOF
{
"name": "awesome_feature",
"scopes": [{ "environment_scope": "*", "active": false, "strategies": [{ "name": "default", "parameters": {} }] },
{ "environment_scope": "production", "active": true, "strategies": [{ "name": "userWithId", "parameters": { "userIds": "1,2,3" } }] }]
}
EOF
```
Example response:
```json
{
"name":"awesome_feature",
"description":null,
"created_at":"2019-11-04T08:32:27.288Z",
"updated_at":"2019-11-04T08:32:27.288Z",
"scopes":[
{
"id":85,
"active":false,
"environment_scope":"*",
"strategies":[
{
"name":"default",
"parameters":{
}
}
],
"created_at":"2019-11-04T08:32:29.324Z",
"updated_at":"2019-11-04T08:32:29.324Z"
},
{
"id":86,
"active":true,
"environment_scope":"production",
"strategies":[
{
"name":"userWithId",
"parameters":{
"userIds":"1,2,3"
}
}
],
"created_at":"2019-11-04T08:32:29.328Z",
"updated_at":"2019-11-04T08:32:29.328Z"
}
]
}
```
## Single feature flag
Gets a single feature flag.
```
GET /projects/:id/feature_flags/:name
```
| Attribute | Type | Required | Description |
| ------------------- | ---------------- | ---------- | ---------------------------------------------------------------------------------------|
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). |
| `name` | string | yes | The name of the feature flag. |
```bash
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/feature_flags/new_live_trace
```
Example response:
```json
{
"name":"new_live_trace",
"description":"This is a new live trace feature",
"created_at":"2019-11-04T08:13:10.507Z",
"updated_at":"2019-11-04T08:13:10.507Z",
"scopes":[
{
"id":79,
"active":false,
"environment_scope":"*",
"strategies":[
{
"name":"default",
"parameters":{
}
}
],
"created_at":"2019-11-04T08:13:10.516Z",
"updated_at":"2019-11-04T08:13:10.516Z"
},
{
"id":80,
"active":true,
"environment_scope":"staging",
"strategies":[
{
"name":"default",
"parameters":{
}
}
],
"created_at":"2019-11-04T08:13:10.525Z",
"updated_at":"2019-11-04T08:13:10.525Z"
},
{
"id":81,
"active":false,
"environment_scope":"production",
"strategies":[
{
"name":"default",
"parameters":{
}
}
],
"created_at":"2019-11-04T08:13:10.527Z",
"updated_at":"2019-11-04T08:13:10.527Z"
}
]
}
```
## Delete feature flag
Deletes a feature flag.
```
DELETE /projects/:id/feature_flags/:name
```
| Attribute | Type | Required | Description |
| ------------------- | ---------------- | ---------- | ---------------------------------------------------------------------------------------|
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). |
| `name` | string | yes | The name of the feature flag. |
```bash
curl --header "PRIVATE-TOKEN: <your_access_token>" --request DELETE https://gitlab.example.com/api/v4/projects/1/feature_flags/awesome_feature
```
...@@ -287,7 +287,7 @@ git reset HEAD~1 ...@@ -287,7 +287,7 @@ git reset HEAD~1
This leaves the changed files and folders unstaged in your local repository. This leaves the changed files and folders unstaged in your local repository.
CAUTION: **Warning:** CAUTION: **Warning:**
A Git commit should not usually be reverse, particularly if you already pushed it A Git commit should not usually be reversed, particularly if you already pushed it
to the remote repository. Although you can undo a commit, the best option is to avoid to the remote repository. Although you can undo a commit, the best option is to avoid
the situation altogether by working carefully. the situation altogether by working carefully.
......
...@@ -51,7 +51,7 @@ The following table depicts the various user permission levels in a project. ...@@ -51,7 +51,7 @@ The following table depicts the various user permission levels in a project.
| View Security reports **(ULTIMATE)** | ✓ (*3*) | ✓ | ✓ | ✓ | ✓ | | View Security reports **(ULTIMATE)** | ✓ (*3*) | ✓ | ✓ | ✓ | ✓ |
| View Dependency list **(ULTIMATE)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | View Dependency list **(ULTIMATE)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ |
| View licenses in Dependency list **(ULTIMATE)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | View licenses in Dependency list **(ULTIMATE)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ |
| View [Design Management](project/issues/design_management.md) pages **(PREMIUM)** | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | View [Design Management](project/issues/design_management.md) pages **(PREMIUM)** | ✓ | ✓ | ✓ | ✓ | ✓ |
| View project code | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | View project code | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ |
| Pull project code | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ | | Pull project code | ✓ (*1*) | ✓ | ✓ | ✓ | ✓ |
| View GitLab Pages protected by [access control](project/pages/introduction.md#gitlab-pages-access-control-core) | ✓ | ✓ | ✓ | ✓ | ✓ | | View GitLab Pages protected by [access control](project/pages/introduction.md#gitlab-pages-access-control-core) | ✓ | ✓ | ✓ | ✓ | ✓ |
...@@ -103,6 +103,7 @@ The following table depicts the various user permission levels in a project. ...@@ -103,6 +103,7 @@ The following table depicts the various user permission levels in a project.
| Apply code change suggestions | | | ✓ | ✓ | ✓ | | Apply code change suggestions | | | ✓ | ✓ | ✓ |
| Create and edit wiki pages | | | ✓ | ✓ | ✓ | | Create and edit wiki pages | | | ✓ | ✓ | ✓ |
| Rewrite/remove Git tags | | | ✓ | ✓ | ✓ | | Rewrite/remove Git tags | | | ✓ | ✓ | ✓ |
| Manage Feature Flags **(PREMIUM)** | | | ✓ | ✓ | ✓ |
| Use environment terminals | | | | ✓ | ✓ | | Use environment terminals | | | | ✓ | ✓ |
| Run Web IDE's Interactive Web Terminals **(ULTIMATE ONLY)** | | | | ✓ | ✓ | | Run Web IDE's Interactive Web Terminals **(ULTIMATE ONLY)** | | | | ✓ | ✓ |
| Add new team members | | | | ✓ | ✓ | | Add new team members | | | | ✓ | ✓ |
......
...@@ -81,7 +81,14 @@ NOTE: **NOTE** ...@@ -81,7 +81,14 @@ NOTE: **NOTE**
We'd highly recommend you to use the [Environment](../../../ci/environments.md) We'd highly recommend you to use the [Environment](../../../ci/environments.md)
feature in order to quickly assess which flag is enabled per environment. feature in order to quickly assess which flag is enabled per environment.
## Rollout strategy ## Feature Flag strategies
GitLab Feature Flag adopts [Unleash](https://unleash.github.io)
as the feature flag engine. In unleash, there is a concept of rulesets for granular feature flag controls,
called [strategies](https://unleash.github.io/docs/activation_strategy).
Supported strategies for GitLab Feature Flags are described below.
### Rollout strategy
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/8240) in GitLab 12.2. > [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/8240) in GitLab 12.2.
...@@ -91,13 +98,13 @@ The status of an environment spec ultimately determines whether or not a feature ...@@ -91,13 +98,13 @@ The status of an environment spec ultimately determines whether or not a feature
For instance, a feature will always be disabled for every user if the matching environment spec has a disabled status, regardless of the chosen rollout strategy. For instance, a feature will always be disabled for every user if the matching environment spec has a disabled status, regardless of the chosen rollout strategy.
However, a feature will be enabled for 50% of logged-in users if the matching environment spec has an enabled status along with a **Percent rollout (logged in users)** strategy set to 50%. However, a feature will be enabled for 50% of logged-in users if the matching environment spec has an enabled status along with a **Percent rollout (logged in users)** strategy set to 50%.
### All users #### All users
Enables the feature for all users. It is implemented using the Unleash Enables the feature for all users. It is implemented using the Unleash
[`default`](https://unleash.github.io/docs/activation_strategy#default) [`default`](https://unleash.github.io/docs/activation_strategy#default)
activation strategy. activation strategy.
### Percent rollout (logged in users) #### Percent rollout (logged in users)
Enables the feature for a percentage of authenticated users. It is Enables the feature for a percentage of authenticated users. It is
implemented using the Unleash implemented using the Unleash
...@@ -112,7 +119,7 @@ CAUTION: **Caution:** ...@@ -112,7 +119,7 @@ CAUTION: **Caution:**
If this strategy is selected, then the Unleash client **must** be given a user If this strategy is selected, then the Unleash client **must** be given a user
ID for the feature to be enabled. See the [Ruby example](#ruby-application-example) below. ID for the feature to be enabled. See the [Ruby example](#ruby-application-example) below.
## Target users ### Target users strategy
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/8240) in GitLab 12.2. > [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/8240) in GitLab 12.2.
...@@ -134,7 +141,7 @@ In order to use Feature Flags, you need to first ...@@ -134,7 +141,7 @@ In order to use Feature Flags, you need to first
[get the access credentials](#configuring-feature-flags) from GitLab and then [get the access credentials](#configuring-feature-flags) from GitLab and then
prepare your application and hook it with a [client library](#client-libraries). prepare your application and hook it with a [client library](#client-libraries).
### Configuring Feature Flags ## Configuring Feature Flags
To get the access credentials that your application will need to talk to GitLab: To get the access credentials that your application will need to talk to GitLab:
...@@ -153,7 +160,7 @@ if **Instance ID** will be single token or multiple tokens, assigned to the ...@@ -153,7 +160,7 @@ if **Instance ID** will be single token or multiple tokens, assigned to the
**Environment**. Also, **Application name** could describe the version of **Environment**. Also, **Application name** could describe the version of
application instead of the running environment. application instead of the running environment.
### Client libraries ## Client libraries
GitLab currently implements a single backend that is compatible with GitLab currently implements a single backend that is compatible with
[Unleash](https://github.com/Unleash/unleash#client-implementations) clients. [Unleash](https://github.com/Unleash/unleash#client-implementations) clients.
...@@ -178,7 +185,7 @@ Community contributed clients: ...@@ -178,7 +185,7 @@ Community contributed clients:
- [Unofficial .Net Core Unleash client](https://github.com/onybo/unleash-client-core) - [Unofficial .Net Core Unleash client](https://github.com/onybo/unleash-client-core)
- [Unleash client for Python 3](https://github.com/aes/unleash-client-python) - [Unleash client for Python 3](https://github.com/aes/unleash-client-python)
### Golang application example ## Golang application example
Here's an example of how to integrate the feature flags in a Golang application: Here's an example of how to integrate the feature flags in a Golang application:
...@@ -219,7 +226,7 @@ func main() { ...@@ -219,7 +226,7 @@ func main() {
} }
``` ```
### Ruby application example ## Ruby application example
Here's an example of how to integrate the feature flags in a Ruby application. Here's an example of how to integrate the feature flags in a Ruby application.
...@@ -249,3 +256,11 @@ else ...@@ -249,3 +256,11 @@ else
puts "hello, world!" puts "hello, world!"
end end
``` ```
## Feature Flags API
You can create, update, read, and delete Feature Flags via API
to control them in an automated flow:
- [Feature Flags API](../../../api/feature_flags.md)
- [Feature Flag Specs API](../../../api/feature_flag_specs.md)
...@@ -65,6 +65,27 @@ project. ...@@ -65,6 +65,27 @@ project.
![Releases list](img/releases.png) ![Releases list](img/releases.png)
## Editing a release
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/26016) in GitLab 12.5.
To edit the details of a release, navigate to **Project overview > Releases** and click
the edit button (pencil icon) in the top-right corner of the release you want to modify.
![A release with an edit button](img/release_edit_button_v12_5.png)
This will bring you to the **Edit Release** page, from which you can
change some of the release's details.
![Edit release page](img/edit_release_page_v12_5.png)
Currently, it is only possible to edit the release title and notes.
To change other release information, such as its tag, associated
milestones, or release date, use the
[Releases API](../../../api/releases/index.md#update-a-release). Editing this
information through the **Edit Release** page is planned for a future version
of GitLab.
## Notification for Releases ## Notification for Releases
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/26001) in GitLab 12.4. > [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/26001) in GitLab 12.4.
...@@ -85,17 +106,82 @@ drag and drop files to it. Release notes are stored in GitLab's database. ...@@ -85,17 +106,82 @@ drag and drop files to it. Release notes are stored in GitLab's database.
There are several ways to add release notes: There are several ways to add release notes:
- In the interface, when you create a new Git tag - In the interface, when you create a new Git tag.
- In the interface, by adding a note to an existing Git tag - In the interface, by adding a note to an existing Git tag.
- Using the GitLab API - Using the GitLab API.
### New tag page with release notes text area To create a new tag, navigate to your project's **Repository > Tags** and
click **New tag**. From there, you can fill the form with all the information
![new_tag](img/new_tag.png) about the release:
### Tags page with button to add or edit release notes for existing Git tag ![new_tag](img/new_tag_12_5.png "Creation of a new tag.")
![tags](img/tags.png) You can also edit an existing tag to add release notes:
![tags](img/tags_12_5.png "Addition of note to an existing tag")
## Release Evidence
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/26019) in GitLab 12.5.
Each time a new release is created, specific related data is collected in
parallel. This dataset will be a snapshot this new release (including linked
milestones and issues) at moment of creation. Such collection of data will
provide a chain of custody and facilitate processes like external audits, for example.
The gathered Evidence data is stored in the database upon creation of a new
release as a JSON object. In GitLab 12.5, a link to
the Evidence data is provided for [each Release](#releases-list).
Here's what this object can look like:
```json
{
"release": {
"id": 5,
"tag": "v4.0",
"name": "New release",
"project_id": 45,
"project_name": "Project name",
"released_at": "2019-06-28 13:23:40 UTC",
"milestones": [
{
"id": 11,
"title": "v4.0-rc1",
"state": "closed",
"due_date": "2019-05-12 12:00:00 UTC",
"created_at": "2019-04-17 15:45:12 UTC",
"issues": [
{
"id": 82,
"title": "The top-right popup is broken",
"author_name": "John Doe",
"author_email": "john@doe.com",
"state": "closed",
"due_date": "2019-05-10 12:00:00 UTC"
},
{
"id": 89,
"title": "The title of this page is misleading",
"author_name": "Jane Smith",
"author_email": "jane@smith.com",
"state": "closed",
"due_date": "nil"
}
]
},
{
"id": 12,
"title": "v4.0-rc2",
"state": "closed",
"due_date": "2019-05-30 18:30:00 UTC",
"created_at": "2019-04-17 15:45:12 UTC",
"issues": []
}
]
}
}
```
<!-- ## Troubleshooting <!-- ## Troubleshooting
......
...@@ -11878,15 +11878,36 @@ msgstr "" ...@@ -11878,15 +11878,36 @@ msgstr ""
msgid "Package was removed" msgid "Package was removed"
msgstr "" msgstr ""
msgid "PackageRegistry|Copy npm command"
msgstr ""
msgid "PackageRegistry|Copy npm setup command"
msgstr ""
msgid "PackageRegistry|Copy yarn command"
msgstr ""
msgid "PackageRegistry|Copy yarn setup command"
msgstr ""
msgid "PackageRegistry|Delete Package" msgid "PackageRegistry|Delete Package"
msgstr "" msgstr ""
msgid "PackageRegistry|Delete Package Version" msgid "PackageRegistry|Delete Package Version"
msgstr "" msgstr ""
msgid "PackageRegistry|Installation"
msgstr ""
msgid "PackageRegistry|Learn how to %{noPackagesLinkStart}publish and share your packages%{noPackagesLinkEnd} with GitLab." msgid "PackageRegistry|Learn how to %{noPackagesLinkStart}publish and share your packages%{noPackagesLinkEnd} with GitLab."
msgstr "" msgstr ""
msgid "PackageRegistry|Package installation"
msgstr ""
msgid "PackageRegistry|Registry Setup"
msgstr ""
msgid "PackageRegistry|Remove package" msgid "PackageRegistry|Remove package"
msgstr "" msgstr ""
...@@ -11905,6 +11926,15 @@ msgstr "" ...@@ -11905,6 +11926,15 @@ msgstr ""
msgid "PackageRegistry|You are about to delete version %{boldStart}%{version}%{boldEnd} of %{boldStart}%{name}%{boldEnd}. Are you sure?" msgid "PackageRegistry|You are about to delete version %{boldStart}%{version}%{boldEnd} of %{boldStart}%{name}%{boldEnd}. Are you sure?"
msgstr "" msgstr ""
msgid "PackageRegistry|You may also need to setup authentication using an auth token. %{linkStart}See the documentation%{linkEnd} to find out more."
msgstr ""
msgid "PackageRegistry|npm"
msgstr ""
msgid "PackageRegistry|yarn"
msgstr ""
msgid "Packages" msgid "Packages"
msgstr "" msgstr ""
...@@ -18443,6 +18473,9 @@ msgstr "" ...@@ -18443,6 +18473,9 @@ msgstr ""
msgid "Updated %{updated_at} by %{updated_by}" msgid "Updated %{updated_at} by %{updated_by}"
msgstr "" msgstr ""
msgid "Updated at"
msgstr ""
msgid "Updated to" msgid "Updated to"
msgstr "" msgstr ""
......
...@@ -62,6 +62,13 @@ describe 'Editing file blob', :js do ...@@ -62,6 +62,13 @@ describe 'Editing file blob', :js do
expect(page).to have_content 'NextFeature' expect(page).to have_content 'NextFeature'
end end
it 'editing a template file in a sub directory does not change path' do
project.repository.create_file(user, 'ci/.gitlab-ci.yml', 'test', message: 'testing', branch_name: branch)
visit project_edit_blob_path(project, tree_join(branch, 'ci/.gitlab-ci.yml'))
expect(find_by_id('file_path').value).to eq('ci/.gitlab-ci.yml')
end
context 'from blob file path' do context 'from blob file path' do
before do before do
visit project_blob_path(project, tree_join(branch, file_path)) visit project_blob_path(project, tree_join(branch, file_path))
......
/* eslint-disable no-var */
import $ from 'jquery'; import $ from 'jquery';
import MockAdapter from 'axios-mock-adapter'; import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils'; import axios from '~/lib/utils/axios_utils';
...@@ -11,9 +10,9 @@ import initMrPage from './helpers/init_vue_mr_page_helper'; ...@@ -11,9 +10,9 @@ import initMrPage from './helpers/init_vue_mr_page_helper';
describe('MergeRequestTabs', function() { describe('MergeRequestTabs', function() {
let mrPageMock; let mrPageMock;
var stubLocation = {}; const stubLocation = {};
var setLocation = function(stubs) { const setLocation = function(stubs) {
var defaults = { const defaults = {
pathname: '', pathname: '',
search: '', search: '',
hash: '', hash: '',
...@@ -44,9 +43,9 @@ describe('MergeRequestTabs', function() { ...@@ -44,9 +43,9 @@ describe('MergeRequestTabs', function() {
}); });
describe('opensInNewTab', function() { describe('opensInNewTab', function() {
var tabUrl; const windowTarget = '_blank';
var windowTarget = '_blank';
let clickTabParams; let clickTabParams;
let tabUrl;
beforeEach(function() { beforeEach(function() {
loadFixtures('merge_requests/merge_request_with_task_list.html'); loadFixtures('merge_requests/merge_request_with_task_list.html');
...@@ -193,11 +192,10 @@ describe('MergeRequestTabs', function() { ...@@ -193,11 +192,10 @@ describe('MergeRequestTabs', function() {
}); });
it('replaces the current history state', function() { it('replaces the current history state', function() {
var newState;
setLocation({ setLocation({
pathname: '/foo/bar/merge_requests/1', pathname: '/foo/bar/merge_requests/1',
}); });
newState = this.subject('commits'); const newState = this.subject('commits');
expect(this.spies.history).toHaveBeenCalledWith( expect(this.spies.history).toHaveBeenCalledWith(
{ {
......
/* eslint-disable no-var, no-return-assign */ /* eslint-disable no-return-assign */
import $ from 'jquery'; import $ from 'jquery';
import syntaxHighlight from '~/syntax_highlight'; import syntaxHighlight from '~/syntax_highlight';
describe('Syntax Highlighter', function() { describe('Syntax Highlighter', function() {
var stubUserColorScheme; const stubUserColorScheme = function(value) {
stubUserColorScheme = function(value) {
if (window.gon == null) { if (window.gon == null) {
window.gon = {}; window.gon = {};
} }
...@@ -40,9 +39,8 @@ describe('Syntax Highlighter', function() { ...@@ -40,9 +39,8 @@ describe('Syntax Highlighter', function() {
}); });
it('prevents an infinite loop when no matches exist', function() { it('prevents an infinite loop when no matches exist', function() {
var highlight;
setFixtures('<div></div>'); setFixtures('<div></div>');
highlight = function() { const highlight = function() {
return syntaxHighlight($('div')); return syntaxHighlight($('div'));
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment