Commit 9c22974c authored by Douwe Maan's avatar Douwe Maan

Rename a few attribute suffixes from `_url` to `_path`

parent 09338e39
......@@ -80,11 +80,11 @@ export default {
type: Boolean,
required: true,
},
markdownPreviewUrl: {
markdownPreviewPath: {
type: String,
required: true,
},
markdownDocs: {
markdownDocsPath: {
type: String,
required: true,
},
......@@ -96,7 +96,7 @@ export default {
type: String,
required: true,
},
projectsAutocompleteUrl: {
projectsAutocompletePath: {
type: String,
required: true,
},
......@@ -242,11 +242,11 @@ export default {
:can-move="canMove"
:can-destroy="canDestroy"
:issuable-templates="issuableTemplates"
:markdown-docs="markdownDocs"
:markdown-preview-url="markdownPreviewUrl"
:markdown-docs-path="markdownDocsPath"
:markdown-preview-path="markdownPreviewPath"
:project-path="projectPath"
:project-namespace="projectNamespace"
:projects-autocomplete-url="projectsAutocompleteUrl"
:projects-autocomplete-path="projectsAutocompletePath"
/>
<div v-else>
<title-component
......
......@@ -10,11 +10,11 @@
type: Object,
required: true,
},
markdownPreviewUrl: {
markdownPreviewPath: {
type: String,
required: true,
},
markdownDocs: {
markdownDocsPath: {
type: String,
required: true,
},
......@@ -36,8 +36,8 @@
Description
</label>
<markdown-field
:markdown-preview-url="markdownPreviewUrl"
:markdown-docs="markdownDocs">
:markdown-preview-path="markdownPreviewPath"
:markdown-docs-path="markdownDocsPath">
<textarea
id="issue-description"
class="note-textarea js-gfm-input js-autosize markdown-area"
......
......@@ -10,7 +10,7 @@
type: Object,
required: true,
},
projectsAutocompleteUrl: {
projectsAutocompletePath: {
type: String,
required: true,
},
......@@ -20,7 +20,7 @@
$moveDropdown.select2({
ajax: {
url: this.projectsAutocompleteUrl,
url: this.projectsAutocompletePath,
quietMillis: 125,
data(term, page, context) {
return {
......
......@@ -26,11 +26,11 @@
required: false,
default: () => [],
},
markdownPreviewUrl: {
markdownPreviewPath: {
type: String,
required: true,
},
markdownDocs: {
markdownDocsPath: {
type: String,
required: true,
},
......@@ -42,7 +42,7 @@
type: String,
required: true,
},
projectsAutocompleteUrl: {
projectsAutocompletePath: {
type: String,
required: true,
},
......@@ -89,14 +89,14 @@
</div>
<description-field
:form-state="formState"
:markdown-preview-url="markdownPreviewUrl"
:markdown-docs="markdownDocs" />
:markdown-preview-path="markdownPreviewPath"
:markdown-docs-path="markdownDocsPath" />
<confidential-checkbox
:form-state="formState" />
<project-move
v-if="canMove"
:form-state="formState"
:projects-autocomplete-url="projectsAutocompleteUrl" />
:projects-autocomplete-path="projectsAutocompletePath" />
<edit-actions
:form-state="formState"
:can-destroy="canDestroy" />
......
......@@ -37,11 +37,11 @@ document.addEventListener('DOMContentLoaded', () => {
initialDescriptionText: this.initialDescriptionText,
issuableTemplates: this.issuableTemplates,
isConfidential: this.isConfidential,
markdownPreviewUrl: this.markdownPreviewUrl,
markdownDocs: this.markdownDocs,
markdownPreviewPath: this.markdownPreviewPath,
markdownDocsPath: this.markdownDocsPath,
projectPath: this.projectPath,
projectNamespace: this.projectNamespace,
projectsAutocompleteUrl: this.projectsAutocompleteUrl,
projectsAutocompletePath: this.projectsAutocompletePath,
updatedAt: this.updatedAt,
updatedByName: this.updatedByName,
updatedByPath: this.updatedByPath,
......
......@@ -71,13 +71,13 @@
'js-note-target-reopen': !this.isIssueOpen,
};
},
markdownDocsUrl() {
return this.getNotesData.markdownDocs;
markdownDocsPath() {
return this.getNotesData.markdownDocsPath;
},
quickActionsDocsUrl() {
return this.getNotesData.quickActionsDocs;
quickActionsDocsPath() {
return this.getNotesData.quickActionsDocsPath;
},
markdownPreviewUrl() {
markdownPreviewPath() {
return this.getIssueData.preview_note_path;
},
author() {
......@@ -231,9 +231,9 @@
<div class="flash-container error-alert timeline-content"></div>
<confidentialIssue v-if="isConfidentialIssue" />
<markdown-field
:markdown-preview-url="markdownPreviewUrl"
:markdown-docs="markdownDocsUrl"
:quick-actions-docs="quickActionsDocsUrl"
:markdown-preview-path="markdownPreviewPath"
:markdown-docs-path="markdownDocsPath"
:quick-actions-docs-path="quickActionsDocsPath"
:add-spacing-classes="false"
:is-confidential-issue="isConfidentialIssue">
<textarea
......
......@@ -52,14 +52,14 @@
noteHash() {
return `#note_${this.noteId}`;
},
markdownPreviewUrl() {
markdownPreviewPath() {
return this.getIssueDataByProp('preview_note_path');
},
markdownDocsUrl() {
return this.getNotesDataByProp('markdownDocs');
markdownDocsPath() {
return this.getNotesDataByProp('markdownDocsPath');
},
quickActionsDocsUrl() {
return !this.isEditing ? this.getNotesDataByProp('quickActionsDocs') : undefined;
quickActionsDocsPath() {
return !this.isEditing ? this.getNotesDataByProp('quickActionsDocsPath') : undefined;
},
currentUserId() {
return this.getUserDataByProp('id');
......@@ -124,9 +124,9 @@
class="edit-note common-note-form js-quick-submit gfm-form">
<confidentialIssue v-if="isConfidentialIssue" />
<markdown-field
:markdown-preview-url="markdownPreviewUrl"
:markdown-docs="markdownDocsUrl"
:quick-actions-docs="quickActionsDocsUrl"
:markdown-preview-path="markdownPreviewPath"
:markdown-docs-path="markdownDocsPath"
:quick-actions-docs-path="quickActionsDocsPath"
:add-spacing-classes="false">
<textarea
id="note_note"
......
......@@ -18,8 +18,8 @@ document.addEventListener('DOMContentLoaded', () => new Vue({
newSessionPath: notesDataset.newSessionPath,
registerPath: notesDataset.registerPath,
notesPath: notesDataset.notesPath,
markdownDocs: notesDataset.markdownDocs,
quickActionsDocs: notesDataset.quickActionsDocs,
markdownDocsPath: notesDataset.markdownDocsPath,
quickActionsDocsPath: notesDataset.quickActionsDocsPath,
},
};
},
......
......@@ -5,12 +5,12 @@
export default {
props: {
markdownPreviewUrl: {
markdownPreviewPath: {
type: String,
required: false,
default: '',
},
markdownDocs: {
markdownDocsPath: {
type: String,
required: true,
},
......@@ -19,7 +19,7 @@
required: false,
default: true,
},
quickActionsDocs: {
quickActionsDocsPath: {
type: String,
required: false,
},
......@@ -52,7 +52,7 @@
} else {
this.markdownPreviewLoading = true;
this.$http.post(
this.markdownPreviewUrl,
this.markdownPreviewPath,
{
/*
Can't use `$refs` as the component is technically in the parent component
......@@ -117,8 +117,8 @@
</i>
</a>
<markdown-toolbar
:markdown-docs="markdownDocs"
:quick-actions-docs="quickActionsDocs"
:markdown-docs-path="markdownDocsPath"
:quick-actions-docs-path="quickActionsDocsPath"
/>
</div>
</div>
......
<script>
export default {
props: {
markdownDocs: {
markdownDocsPath: {
type: String,
required: true,
},
quickActionsDocs: {
quickActionsDocsPath: {
type: String,
required: false,
},
......@@ -16,24 +16,24 @@
<template>
<div class="comment-toolbar clearfix">
<div class="toolbar-text">
<template v-if="!quickActionsDocs && markdownDocs">
<template v-if="!quickActionsDocsPath && markdownDocsPath">
<a
:href="markdownDocs"
:href="markdownDocsPath"
target="_blank"
tabindex="-1">
Markdown is supported
</a>
</template>
<template v-if="quickActionsDocs && markdownDocs">
<template v-if="quickActionsDocsPath && markdownDocsPath">
<a
:href="markdownDocs"
:href="markdownDocsPath"
target="_blank"
tabindex="-1">
Markdown
</a>
and
<a
:href="quickActionsDocs"
:href="quickActionsDocsPath"
target="_blank"
tabindex="-1">
quick actions
......
......@@ -210,9 +210,9 @@ module IssuablesHelper
canMove: current_user ? issuable.can_move?(current_user) : false,
issuableRef: issuable.to_reference,
isConfidential: issuable.confidential,
markdownPreviewUrl: preview_markdown_path(@project),
markdownDocs: help_page_path('user/markdown'),
projectsAutocompleteUrl: autocomplete_projects_path(project_id: @project.id),
markdownPreviewPath: preview_markdown_path(@project),
markdownDocsPath: help_page_path('user/markdown'),
projectsAutocompletePath: autocomplete_projects_path(project_id: @project.id),
issuableTemplates: issuable_templates(issuable),
projectPath: ref_project.path,
projectNamespace: ref_project.namespace.full_path,
......
......@@ -8,8 +8,8 @@
#js-vue-notes{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json),
register_path: "#{new_session_path(:user, redirect_to_referer: 'yes')}#register-pane",
new_session_path: new_session_path(:user, redirect_to_referer: 'yes'),
markdown_docs: help_page_path('user/markdown'),
quick_actions_docs: help_page_path('user/project/quick_actions'),
markdown_docs_path: help_page_path('user/markdown'),
quick_actions_docs_path: help_page_path('user/project/quick_actions'),
notes_path: notes_url,
last_fetched_at: Time.now.to_i,
issue_data: serialize_issuable(@issue),
......
......@@ -41,9 +41,9 @@ describe('Issuable output', () => {
initialTitleText: '',
initialDescriptionHtml: '',
initialDescriptionText: '',
markdownPreviewUrl: '/',
markdownDocs: '/',
projectsAutocompleteUrl: '/',
markdownPreviewPath: '/',
markdownDocsPath: '/',
projectsAutocompletePath: '/',
isConfidential: false,
projectNamespace: '/',
projectPath: '/',
......
......@@ -25,8 +25,8 @@ describe('Description field component', () => {
vm = new Component({
el,
propsData: {
markdownPreviewUrl: '/',
markdownDocs: '/',
markdownPreviewPath: '/',
markdownDocsPath: '/',
formState: store.formState,
},
}).$mount();
......
......@@ -15,7 +15,7 @@ describe('Project move field component', () => {
vm = new Component({
propsData: {
formState,
projectsAutocompleteUrl: '/autocomplete',
projectsAutocompletePath: '/autocomplete',
},
}).$mount();
......
......@@ -18,9 +18,9 @@ describe('Inline edit form component', () => {
description: 'a',
lockedWarningVisible: false,
},
markdownPreviewUrl: '/',
markdownDocs: '/',
projectsAutocompleteUrl: '/',
markdownPreviewPath: '/',
markdownDocsPath: '/',
projectsAutocompletePath: '/',
projectPath: '/',
projectNamespace: '/',
},
......
......@@ -46,13 +46,13 @@ describe('issue_comment_form component', () => {
});
it('should link to markdown docs', () => {
const { markdownDocs } = notesDataMock;
expect(vm.$el.querySelector(`a[href="${markdownDocs}"]`).textContent.trim()).toEqual('Markdown');
const { markdownDocsPath } = notesDataMock;
expect(vm.$el.querySelector(`a[href="${markdownDocsPath}"]`).textContent.trim()).toEqual('Markdown');
});
it('should link to quick actions docs', () => {
const { quickActionsDocs } = notesDataMock;
expect(vm.$el.querySelector(`a[href="${quickActionsDocs}"]`).textContent.trim()).toEqual('quick actions');
const { quickActionsDocsPath } = notesDataMock;
expect(vm.$el.querySelector(`a[href="${quickActionsDocsPath}"]`).textContent.trim()).toEqual('quick actions');
});
describe('edit mode', () => {
......
......@@ -204,13 +204,13 @@ describe('issue_note_app', () => {
});
it('should render markdown docs url', () => {
const { markdownDocs } = mockData.notesDataMock;
expect(vm.$el.querySelector(`a[href="${markdownDocs}"]`).textContent.trim()).toEqual('Markdown');
const { markdownDocsPath } = mockData.notesDataMock;
expect(vm.$el.querySelector(`a[href="${markdownDocsPath}"]`).textContent.trim()).toEqual('Markdown');
});
it('should render quick action docs url', () => {
const { quickActionsDocs } = mockData.notesDataMock;
expect(vm.$el.querySelector(`a[href="${quickActionsDocs}"]`).textContent.trim()).toEqual('quick actions');
const { quickActionsDocsPath } = mockData.notesDataMock;
expect(vm.$el.querySelector(`a[href="${quickActionsDocsPath}"]`).textContent.trim()).toEqual('quick actions');
});
});
......@@ -227,11 +227,11 @@ describe('issue_note_app', () => {
it('should render markdown docs url', (done) => {
setTimeout(() => {
vm.$el.querySelector('.js-note-edit').click();
const { markdownDocs } = mockData.notesDataMock;
const { markdownDocsPath } = mockData.notesDataMock;
Vue.nextTick(() => {
expect(
vm.$el.querySelector(`.edit-note a[href="${markdownDocs}"]`).textContent.trim(),
vm.$el.querySelector(`.edit-note a[href="${markdownDocsPath}"]`).textContent.trim(),
).toEqual('Markdown is supported');
done();
});
......@@ -241,11 +241,11 @@ describe('issue_note_app', () => {
it('should not render quick actions docs url', (done) => {
setTimeout(() => {
vm.$el.querySelector('.js-note-edit').click();
const { quickActionsDocs } = mockData.notesDataMock;
const { quickActionsDocsPath } = mockData.notesDataMock;
Vue.nextTick(() => {
expect(
vm.$el.querySelector(`.edit-note a[href="${quickActionsDocs}"]`),
vm.$el.querySelector(`.edit-note a[href="${quickActionsDocsPath}"]`),
).toEqual(null);
done();
});
......
......@@ -53,8 +53,8 @@ describe('issue_note_form component', () => {
});
it('should link to markdown docs', () => {
const { markdownDocs } = notesDataMock;
expect(vm.$el.querySelector(`a[href="${markdownDocs}"]`).textContent.trim()).toEqual('Markdown');
const { markdownDocsPath } = notesDataMock;
expect(vm.$el.querySelector(`a[href="${markdownDocsPath}"]`).textContent.trim()).toEqual('Markdown');
});
describe('keyboard events', () => {
......
......@@ -2,10 +2,10 @@
export const notesDataMock = {
discussionsPath: '/gitlab-org/gitlab-ce/issues/26/discussions.json',
lastFetchedAt: '1501862675',
markdownDocs: '/help/user/markdown',
markdownDocsPath: '/help/user/markdown',
newSessionPath: '/users/sign_in?redirect_to_referer=yes',
notesPath: '/gitlab-org/gitlab-ce/noteable/issue/98/notes',
quickActionsDocs: '/help/user/project/quick_actions',
quickActionsDocsPath: '/help/user/project/quick_actions',
registerPath: '/users/sign_in?redirect_to_referer=yes#register-pane',
};
......
......@@ -16,8 +16,8 @@ describe('Markdown field component', () => {
},
template: `
<field-component
marodown-preview-url="/preview"
markdown-docs="/docs"
markdown-preview-path="/preview"
markdown-docs-path="/docs"
>
<textarea
slot="textarea"
......
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