diff options
29 files changed, 243 insertions, 1275 deletions
diff --git a/app/assets/javascripts/boards/components/board_form.vue b/app/assets/javascripts/boards/components/board_form.vue index 34560560756..c0df8b72095 100644 --- a/app/assets/javascripts/boards/components/board_form.vue +++ b/app/assets/javascripts/boards/components/board_form.vue @@ -133,7 +133,7 @@ export default { if (this.board.name.length === 0) return; this.isLoading = true; if (this.isDeleteForm) { - gl.boardService + boardsStore .deleteBoard(this.currentBoard) .then(() => { visitUrl(boardsStore.rootPath); @@ -143,7 +143,7 @@ export default { this.isLoading = false; }); } else { - gl.boardService + boardsStore .createBoard(this.board) .then(resp => resp.data) .then(data => { diff --git a/app/assets/javascripts/dropzone_input.js b/app/assets/javascripts/dropzone_input.js index 0ff26445a6a..62b390a46d7 100644 --- a/app/assets/javascripts/dropzone_input.js +++ b/app/assets/javascripts/dropzone_input.js @@ -290,5 +290,5 @@ export default function dropzoneInput(form) { formTextarea.focus(); }); - return Dropzone.forElement($formDropzone.get(0)); + return $formDropzone.get(0) ? Dropzone.forElement($formDropzone.get(0)) : null; } diff --git a/app/assets/javascripts/merge_request.js b/app/assets/javascripts/merge_request.js index b967a790fac..3a7ade5ad94 100644 --- a/app/assets/javascripts/merge_request.js +++ b/app/assets/javascripts/merge_request.js @@ -1,4 +1,4 @@ -/* eslint-disable func-names, no-var, no-underscore-dangle, one-var, consistent-return */ +/* eslint-disable func-names, no-underscore-dangle, consistent-return */ import $ from 'jquery'; import { __ } from '~/locale'; @@ -64,12 +64,10 @@ MergeRequest.prototype.showAllCommits = function() { }; MergeRequest.prototype.initMRBtnListeners = function() { - var _this; - _this = this; + const _this = this; return $('a.btn-close, a.btn-reopen').on('click', function(e) { - var $this, shouldSubmit; - $this = $(this); - shouldSubmit = $this.hasClass('btn-comment'); + const $this = $(this); + const shouldSubmit = $this.hasClass('btn-comment'); if (shouldSubmit && $this.data('submitted')) { return; } @@ -88,8 +86,7 @@ MergeRequest.prototype.initMRBtnListeners = function() { }; MergeRequest.prototype.submitNoteForm = function(form, $button) { - var noteText; - noteText = form.find('textarea.js-note-text').val(); + const noteText = form.find('textarea.js-note-text').val(); if (noteText.trim().length > 0) { form.submit(); $button.data('submitted', true); @@ -99,7 +96,7 @@ MergeRequest.prototype.submitNoteForm = function(form, $button) { MergeRequest.prototype.initCommitMessageListeners = function() { $(document).on('click', 'a.js-with-description-link', e => { - var textarea = $('textarea.js-commit-message'); + const textarea = $('textarea.js-commit-message'); e.preventDefault(); textarea.val(textarea.data('messageWithDescription')); @@ -108,7 +105,7 @@ MergeRequest.prototype.initCommitMessageListeners = function() { }); $(document).on('click', 'a.js-without-description-link', e => { - var textarea = $('textarea.js-commit-message'); + const textarea = $('textarea.js-commit-message'); e.preventDefault(); textarea.val(textarea.data('messageWithoutDescription')); diff --git a/app/assets/javascripts/network/branch_graph.js b/app/assets/javascripts/network/branch_graph.js index 8173e23769a..c301c304409 100644 --- a/app/assets/javascripts/network/branch_graph.js +++ b/app/assets/javascripts/network/branch_graph.js @@ -1,4 +1,4 @@ -/* eslint-disable func-names, no-var, one-var, consistent-return, camelcase */ +/* eslint-disable func-names, consistent-return, camelcase */ import $ from 'jquery'; import { __ } from '../locale'; @@ -40,18 +40,20 @@ export default class BranchGraph { } prepareData(days, commits) { - var c, ch, cw, j, len, ref; + let c = 0; + let j = 0; + let len = 0; this.days = days; this.commits = commits; this.collectParents(); this.graphHeight = $(this.element).height(); this.graphWidth = $(this.element).width(); - ch = Math.max(this.graphHeight, this.offsetY + this.unitTime * this.mtime + 150); - cw = Math.max(this.graphWidth, this.offsetX + this.unitSpace * this.mspace + 300); + const ch = Math.max(this.graphHeight, this.offsetY + this.unitTime * this.mtime + 150); + const cw = Math.max(this.graphWidth, this.offsetX + this.unitSpace * this.mspace + 300); this.r = Raphael(this.element.get(0), cw, ch); this.top = this.r.set(); this.barHeight = Math.max(this.graphHeight, this.unitTime * this.days.length + 320); - ref = this.commits; + const ref = this.commits; for (j = 0, len = ref.length; j < len; j += 1) { c = ref[j]; if (c.id in this.parents) { @@ -64,18 +66,20 @@ export default class BranchGraph { } collectParents() { - var c, j, len, p, ref, results; - var l, len1, ref1, results1; - ref = this.commits; - results = []; + let j = 0; + let l = 0; + let len = 0; + let len1 = 0; + const ref = this.commits; + const results = []; for (j = 0, len = ref.length; j < len; j += 1) { - c = ref[j]; + const c = ref[j]; this.mtime = Math.max(this.mtime, c.time); this.mspace = Math.max(this.mspace, c.space); - ref1 = c.parents; - results1 = []; + const ref1 = c.parents; + const results1 = []; for (l = 0, len1 = ref1.length; l < len1; l += 1) { - p = ref1[l]; + const p = ref1[l]; this.parents[p[0]] = true; results1.push((this.mspace = Math.max(this.mspace, p[1]))); } @@ -85,9 +89,8 @@ export default class BranchGraph { } collectColors() { - var k, results; - k = 0; - results = []; + let k = 0; + const results = []; while (k < this.mspace) { this.colors.push(Raphael.getColor(0.8)); // Skipping a few colors in the spectrum to get more contrast between colors @@ -99,20 +102,21 @@ export default class BranchGraph { } buildGraph() { - var cuday, cumonth, day, len, mm, ref; + let mm = 0; + let len = 0; + let cuday = 0; + let cumonth = ''; const { r } = this; - cuday = 0; - cumonth = ''; r.rect(0, 0, 40, this.barHeight).attr({ fill: '#222', }); r.rect(40, 0, 30, this.barHeight).attr({ fill: '#444', }); - ref = this.days; + const ref = this.days; for (mm = 0, len = ref.length; mm < len; mm += 1) { - day = ref[mm]; + const day = ref[mm]; if (cuday !== day[0] || cumonth !== day[1]) { // Dates r.text(55, this.offsetY + this.unitTime * mm, day[0]).attr({ @@ -137,26 +141,25 @@ export default class BranchGraph { } renderPartialGraph() { - var commit, end, i, isGraphEdge, start, x, y; - start = Math.floor((this.element.scrollTop() - this.offsetY) / this.unitTime) - 10; + const isGraphEdge = true; + let i = 0; + let start = Math.floor((this.element.scrollTop() - this.offsetY) / this.unitTime) - 10; if (start < 0) { - isGraphEdge = true; start = 0; } - end = start + 40; + let end = start + 40; if (this.commits.length < end) { - isGraphEdge = true; end = this.commits.length; } if (this.prev_start === -1 || Math.abs(this.prev_start - start) > 10 || isGraphEdge) { i = start; this.prev_start = start; while (i < end) { - commit = this.commits[i]; + const commit = this.commits[i]; i += 1; if (commit.hasDrawn !== true) { - x = this.offsetX + this.unitSpace * (this.mspace - commit.space); - y = this.offsetY + this.unitTime * commit.time; + const x = this.offsetX + this.unitSpace * (this.mspace - commit.space); + const y = this.offsetY + this.unitTime * commit.time; this.drawDot(x, y, commit); this.drawLines(x, y, commit); this.appendLabel(x, y, commit); @@ -203,27 +206,25 @@ export default class BranchGraph { } appendLabel(x, y, commit) { - var label, rect, shortrefs, text, textbox; - if (!commit.refs) { return; } const { r } = this; - shortrefs = commit.refs; + let shortrefs = commit.refs; // Truncate if longer than 15 chars if (shortrefs.length > 17) { shortrefs = `${shortrefs.substr(0, 15)}…`; } - text = r.text(x + 4, y, shortrefs).attr({ + const text = r.text(x + 4, y, shortrefs).attr({ 'text-anchor': 'start', font: '10px Monaco, monospace', fill: '#FFF', title: commit.refs, }); - textbox = text.getBBox(); + const textbox = text.getBBox(); // Create rectangle based on the size of the textbox - rect = r.rect(x, y - 7, textbox.width + 5, textbox.height + 5, 4).attr({ + const rect = r.rect(x, y - 7, textbox.width + 5, textbox.height + 5, 4).attr({ fill: '#000', 'fill-opacity': 0.5, stroke: 'none', @@ -234,7 +235,7 @@ export default class BranchGraph { 'fill-opacity': 0.5, stroke: 'none', }); - label = r.set(rect, text); + const label = r.set(rect, text); label.transform(['t', -rect.getBBox().width - 15, 0]); // Set text to front return text.toFront(); @@ -286,17 +287,21 @@ export default class BranchGraph { } drawLines(x, y, commit) { - var arrow, color, i, len, offset, parent, parentCommit, parentX1, parentX2, parentY, route; + let i = 0; + let len = 0; + let arrow = ''; + let offset = []; + let color = []; const { r } = this; const ref = commit.parents; const results = []; for (i = 0, len = ref.length; i < len; i += 1) { - parent = ref[i]; - parentCommit = this.preparedCommits[parent[0]]; - parentY = this.offsetY + this.unitTime * parentCommit.time; - parentX1 = this.offsetX + this.unitSpace * (this.mspace - parentCommit.space); - parentX2 = this.offsetX + this.unitSpace * (this.mspace - parent[1]); + const parent = ref[i]; + const parentCommit = this.preparedCommits[parent[0]]; + const parentY = this.offsetY + this.unitTime * parentCommit.time; + const parentX1 = this.offsetX + this.unitSpace * (this.mspace - parentCommit.space); + const parentX2 = this.offsetX + this.unitSpace * (this.mspace - parent[1]); // Set line color if (parentCommit.space <= commit.space) { color = this.colors[commit.space]; @@ -315,7 +320,7 @@ export default class BranchGraph { arrow = 'l-5,0,2,4,3,-4,-4,2'; } // Start point - route = ['M', x + offset[0], y + offset[1]]; + const route = ['M', x + offset[0], y + offset[1]]; // Add arrow if not first parent if (i > 0) { route.push(arrow); diff --git a/app/assets/javascripts/search_autocomplete.js b/app/assets/javascripts/search_autocomplete.js index 57bf9a2d233..8d888a574d8 100644 --- a/app/assets/javascripts/search_autocomplete.js +++ b/app/assets/javascripts/search_autocomplete.js @@ -1,4 +1,4 @@ -/* eslint-disable no-return-assign, one-var, no-var, consistent-return, class-methods-use-this, vars-on-top */ +/* eslint-disable no-return-assign, consistent-return, class-methods-use-this */ import $ from 'jquery'; import { escape, throttle } from 'underscore'; @@ -29,14 +29,14 @@ const KEYCODE = { }; function setSearchOptions() { - var $projectOptionsDataEl = $('.js-search-project-options'); - var $groupOptionsDataEl = $('.js-search-group-options'); - var $dashboardOptionsDataEl = $('.js-search-dashboard-options'); + const $projectOptionsDataEl = $('.js-search-project-options'); + const $groupOptionsDataEl = $('.js-search-group-options'); + const $dashboardOptionsDataEl = $('.js-search-dashboard-options'); if ($projectOptionsDataEl.length) { gl.projectOptions = gl.projectOptions || {}; - var projectPath = $projectOptionsDataEl.data('projectPath'); + const projectPath = $projectOptionsDataEl.data('projectPath'); gl.projectOptions[projectPath] = { name: $projectOptionsDataEl.data('name'), @@ -49,7 +49,7 @@ function setSearchOptions() { if ($groupOptionsDataEl.length) { gl.groupOptions = gl.groupOptions || {}; - var groupPath = $groupOptionsDataEl.data('groupPath'); + const groupPath = $groupOptionsDataEl.data('groupPath'); gl.groupOptions[groupPath] = { name: $groupOptionsDataEl.data('name'), @@ -387,20 +387,18 @@ export class SearchAutocomplete { } restoreOriginalState() { - var i, input, inputs, len; - inputs = Object.keys(this.originalState); - for (i = 0, len = inputs.length; i < len; i += 1) { - input = inputs[i]; + const inputs = Object.keys(this.originalState); + for (let i = 0, len = inputs.length; i < len; i += 1) { + const input = inputs[i]; this.getElement(`#${input}`).val(this.originalState[input]); } } resetSearchState() { - var i, input, inputs, len, results; - inputs = Object.keys(this.originalState); - results = []; - for (i = 0, len = inputs.length; i < len; i += 1) { - input = inputs[i]; + const inputs = Object.keys(this.originalState); + const results = []; + for (let i = 0, len = inputs.length; i < len; i += 1) { + const input = inputs[i]; results.push(this.getElement(`#${input}`).val('')); } return results; @@ -415,8 +413,7 @@ export class SearchAutocomplete { } restoreMenu() { - var html; - html = `<ul><li class="dropdown-menu-empty-item"><a>${__('Loading...')}</a></li></ul>`; + const html = `<ul><li class="dropdown-menu-empty-item"><a>${__('Loading...')}</a></li></ul>`; return this.dropdownContent.html(html); } diff --git a/app/graphql/types/extended_issue_type.rb b/app/graphql/types/extended_issue_type.rb deleted file mode 100644 index e007c1109a3..00000000000 --- a/app/graphql/types/extended_issue_type.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module Types - class ExtendedIssueType < IssueType - graphql_name 'ExtendedIssue' - - authorize :read_issue - expose_permissions Types::PermissionTypes::Issue - present_using IssuePresenter - - field :subscribed, GraphQL::BOOLEAN_TYPE, method: :subscribed?, null: false, complexity: 5, - description: 'Boolean flag for whether the currently logged in user is subscribed to this issue' - end -end diff --git a/app/graphql/types/issue_type.rb b/app/graphql/types/issue_type.rb index bf055bd9eef..4cbb849da3a 100644 --- a/app/graphql/types/issue_type.rb +++ b/app/graphql/types/issue_type.rb @@ -68,6 +68,8 @@ module Types field :participants, Types::UserType.connection_type, null: true, complexity: 5, description: 'List of participants in the issue' + field :subscribed, GraphQL::BOOLEAN_TYPE, method: :subscribed?, null: false, complexity: 5, + description: 'Boolean flag for whether the currently logged in user is subscribed to this issue' field :time_estimate, GraphQL::INT_TYPE, null: false, description: 'Time estimate of the issue' field :total_time_spent, GraphQL::INT_TYPE, null: false, diff --git a/app/graphql/types/project_type.rb b/app/graphql/types/project_type.rb index f1e735508cc..73255021119 100644 --- a/app/graphql/types/project_type.rb +++ b/app/graphql/types/project_type.rb @@ -135,7 +135,7 @@ module Types resolver: Resolvers::IssuesResolver field :issue, - Types::ExtendedIssueType, + Types::IssueType, null: true, description: 'A single issue of the project', resolver: Resolvers::IssuesResolver.single diff --git a/changelogs/unreleased/34335-move-subscribed-field-to-issue-type.yml b/changelogs/unreleased/34335-move-subscribed-field-to-issue-type.yml new file mode 100644 index 00000000000..d411874e62a --- /dev/null +++ b/changelogs/unreleased/34335-move-subscribed-field-to-issue-type.yml @@ -0,0 +1,5 @@ +--- +title: Expose subscribed field in issue lists queried with GraphQL +merge_request: 19458 +author: briankabiro +type: changed diff --git a/changelogs/unreleased/35751-new-trial-flow-for-logged-in-user-should-not-take-them-to-the-custo.yml b/changelogs/unreleased/35751-new-trial-flow-for-logged-in-user-should-not-take-them-to-the-custo.yml new file mode 100644 index 00000000000..4e3a1479f11 --- /dev/null +++ b/changelogs/unreleased/35751-new-trial-flow-for-logged-in-user-should-not-take-them-to-the-custo.yml @@ -0,0 +1,5 @@ +--- +title: Use new trial registration URL in billing +merge_request: 19978 +author: +type: fixed diff --git a/changelogs/unreleased/35908-embedded-videos-not-scaled-correctly.yml b/changelogs/unreleased/35908-embedded-videos-not-scaled-correctly.yml new file mode 100644 index 00000000000..a5234533dc2 --- /dev/null +++ b/changelogs/unreleased/35908-embedded-videos-not-scaled-correctly.yml @@ -0,0 +1,5 @@ +--- +title: Fixed the scale of embedded videos to fit the page +merge_request: 20056 +author: +type: fixed diff --git a/changelogs/unreleased/Update-boards-components-board_form-vue.yml b/changelogs/unreleased/Update-boards-components-board_form-vue.yml new file mode 100644 index 00000000000..e754aaf3b94 --- /dev/null +++ b/changelogs/unreleased/Update-boards-components-board_form-vue.yml @@ -0,0 +1,5 @@ +--- +title: Remove all reference to BoardService in board_form.vue +merge_request: 20158 +author: nuwe1 +type: other diff --git a/changelogs/unreleased/fix-dropzone-no-element-exception.yml b/changelogs/unreleased/fix-dropzone-no-element-exception.yml new file mode 100644 index 00000000000..80dfb44c297 --- /dev/null +++ b/changelogs/unreleased/fix-dropzone-no-element-exception.yml @@ -0,0 +1,5 @@ +--- +title: Prevent Dropzone.js initialisation error by checking target element existence +merge_request: 20256 +author: Fabio Huser +type: fixed diff --git a/danger/commit_messages/Dangerfile b/danger/commit_messages/Dangerfile index da5a63633c3..60bc90139ab 100644 --- a/danger/commit_messages/Dangerfile +++ b/danger/commit_messages/Dangerfile @@ -240,7 +240,7 @@ def lint_commit(commit) # rubocop:disable Metrics/AbcSize fail_commit( commit, 'Use full URLs instead of short references ' \ - '(`gitlab-org/gitlab-ce#123` or `!123`), as short references are ' \ + '(`gitlab-org/gitlab#123` or `!123`), as short references are ' \ 'displayed as plain text outside of GitLab' ) diff --git a/doc/api/graphql/reference/gitlab_schema.graphql b/doc/api/graphql/reference/gitlab_schema.graphql index f79122538a8..8a4e8166dde 100644 --- a/doc/api/graphql/reference/gitlab_schema.graphql +++ b/doc/api/graphql/reference/gitlab_schema.graphql @@ -1626,6 +1626,11 @@ type EpicIssue implements Noteable { state: IssueState! """ + Boolean flag for whether the currently logged in user is subscribed to this issue + """ + subscribed: Boolean! + + """ Task completion status of the issue """ taskCompletionStatus: TaskCompletionStatus! @@ -1908,276 +1913,6 @@ type EpicTreeReorderPayload { errors: [String!]! } -type ExtendedIssue implements Noteable { - """ - Assignees of the issue - """ - assignees( - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - - """ - Returns the first _n_ elements from the list. - """ - first: Int - - """ - Returns the last _n_ elements from the list. - """ - last: Int - ): UserConnection - - """ - User that created the issue - """ - author: User! - - """ - Timestamp of when the issue was closed - """ - closedAt: Time - - """ - Indicates the issue is confidential - """ - confidential: Boolean! - - """ - Timestamp of when the issue was created - """ - createdAt: Time! - - """ - Description of the issue - """ - description: String - - """ - The GitLab Flavored Markdown rendering of `description` - """ - descriptionHtml: String - designCollection: DesignCollection - designs: DesignCollection @deprecated(reason: "use design_collection") - - """ - Indicates discussion is locked on the issue - """ - discussionLocked: Boolean! - - """ - All discussions on this noteable - """ - discussions( - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - - """ - Returns the first _n_ elements from the list. - """ - first: Int - - """ - Returns the last _n_ elements from the list. - """ - last: Int - ): DiscussionConnection! - - """ - Number of downvotes the issue has received - """ - downvotes: Int! - - """ - Due date of the issue - """ - dueDate: Time - - """ - The epic to which issue belongs - """ - epic: Epic - - """ - Internal ID of the issue - """ - iid: ID! - - """ - Labels of the issue - """ - labels( - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - - """ - Returns the first _n_ elements from the list. - """ - first: Int - - """ - Returns the last _n_ elements from the list. - """ - last: Int - ): LabelConnection - - """ - Milestone of the issue - """ - milestone: Milestone - - """ - All notes on this noteable - """ - notes( - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - - """ - Returns the first _n_ elements from the list. - """ - first: Int - - """ - Returns the last _n_ elements from the list. - """ - last: Int - ): NoteConnection! - - """ - List of participants in the issue - """ - participants( - """ - Returns the elements in the list that come after the specified cursor. - """ - after: String - - """ - Returns the elements in the list that come before the specified cursor. - """ - before: String - - """ - Returns the first _n_ elements from the list. - """ - first: Int - - """ - Returns the last _n_ elements from the list. - """ - last: Int - ): UserConnection - - """ - Internal reference of the issue. Returned in shortened format by default - """ - reference( - """ - Boolean option specifying whether the reference should be returned in full - """ - full: Boolean = false - ): String! - - """ - Relative position of the issue (used for positioning in epic tree and issue boards) - """ - relativePosition: Int - - """ - State of the issue - """ - state: IssueState! - - """ - Boolean flag for whether the currently logged in user is subscribed to this issue - """ - subscribed: Boolean! - - """ - Task completion status of the issue - """ - taskCompletionStatus: TaskCompletionStatus! - - """ - Time estimate of the issue - """ - timeEstimate: Int! - - """ - Title of the issue - """ - title: String! - - """ - The GitLab Flavored Markdown rendering of `title` - """ - titleHtml: String - - """ - Total time reported as spent on the issue - """ - totalTimeSpent: Int! - - """ - Timestamp of when the issue was last updated - """ - updatedAt: Time! - - """ - Number of upvotes the issue has received - """ - upvotes: Int! - - """ - Number of user notes of the issue - """ - userNotesCount: Int! - - """ - Permissions for the current user on the resource - """ - userPermissions: IssuePermissions! - - """ - Web path of the issue - """ - webPath: String! - - """ - Web URL of the issue - """ - webUrl: String! - weight: Int -} - type Group { """ Avatar URL of the group @@ -2627,6 +2362,11 @@ type Issue implements Noteable { state: IssueState! """ + Boolean flag for whether the currently logged in user is subscribed to this issue + """ + subscribed: Boolean! + + """ Task completion status of the issue """ taskCompletionStatus: TaskCompletionStatus! @@ -4270,7 +4010,7 @@ type Project { Issues updated before this date """ updatedBefore: Time - ): ExtendedIssue + ): Issue """ Issues of the project diff --git a/doc/api/graphql/reference/gitlab_schema.json b/doc/api/graphql/reference/gitlab_schema.json index eee98255367..bf0cb2ca6f2 100644 --- a/doc/api/graphql/reference/gitlab_schema.json +++ b/doc/api/graphql/reference/gitlab_schema.json @@ -506,7 +506,7 @@ ], "type": { "kind": "OBJECT", - "name": "ExtendedIssue", + "name": "Issue", "ofType": null }, "isDeprecated": false, @@ -4361,11 +4361,6 @@ }, { "kind": "OBJECT", - "name": "ExtendedIssue", - "ofType": null - }, - { - "kind": "OBJECT", "name": "Issue", "ofType": null }, @@ -7369,6 +7364,24 @@ "deprecationReason": null }, { + "name": "subscribed", + "description": "Boolean flag for whether the currently logged in user is subscribed to this issue", + "args": [ + + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { "name": "taskCompletionStatus", "description": "Task completion status of the issue", "args": [ @@ -8735,6 +8748,24 @@ "deprecationReason": null }, { + "name": "subscribed", + "description": "Boolean flag for whether the currently logged in user is subscribed to this issue", + "args": [ + + ], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { "name": "taskCompletionStatus", "description": "Task completion status of the issue", "args": [ @@ -13655,801 +13686,6 @@ }, { "kind": "OBJECT", - "name": "ExtendedIssue", - "description": null, - "fields": [ - { - "name": "assignees", - "description": "Assignees of the issue", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "UserConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "author", - "description": "User that created the issue", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "User", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "closedAt", - "description": "Timestamp of when the issue was closed", - "args": [ - - ], - "type": { - "kind": "SCALAR", - "name": "Time", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "confidential", - "description": "Indicates the issue is confidential", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Timestamp of when the issue was created", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Time", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": "Description of the issue", - "args": [ - - ], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "descriptionHtml", - "description": "The GitLab Flavored Markdown rendering of `description`", - "args": [ - - ], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "designCollection", - "description": null, - "args": [ - - ], - "type": { - "kind": "OBJECT", - "name": "DesignCollection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "designs", - "description": null, - "args": [ - - ], - "type": { - "kind": "OBJECT", - "name": "DesignCollection", - "ofType": null - }, - "isDeprecated": true, - "deprecationReason": "use design_collection" - }, - { - "name": "discussionLocked", - "description": "Indicates discussion is locked on the issue", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "discussions", - "description": "All discussions on this noteable", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "DiscussionConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "downvotes", - "description": "Number of downvotes the issue has received", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dueDate", - "description": "Due date of the issue", - "args": [ - - ], - "type": { - "kind": "SCALAR", - "name": "Time", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "epic", - "description": "The epic to which issue belongs", - "args": [ - - ], - "type": { - "kind": "OBJECT", - "name": "Epic", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "iid", - "description": "Internal ID of the issue", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "labels", - "description": "Labels of the issue", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "LabelConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "milestone", - "description": "Milestone of the issue", - "args": [ - - ], - "type": { - "kind": "OBJECT", - "name": "Milestone", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "notes", - "description": "All notes on this noteable", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "NoteConnection", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "participants", - "description": "List of participants in the issue", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "UserConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "reference", - "description": "Internal reference of the issue. Returned in shortened format by default", - "args": [ - { - "name": "full", - "description": "Boolean option specifying whether the reference should be returned in full", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "relativePosition", - "description": "Relative position of the issue (used for positioning in epic tree and issue boards)", - "args": [ - - ], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "state", - "description": "State of the issue", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "IssueState", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscribed", - "description": "Boolean flag for whether the currently logged in user is subscribed to this issue", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "taskCompletionStatus", - "description": "Task completion status of the issue", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "TaskCompletionStatus", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "timeEstimate", - "description": "Time estimate of the issue", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "Title of the issue", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "titleHtml", - "description": "The GitLab Flavored Markdown rendering of `title`", - "args": [ - - ], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalTimeSpent", - "description": "Total time reported as spent on the issue", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Timestamp of when the issue was last updated", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Time", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "upvotes", - "description": "Number of upvotes the issue has received", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "userNotesCount", - "description": "Number of user notes of the issue", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "userPermissions", - "description": "Permissions for the current user on the resource", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "IssuePermissions", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "webPath", - "description": "Web path of the issue", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "webUrl", - "description": "Web URL of the issue", - "args": [ - - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "weight", - "description": null, - "args": [ - - ], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Noteable", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", "name": "Metadata", "description": null, "fields": [ diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 56fdde34666..8432e9a43c3 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -254,6 +254,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `webPath` | String! | Web path of the issue | | `webUrl` | String! | Web URL of the issue | | `relativePosition` | Int | Relative position of the issue (used for positioning in epic tree and issue boards) | +| `subscribed` | Boolean! | Boolean flag for whether the currently logged in user is subscribed to this issue | | `timeEstimate` | Int! | Time estimate of the issue | | `totalTimeSpent` | Int! | Total time reported as spent on the issue | | `closedAt` | Time | Timestamp of when the issue was closed | @@ -296,41 +297,6 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `clientMutationId` | String | A unique identifier for the client performing the mutation. | | `errors` | String! => Array | Reasons why the mutation failed. | -### ExtendedIssue - -| Name | Type | Description | -| --- | ---- | ---------- | -| `userPermissions` | IssuePermissions! | Permissions for the current user on the resource | -| `iid` | ID! | Internal ID of the issue | -| `title` | String! | Title of the issue | -| `titleHtml` | String | The GitLab Flavored Markdown rendering of `title` | -| `description` | String | Description of the issue | -| `descriptionHtml` | String | The GitLab Flavored Markdown rendering of `description` | -| `state` | IssueState! | State of the issue | -| `reference` | String! | Internal reference of the issue. Returned in shortened format by default | -| `author` | User! | User that created the issue | -| `milestone` | Milestone | Milestone of the issue | -| `dueDate` | Time | Due date of the issue | -| `confidential` | Boolean! | Indicates the issue is confidential | -| `discussionLocked` | Boolean! | Indicates discussion is locked on the issue | -| `upvotes` | Int! | Number of upvotes the issue has received | -| `downvotes` | Int! | Number of downvotes the issue has received | -| `userNotesCount` | Int! | Number of user notes of the issue | -| `webPath` | String! | Web path of the issue | -| `webUrl` | String! | Web URL of the issue | -| `relativePosition` | Int | Relative position of the issue (used for positioning in epic tree and issue boards) | -| `timeEstimate` | Int! | Time estimate of the issue | -| `totalTimeSpent` | Int! | Total time reported as spent on the issue | -| `closedAt` | Time | Timestamp of when the issue was closed | -| `createdAt` | Time! | Timestamp of when the issue was created | -| `updatedAt` | Time! | Timestamp of when the issue was last updated | -| `taskCompletionStatus` | TaskCompletionStatus! | Task completion status of the issue | -| `epic` | Epic | The epic to which issue belongs | -| `weight` | Int | | -| `designs` | DesignCollection | | -| `designCollection` | DesignCollection | | -| `subscribed` | Boolean! | Boolean flag for whether the currently logged in user is subscribed to this issue | - ### Group | Name | Type | Description | @@ -382,6 +348,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `webPath` | String! | Web path of the issue | | `webUrl` | String! | Web URL of the issue | | `relativePosition` | Int | Relative position of the issue (used for positioning in epic tree and issue boards) | +| `subscribed` | Boolean! | Boolean flag for whether the currently logged in user is subscribed to this issue | | `timeEstimate` | Int! | Time estimate of the issue | | `totalTimeSpent` | Int! | Total time reported as spent on the issue | | `closedAt` | Time | Timestamp of when the issue was closed | @@ -678,7 +645,7 @@ The API can be explored interactively using the [GraphiQL IDE](../index.md#graph | `statistics` | ProjectStatistics | Statistics of the project | | `repository` | Repository | Git repository of the project | | `mergeRequest` | MergeRequest | A single merge request of the project | -| `issue` | ExtendedIssue | A single issue of the project | +| `issue` | Issue | A single issue of the project | ### ProjectPermissions diff --git a/lib/banzai/filter/video_link_filter.rb b/lib/banzai/filter/video_link_filter.rb index ed82fbc1f94..98987ee2019 100644 --- a/lib/banzai/filter/video_link_filter.rb +++ b/lib/banzai/filter/video_link_filter.rb @@ -15,7 +15,7 @@ module Banzai end def extra_element_attrs - { width: "100%" } + { width: "400" } end end end diff --git a/package.json b/package.json index 1cf88523c97..016f4f96e21 100644 --- a/package.json +++ b/package.json @@ -40,8 +40,8 @@ "@gitlab/svgs": "^1.82.0", "@gitlab/ui": "7.11.0", "@gitlab/visual-review-tools": "1.2.0", - "@sourcegraph/code-host-integration": "^0.0.13", "@sentry/browser": "^5.7.1", + "@sourcegraph/code-host-integration": "^0.0.13", "apollo-cache-inmemory": "^1.6.3", "apollo-client": "^2.6.4", "apollo-link": "^1.2.11", @@ -112,7 +112,7 @@ "prosemirror-model": "^1.6.4", "raphael": "^2.2.7", "raw-loader": "^3.1.0", - "sanitize-html": "^1.16.1", + "sanitize-html": "^1.20.0", "select2": "3.5.2-browserify", "sha1": "^1.1.1", "smooshpack": "^0.0.54", diff --git a/spec/frontend/sidebar/components/assignees/assignee_avatar_link_spec.js b/spec/frontend/sidebar/components/assignees/assignee_avatar_link_spec.js index 452d4cd07cc..d0d1af56872 100644 --- a/spec/frontend/sidebar/components/assignees/assignee_avatar_link_spec.js +++ b/spec/frontend/sidebar/components/assignees/assignee_avatar_link_spec.js @@ -24,6 +24,7 @@ describe('AssigneeAvatarLink component', () => { }; wrapper = shallowMount(AssigneeAvatarLink, { + attachToDocument: true, propsData, sync: false, }); diff --git a/spec/frontend/sidebar/components/assignees/collapsed_assignee_list_spec.js b/spec/frontend/sidebar/components/assignees/collapsed_assignee_list_spec.js index ff0c8d181b5..c88ae196875 100644 --- a/spec/frontend/sidebar/components/assignees/collapsed_assignee_list_spec.js +++ b/spec/frontend/sidebar/components/assignees/collapsed_assignee_list_spec.js @@ -16,6 +16,7 @@ describe('CollapsedAssigneeList component', () => { }; wrapper = shallowMount(CollapsedAssigneeList, { + attachToDocument: true, propsData, sync: false, }); diff --git a/spec/frontend/sidebar/components/assignees/uncollapsed_assignee_list_spec.js b/spec/frontend/sidebar/components/assignees/uncollapsed_assignee_list_spec.js index 6398351834c..1de21f30d21 100644 --- a/spec/frontend/sidebar/components/assignees/uncollapsed_assignee_list_spec.js +++ b/spec/frontend/sidebar/components/assignees/uncollapsed_assignee_list_spec.js @@ -18,6 +18,7 @@ describe('UncollapsedAssigneeList component', () => { }; wrapper = mount(UncollapsedAssigneeList, { + attachToDocument: true, sync: false, propsData, }); diff --git a/spec/graphql/types/extended_issue_type_spec.rb b/spec/graphql/types/extended_issue_type_spec.rb deleted file mode 100644 index 72ce53ae1be..00000000000 --- a/spec/graphql/types/extended_issue_type_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -describe GitlabSchema.types['ExtendedIssue'] do - it { expect(described_class).to expose_permissions_using(Types::PermissionTypes::Issue) } - - it { expect(described_class.graphql_name).to eq('ExtendedIssue') } - - it { expect(described_class).to require_graphql_authorizations(:read_issue) } - - it { expect(described_class.interfaces).to include(Types::Notes::NoteableType.to_graphql) } - - it 'has specific fields' do - fields = Types::IssueType.fields.keys + [:subscribed] - - fields.each do |field_name| - expect(described_class).to have_graphql_field(field_name) - end - end -end diff --git a/spec/graphql/types/issue_type_spec.rb b/spec/graphql/types/issue_type_spec.rb index 8aa2385ddaa..daa2224ef20 100644 --- a/spec/graphql/types/issue_type_spec.rb +++ b/spec/graphql/types/issue_type_spec.rb @@ -14,7 +14,7 @@ describe GitlabSchema.types['Issue'] do it 'has specific fields' do fields = %i[iid title description state reference author assignees participants labels milestone due_date confidential discussion_locked upvotes downvotes user_notes_count web_path web_url relative_position - time_estimate total_time_spent closed_at created_at updated_at task_completion_status] + subscribed time_estimate total_time_spent closed_at created_at updated_at task_completion_status] fields.each do |field_name| expect(described_class).to have_graphql_field(field_name) diff --git a/spec/graphql/types/project_type_spec.rb b/spec/graphql/types/project_type_spec.rb index f837fb9f77f..19a433f090e 100644 --- a/spec/graphql/types/project_type_spec.rb +++ b/spec/graphql/types/project_type_spec.rb @@ -33,7 +33,7 @@ describe GitlabSchema.types['Project'] do subject { described_class.fields['issue'] } it 'returns issue' do - is_expected.to have_graphql_type(Types::ExtendedIssueType) + is_expected.to have_graphql_type(Types::IssueType) is_expected.to have_graphql_resolver(Resolvers::IssuesResolver.single) end end diff --git a/spec/javascripts/dropzone_input_spec.js b/spec/javascripts/dropzone_input_spec.js index ef899612b08..125dcdb3763 100644 --- a/spec/javascripts/dropzone_input_spec.js +++ b/spec/javascripts/dropzone_input_spec.js @@ -13,54 +13,68 @@ const TEMPLATE = `<form class="gfm-form" data-uploads-path="${TEST_UPLOAD_PATH}" </form>`; describe('dropzone_input', () => { - let form; - let dropzone; - let xhr; - let oldXMLHttpRequest; + it('returns null when failed to initialize', () => { + const dropzone = dropzoneInput($('<form class="gfm-form"></form>')); - beforeEach(() => { - form = $(TEMPLATE); + expect(dropzone).toBeNull(); + }); - dropzone = dropzoneInput(form); + it('returns valid dropzone when successfully initialize', () => { + const dropzone = dropzoneInput($(TEMPLATE)); - xhr = jasmine.createSpyObj(Object.keys(XMLHttpRequest.prototype)); - oldXMLHttpRequest = window.XMLHttpRequest; - window.XMLHttpRequest = () => xhr; + expect(dropzone.version).toBeTruthy(); }); - afterEach(() => { - window.XMLHttpRequest = oldXMLHttpRequest; - }); + describe('shows error message', () => { + let form; + let dropzone; + let xhr; + let oldXMLHttpRequest; - it('shows error message, when AJAX fails with json', () => { - xhr = { - ...xhr, - statusCode: 400, - readyState: 4, - responseText: JSON.stringify({ message: TEST_ERROR_MESSAGE }), - getResponseHeader: () => 'application/json', - }; + beforeEach(() => { + form = $(TEMPLATE); - dropzone.processFile(TEST_FILE); + dropzone = dropzoneInput(form); - xhr.onload(); + xhr = jasmine.createSpyObj(Object.keys(XMLHttpRequest.prototype)); + oldXMLHttpRequest = window.XMLHttpRequest; + window.XMLHttpRequest = () => xhr; + }); - expect(form.find('.uploading-error-message').text()).toEqual(TEST_ERROR_MESSAGE); - }); + afterEach(() => { + window.XMLHttpRequest = oldXMLHttpRequest; + }); + + it('when AJAX fails with json', () => { + xhr = { + ...xhr, + statusCode: 400, + readyState: 4, + responseText: JSON.stringify({ message: TEST_ERROR_MESSAGE }), + getResponseHeader: () => 'application/json', + }; + + dropzone.processFile(TEST_FILE); + + xhr.onload(); + + expect(form.find('.uploading-error-message').text()).toEqual(TEST_ERROR_MESSAGE); + }); - it('shows error message, when AJAX fails with text', () => { - xhr = { - ...xhr, - statusCode: 400, - readyState: 4, - responseText: TEST_ERROR_MESSAGE, - getResponseHeader: () => 'text/plain', - }; + it('when AJAX fails with text', () => { + xhr = { + ...xhr, + statusCode: 400, + readyState: 4, + responseText: TEST_ERROR_MESSAGE, + getResponseHeader: () => 'text/plain', + }; - dropzone.processFile(TEST_FILE); + dropzone.processFile(TEST_FILE); - xhr.onload(); + xhr.onload(); - expect(form.find('.uploading-error-message').text()).toEqual(TEST_ERROR_MESSAGE); + expect(form.find('.uploading-error-message').text()).toEqual(TEST_ERROR_MESSAGE); + }); }); }); diff --git a/spec/lib/banzai/filter/video_link_filter_spec.rb b/spec/lib/banzai/filter/video_link_filter_spec.rb index a395b021f32..c324c36fe4d 100644 --- a/spec/lib/banzai/filter/video_link_filter_spec.rb +++ b/spec/lib/banzai/filter/video_link_filter_spec.rb @@ -32,7 +32,7 @@ describe Banzai::Filter::VideoLinkFilter do expect(video.name).to eq 'video' expect(video['src']).to eq src - expect(video['width']).to eq "100%" + expect(video['width']).to eq "400" expect(paragraph.name).to eq 'p' diff --git a/spec/requests/api/sidekiq_metrics_spec.rb b/spec/requests/api/sidekiq_metrics_spec.rb index d6f0f48d288..438b1475c54 100644 --- a/spec/requests/api/sidekiq_metrics_spec.rb +++ b/spec/requests/api/sidekiq_metrics_spec.rb @@ -25,6 +25,10 @@ describe API::SidekiqMetrics do expect(response).to have_gitlab_http_status(200) expect(json_response).to be_a Hash + expect(json_response['jobs']).to be_a Hash + expect(json_response['jobs'].keys) + .to contain_exactly(*%w[processed failed enqueued dead]) + expect(json_response['jobs'].values).to all(be_an(Integer)) end it 'defines the `compound_metrics` endpoint' do diff --git a/yarn.lock b/yarn.lock index f50795dec08..3b359ee98e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5526,7 +5526,7 @@ html-tags@^3.0.0: resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.0.0.tgz#41f57708c9e6b7b46a00a22317d614c4a2bab166" integrity sha512-xiXEBjihaNI+VZ2mKEoI5ZPxqUsevTKM+aeeJ/W4KAg2deGE35minmCJMn51BvwJZmiHaeAxrb2LAS0yZJxuuA== -htmlparser2@^3.10.0, htmlparser2@^3.9.0: +htmlparser2@^3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.0.tgz#5f5e422dcf6119c0d983ed36260ce9ded0bee464" integrity sha512-J1nEUGv+MkXS0weHNWVKJJ+UrLfePxRWpN3C9bEi9fLxL2+ggW94DQvgYVXsaT30PGwYRIZKNZXuyMhp3Di4bQ== @@ -7219,12 +7219,22 @@ lodash.isequal@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= +lodash.isplainobject@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" + integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= + +lodash.isstring@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" + integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= + lodash.kebabcase@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" integrity sha1-hImxyw0p/4gZXM7KRI/21swpXDY= -lodash.mergewith@^4.6.0: +lodash.mergewith@^4.6.1: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55" integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ== @@ -8889,7 +8899,7 @@ postcss-value-parser@^4.0.0: resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.0.0.tgz#99a983d365f7b2ad8d0f9b8c3094926eab4b936d" integrity sha512-ESPktioptiSUchCKgggAkzdmkgzKfmp0EU8jXH+5kbIUB+unr0Y4CY9SRMvibuvYUBjNh1ACLbxqYNpdTQOteQ== -postcss@^6.0.1, postcss@^6.0.14, postcss@^6.0.23: +postcss@^6.0.1, postcss@^6.0.23: version "6.0.23" resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324" integrity sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag== @@ -8898,10 +8908,10 @@ postcss@^6.0.1, postcss@^6.0.14, postcss@^6.0.23: source-map "^0.6.1" supports-color "^5.4.0" -postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.7: - version "7.0.18" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.18.tgz#4b9cda95ae6c069c67a4d933029eddd4838ac233" - integrity sha512-/7g1QXXgegpF+9GJj4iN7ChGF40sYuGYJ8WZu8DZWnmhQ/G36hfdk3q9LBJmoK+lZ+yzZ5KYpOoxq7LF1BxE8g== +postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2, postcss@^7.0.5, postcss@^7.0.7: + version "7.0.21" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.21.tgz#06bb07824c19c2021c5d056d5b10c35b989f7e17" + integrity sha512-uIFtJElxJo29QC753JzhidoAhvp/e/Exezkdhfmt8AymWT6/5B7W1WmponYWkHk2eg6sONyTch0A3nkMPun3SQ== dependencies: chalk "^2.4.2" source-map "^0.6.1" @@ -9831,18 +9841,21 @@ sane@^4.0.3: minimist "^1.1.1" walker "~1.0.5" -sanitize-html@^1.16.1: - version "1.16.3" - resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-1.16.3.tgz#96c1b44a36ff7312e1c22a14b05274370ac8bd56" - integrity sha512-XpAJGnkMfNM7AzXLRw225blBB/pE4dM4jzRn98g4r88cfxwN6g+5IsRmCAh/gbhYGm6u6i97zsatMOM7Lr8wyw== +sanitize-html@^1.20.0: + version "1.20.1" + resolved "https://registry.yarnpkg.com/sanitize-html/-/sanitize-html-1.20.1.tgz#f6effdf55dd398807171215a62bfc21811bacf85" + integrity sha512-txnH8TQjaQvg2Q0HY06G6CDJLVYCpbnxrdO0WN8gjCKaU5J0KbyGYhZxx5QJg3WLZ1lB7XU9kDkfrCXUozqptA== dependencies: - htmlparser2 "^3.9.0" + chalk "^2.4.1" + htmlparser2 "^3.10.0" lodash.clonedeep "^4.5.0" lodash.escaperegexp "^4.1.2" - lodash.mergewith "^4.6.0" - postcss "^6.0.14" + lodash.isplainobject "^4.0.6" + lodash.isstring "^4.0.1" + lodash.mergewith "^4.6.1" + postcss "^7.0.5" srcset "^1.0.0" - xtend "^4.0.0" + xtend "^4.0.1" sass-graph@^2.2.4: version "2.2.4" |