summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-23 21:06:29 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-23 21:06:29 +0000
commitb9254657872c4db441ab268154686f5476fb4bc6 (patch)
treeab045c623296a049d1246ba2d66800456a1077aa /app
parentc792263edfaf826c58f4aa41d26904464a17a3e7 (diff)
downloadgitlab-ce-b9254657872c4db441ab268154686f5476fb4bc6.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/api.js5
-rw-r--r--app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js2
-rw-r--r--app/assets/javascripts/lib/utils/datetime_utility.js7
-rw-r--r--app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue18
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue5
-rw-r--r--app/assets/javascripts/vue_shared/components/recaptcha_eventhub.js21
-rw-r--r--app/assets/javascripts/vue_shared/components/recaptcha_modal.vue8
-rw-r--r--app/helpers/boards_helper.rb2
-rw-r--r--app/services/boards/lists/update_service.rb10
-rw-r--r--app/views/admin/application_settings/_snowplow.html.haml2
-rw-r--r--app/views/shared/issuable/_search_bar.html.haml2
11 files changed, 44 insertions, 38 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js
index 992c5e5e330..d57be10f472 100644
--- a/app/assets/javascripts/api.js
+++ b/app/assets/javascripts/api.js
@@ -74,6 +74,11 @@ const Api = {
});
},
+ groupLabels(namespace) {
+ const url = Api.buildUrl(Api.groupLabelsPath).replace(':namespace_path', namespace);
+ return axios.get(url).then(({ data }) => data);
+ },
+
// Return namespaces list. Filtered by query
namespaces(query, callback) {
const url = Api.buildUrl(Api.namespacesPath);
diff --git a/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js b/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js
index 7744984edfc..ac903d60089 100644
--- a/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js
+++ b/app/assets/javascripts/cycle_analytics/cycle_analytics_bundle.js
@@ -48,6 +48,8 @@ export default () => {
import('ee_component/analytics/cycle_analytics/components/custom_stage_form.vue'),
AddStageButton: () =>
import('ee_component/analytics/cycle_analytics/components/add_stage_button.vue'),
+ CustomStageFormContainer: () =>
+ import('ee_component/analytics/cycle_analytics/components/custom_stage_form_container.vue'),
},
mixins: [filterMixins, addStageMixin],
data() {
diff --git a/app/assets/javascripts/lib/utils/datetime_utility.js b/app/assets/javascripts/lib/utils/datetime_utility.js
index a4715789337..e0832ab535d 100644
--- a/app/assets/javascripts/lib/utils/datetime_utility.js
+++ b/app/assets/javascripts/lib/utils/datetime_utility.js
@@ -537,13 +537,6 @@ export const stringifyTime = (timeObject, fullNameFormat = false) => {
};
/**
- * Accepts a time string of any size (e.g. '1w 2d 3h 5m' or '1w 2d') and returns
- * the first non-zero unit/value pair.
- */
-export const abbreviateTime = timeStr =>
- timeStr.split(' ').filter(unitStr => unitStr.charAt(0) !== '0')[0];
-
-/**
* Calculates the milliseconds between now and a given date string.
* The result cannot become negative.
*
diff --git a/app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue b/app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue
index 24d5b14ded9..65ecd5be05d 100644
--- a/app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue
+++ b/app/assets/javascripts/sidebar/components/time_tracking/collapsed_state.vue
@@ -1,6 +1,5 @@
<script>
import { __, sprintf } from '~/locale';
-import { abbreviateTime } from '~/lib/utils/datetime_utility';
import icon from '~/vue_shared/components/icon.vue';
import tooltip from '~/vue_shared/directives/tooltip';
@@ -41,12 +40,6 @@ export default {
},
},
computed: {
- timeSpent() {
- return this.abbreviateTime(this.timeSpentHumanReadable);
- },
- timeEstimate() {
- return this.abbreviateTime(this.timeEstimateHumanReadable);
- },
divClass() {
if (this.showComparisonState) {
return 'compare';
@@ -73,11 +66,11 @@ export default {
},
text() {
if (this.showComparisonState) {
- return `${this.timeSpent} / ${this.timeEstimate}`;
+ return `${this.timeSpentHumanReadable} / ${this.timeEstimateHumanReadable}`;
} else if (this.showEstimateOnlyState) {
- return `-- / ${this.timeEstimate}`;
+ return `-- / ${this.timeEstimateHumanReadable}`;
} else if (this.showSpentOnlyState) {
- return `${this.timeSpent} / --`;
+ return `${this.timeSpentHumanReadable} / --`;
} else if (this.showNoTimeTrackingState) {
return __('None');
}
@@ -100,11 +93,6 @@ export default {
return this.showNoTimeTrackingState ? __('Time tracking') : this.timeTrackedTooltipText;
},
},
- methods: {
- abbreviateTime(timeStr) {
- return abbreviateTime(timeStr);
- },
- },
};
</script>
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue
index 52acd1de666..ebedd4842c9 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue
@@ -110,7 +110,10 @@ export default {
<div class="ci-widget-container d-flex">
<div class="ci-widget-content">
<div class="media-body">
- <div class="font-weight-bold js-pipeline-info-container">
+ <div
+ class="font-weight-bold js-pipeline-info-container"
+ data-qa-selector="merge_request_pipeline_info_content"
+ >
{{ pipeline.details.name }}
<gl-link :href="pipeline.path" class="pipeline-id font-weight-normal pipeline-number"
>#{{ pipeline.id }}</gl-link
diff --git a/app/assets/javascripts/vue_shared/components/recaptcha_eventhub.js b/app/assets/javascripts/vue_shared/components/recaptcha_eventhub.js
new file mode 100644
index 00000000000..a4e004c3341
--- /dev/null
+++ b/app/assets/javascripts/vue_shared/components/recaptcha_eventhub.js
@@ -0,0 +1,21 @@
+import Vue from 'vue';
+
+// see recaptcha_tags in app/views/shared/_recaptcha_form.html.haml
+export const callbackName = 'recaptchaDialogCallback';
+
+export const eventHub = new Vue();
+
+const throwDuplicateCallbackError = () => {
+ throw new Error(`${callbackName} is already defined!`);
+};
+
+if (window[callbackName]) {
+ throwDuplicateCallbackError();
+}
+
+const callback = () => eventHub.$emit('submit');
+
+Object.defineProperty(window, callbackName, {
+ get: () => callback,
+ set: throwDuplicateCallbackError,
+});
diff --git a/app/assets/javascripts/vue_shared/components/recaptcha_modal.vue b/app/assets/javascripts/vue_shared/components/recaptcha_modal.vue
index f0aae20477b..55172649813 100644
--- a/app/assets/javascripts/vue_shared/components/recaptcha_modal.vue
+++ b/app/assets/javascripts/vue_shared/components/recaptcha_modal.vue
@@ -1,5 +1,6 @@
<script>
import DeprecatedModal from './deprecated_modal.vue';
+import { eventHub } from './recaptcha_eventhub';
export default {
name: 'RecaptchaModal',
@@ -30,14 +31,11 @@ export default {
},
mounted() {
- if (window.recaptchaDialogCallback) {
- throw new Error('recaptchaDialogCallback is already defined!');
- }
- window.recaptchaDialogCallback = this.submit.bind(this);
+ eventHub.$on('submit', this.submit);
},
beforeDestroy() {
- window.recaptchaDialogCallback = null;
+ eventHub.$off('submit', this.submit);
},
methods: {
diff --git a/app/helpers/boards_helper.rb b/app/helpers/boards_helper.rb
index 3f0679f9bf9..d3950219f3f 100644
--- a/app/helpers/boards_helper.rb
+++ b/app/helpers/boards_helper.rb
@@ -88,7 +88,7 @@ module BoardsHelper
end
def boards_link_text
- if multiple_boards_available?
+ if current_board_parent.multiple_issue_boards_available?
s_("IssueBoards|Boards")
else
s_("IssueBoards|Board")
diff --git a/app/services/boards/lists/update_service.rb b/app/services/boards/lists/update_service.rb
index 2ddeb6f0bd8..ad96e42f756 100644
--- a/app/services/boards/lists/update_service.rb
+++ b/app/services/boards/lists/update_service.rb
@@ -4,10 +4,10 @@ module Boards
module Lists
class UpdateService < Boards::BaseService
def execute(list)
- return not_authorized if preferences? && !can_read?(list)
- return not_authorized if position? && !can_admin?(list)
+ update_preferences_result = update_preferences(list) if can_read?(list)
+ update_position_result = update_position(list) if can_admin?(list)
- if update_preferences(list) || update_position(list)
+ if update_preferences_result || update_position_result
success(list: list)
else
error(list.errors.messages, 422)
@@ -32,10 +32,6 @@ module Boards
{ collapsed: Gitlab::Utils.to_boolean(params[:collapsed]) }
end
- def not_authorized
- error("Not authorized", 403)
- end
-
def preferences?
params.has_key?(:collapsed)
end
diff --git a/app/views/admin/application_settings/_snowplow.html.haml b/app/views/admin/application_settings/_snowplow.html.haml
index b60b5d55a1b..31fd12d191e 100644
--- a/app/views/admin/application_settings/_snowplow.html.haml
+++ b/app/views/admin/application_settings/_snowplow.html.haml
@@ -9,7 +9,7 @@
= _('Configure the %{link} integration.').html_safe % { link: link_to('Snowplow', 'https://snowplowanalytics.com/', target: '_blank') }
.settings-content
- = form_for @application_setting, url: integrations_admin_application_settings_path, html: { class: 'fieldset-form' } do |f|
+ = form_for @application_setting, url: integrations_admin_application_settings_path(anchor: 'js-snowplow-settings'), html: { class: 'fieldset-form' } do |f|
= form_errors(@application_setting)
%fieldset
diff --git a/app/views/shared/issuable/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml
index de994250649..c9458475aa5 100644
--- a/app/views/shared/issuable/_search_bar.html.haml
+++ b/app/views/shared/issuable/_search_bar.html.haml
@@ -6,7 +6,7 @@
.issues-filters{ class: ("w-100" if type == :boards_modal) }
.issues-details-filters.filtered-search-block.d-flex.flex-column.flex-md-row{ class: block_css_class, "v-pre" => type == :boards_modal }
- - if type == :boards && (multiple_boards_available? || current_board_parent.boards.size > 1)
+ - if type == :boards
= render "shared/boards/switcher", board: board
= form_tag page_filter_path, method: :get, class: 'filter-form js-filter-form w-100' do
- if params[:search].present?