debian-mirror-gitlab/app/assets/javascripts/notes/mixins/issuable_state.js

33 lines
819 B
JavaScript
Raw Normal View History

2019-09-04 21:01:54 +05:30
import { mapGetters } from 'vuex';
2018-03-17 18:26:18 +05:30
export default {
2019-09-04 21:01:54 +05:30
computed: {
...mapGetters(['getNoteableDataByProp']),
2020-01-01 13:55:28 +05:30
isProjectArchived() {
return this.getNoteableDataByProp('is_project_archived');
},
archivedProjectDocsPath() {
return this.getNoteableDataByProp('archived_project_docs_path');
},
2019-09-04 21:01:54 +05:30
lockedIssueDocsPath() {
return this.getNoteableDataByProp('locked_discussion_docs_path');
},
confidentialIssueDocsPath() {
return this.getNoteableDataByProp('confidential_issues_docs_path');
},
},
2018-03-17 18:26:18 +05:30
methods: {
isConfidential(issue) {
2019-09-04 21:01:54 +05:30
return Boolean(issue.confidential);
2018-03-17 18:26:18 +05:30
},
isLocked(issue) {
2019-09-04 21:01:54 +05:30
return Boolean(issue.discussion_locked);
2018-03-17 18:26:18 +05:30
},
hasWarning(issue) {
return this.isConfidential(issue) || this.isLocked(issue);
},
},
};