提交 20f2987a 编写于 作者: F Filipa Lacerda

[ci skip] Fix broken links for signin and register path

上级 85f2d7d4
......@@ -33,9 +33,10 @@
computed: {
...mapGetters([
'getCurrentUserLastNote',
'getUserData',
]),
isLoggedIn() {
return window.gon.current_user_id;
return this.getUserData === null ? false : true;
},
commentButtonTitle() {
return this.noteType === constants.COMMENT ? 'Comment' : 'Start discussion';
......
<script>
/* global Flash */
import { mapActions } from 'vuex';
import { mapActions, mapGetters } from 'vuex';
import { SYSTEM_NOTE } from '../constants';
import issueNote from './issue_note.vue';
import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
......@@ -21,7 +21,6 @@
},
data() {
return {
newNotePath: window.gl.issueData.create_note_path,
isReplying: false,
};
},
......@@ -37,6 +36,9 @@
placeholderSystemNote,
},
computed: {
...mapGetters([
'getIssueData',
]),
discussion() {
return this.note.notes[0];
},
......@@ -44,8 +46,11 @@
return this.discussion.author;
},
canReply() {
return window.gl.issueData.current_user.can_create_note;
return this.getIssueData.current_user.can_create_note;
},
newNotePath() {
return this.getIssueData.create_note_path;
}
},
methods: {
...mapActions([
......
<script>
import { mapGetters } from 'vuex';
export default {
name: 'singInLinksNotes',
data() {
const { newSessionPath, registerPath } = this.$store.getters.notesData;
computed: {
...mapGetters([
'getNotesDataByProp'
]),
registerLink() {
return this.getNotesDataByProp('registerPath')
return {
signInLink: newSessionPath,
registerLink: registerPath,
};
},
},
signInLink(){
return this.getNotesDataByProp('newSessionPath');
}
}
};
</script>
......
......@@ -26,7 +26,8 @@
},
userData: {
type: Object,
required: true,
required: false,
default: {}
},
},
store,
......
......@@ -8,7 +8,7 @@ export const getIssueData = state => state.issueData;
export const getIssueDataByProp = state => prop => state.issueData[prop];
export const getUserData = state => state.userData;
export const getUserDataByProp = state => prop => state.userData[prop];
export const getUserDataByProp = state => prop => state.userData && state.userData[prop];
export const notesById = state => state.notes.reduce((acc, note) => {
note.notes.every(n => Object.assign(acc, { [n.id]: n }));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册