From f8afb3805cf8cd12085c0e93bc6dad111afbd9c2 Mon Sep 17 00:00:00 2001 From: Rajendra kadam Date: Wed, 17 Jul 2019 06:41:26 +0000 Subject: Fetch latest link in the description for zoom link, add more tests and remove frontend spec unnecessary tests --- .../javascripts/issue_show/components/app.vue | 7 ++- .../issue_show/components/pinned_links.vue | 31 +++---------- app/helpers/issuables_helper.rb | 4 ++ changelogs/unreleased/issue-zoom-url.yml | 5 +++ lib/gitlab/zoom_link_extractor.rb | 21 +++++++++ .../issue_show/components/pinned_links_spec.js | 52 ++-------------------- spec/helpers/issuables_helper_spec.rb | 41 +++++++++++++++++ spec/lib/gitlab/zoom_link_extractor_spec.rb | 24 ++++++++++ 8 files changed, 110 insertions(+), 75 deletions(-) create mode 100644 changelogs/unreleased/issue-zoom-url.yml create mode 100644 lib/gitlab/zoom_link_extractor.rb create mode 100644 spec/lib/gitlab/zoom_link_extractor_spec.rb diff --git a/app/assets/javascripts/issue_show/components/app.vue b/app/assets/javascripts/issue_show/components/app.vue index de2a9664cde..9ca38d6bbfa 100644 --- a/app/assets/javascripts/issue_show/components/app.vue +++ b/app/assets/javascripts/issue_show/components/app.vue @@ -55,6 +55,11 @@ export default { required: false, default: true, }, + zoomMeetingUrl: { + type: String, + required: false, + default: null, + }, issuableRef: { type: String, required: true, @@ -342,7 +347,7 @@ export default { :title-text="state.titleText" :show-inline-edit-button="showInlineEditButton" /> - + a.href); - }, - // Detect links matching the following formats: - // Zoom Start links: https://zoom.us/s/ - // Zoom Join links: https://zoom.us/j/ - // Personal Zoom links: https://zoom.us/my/ - // Vanity Zoom links: https://gitlab.zoom.us/j/ (also /s and /my) - zoomHref() { - const zoomRegex = /^https:\/\/([\w\d-]+\.)?zoom\.us\/(s|j|my)\/.+/; - return this.linksInDescription.reduce((acc, currentLink) => { - let lastLink = acc; - if (zoomRegex.test(currentLink)) { - lastLink = currentLink; - } - return lastLink; - }, ''); + required: false, + default: null, }, }, };