Commit 00ee7a9f authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

FE review changes app code

parent fe96bd41
...@@ -18,7 +18,7 @@ class Diff { ...@@ -18,7 +18,7 @@ class Diff {
}); });
const tab = document.getElementById('diffs'); const tab = document.getElementById('diffs');
if (!tab || (tab && !Object.hasOwnProperty.call(tab.dataset, 'isLocked'))) FilesCommentButton.init($diffFile); if (!tab || (tab && tab.dataset && tab.dataset.isLocked !== '')) FilesCommentButton.init($diffFile);
$diffFile.each((index, file) => new gl.ImageFile(file)); $diffFile.each((index, file) => new gl.ImageFile(file));
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
isIssueOpen() { isIssueOpen() {
return this.issueState === constants.OPENED || this.issueState === constants.REOPENED; return this.issueState === constants.OPENED || this.issueState === constants.REOPENED;
}, },
canCreate() { canCreateNote() {
return this.getIssueData.current_user.can_create_note; return this.getIssueData.current_user.can_create_note;
}, },
issueActionButtonTitle() { issueActionButtonTitle() {
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
<template> <template>
<div> <div>
<issue-note-signed-out-widget v-if="!isLoggedIn" /> <issue-note-signed-out-widget v-if="!isLoggedIn" />
<issue-discussion-locked-widget v-else-if="!canCreate" /> <issue-discussion-locked-widget v-else-if="!canCreateNote" />
<ul <ul
v-else v-else
class="notes notes-form timeline"> class="notes notes-form timeline">
......
<script> <script>
export default { export default {
computed: { computed: {
icon() { lockIcon() {
return gl.utils.spriteIcon('lock'); return gl.utils.spriteIcon('lock');
}, },
}, },
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<template> <template>
<div class="disabled-comment text-center"> <div class="disabled-comment text-center">
<span class="issuable-note-warning"> <span class="issuable-note-warning">
<span class="icon" v-html="icon"></span> <span class="icon" v-html="lockIcon"></span>
<span>This issue is locked. Only <b>project members</b> can comment.</span> <span>This issue is locked. Only <b>project members</b> can comment.</span>
</span> </span>
</div> </div>
......
...@@ -15,7 +15,7 @@ export default { ...@@ -15,7 +15,7 @@ export default {
}, },
}, },
computed: { computed: {
buttonText() { toggleButtonText() {
return this.isConfidential ? 'Turn Off' : 'Turn On'; return this.isConfidential ? 'Turn Off' : 'Turn On';
}, },
updateConfidentialBool() { updateConfidentialBool() {
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
class="btn btn-close" class="btn btn-close"
@click.prevent="updateConfidentialAttribute(updateConfidentialBool)" @click.prevent="updateConfidentialAttribute(updateConfidentialBool)"
> >
{{ buttonText }} {{ toggleButtonText }}
</button> </button>
</div> </div>
</template> </template>
...@@ -86,7 +86,7 @@ export default { ...@@ -86,7 +86,7 @@ export default {
</div> </div>
<div class="value sidebar-item-value hide-collapsed"> <div class="value sidebar-item-value hide-collapsed">
<editForm <edit-form
v-if="isLockDialogOpen" v-if="isLockDialogOpen"
:toggle-form="toggleForm" :toggle-form="toggleForm"
:is-locked="isLocked" :is-locked="isLocked"
...@@ -94,13 +94,25 @@ export default { ...@@ -94,13 +94,25 @@ export default {
:issuable-type="issuableType" :issuable-type="issuableType"
/> />
<div v-if="isLocked" class="value sidebar-item-value"> <div
<i aria-hidden="true" class="fa fa-lock sidebar-item-icon is-active"></i> v-if="isLocked"
class="value sidebar-item-value"
>
<i
aria-hidden="true"
class="fa fa-lock sidebar-item-icon is-active"
></i>
{{ __('Locked') }} {{ __('Locked') }}
</div> </div>
<div v-else class="no-value sidebar-item-value hide-collapsed"> <div
<i aria-hidden="true" class="fa fa-unlock sidebar-item-icon"></i> v-else
class="no-value sidebar-item-value hide-collapsed"
>
<i
aria-hidden="true"
class="fa fa-unlock sidebar-item-icon"
></i>
{{ __('Unlocked') }} {{ __('Unlocked') }}
</div> </div>
</div> </div>
......
import Vue from 'vue'; import Vue from 'vue';
import sidebarTimeTracking from './components/time_tracking/sidebar_time_tracking'; import SidebarTimeTracking from './components/time_tracking/sidebar_time_tracking';
import sidebarAssignees from './components/assignees/sidebar_assignees'; import SidebarAssignees from './components/assignees/sidebar_assignees';
import confidential from './components/confidential/confidential_issue_sidebar.vue'; import ConfidentialIssueSidebar from './components/confidential/confidential_issue_sidebar.vue';
import SidebarMoveIssue from './lib/sidebar_move_issue'; import SidebarMoveIssue from './lib/sidebar_move_issue';
import lockBlock from './components/lock/lock_issue_sidebar.vue'; import LockIssueSidebar from './components/lock/lock_issue_sidebar.vue';
import Translate from '../vue_shared/translate'; import Translate from '../vue_shared/translate';
import Mediator from './sidebar_mediator'; import Mediator from './sidebar_mediator';
...@@ -11,14 +11,14 @@ import Mediator from './sidebar_mediator'; ...@@ -11,14 +11,14 @@ import Mediator from './sidebar_mediator';
Vue.use(Translate); Vue.use(Translate);
function mountConfidentialComponent(mediator) { function mountConfidentialComponent(mediator) {
const el = document.querySelector('#js-confidential-entry-point'); const el = document.getElementById('js-confidential-entry-point');
if (!el) return; if (!el) return;
const dataNode = document.getElementById('js-confidential-issue-data'); const dataNode = document.getElementById('js-confidential-issue-data');
const initialData = JSON.parse(dataNode.innerHTML); const initialData = JSON.parse(dataNode.innerHTML);
const ConfidentialComp = Vue.extend(confidential); const ConfidentialComp = Vue.extend(ConfidentialIssueSidebar);
new ConfidentialComp({ new ConfidentialComp({
propsData: { propsData: {
...@@ -30,14 +30,14 @@ function mountConfidentialComponent(mediator) { ...@@ -30,14 +30,14 @@ function mountConfidentialComponent(mediator) {
} }
function mountLockComponent(mediator) { function mountLockComponent(mediator) {
const el = document.querySelector('#js-lock-entry-point'); const el = document.getElementById('js-lock-entry-point');
if (!el) return; if (!el) return;
const dataNode = document.getElementById('js-lock-issue-data'); const dataNode = document.getElementById('js-lock-issue-data');
const initialData = JSON.parse(dataNode.innerHTML); const initialData = JSON.parse(dataNode.innerHTML);
const LockComp = Vue.extend(lockBlock); const LockComp = Vue.extend(LockIssueSidebar);
new LockComp({ new LockComp({
propsData: { propsData: {
...@@ -54,11 +54,11 @@ function domContentLoaded() { ...@@ -54,11 +54,11 @@ function domContentLoaded() {
const mediator = new Mediator(sidebarOptions); const mediator = new Mediator(sidebarOptions);
mediator.fetch(); mediator.fetch();
const sidebarAssigneesEl = document.querySelector('#js-vue-sidebar-assignees'); const sidebarAssigneesEl = document.getElementById('js-vue-sidebar-assignees');
// Only create the sidebarAssignees vue app if it is found in the DOM // Only create the sidebarAssignees vue app if it is found in the DOM
// We currently do not use sidebarAssignees for the MR page // We currently do not use sidebarAssignees for the MR page
if (sidebarAssigneesEl) { if (sidebarAssigneesEl) {
new Vue(sidebarAssignees).$mount(sidebarAssigneesEl); new Vue(SidebarAssignees).$mount(sidebarAssigneesEl);
} }
mountConfidentialComponent(mediator); mountConfidentialComponent(mediator);
...@@ -70,7 +70,7 @@ function domContentLoaded() { ...@@ -70,7 +70,7 @@ function domContentLoaded() {
$('.js-move-issue-confirmation-button'), $('.js-move-issue-confirmation-button'),
).init(); ).init();
new Vue(sidebarTimeTracking).$mount('#issuable-time-tracker'); new Vue(SidebarTimeTracking).$mount('#issuable-time-tracker');
} }
document.addEventListener('DOMContentLoaded', domContentLoaded); document.addEventListener('DOMContentLoaded', domContentLoaded);
......
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
isLocked: { isLocked: {
type: Boolean, type: Boolean,
default: false, default: false,
required: false,
}, },
isConfidential: { isConfidential: {
type: Boolean, type: Boolean,
default: false, default: false,
required: false,
}, },
}, },
......
export default { export default {
methods: { methods: {
issuableDisplayName(issuableType) { issuableDisplayName(issuableType) {
return issuableType.replace(/_/, ' '); const displayName = issuableType.replace(/_/, ' ');
return this.__ ? this.__(displayName) : displayName;
}, },
}, },
}; };
...@@ -1218,6 +1218,7 @@ ActiveRecord::Schema.define(version: 20170921115009) do ...@@ -1218,6 +1218,7 @@ ActiveRecord::Schema.define(version: 20170921115009) do
t.datetime "last_repository_updated_at" t.datetime "last_repository_updated_at"
t.integer "storage_version", limit: 2 t.integer "storage_version", limit: 2
t.boolean "resolve_outdated_diff_discussions" t.boolean "resolve_outdated_diff_discussions"
t.boolean "merge_requests_ff_only_enabled", default: false, null: false
end end
add_index "projects", ["ci_id"], name: "index_projects_on_ci_id", using: :btree add_index "projects", ["ci_id"], name: "index_projects_on_ci_id", using: :btree
......
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