Commit 880fa596 authored by Rémy Coutable's avatar Rémy Coutable

Merge remote-tracking branch 'origin/master' into ce-to-ee-2018-02-14

parents 16da0223 9fe6f28c
...@@ -10,7 +10,6 @@ import SearchAutocomplete from './search_autocomplete'; ...@@ -10,7 +10,6 @@ import SearchAutocomplete from './search_autocomplete';
import UsersSelect from './users_select'; import UsersSelect from './users_select';
import UserCallout from './user_callout'; import UserCallout from './user_callout';
import ZenMode from './zen_mode'; import ZenMode from './zen_mode';
import initCompareAutocomplete from './compare_autocomplete';
import initGeoInfoModal from 'ee/init_geo_info_modal'; // eslint-disable-line import/first import initGeoInfoModal from 'ee/init_geo_info_modal'; // eslint-disable-line import/first
import initGroupAnalytics from 'ee/init_group_analytics'; // eslint-disable-line import/first import initGroupAnalytics from 'ee/init_group_analytics'; // eslint-disable-line import/first
import initPathLocks from 'ee/path_locks'; // eslint-disable-line import/first import initPathLocks from 'ee/path_locks'; // eslint-disable-line import/first
...@@ -53,19 +52,6 @@ var Dispatcher; ...@@ -53,19 +52,6 @@ var Dispatcher;
}); });
}); });
function initBlobEE() {
const dataEl = document.getElementById('js-file-lock');
if (dataEl) {
const {
toggle_path,
path,
} = JSON.parse(dataEl.innerHTML);
initPathLocks(toggle_path, path);
}
}
switch (page) { switch (page) {
case 'projects:environments:metrics': case 'projects:environments:metrics':
import('./pages/projects/environments/metrics') import('./pages/projects/environments/metrics')
...@@ -86,7 +72,6 @@ var Dispatcher; ...@@ -86,7 +72,6 @@ var Dispatcher;
import('./pages/projects/milestones/show') import('./pages/projects/milestones/show')
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
new UserCallout();
break; break;
case 'groups:milestones:show': case 'groups:milestones:show':
import('./pages/groups/milestones/show') import('./pages/groups/milestones/show')
...@@ -185,14 +170,6 @@ var Dispatcher; ...@@ -185,14 +170,6 @@ var Dispatcher;
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
break; break;
case 'groups:epics:show':
new ZenMode();
break;
case 'groups:epics:index':
import(/* webpackChunkName: "ee_epics_show" */ 'ee/pages/epics')
.then(callDefault)
.catch(fail);
break;
case 'projects:compare:show': case 'projects:compare:show':
import('./pages/projects/compare/show') import('./pages/projects/compare/show')
.then(callDefault) .then(callDefault)
...@@ -229,24 +206,17 @@ var Dispatcher; ...@@ -229,24 +206,17 @@ var Dispatcher;
import('./pages/projects/merge_requests/creations/new') import('./pages/projects/merge_requests/creations/new')
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
new UserCallout();
case 'projects:merge_requests:creations:diffs': case 'projects:merge_requests:creations:diffs':
import('./pages/projects/merge_requests/creations/diffs') import('./pages/projects/merge_requests/creations/diffs')
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
shortcut_handler = true; shortcut_handler = true;
// ee-start
initApprovals();
// ee-end
break; break;
case 'projects:merge_requests:edit': case 'projects:merge_requests:edit':
import('./pages/projects/merge_requests/edit') import('./pages/projects/merge_requests/edit')
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
shortcut_handler = true; shortcut_handler = true;
// ee-start
initApprovals();
// ee-end
break; break;
case 'projects:tags:new': case 'projects:tags:new':
import('./pages/projects/tags/new') import('./pages/projects/tags/new')
...@@ -331,9 +301,6 @@ var Dispatcher; ...@@ -331,9 +301,6 @@ var Dispatcher;
break; break;
case 'projects:show': case 'projects:show':
shortcut_handler = true; shortcut_handler = true;
// ee-start
initGeoInfoModal();
// ee-end
break; break;
case 'projects:edit': case 'projects:edit':
import(/* webpackChunkName: "ee_projects_edit" */ 'ee/pages/projects/edit') import(/* webpackChunkName: "ee_projects_edit" */ 'ee/pages/projects/edit')
...@@ -415,14 +382,12 @@ var Dispatcher; ...@@ -415,14 +382,12 @@ var Dispatcher;
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
shortcut_handler = true; shortcut_handler = true;
initBlobEE();
break; break;
case 'projects:blame:show': case 'projects:blame:show':
import('./pages/projects/blame/show') import('./pages/projects/blame/show')
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
shortcut_handler = true; shortcut_handler = true;
initBlobEE();
break; break;
case 'groups:labels:new': case 'groups:labels:new':
import('./pages/groups/labels/new') import('./pages/groups/labels/new')
...@@ -485,26 +450,11 @@ var Dispatcher; ...@@ -485,26 +450,11 @@ var Dispatcher;
import('./pages/search/show') import('./pages/search/show')
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
new UserCallout();
break;
case 'projects:mirrors:show':
case 'projects:mirrors:update':
new UsersSelect();
break;
case 'admin:emails:show':
import(/* webpackChunkName: "ee_admin_emails_show" */ 'ee/pages/admin/emails/show').then(m => m.default()).catch(fail);
break;
case 'admin:audit_logs:index':
import(/* webpackChunkName: "ee_audit_logs" */ 'ee/pages/admin/audit_logs').then(m => m.default()).catch(fail);
break; break;
case 'projects:settings:repository:show': case 'projects:settings:repository:show':
import('./pages/projects/settings/repository/show') import('./pages/projects/settings/repository/show')
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
// ee-start
new UsersSelect();
new UserCallout();
// ee-end
break; break;
case 'projects:settings:ci_cd:show': case 'projects:settings:ci_cd:show':
import('./pages/projects/settings/ci_cd/show') import('./pages/projects/settings/ci_cd/show')
...@@ -552,11 +502,6 @@ var Dispatcher; ...@@ -552,11 +502,6 @@ var Dispatcher;
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
break; break;
case 'profiles:personal_access_tokens:index':
import('./pages/profiles/personal_access_tokens')
.then(callDefault)
.catch(fail);
break;
case 'projects:clusters:show': case 'projects:clusters:show':
case 'projects:clusters:update': case 'projects:clusters:update':
case 'projects:clusters:destroy': case 'projects:clusters:destroy':
...@@ -573,14 +518,6 @@ var Dispatcher; ...@@ -573,14 +518,6 @@ var Dispatcher;
import('./pages/dashboard/groups/index') import('./pages/dashboard/groups/index')
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
case 'admin:licenses:new':
import(/* webpackChunkName: "admin_licenses" */ 'ee/pages/admin/licenses/new').then(m => m.default()).catch(fail);
break;
case 'groups:analytics:show':
initGroupAnalytics();
break;
case 'groups:ldap_group_links:index':
initLDAPGroupsSelect();
break; break;
} }
switch (path[0]) { switch (path[0]) {
...@@ -616,11 +553,7 @@ var Dispatcher; ...@@ -616,11 +553,7 @@ var Dispatcher;
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
break; break;
case 'edit':
import(/* webpackChunkName: "ee_admin_groups_edit" */ 'ee/pages/admin/groups/edit').then(m => m.default()).catch(fail);
break;
} }
break; break;
case 'projects': case 'projects':
import('./pages/admin/projects') import('./pages/admin/projects')
...@@ -645,11 +578,6 @@ var Dispatcher; ...@@ -645,11 +578,6 @@ var Dispatcher;
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
break; break;
case 'geo_nodes':
import(/* webpackChunkName: 'geo_node_form' */ './geo/geo_node_form')
.then(geoNodeForm => geoNodeForm.default($('.js-geo-node-form')))
.catch(() => {});
break;
} }
break; break;
case 'profiles': case 'profiles':
...@@ -664,7 +592,9 @@ var Dispatcher; ...@@ -664,7 +592,9 @@ var Dispatcher;
shortcut_handler = true; shortcut_handler = true;
switch (path[1]) { switch (path[1]) {
case 'compare': case 'compare':
initCompareAutocomplete(); import('./pages/projects/compare')
.then(callDefault)
.catch(fail);
break; break;
case 'create': case 'create':
case 'new': case 'new':
...@@ -686,6 +616,81 @@ var Dispatcher; ...@@ -686,6 +616,81 @@ var Dispatcher;
new Shortcuts(); new Shortcuts();
} }
// EE-only route-based code
function initBlobEE() {
const dataEl = document.getElementById('js-file-lock');
if (dataEl) {
const {
toggle_path,
path,
} = JSON.parse(dataEl.innerHTML);
initPathLocks(toggle_path, path);
}
}
switch (page) {
case 'groups:epics:show':
new ZenMode();
break;
case 'groups:epics:index':
import(/* webpackChunkName: "ee_epics_index" */ 'ee/pages/epics')
.then(callDefault)
.catch(fail);
break;
case 'projects:milestones:show':
case 'search:show':
new UserCallout();
break;
case 'projects:merge_requests:creations:new':
new UserCallout();
initApprovals();
break;
case 'projects:merge_requests:creations:diffs':
case 'projects:merge_requests:edit':
initApprovals();
break;
case 'projects:show':
initGeoInfoModal();
break;
case 'projects:blob:show':
case 'projects:blame:show':
initBlobEE();
break;
case 'projects:mirrors:show':
case 'projects:mirrors:update':
new UsersSelect();
break;
case 'admin:emails:show':
import(/* webpackChunkName: "ee_admin_emails_show" */ 'ee/pages/admin/emails/show').then(m => m.default()).catch(fail);
break;
case 'admin:audit_logs:index':
import(/* webpackChunkName: "ee_audit_logs" */ 'ee/pages/admin/audit_logs').then(m => m.default()).catch(fail);
break;
case 'projects:settings:repository:show':
new UsersSelect();
new UserCallout();
break;
case 'admin:licenses:new':
import(/* webpackChunkName: "admin_licenses" */ 'ee/pages/admin/licenses/new').then(m => m.default()).catch(fail);
break;
case 'groups:analytics:show':
initGroupAnalytics();
break;
case 'groups:ldap_group_links:index':
initLDAPGroupsSelect();
break;
case 'admin:groups:edit':
import(/* webpackChunkName: "ee_admin_groups_edit" */ 'ee/pages/admin/groups/edit').then(m => m.default()).catch(fail);
break;
case 'admin:geo_nodes':
import(/* webpackChunkName: 'geo_node_form' */ './geo/geo_node_form')
.then(geoNodeForm => geoNodeForm.default($('.js-geo-node-form')))
.catch(() => {});
break;
}
if (document.querySelector('#peek')) { if (document.querySelector('#peek')) {
import('./performance_bar') import('./performance_bar')
.then(m => new m.default({ container: '#peek' })) // eslint-disable-line new-cap .then(m => new m.default({ container: '#peek' })) // eslint-disable-line new-cap
......
import initForm from '../shared/init_form';
document.addEventListener('DOMContentLoaded', initForm);
import initForm from '../shared/init_form';
document.addEventListener('DOMContentLoaded', initForm);
import Vue from 'vue'; import Vue from 'vue';
import PipelineSchedulesCallout from './components/pipeline_schedules_callout.vue'; import PipelineSchedulesCallout from '../shared/components/pipeline_schedules_callout.vue';
document.addEventListener('DOMContentLoaded', () => new Vue({ document.addEventListener('DOMContentLoaded', () => new Vue({
el: '#pipeline-schedules-callout', el: '#pipeline-schedules-callout',
......
import initForm from '../shared/init_form';
document.addEventListener('DOMContentLoaded', initForm);
<script> <script>
import Vue from 'vue'; import Vue from 'vue';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
import Translate from '../../vue_shared/translate'; import Translate from '../../../../../vue_shared/translate';
import illustrationSvg from '../icons/intro_illustration.svg'; import illustrationSvg from '../icons/intro_illustration.svg';
Vue.use(Translate); Vue.use(Translate);
......
import Vue from 'vue'; import Vue from 'vue';
import Translate from '../vue_shared/translate'; import Translate from '../../../../vue_shared/translate';
import GlFieldErrors from '../gl_field_errors'; import GlFieldErrors from '../../../../gl_field_errors';
import intervalPatternInput from './components/interval_pattern_input.vue'; import intervalPatternInput from './components/interval_pattern_input.vue';
import TimezoneDropdown from './components/timezone_dropdown'; import TimezoneDropdown from './components/timezone_dropdown';
import TargetBranchDropdown from './components/target_branch_dropdown'; import TargetBranchDropdown from './components/target_branch_dropdown';
import setupNativeFormVariableList from '../ci_variable_list/native_form_variable_list'; import setupNativeFormVariableList from '../../../../ci_variable_list/native_form_variable_list';
Vue.use(Translate); Vue.use(Translate);
...@@ -27,7 +27,7 @@ function initIntervalPatternInput() { ...@@ -27,7 +27,7 @@ function initIntervalPatternInput() {
}); });
} }
document.addEventListener('DOMContentLoaded', () => { export default () => {
/* Most of the form is written in haml, but for fields with more complex behaviors, /* Most of the form is written in haml, but for fields with more complex behaviors,
* you should mount individual Vue components here. If at some point components need * you should mount individual Vue components here. If at some point components need
* to share state, it may make sense to refactor the whole form to Vue */ * to share state, it may make sense to refactor the whole form to Vue */
...@@ -46,4 +46,4 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -46,4 +46,4 @@ document.addEventListener('DOMContentLoaded', () => {
container: $('.js-ci-variable-list-section'), container: $('.js-ci-variable-list-section'),
formField: 'schedule', formField: 'schedule',
}); });
}); };
import initForm from '../shared/init_form';
document.addEventListener('DOMContentLoaded', initForm);
import statusIcon from '../mr_widget_status_icon.vue';
export default {
name: 'MRWidgetNotAllowed',
components: {
statusIcon,
},
template: `
<div class="mr-widget-body media">
<status-icon status="success" :show-disabled-button="true" />
<div class="media-body space-children">
<span class="bold">
Ready to be merged automatically.
Ask someone with write access to this repository to merge this request
</span>
</div>
</div>
`,
};
<script>
import StatusIcon from '../mr_widget_status_icon.vue';
export default {
name: 'MRWidgetNotAllowed',
components: {
StatusIcon,
},
};
</script>
<template>
<div class="mr-widget-body media">
<status-icon
status="success"
:show-disabled-button="true"
/>
<div class="media-body space-children">
<span class="bold">
{{ s__(`mrWidget|Ready to be merged automatically.
Ask someone with write access to this repository to merge this request`) }}
</span>
</div>
</div>
</template>
import statusIcon from '../mr_widget_status_icon.vue';
export default {
name: 'MRWidgetPipelineBlocked',
components: {
statusIcon,
},
template: `
<div class="mr-widget-body media">
<status-icon status="warning" :show-disabled-button="true" />
<div class="media-body space-children">
<span class="bold">
Pipeline blocked. The pipeline for this merge request requires a manual action to proceed
</span>
</div>
</div>
`,
};
<script>
import StatusIcon from '../mr_widget_status_icon.vue';
export default {
name: 'MRWidgetPipelineBlocked',
components: {
StatusIcon,
},
};
</script>
<template>
<div class="mr-widget-body media">
<status-icon
status="warning"
:show-disabled-button="true"
/>
<div class="media-body space-children">
<span class="bold">
{{ s__(`mrWidget|Pipeline blocked.
The pipeline for this merge request requires a manual action to proceed`) }}
</span>
</div>
</div>
</template>
...@@ -25,11 +25,11 @@ export { default as ArchivedState } from './components/states/mr_widget_archived ...@@ -25,11 +25,11 @@ export { default as ArchivedState } from './components/states/mr_widget_archived
export { default as ConflictsState } from './components/states/mr_widget_conflicts.vue'; export { default as ConflictsState } from './components/states/mr_widget_conflicts.vue';
export { default as NothingToMergeState } from './components/states/mr_widget_nothing_to_merge'; export { default as NothingToMergeState } from './components/states/mr_widget_nothing_to_merge';
export { default as MissingBranchState } from './components/states/mr_widget_missing_branch.vue'; export { default as MissingBranchState } from './components/states/mr_widget_missing_branch.vue';
export { default as NotAllowedState } from './components/states/mr_widget_not_allowed'; export { default as NotAllowedState } from './components/states/mr_widget_not_allowed.vue';
export { default as ReadyToMergeState } from 'ee/vue_merge_request_widget/components/states/mr_widget_ready_to_merge'; export { default as ReadyToMergeState } from 'ee/vue_merge_request_widget/components/states/mr_widget_ready_to_merge';
export { default as SHAMismatchState } from './components/states/mr_widget_sha_mismatch'; export { default as SHAMismatchState } from './components/states/mr_widget_sha_mismatch';
export { default as UnresolvedDiscussionsState } from './components/states/mr_widget_unresolved_discussions'; export { default as UnresolvedDiscussionsState } from './components/states/mr_widget_unresolved_discussions';
export { default as PipelineBlockedState } from './components/states/mr_widget_pipeline_blocked'; export { default as PipelineBlockedState } from './components/states/mr_widget_pipeline_blocked.vue';
export { default as PipelineFailedState } from './components/states/mr_widget_pipeline_failed'; export { default as PipelineFailedState } from './components/states/mr_widget_pipeline_failed';
export { default as MergeWhenPipelineSucceedsState } from './components/states/mr_widget_merge_when_pipeline_succeeds.vue'; export { default as MergeWhenPipelineSucceedsState } from './components/states/mr_widget_merge_when_pipeline_succeeds.vue';
export { default as RebaseState } from './components/states/mr_widget_rebase.vue'; export { default as RebaseState } from './components/states/mr_widget_rebase.vue';
......
...@@ -266,7 +266,7 @@ class Project < ActiveRecord::Base ...@@ -266,7 +266,7 @@ class Project < ActiveRecord::Base
validates :repository_storage, validates :repository_storage,
presence: true, presence: true,
inclusion: { in: ->(_object) { Gitlab.config.repositories.storages.keys } } inclusion: { in: ->(_object) { Gitlab.config.repositories.storages.keys } }
validates :variables, variable_duplicates: true validates :variables, variable_duplicates: { scope: :environment_scope }
has_many :uploads, as: :model, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_many :uploads, as: :model, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
......
# VariableDuplicatesValidator # VariableDuplicatesValidator
# #
# This validtor is designed for especially the following condition # This validator is designed for especially the following condition
# - Use `accepts_nested_attributes_for :xxx` in a parent model # - Use `accepts_nested_attributes_for :xxx` in a parent model
# - Use `validates :xxx, uniqueness: { scope: :xxx_id }` in a child model # - Use `validates :xxx, uniqueness: { scope: :xxx_id }` in a child model
class VariableDuplicatesValidator < ActiveModel::EachValidator class VariableDuplicatesValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value) def validate_each(record, attribute, value)
duplicates = value.reject(&:marked_for_destruction?).group_by(&:key).select { |_, v| v.many? }.map(&:first) if options[:scope]
scoped = value.group_by do |variable|
Array(options[:scope]).map { |attr| variable.send(attr) } # rubocop:disable GitlabSecurity/PublicSend
end
scoped.each_value { |scope| validate_duplicates(record, attribute, scope) }
else
validate_duplicates(record, attribute, value)
end
end
private
def validate_duplicates(record, attribute, values)
duplicates = values.reject(&:marked_for_destruction?).group_by(&:key).select { |_, v| v.many? }.map(&:first)
if duplicates.any? if duplicates.any?
record.errors.add(attribute, "Duplicate variables: #{duplicates.join(", ")}") error_message = "have duplicate values (#{duplicates.join(", ")})"
error_message += " for #{values.first.send(options[:scope])} scope" if options[:scope] # rubocop:disable GitlabSecurity/PublicSend
record.errors.add(attribute, error_message)
end end
end end
end end
- content_for :page_specific_javascripts do
= webpack_bundle_tag 'common_vue'
= webpack_bundle_tag 'schedule_form'
= form_for [@project.namespace.becomes(Namespace), @project, @schedule], as: :schedule, html: { id: "new-pipeline-schedule-form", class: "form-horizontal js-pipeline-schedule-form" } do |f| = form_for [@project.namespace.becomes(Namespace), @project, @schedule], as: :schedule, html: { id: "new-pipeline-schedule-form", class: "form-horizontal js-pipeline-schedule-form" } do |f|
= form_errors(@schedule) = form_errors(@schedule)
.form-group .form-group
......
- breadcrumb_title _("Schedules") - breadcrumb_title _("Schedules")
- content_for :page_specific_javascripts do
= webpack_bundle_tag 'common_vue'
= webpack_bundle_tag 'schedules_index'
- @no_container = true - @no_container = true
- page_title _("Pipeline Schedules") - page_title _("Pipeline Schedules")
......
---
title: "[Geo] Fix redownload repository recovery when there is not local repo at all"
merge_request:
author:
type: fixed
---
title: Fix validation of environment scope of variables
merge_request:
author:
type: fixed
---
title: Only check LFS integrity for first ref in a push to avoid timeout
merge_request: 17098
author:
type: performance
...@@ -105,8 +105,6 @@ var config = { ...@@ -105,8 +105,6 @@ var config = {
ide: './ide/index.js', ide: './ide/index.js',
sidebar: './sidebar/sidebar_bundle.js', sidebar: './sidebar/sidebar_bundle.js',
ee_sidebar: 'ee/sidebar/sidebar_bundle.js', ee_sidebar: 'ee/sidebar/sidebar_bundle.js',
schedule_form: './pipeline_schedules/pipeline_schedule_form_bundle.js',
schedules_index: './pipeline_schedules/pipeline_schedules_index_bundle.js',
snippet: './snippet/snippet_bundle.js', snippet: './snippet/snippet_bundle.js',
sketch_viewer: './blob/sketch_viewer.js', sketch_viewer: './blob/sketch_viewer.js',
stl_viewer: './blob/stl_viewer.js', stl_viewer: './blob/stl_viewer.js',
......
...@@ -39,7 +39,7 @@ Example response: ...@@ -39,7 +39,7 @@ Example response:
"path": "group1", "path": "group1",
"kind": "group" "kind": "group"
"full_path": "group1", "full_path": "group1",
"parent_id": "null", "parent_id": null,
"members_count_with_descendants": 2, "members_count_with_descendants": 2,
"plan": "bronze" "plan": "bronze"
}, },
...@@ -49,7 +49,7 @@ Example response: ...@@ -49,7 +49,7 @@ Example response:
"path": "bar", "path": "bar",
"kind": "group", "kind": "group",
"full_path": "foo/bar", "full_path": "foo/bar",
"parent_id": "9", "parent_id": 9,
"members_count_with_descendants": 5 "members_count_with_descendants": 5
} }
] ]
...@@ -85,7 +85,7 @@ Example response: ...@@ -85,7 +85,7 @@ Example response:
"path": "twitter", "path": "twitter",
"kind": "group", "kind": "group",
"full_path": "twitter", "full_path": "twitter",
"parent_id": "null", "parent_id": null,
"members_count_with_descendants": 2 "members_count_with_descendants": 2
} }
] ]
...@@ -118,7 +118,7 @@ Example response: ...@@ -118,7 +118,7 @@ Example response:
"path": "group1", "path": "group1",
"kind": "group", "kind": "group",
"full_path": "group1", "full_path": "group1",
"parent_id": "null", "parent_id": null,
"members_count_with_descendants": 2 "members_count_with_descendants": 2
} }
``` ```
...@@ -138,7 +138,7 @@ Example response: ...@@ -138,7 +138,7 @@ Example response:
"path": "group1", "path": "group1",
"kind": "group", "kind": "group",
"full_path": "group1", "full_path": "group1",
"parent_id": "null", "parent_id": null,
"members_count_with_descendants": 2 "members_count_with_descendants": 2
} }
``` ```
...@@ -20,30 +20,6 @@ function WeightSelect(els, options = {}) { ...@@ -20,30 +20,6 @@ function WeightSelect(els, options = {}) {
inputField.val(options.selected); inputField.val(options.selected);
} }
updateWeight = function(selected) {
var data;
data = {};
data[abilityName] = {};
data[abilityName].weight = selected != null ? selected : null;
$loading.fadeIn();
$dropdown.trigger('loading.gl.dropdown');
return $.ajax({
type: 'PUT',
dataType: 'json',
url: updateUrl,
data: data
}).done(function(data) {
$dropdown.trigger('loaded.gl.dropdown');
$loading.fadeOut();
$selectbox.hide();
if (data.weight != null) {
$value.html(`<strong>${data.weight}</strong>`);
} else {
$value.html('<span class="no-value">None</span>');
}
return $sidebarCollapsedValue.html(data.weight);
});
};
return $dropdown.glDropdown({ return $dropdown.glDropdown({
selectable: true, selectable: true,
fieldName, fieldName,
...@@ -70,13 +46,8 @@ function WeightSelect(els, options = {}) { ...@@ -70,13 +46,8 @@ function WeightSelect(els, options = {}) {
e.preventDefault(); e.preventDefault();
selected = inputField.val(); selected = inputField.val();
options.handleClick(selected); options.handleClick(selected);
} else if ($(dropdown).is(".js-filter-submit")) {
return $(dropdown).parents('form').submit();
} else if ($dropdown.is('.js-issuable-form-weight')) { } else if ($dropdown.is('.js-issuable-form-weight')) {
e.preventDefault(); e.preventDefault();
} else {
selected = inputField.val();
return updateWeight(selected);
} }
} }
}); });
......
...@@ -8,7 +8,7 @@ module EpicsHelper ...@@ -8,7 +8,7 @@ module EpicsHelper
name: author.name, name: author.name,
url: user_path(author), url: user_path(author),
username: "@#{author.username}", username: "@#{author.username}",
src: avatar_icon(@epic.author) src: avatar_icon_for_user(@epic.author)
}, },
start_date: @epic.start_date, start_date: @epic.start_date,
end_date: @epic.end_date end_date: @epic.end_date
......
...@@ -184,8 +184,7 @@ module Geo ...@@ -184,8 +184,7 @@ module Geo
# Remove the deleted path in case it exists, but it may not be there # Remove the deleted path in case it exists, but it may not be there
gitlab_shell.remove_repository(project.repository_storage_path, deleted_disk_path_temp) gitlab_shell.remove_repository(project.repository_storage_path, deleted_disk_path_temp)
# Move the original repository out of the way if project.repository_exists? && !gitlab_shell.mv_repository(project.repository_storage_path, repository.disk_path, deleted_disk_path_temp)
unless gitlab_shell.mv_repository(project.repository_storage_path, repository.disk_path, deleted_disk_path_temp)
raise Gitlab::Shell::Error, 'Can not move original repository out of the way' raise Gitlab::Shell::Error, 'Can not move original repository out of the way'
end end
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
%span{ style: "font-weight: 600;color:#333333;" } Merge request %span{ style: "font-weight: 600;color:#333333;" } Merge request
%a{ href: merge_request_url(@merge_request), style: "font-weight: 600;color:#3777b0;text-decoration:none" }= @merge_request.to_reference %a{ href: merge_request_url(@merge_request), style: "font-weight: 600;color:#3777b0;text-decoration:none" }= @merge_request.to_reference
%span was approved by %span was approved by
%img.avatar{ height: "24", src: avatar_icon(@approved_by, 24, only_path: false), style: "border-radius:12px;margin:-7px 0 -7px 3px;", width: "24", alt: "Avatar" }/ %img.avatar{ height: "24", src: avatar_icon_for_user(@approved_by, 24, only_path: false), style: "border-radius:12px;margin:-7px 0 -7px 3px;", width: "24", alt: "Avatar" }/
%a.muted{ href: user_url(@approved_by), style: "color:#333333;text-decoration:none;" } %a.muted{ href: user_url(@approved_by), style: "color:#333333;text-decoration:none;" }
= @approved_by.name = @approved_by.name
%tr.spacer %tr.spacer
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
%tbody %tbody
%tr %tr
%td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;" } %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;" }
%img.avatar{ height: "24", src: avatar_icon(@merge_request.author, 24, only_path: false), style: "display:block;border-radius:12px;margin:-2px 0;", width: "24", alt: "Avatar" }/ %img.avatar{ height: "24", src: avatar_icon_for_user(@merge_request.author, 24, only_path: false), style: "display:block;border-radius:12px;margin:-2px 0;", width: "24", alt: "Avatar" }/
%td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;" } %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;" }
%a.muted{ href: user_url(@merge_request.author), style: "color:#333333;text-decoration:none;" } %a.muted{ href: user_url(@merge_request.author), style: "color:#333333;text-decoration:none;" }
= @merge_request.author.name = @merge_request.author.name
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
%tbody %tbody
%tr %tr
%td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;" } %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;" }
%img.avatar{ height: "24", src: avatar_icon(@merge_request.assignee, 24, only_path: false), style: "display:block;border-radius:12px;margin:-2px 0;", width: "24", alt: "Avatar" }/ %img.avatar{ height: "24", src: avatar_icon_for_user(@merge_request.assignee, 24, only_path: false), style: "display:block;border-radius:12px;margin:-2px 0;", width: "24", alt: "Avatar" }/
%td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;" } %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;" }
%a.muted{ href: user_url(@merge_request.assignee), style: "color:#333333;text-decoration:none;" } %a.muted{ href: user_url(@merge_request.assignee), style: "color:#333333;text-decoration:none;" }
= @merge_request.assignee.name = @merge_request.assignee.name
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
%span{ style: "font-weight: 600;color:#333333;" } Merge request %span{ style: "font-weight: 600;color:#333333;" } Merge request
%a{ href: merge_request_url(@merge_request), style: "font-weight: 600;color:#3777b0;text-decoration:none" }= @merge_request.to_reference %a{ href: merge_request_url(@merge_request), style: "font-weight: 600;color:#3777b0;text-decoration:none" }= @merge_request.to_reference
%span was unapproved by %span was unapproved by
%img.avatar{ height: "24", src: avatar_icon(@unapproved_by, 24), style: "border-radius:12px;margin:-7px 0 -7px 3px;", width: "24", alt: "Avatar" }/ %img.avatar{ height: "24", src: avatar_icon_for_user(@unapproved_by, 24), style: "border-radius:12px;margin:-7px 0 -7px 3px;", width: "24", alt: "Avatar" }/
%a.muted{ href: user_url(@unapproved_by), style: "color:#333333;text-decoration:none;" } %a.muted{ href: user_url(@unapproved_by), style: "color:#333333;text-decoration:none;" }
= @unapproved_by.name = @unapproved_by.name
%tr.spacer %tr.spacer
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
%tbody %tbody
%tr %tr
%td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;" } %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;" }
%img.avatar{ height: "24", src: avatar_icon(@merge_request.author, 24), style: "display:block;border-radius:12px;margin:-2px 0;", width: "24", alt: "Avatar" }/ %img.avatar{ height: "24", src: avatar_icon_for_user(@merge_request.author, 24), style: "display:block;border-radius:12px;margin:-2px 0;", width: "24", alt: "Avatar" }/
%td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;" } %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;" }
%a.muted{ href: user_url(@merge_request.author), style: "color:#333333;text-decoration:none;" } %a.muted{ href: user_url(@merge_request.author), style: "color:#333333;text-decoration:none;" }
= @merge_request.author.name = @merge_request.author.name
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
%tbody %tbody
%tr %tr
%td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;" } %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;" }
%img.avatar{ height: "24", src: avatar_icon(@merge_request.assignee, 24), style: "display:block;border-radius:12px;margin:-2px 0;", width: "24", alt: "Avatar" }/ %img.avatar{ height: "24", src: avatar_icon_for_user(@merge_request.assignee, 24), style: "display:block;border-radius:12px;margin:-2px 0;", width: "24", alt: "Avatar" }/
%td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;" } %td{ style: "font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;" }
%a.muted{ href: user_url(@merge_request.assignee), style: "color:#333333;text-decoration:none;" } %a.muted{ href: user_url(@merge_request.assignee), style: "color:#333333;text-decoration:none;" }
= @merge_request.assignee.name = @merge_request.assignee.name
......
...@@ -141,7 +141,7 @@ describe Groups::EpicsController do ...@@ -141,7 +141,7 @@ describe Groups::EpicsController do
show_epic(:json) show_epic(:json)
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(response).to match_response_schema('entities/epic') expect(response).to match_response_schema('entities/epic', dir: 'ee')
end end
context 'with unauthorized user' do context 'with unauthorized user' do
......
require_relative '../support/test_env'
FactoryBot.define do FactoryBot.define do
factory :remote_mirror, class: 'RemoteMirror' do factory :remote_mirror, class: 'RemoteMirror' do
association :project, :repository association :project, :repository
......
...@@ -13,7 +13,7 @@ describe EpicsHelper do ...@@ -13,7 +13,7 @@ describe EpicsHelper do
'name' => user.name, 'name' => user.name,
'url' => "/#{user.username}", 'url' => "/#{user.username}",
'username' => "@#{user.username}", 'username' => "@#{user.username}",
'src' => "#{avatar_icon(user)}" 'src' => "#{avatar_icon_for_user(user)}"
}) })
end end
end end
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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