Commit e11f5a61 authored by Stan Hu's avatar Stan Hu

Merge branch 'ce-to-ee-2018-10-06' into 'master'

CE upstream - 2018-10-06 21:38 UTC

See merge request gitlab-org/gitlab-ee!7829
parents 0b68db84 4ad21960
...@@ -18,6 +18,16 @@ ...@@ -18,6 +18,16 @@
required: true, required: true,
}, },
}, },
computed: {
mdTable() {
return [
'| header | header |',
'| ------ | ------ |',
'| cell | cell |',
'| cell | cell |',
].join('\n');
},
},
mounted() { mounted() {
$(document).on('markdown-preview:show.vue', this.previewMarkdownTab); $(document).on('markdown-preview:show.vue', this.previewMarkdownTab);
$(document).on('markdown-preview:hide.vue', this.writeMarkdownTab); $(document).on('markdown-preview:hide.vue', this.writeMarkdownTab);
...@@ -129,6 +139,12 @@ ...@@ -129,6 +139,12 @@
button-title="Add a task list" button-title="Add a task list"
icon="task-done" icon="task-done"
/> />
<toolbar-button
:tag="mdTable"
:prepend="true"
:button-title="__('Add a table')"
icon="table"
/>
<button <button
v-tooltip v-tooltip
aria-label="Go full screen" aria-label="Go full screen"
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
.group-root-path.input-group-prepend.has-tooltip{ title: group_path(@group), :'data-placement' => 'bottom' } .group-root-path.input-group-prepend.has-tooltip{ title: group_path(@group), :'data-placement' => 'bottom' }
.input-group-text .input-group-text
%span>= root_url %span>= root_url
- if parent - if @group.parent
%strong= parent.full_path + '/' %strong= @group.parent.full_path + '/'
= f.hidden_field :parent_id = f.hidden_field :parent_id
= f.text_field :path, placeholder: 'open-source', class: 'form-control', = f.text_field :path, placeholder: 'open-source', class: 'form-control',
autofocus: local_assigns[:autofocus] || false, required: true, autofocus: local_assigns[:autofocus] || false, required: true,
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
= markdown_toolbar_button({ icon: "list-bulleted", data: { "md-tag" => "* ", "md-prepend" => true }, title: s_("MarkdownToolbar|Add a bullet list") }) = markdown_toolbar_button({ icon: "list-bulleted", data: { "md-tag" => "* ", "md-prepend" => true }, title: s_("MarkdownToolbar|Add a bullet list") })
= markdown_toolbar_button({ icon: "list-numbered", data: { "md-tag" => "1. ", "md-prepend" => true }, title: s_("MarkdownToolbar|Add a numbered list") }) = markdown_toolbar_button({ icon: "list-numbered", data: { "md-tag" => "1. ", "md-prepend" => true }, title: s_("MarkdownToolbar|Add a numbered list") })
= markdown_toolbar_button({ icon: "task-done", data: { "md-tag" => "* [ ] ", "md-prepend" => true }, title: s_("MarkdownToolbar|Add a task list") }) = markdown_toolbar_button({ icon: "task-done", data: { "md-tag" => "* [ ] ", "md-prepend" => true }, title: s_("MarkdownToolbar|Add a task list") })
= markdown_toolbar_button({ icon: "table", data: { "md-tag" => "| header 1 | header 2 |\n| -------- | -------- |\n| cell 1 | cell 2 |\n| cell 3 | cell 4 |", "md-prepend" => true }, title: s_("MarkdownToolbar|Add a table") })
= markdown_toolbar_button({ icon: "table", data: { "md-tag" => "| header | header |\n| ------ | ------ |\n| cell | cell |\n| cell | cell |", "md-prepend" => true }, title: _('Add a table') })
%button.toolbar-btn.toolbar-fullscreen-btn.js-zen-enter.has-tooltip{ type: "button", tabindex: -1, "aria-label": "Go full screen", title: s_("MarkdownToolbar|Go full screen"), data: { container: "body" } } %button.toolbar-btn.toolbar-fullscreen-btn.js-zen-enter.has-tooltip{ type: "button", tabindex: -1, "aria-label": "Go full screen", title: s_("MarkdownToolbar|Go full screen"), data: { container: "body" } }
= sprite_icon("screen-full") = sprite_icon("screen-full")
......
---
title: Fix incorrect parent path on group settings page
merge_request: 22142
author:
type: fixed
---
title: Add markdown header toolbar button to insert table
merge_request: 18480
author: George Tsiolis
type: added
...@@ -404,6 +404,9 @@ msgstr "" ...@@ -404,6 +404,9 @@ msgstr ""
msgid "Add Readme" msgid "Add Readme"
msgstr "" msgstr ""
msgid "Add a table"
msgstr ""
msgid "Add additional text to appear in all email communications. %{character_limit} character limit" msgid "Add additional text to appear in all email communications. %{character_limit} character limit"
msgstr "" msgstr ""
...@@ -4797,6 +4800,9 @@ msgstr "" ...@@ -4797,6 +4800,9 @@ msgstr ""
msgid "MarkdownToolbar|Add a numbered list" msgid "MarkdownToolbar|Add a numbered list"
msgstr "" msgstr ""
msgid "MarkdownToolbar|Add a table"
msgstr ""
msgid "MarkdownToolbar|Add a task list" msgid "MarkdownToolbar|Add a task list"
msgstr "" msgstr ""
......
...@@ -98,6 +98,22 @@ describe 'Edit group settings' do ...@@ -98,6 +98,22 @@ describe 'Edit group settings' do
end end
end end
describe 'edit group path' do
it 'has a root URL label for top-level group' do
visit edit_group_path(group)
expect(find(:css, '.group-root-path').text).to eq(root_url)
end
it 'has a parent group URL label for a subgroup group', :postgresql do
subgroup = create(:group, parent: group)
visit edit_group_path(subgroup)
expect(find(:css, '.group-root-path').text).to eq(group_url(subgroup.parent) + '/')
end
end
def update_path(new_group_path) def update_path(new_group_path)
visit edit_group_path(group) visit edit_group_path(group)
......
...@@ -17,8 +17,13 @@ describe('Markdown field header component', () => { ...@@ -17,8 +17,13 @@ describe('Markdown field header component', () => {
Vue.nextTick(done); Vue.nextTick(done);
}); });
it('renders markdown buttons', () => { it('renders markdown header buttons', () => {
expect(vm.$el.querySelectorAll('.js-md').length).toBe(8); const buttons = ['Add bold text', 'Add italic text', 'Insert a quote', 'Insert code', 'Add a link', 'Add a bullet list', 'Add a numbered list', 'Add a task list', 'Add a table', 'Go full screen'];
const elements = vm.$el.querySelectorAll('.toolbar-btn');
elements.forEach((buttonEl, index) => {
expect(buttonEl.getAttribute('data-original-title')).toBe(buttons[index]);
});
}); });
it('renders `write` link as active when previewMarkdown is false', () => { it('renders `write` link as active when previewMarkdown is false', () => {
...@@ -69,4 +74,8 @@ describe('Markdown field header component', () => { ...@@ -69,4 +74,8 @@ describe('Markdown field header component', () => {
done(); done();
}); });
}); });
it('renders markdown table template', () => {
expect(vm.mdTable).toEqual('| header | header |\n| ------ | ------ |\n| cell | cell |\n| cell | cell |');
});
}); });
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