diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2017-06-10 00:13:41 +0300 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-06-10 00:13:41 +0300 |
commit | 342e23115523210b60b9f557f1cfbcfdc3361af0 (patch) | |
tree | f78df9d79f4b05f1ecbdedf19a9e96678d5d2fc7 /app | |
parent | fd760b78bc0ef7a75be9193fb66a8b37a6a9b857 (diff) |
Resolve inconsistencies
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/issue_show/issue_title_description.vue | 199 | ||||
-rw-r--r-- | app/assets/javascripts/users_select.js | 2 | ||||
-rw-r--r-- | app/assets/stylesheets/framework/sidebar.scss | 4 | ||||
-rw-r--r-- | app/assets/stylesheets/framework/timeline.scss | 5 | ||||
-rw-r--r-- | app/uploaders/gitlab_uploader.rb | 2 |
5 files changed, 3 insertions, 209 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 |