Commit 421ea021 authored by GitLab Bot's avatar GitLab Bot

Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-10-01

parents 71937c6d f13636b6
......@@ -115,9 +115,6 @@ gem 'hamlit', '~> 2.8.8'
gem 'carrierwave', '= 1.2.3'
gem 'mini_magick'
# Drag and Drop UI
gem 'dropzonejs-rails', '~> 0.7.1'
# for backups
gem 'fog-aws', '~> 2.0.1'
gem 'fog-core', '~> 1.44'
......
......@@ -183,8 +183,6 @@ GEM
doorkeeper-openid_connect (1.5.0)
doorkeeper (~> 4.3)
json-jwt (~> 1.6)
dropzonejs-rails (0.7.2)
rails (> 3.1)
ed25519 (1.2.4)
elasticsearch (5.0.3)
elasticsearch-api (= 5.0.3)
......@@ -1036,7 +1034,6 @@ DEPENDENCIES
diffy (~> 3.1.0)
doorkeeper (~> 4.3)
doorkeeper-openid_connect (~> 1.5)
dropzonejs-rails (~> 0.7.1)
ed25519 (~> 1.2)
elasticsearch-api (= 5.0.3)
elasticsearch-model (~> 0.1.9)
......
......@@ -186,8 +186,6 @@ GEM
doorkeeper-openid_connect (1.5.0)
doorkeeper (~> 4.3)
json-jwt (~> 1.6)
dropzonejs-rails (0.7.2)
rails (> 3.1)
ed25519 (1.2.4)
elasticsearch (5.0.3)
elasticsearch-api (= 5.0.3)
......@@ -1045,7 +1043,6 @@ DEPENDENCIES
diffy (~> 3.1.0)
doorkeeper (~> 4.3)
doorkeeper-openid_connect (~> 1.5)
dropzonejs-rails (~> 0.7.1)
ed25519 (~> 1.2)
elasticsearch-api (= 5.0.3)
elasticsearch-model (~> 0.1.9)
......
import Api from '~/api';
import { __ } from '~/locale';
import { normalizeHeaders } from '~/lib/utils/common_utils';
import * as types from './mutation_types';
import eventHub from '../../../eventhub';
......@@ -22,13 +23,21 @@ export const receiveTemplateTypesError = ({ commit, dispatch }) => {
export const receiveTemplateTypesSuccess = ({ commit }, templates) =>
commit(types.RECEIVE_TEMPLATE_TYPES_SUCCESS, templates);
export const fetchTemplateTypes = ({ dispatch, state }) => {
export const fetchTemplateTypes = ({ dispatch, state }, page = 1) => {
if (!Object.keys(state.selectedTemplateType).length) return Promise.reject();
dispatch('requestTemplateTypes');
return Api.templates(state.selectedTemplateType.key)
.then(({ data }) => dispatch('receiveTemplateTypesSuccess', data))
return Api.templates(state.selectedTemplateType.key, { page })
.then(({ data, headers }) => {
const nextPage = parseInt(normalizeHeaders(headers)['X-NEXT-PAGE'], 10);
dispatch('receiveTemplateTypesSuccess', data);
if (nextPage) {
dispatch('fetchTemplateTypes', nextPage);
}
})
.catch(() => dispatch('receiveTemplateTypesError'));
};
......
......@@ -9,7 +9,7 @@ export default {
},
[types.RECEIVE_TEMPLATE_TYPES_SUCCESS](state, templates) {
state.isLoading = false;
state.templates = templates;
state.templates = state.templates.concat(templates);
},
[types.SET_SELECTED_TEMPLATE_TYPE](state, type) {
state.selectedTemplateType = type;
......
......@@ -5,7 +5,6 @@
*= require jquery.atwho
*= require select2
*= require_self
*= require dropzone/basic
*= require cropper.css
*/
......@@ -18,6 +17,7 @@
*/
@import "../../../node_modules/pikaday/scss/pikaday";
@import "../../../node_modules/dropzone/dist/basic.css";
/*
* GitLab UI framework
......
---
title: Skip creating auto devops jobs for sast, container_scanning, dast, dependency_scanning
when not licensed
merge_request: 21959
author:
type: performance
---
title: Fixed file templates not fully being fetched in Web IDE
merge_request:
author:
type: fixed
......@@ -208,5 +208,9 @@ module ActiveRecord
index_parts << "comment: #{index.comment.inspect}" if Gitlab.rails5? && index.comment
index_parts
end
def format_options(options)
options.map { |key, value| "#{key}: #{value.inspect}" }.join(", ")
end
end
end
......@@ -90,6 +90,8 @@ Like [Get file from repository](repository_files.md#get-file-from-repository) yo
## Create new file in repository
This allows you to create a single file. For creating multiple files with a single request see the [commits API](commits.html#create-a-commit-with-multiple-files-and-actions).
```
POST /projects/:id/repository/files/:file_path
```
......@@ -120,6 +122,8 @@ Parameters:
## Update existing file in repository
This allows you to update a single file. For updating multiple files with a single request see the [commits API](commits.html#create-a-commit-with-multiple-files-and-actions).
```
PUT /projects/:id/repository/files/:file_path
```
......@@ -160,6 +164,8 @@ Currently gitlab-shell has a boolean return code, preventing GitLab from specify
## Delete existing file in repository
This allows you to delete a single file. For deleting multiple files with a singleh request see the [commits API](commits.html#create-a-commit-with-multiple-files-and-actions).
```
DELETE /projects/:id/repository/files/:file_path
```
......
......@@ -162,7 +162,10 @@ sast:
artifacts:
paths: [gl-sast-report.json]
only:
- branches
refs:
- branches
variables:
- $GITLAB_FEATURES =~ /\bsast\b/
except:
variables:
- $SAST_DISABLED
......@@ -179,7 +182,10 @@ dependency_scanning:
artifacts:
paths: [gl-dependency-scanning-report.json]
only:
- branches
refs:
- branches
variables:
- $GITLAB_FEATURES =~ /\bdependency_scanning\b/
except:
variables:
- $DEPENDENCY_SCANNING_DISABLED
......@@ -196,7 +202,10 @@ container_scanning:
artifacts:
paths: [gl-container-scanning-report.json]
only:
- branches
refs:
- branches
variables:
- $GITLAB_FEATURES =~ /\bsast_container\b/
except:
variables:
- $CONTAINER_SCANNING_DISABLED
......@@ -215,6 +224,8 @@ dast:
refs:
- branches
kubernetes: active
variables:
- $GITLAB_FEATURES =~ /\bdast\b/
except:
refs:
- master
......
......@@ -69,11 +69,17 @@ describe('IDE file templates actions', () => {
describe('fetchTemplateTypes', () => {
describe('success', () => {
let nextPage;
beforeEach(() => {
mock.onGet(/api\/(.*)\/templates\/licenses/).replyOnce(200, [
{
name: 'MIT',
},
mock.onGet(/api\/(.*)\/templates\/licenses/).replyOnce(() => [
200,
[
{
name: 'MIT',
},
],
{ 'X-NEXT-PAGE': nextPage },
]);
});
......@@ -116,6 +122,38 @@ describe('IDE file templates actions', () => {
done,
);
});
it('dispatches actions for next page', done => {
nextPage = '2';
state.selectedTemplateType = {
key: 'licenses',
};
testAction(
actions.fetchTemplateTypes,
null,
state,
[],
[
{
type: 'requestTemplateTypes',
},
{
type: 'receiveTemplateTypesSuccess',
payload: [
{
name: 'MIT',
},
],
},
{
type: 'fetchTemplateTypes',
payload: 2,
},
],
done,
);
});
});
describe('error', () => {
......
......@@ -336,7 +336,6 @@ doorkeeper,4.3.2,MIT
doorkeeper-openid_connect,1.5.0,MIT
dot-prop,4.2.0,MIT
dropzone,4.2.0,MIT
dropzonejs-rails,0.7.2,MIT
duplexer,0.1.1,MIT
duplexer3,0.1.4,New BSD
duplexify,3.5.3,MIT
......
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