summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2017-06-09 16:13:41 -0500
committerClement Ho <ClemMakesApps@gmail.com>2017-06-09 16:13:41 -0500
commit342e23115523210b60b9f557f1cfbcfdc3361af0 (patch)
treef78df9d79f4b05f1ecbdedf19a9e96678d5d2fc7
parentfd760b78bc0ef7a75be9193fb66a8b37a6a9b857 (diff)
downloadgitlab-ce-342e23115523210b60b9f557f1cfbcfdc3361af0.tar.gz
Resolve inconsistencies
-rw-r--r--app/assets/javascripts/issue_show/issue_title_description.vue199
-rw-r--r--app/assets/javascripts/users_select.js2
-rw-r--r--app/assets/stylesheets/framework/sidebar.scss4
-rw-r--r--app/assets/stylesheets/framework/timeline.scss5
-rw-r--r--app/uploaders/gitlab_uploader.rb2
-rw-r--r--doc/development/README.md4
-rwxr-xr-xdoc/user/project/issues/img/issues_main_view_numbered.pngbin73508 -> 0 bytes
-rw-r--r--features/project/merge_requests/accept.feature1
-rw-r--r--lib/gitlab/regex.rb8
-rw-r--r--spec/javascripts/commit/pipelines/mock_data.js90
-rw-r--r--spec/javascripts/issue_show/issue_title_description_spec.js78
-rw-r--r--spec/javascripts/notes_spec.js16
-rw-r--r--spec/migrations/update_retried_for_ci_builds_spec.rb17
13 files changed, 3 insertions, 423 deletions
diff --git a/app/assets/javascripts/issue_show/issue_title_description.vue b/app/assets/javascripts/issue_show/issue_title_description.vue
deleted file mode 100644
index 8a7a813efd8..00000000000
--- a/app/assets/javascripts/issue_show/issue_title_description.vue
+++ /dev/null
@@ -1,199 +0,0 @@
-<script>
-import Visibility from 'visibilityjs';
-import Poll from './../lib/utils/poll';
-import Service from './services/index';
-import tasks from './actions/tasks';
-import edited from './components/edited.vue';
-
-export default {
- props: {
- endpoint: {
- required: true,
- type: String,
- },
- canUpdateTasksClass: {
- required: true,
- type: String,
- },
- isEdited: {
- type: Boolean,
- default: false,
- required: false,
- },
- initialTitle: {
- type: String,
- required: true,
- },
- initialDescription: {
- type: String,
- required: true,
- },
- },
- data() {
- const resource = new Service(this.$http, this.endpoint);
-
- const poll = new Poll({
- resource,
- method: 'getTitle',
- successCallback: (res) => {
- this.renderResponse(res);
- },
- errorCallback: (err) => {
- throw new Error(err);
- },
- });
-
- return {
- poll,
- apiData: {},
- tasks: '0 of 0',
- title: this.initialTitle,
- titleText: '',
- titleFlag: {
- pre: false,
- pulse: false,
- },
- description: this.initialDescription,
- descriptionText: '',
- descriptionChange: false,
- descriptionFlag: {
- pre: false,
- pulse: false,
- },
- titleEl: document.querySelector('title'),
- hasBeenEdited: this.isEdited,
- };
- },
- components: {
- edited,
- },
- methods: {
- updateFlag(key, toggle) {
- this[key].pre = toggle;
- this[key].pulse = !toggle;
- },
- renderResponse(res) {
- this.apiData = res.json();
-
- if (this.apiData.updated_at) this.hasBeenEdited = true;
-
- this.triggerAnimation();
- },
- updateTaskHTML() {
- tasks(this.apiData, this.tasks);
- },
- elementsToVisualize(noTitleChange, noDescriptionChange) {
- if (!noTitleChange) {
- this.setTabTitle();
- this.updateFlag('titleFlag', true);
- }
-
- if (!noDescriptionChange) {
- // only change to true when we need to bind TaskLists the html of description
- this.descriptionChange = true;
- this.updateTaskHTML();
- this.tasks = this.apiData.task_status;
- this.updateFlag('descriptionFlag', true);
- }
- },
- setTabTitle() {
- const currentTabTitleScope = this.titleEl.innerText.split('·');
- currentTabTitleScope[0] = `${this.titleText} (#${this.apiData.issue_number}) `;
- this.titleEl.innerText = currentTabTitleScope.join('·');
- },
- animate(title, description) {
- this.title = title;
- this.description = description;
-
- this.$nextTick(() => {
- this.updateFlag('titleFlag', false);
- this.updateFlag('descriptionFlag', false);
- });
- },
- triggerAnimation() {
- // always reset to false before checking the change
- this.descriptionChange = false;
-
- const { title, description } = this.apiData;
- this.descriptionText = this.apiData.description_text;
- this.titleText = this.apiData.title_text;
-
- const noTitleChange = this.title === title;
- const noDescriptionChange = this.description === description;
-
- /**
- * since opacity is changed, even if there is no diff for Vue to update
- * we must check the title/description even on a 304 to ensure no visual change
- */
- if (noTitleChange && noDescriptionChange) return;
-
- this.elementsToVisualize(noTitleChange, noDescriptionChange);
- this.animate(title, description);
- },
- },
- created() {
- if (!Visibility.hidden()) {
- this.poll.makeRequest();
- }
-
- Visibility.change(() => {
- if (!Visibility.hidden()) {
- this.poll.restart();
- } else {
- this.poll.stop();
- }
- });
- },
- updated() {
- // if new html is injected (description changed) - bind TaskList and call renderGFM
- if (this.descriptionChange) {
- $(this.$refs['issue-content-container-gfm-entry']).renderGFM();
-
- const tl = new gl.TaskList({
- dataType: 'issue',
- fieldName: 'description',
- selector: '.detail-page-description',
- });
-
- return tl && null;
- }
-
- return null;
- },
-};
-</script>
-
-<template>
- <div>
- <h2
- class="title"
- :class="{ 'issue-realtime-pre-pulse': titleFlag.pre, 'issue-realtime-trigger-pulse': titleFlag.pulse }"
- ref="issue-title"
- v-html="title"
- >
- </h2>
- <div
- class="description is-task-list-enabled"
- :class="canUpdateTasksClass"
- v-if="description"
- >
- <div
- class="wiki"
- :class="{ 'issue-realtime-pre-pulse': descriptionFlag.pre, 'issue-realtime-trigger-pulse': descriptionFlag.pulse }"
- v-html="description"
- ref="issue-content-container-gfm-entry"
- >
- </div>
- <textarea
- class="hidden js-task-list-field"
- v-if="descriptionText"
- >{{descriptionText}}</textarea>
- </div>
- <edited
- v-if="hasBeenEdited"
- :updated-at="apiData.updated_at"
- :updated-by-name="apiData.updated_by_name"
- :updated-by-path="apiData.updated_by_path"
- />
- </div>
-</template>
diff --git a/app/assets/javascripts/users_select.js b/app/assets/javascripts/users_select.js
index b25e638902c..ec45253e50b 100644
--- a/app/assets/javascripts/users_select.js
+++ b/app/assets/javascripts/users_select.js
@@ -566,8 +566,6 @@ function UsersSelect(currentUser, els) {
break;
}
}
- } else {
- selected = user.id === selectedId;
}
if (showNullUser) {
nullUser = {
diff --git a/app/assets/stylesheets/framework/sidebar.scss b/app/assets/stylesheets/framework/sidebar.scss
index 135520e0c07..d4421e3af74 100644
--- a/app/assets/stylesheets/framework/sidebar.scss
+++ b/app/assets/stylesheets/framework/sidebar.scss
@@ -119,8 +119,4 @@
.issuable-sidebar {
padding: 0 3px;
}
-
- &:not(.affix-top) {
- min-height: 100%;
- }
}
diff --git a/app/assets/stylesheets/framework/timeline.scss b/app/assets/stylesheets/framework/timeline.scss
index 0d328031dcf..10881987038 100644
--- a/app/assets/stylesheets/framework/timeline.scss
+++ b/app/assets/stylesheets/framework/timeline.scss
@@ -35,8 +35,9 @@
display: none;
}
- .timeline-content {
- margin-left: 0;
+ .timeline-content {
+ margin-left: 0;
+ }
}
}
diff --git a/app/uploaders/gitlab_uploader.rb b/app/uploaders/gitlab_uploader.rb
index 0048e07e1f2..e4e6d6f46b1 100644
--- a/app/uploaders/gitlab_uploader.rb
+++ b/app/uploaders/gitlab_uploader.rb
@@ -29,8 +29,6 @@ class GitlabUploader < CarrierWave::Uploader::Base
cache_storage.is_a?(CarrierWave::Storage::File)
end
- delegate :base_dir, :file_storage?, to: :class
-
# Reduce disk IO
def move_to_cache
true
diff --git a/doc/development/README.md b/doc/development/README.md
index a3cae34a7ec..40addfd8a4c 100644
--- a/doc/development/README.md
+++ b/doc/development/README.md
@@ -58,10 +58,6 @@
- [Internationalization for GitLab](i18n_guide.md)
-## i18n
-
-- [Internationalization for GitLab](i18n_guide.md)
-
## Compliance
- [Licensing](licensing.md) for ensuring license compliance
diff --git a/doc/user/project/issues/img/issues_main_view_numbered.png b/doc/user/project/issues/img/issues_main_view_numbered.png
deleted file mode 100755
index 9cff61d7041..00000000000
--- a/doc/user/project/issues/img/issues_main_view_numbered.png
+++ /dev/null
Binary files differ
diff --git a/features/project/merge_requests/accept.feature b/features/project/merge_requests/accept.feature
index 772a2407a64..2ab1c19f452 100644
--- a/features/project/merge_requests/accept.feature
+++ b/features/project/merge_requests/accept.feature
@@ -23,7 +23,6 @@ Feature: Project Merge Requests Acceptance
@javascript
Scenario: Accepting the Merge Request without removing the source branch
Given I am on the Merge Request detail page
- When I click on "Remove source branch" option
When I click on Accept Merge Request
Then I should see merge request merged
And I should see the Remove Source Branch button
diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb
index 009ecc9b263..e4d2a992470 100644
--- a/lib/gitlab/regex.rb
+++ b/lib/gitlab/regex.rb
@@ -62,13 +62,5 @@ module Gitlab
"can contain only lowercase letters, digits, and '-'. " \
"Must start with a letter, and cannot end with '-'"
end
-
- private
-
- def single_line_regexp(regex)
- # Turns a multiline extended regexp into a single line one,
- # beacuse `rake routes` breaks on multiline regexes.
- Regexp.new(regex.source.gsub(/\(\?#.+?\)/, '').gsub(/\s*/, ''), regex.options ^ Regexp::EXTENDED).freeze
- end
end
end
diff --git a/spec/javascripts/commit/pipelines/mock_data.js b/spec/javascripts/commit/pipelines/mock_data.js
deleted file mode 100644
index 10a60620f49..00000000000
--- a/spec/javascripts/commit/pipelines/mock_data.js
+++ /dev/null
@@ -1,90 +0,0 @@
-export default {
- id: 73,
- user: {
- name: 'Administrator',
- username: 'root',
- id: 1,
- state: 'active',
- avatar_url: 'http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
- web_url: 'http://localhost:3000/root',
- },
- path: '/root/review-app/pipelines/73',
- details: {
- status: {
- icon: 'icon_status_failed',
- text: 'failed',
- label: 'failed',
- group: 'failed',
- has_details: true,
- details_path: '/root/review-app/pipelines/73',
- },
- duration: null,
- finished_at: '2017-01-25T00:00:17.130Z',
- stages: [{
- name: 'build',
- title: 'build: failed',
- status: {
- icon: 'icon_status_failed',
- text: 'failed',
- label: 'failed',
- group: 'failed',
- has_details: true,
- details_path: '/root/review-app/pipelines/73#build',
- },
- path: '/root/review-app/pipelines/73#build',
- dropdown_path: '/root/review-app/pipelines/73/stage.json?stage=build',
- }],
- artifacts: [],
- manual_actions: [
- {
- name: 'stop_review',
- path: '/root/review-app/builds/1463/play',
- },
- {
- name: 'name',
- path: '/root/review-app/builds/1490/play',
- },
- ],
- },
- flags: {
- latest: true,
- triggered: false,
- stuck: false,
- yaml_errors: false,
- retryable: true,
- cancelable: false,
- },
- ref:
- {
- name: 'master',
- path: '/root/review-app/tree/master',
- tag: false,
- branch: true,
- },
- coverage: '42.21',
- commit: {
- id: 'fbd79f04fa98717641deaaeb092a4d417237c2e4',
- short_id: 'fbd79f04',
- title: 'Update .gitlab-ci.yml',
- author_name: 'Administrator',
- author_email: 'admin@example.com',
- created_at: '2017-01-16T12:13:57.000-05:00',
- committer_name: 'Administrator',
- committer_email: 'admin@example.com',
- message: 'Update .gitlab-ci.yml',
- author: {
- name: 'Administrator',
- username: 'root',
- id: 1,
- state: 'active',
- avatar_url: 'http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
- web_url: 'http://localhost:3000/root',
- },
- author_gravatar_url: 'http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon',
- commit_url: 'http://localhost:3000/root/review-app/commit/fbd79f04fa98717641deaaeb092a4d417237c2e4',
- commit_path: '/root/review-app/commit/fbd79f04fa98717641deaaeb092a4d417237c2e4',
- },
- retry_path: '/root/review-app/pipelines/73/retry',
- created_at: '2017-01-16T17:13:59.800Z',
- updated_at: '2017-01-25T00:00:17.132Z',
-};
diff --git a/spec/javascripts/issue_show/issue_title_description_spec.js b/spec/javascripts/issue_show/issue_title_description_spec.js
deleted file mode 100644
index 992ff1a331f..00000000000
--- a/spec/javascripts/issue_show/issue_title_description_spec.js
+++ /dev/null
@@ -1,78 +0,0 @@
-import Vue from 'vue';
-import $ from 'jquery';
-import '~/render_math';
-import '~/render_gfm';
-import issueTitleDescription from '~/issue_show/issue_title_description.vue';
-import issueShowData from './mock_data';
-
-window.$ = $;
-
-function formatText(text) {
- return text.trim().replace(/\s\s+/g, ' ');
-}
-
-const issueShowInterceptor = data => (request, next) => {
- next(request.respondWith(JSON.stringify(data), {
- status: 200,
- headers: {
- 'POLL-INTERVAL': 1,
- },
- }));
-};
-
-describe('Issue Title', () => {
- document.body.innerHTML = '<span id="task_status"></span>';
-
- let IssueTitleDescriptionComponent;
-
- beforeEach(() => {
- IssueTitleDescriptionComponent = Vue.extend(issueTitleDescription);
- });
-
- afterEach(() => {
- Vue.http.interceptors = _.without(Vue.http.interceptors, issueShowInterceptor);
- });
-
- it('should render a title/description/edited and update title/description/edited on update', (done) => {
- Vue.http.interceptors.push(issueShowInterceptor(issueShowData.initialRequest));
-
- const issueShowComponent = new IssueTitleDescriptionComponent({
- propsData: {
- canUpdateIssue: '.css-stuff',
- endpoint: '/gitlab-org/gitlab-shell/issues/9/rendered_title',
- initialTitle: 'test',
- initialDescription: 'testing',
- },
- }).$mount();
-
- expect(issueShowComponent.$el.querySelector('.title').innerHTML).toContain('test');
- expect(issueShowComponent.$el.querySelector('.wiki').innerHTML).toContain('testing');
-
- setTimeout(() => {
- const editedText = issueShowComponent.$el.querySelector('.edited-text');
-
- expect(document.querySelector('title').innerText).toContain('this is a title (#1)');
- expect(issueShowComponent.$el.querySelector('.title').innerHTML).toContain('<p>this is a title</p>');
- expect(issueShowComponent.$el.querySelector('.wiki').innerHTML).toContain('<p>this is a description!</p>');
- expect(issueShowComponent.$el.querySelector('.js-task-list-field').innerText).toContain('this is a description');
- expect(formatText(editedText.innerText)).toMatch(/Edited[\s\S]+?by Some User/);
- expect(editedText.querySelector('.author_link').href).toMatch(/\/some_user$/);
- expect(editedText.querySelector('time')).toBeTruthy();
-
- Vue.http.interceptors.push(issueShowInterceptor(issueShowData.secondRequest));
-
- setTimeout(() => {
- expect(document.querySelector('title').innerText).toContain('2 (#1)');
- expect(issueShowComponent.$el.querySelector('.title').innerHTML).toContain('<p>2</p>');
- expect(issueShowComponent.$el.querySelector('.wiki').innerHTML).toContain('<p>42</p>');
- expect(issueShowComponent.$el.querySelector('.js-task-list-field').innerText).toContain('42');
- expect(issueShowComponent.$el.querySelector('.edited-text')).toBeTruthy();
- expect(formatText(issueShowComponent.$el.querySelector('.edited-text').innerText)).toMatch(/Edited[\s\S]+?by Other User/);
- expect(editedText.querySelector('.author_link').href).toMatch(/\/other_user$/);
- expect(editedText.querySelector('time')).toBeTruthy();
-
- done();
- });
- });
- });
-});
diff --git a/spec/javascripts/notes_spec.js b/spec/javascripts/notes_spec.js
index 77e68d578d9..bfd8b8648a6 100644
--- a/spec/javascripts/notes_spec.js
+++ b/spec/javascripts/notes_spec.js
@@ -622,22 +622,6 @@ import '~/notes';
beforeEach(() => {
this.notes = new Notes('', []);
- spyOn(_, 'escape').and.callFake((comment) => {
- const escapedString = comment.replace(/["&'<>]/g, (a) => {
- const escapedToken = {
- '&': '&amp;',
- '<': '&lt;',
- '>': '&gt;',
- '"': '&quot;',
- "'": '&#x27;',
- '`': '&#x60;'
- }[a];
-
- return escapedToken;
- });
-
- return escapedString;
- });
});
it('should return constructed placeholder element for regular note based on form contents', () => {
diff --git a/spec/migrations/update_retried_for_ci_builds_spec.rb b/spec/migrations/update_retried_for_ci_builds_spec.rb
deleted file mode 100644
index 3742b4dafe5..00000000000
--- a/spec/migrations/update_retried_for_ci_builds_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'spec_helper'
-require Rails.root.join('db', 'post_migrate', '20170503004427_update_retried_for_ci_build.rb')
-
-describe UpdateRetriedForCiBuild, truncate: true do
- let(:pipeline) { create(:ci_pipeline) }
- let!(:build_old) { create(:ci_build, pipeline: pipeline, name: 'test') }
- let!(:build_new) { create(:ci_build, pipeline: pipeline, name: 'test') }
-
- before do
- described_class.new.up
- end
-
- it 'updates ci_builds.is_retried' do
- expect(build_old.reload).to be_retried
- expect(build_new.reload).not_to be_retried
- end
-end