diff options
Diffstat (limited to 'app/assets')
4 files changed, 32 insertions, 9 deletions
diff --git a/app/assets/javascripts/notes/components/discussion_filter_note.vue b/app/assets/javascripts/notes/components/discussion_filter_note.vue index 889731df180..8dc4b43d69a 100644 --- a/app/assets/javascripts/notes/components/discussion_filter_note.vue +++ b/app/assets/javascripts/notes/components/discussion_filter_note.vue @@ -38,12 +38,12 @@ export default { <icon name="comment" /> </div> <div class="timeline-content"> - <div v-html="timelineContent"></div> + <div ref="timelineContent" v-html="timelineContent"></div> <div class="discussion-filter-actions mt-2"> - <gl-button variant="default" @click="selectFilter(0)"> + <gl-button ref="showAllActivity" variant="default" @click="selectFilter(0)"> {{ __('Show all activity') }} </gl-button> - <gl-button variant="default" @click="selectFilter(1)"> + <gl-button ref="showComments" variant="default" @click="selectFilter(1)"> {{ __('Show comments only') }} </gl-button> </div> diff --git a/app/assets/javascripts/notes/components/note_attachment.vue b/app/assets/javascripts/notes/components/note_attachment.vue index b6d8c831e2e..72f9a4c7e74 100644 --- a/app/assets/javascripts/notes/components/note_attachment.vue +++ b/app/assets/javascripts/notes/components/note_attachment.vue @@ -12,11 +12,23 @@ export default { <template> <div class="note-attachment"> - <a v-if="attachment.image" :href="attachment.url" target="_blank" rel="noopener noreferrer"> + <a + v-if="attachment.image" + ref="attachmentImage" + :href="attachment.url" + target="_blank" + rel="noopener noreferrer" + > <img :src="attachment.url" class="note-image-attach" /> </a> <div class="attachment"> - <a v-if="attachment.url" :href="attachment.url" target="_blank" rel="noopener noreferrer"> + <a + v-if="attachment.url" + ref="attachmentUrl" + :href="attachment.url" + target="_blank" + rel="noopener noreferrer" + > <i class="fa fa-paperclip" aria-hidden="true"> </i> {{ attachment.filename }} </a> </div> diff --git a/app/assets/javascripts/notes/components/note_header.vue b/app/assets/javascripts/notes/components/note_header.vue index e4f09492d9c..16351baedb7 100644 --- a/app/assets/javascripts/notes/components/note_header.vue +++ b/app/assets/javascripts/notes/components/note_header.vue @@ -63,13 +63,13 @@ export default { <template> <div class="note-header-info"> - <div v-if="includeToggle" class="discussion-actions"> + <div v-if="includeToggle" ref="discussionActions" class="discussion-actions"> <button class="note-action-button discussion-toggle-button js-vue-toggle-button" type="button" @click="handleToggle" > - <i :class="toggleChevronClass" class="fa" aria-hidden="true"></i> + <i ref="chevronIcon" :class="toggleChevronClass" class="fa" aria-hidden="true"></i> {{ __('Toggle thread') }} </button> </div> @@ -90,10 +90,11 @@ export default { <span class="note-headline-light note-headline-meta"> <span class="system-note-message"> <slot></slot> </span> <template v-if="createdAt"> - <span class="system-note-separator"> + <span ref="actionText" class="system-note-separator"> <template v-if="actionText">{{ actionText }}</template> </span> <a + ref="noteTimestamp" :href="noteTimestampLink" class="note-timestamp system-note-separator" @click="updateTargetNoteHash" diff --git a/app/assets/javascripts/releases/list/components/release_block.vue b/app/assets/javascripts/releases/list/components/release_block.vue index d924b5795f0..e6bb5325120 100644 --- a/app/assets/javascripts/releases/list/components/release_block.vue +++ b/app/assets/javascripts/releases/list/components/release_block.vue @@ -1,9 +1,11 @@ <script> import _ from 'underscore'; +import $ from 'jquery'; import { slugify } from '~/lib/utils/text_utility'; import { getLocationHash } from '~/lib/utils/url_utility'; import { scrollToElement } from '~/lib/utils/common_utils'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; +import '~/behaviors/markdown/render_gfm'; import EvidenceBlock from './evidence_block.vue'; import ReleaseBlockAssets from './release_block_assets.vue'; import ReleaseBlockFooter from './release_block_footer.vue'; @@ -65,7 +67,10 @@ export default { return Boolean(this.glFeatures.releaseIssueSummary && !_.isEmpty(this.release.milestones)); }, }, + mounted() { + this.renderGFM(); + const hash = getLocationHash(); if (hash && slugify(hash) === this.id) { this.isHighlighted = true; @@ -76,6 +81,11 @@ export default { scrollToElement(this.$el); } }, + methods: { + renderGFM() { + $(this.$refs['gfm-content']).renderGFM(); + }, + }, }; </script> <template> @@ -91,7 +101,7 @@ export default { <release-block-assets v-if="shouldRenderAssets" :assets="assets" /> <evidence-block v-if="hasEvidence && shouldShowEvidence" :release="release" /> - <div class="card-text prepend-top-default"> + <div ref="gfm-content" class="card-text prepend-top-default"> <div v-html="release.description_html"></div> </div> </div> |