BigW Consortium Gitlab

Commit 20f2987a by Filipa Lacerda

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

parent 85f2d7d4
...@@ -33,9 +33,10 @@ ...@@ -33,9 +33,10 @@
computed: { computed: {
...mapGetters([ ...mapGetters([
'getCurrentUserLastNote', 'getCurrentUserLastNote',
'getUserData',
]), ]),
isLoggedIn() { isLoggedIn() {
return window.gon.current_user_id; return this.getUserData === null ? false : true;
}, },
commentButtonTitle() { commentButtonTitle() {
return this.noteType === constants.COMMENT ? 'Comment' : 'Start discussion'; return this.noteType === constants.COMMENT ? 'Comment' : 'Start discussion';
......
<script> <script>
/* global Flash */ /* global Flash */
import { mapActions } from 'vuex'; import { mapActions, mapGetters } from 'vuex';
import { SYSTEM_NOTE } from '../constants'; import { SYSTEM_NOTE } from '../constants';
import issueNote from './issue_note.vue'; import issueNote from './issue_note.vue';
import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue'; import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_link.vue';
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
}, },
data() { data() {
return { return {
newNotePath: window.gl.issueData.create_note_path,
isReplying: false, isReplying: false,
}; };
}, },
...@@ -37,6 +36,9 @@ ...@@ -37,6 +36,9 @@
placeholderSystemNote, placeholderSystemNote,
}, },
computed: { computed: {
...mapGetters([
'getIssueData',
]),
discussion() { discussion() {
return this.note.notes[0]; return this.note.notes[0];
}, },
...@@ -44,8 +46,11 @@ ...@@ -44,8 +46,11 @@
return this.discussion.author; return this.discussion.author;
}, },
canReply() { 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: { methods: {
...mapActions([ ...mapActions([
......
<script> <script>
import { mapGetters } from 'vuex';
export default { export default {
name: 'singInLinksNotes', name: 'singInLinksNotes',
data() { computed: {
const { newSessionPath, registerPath } = this.$store.getters.notesData; ...mapGetters([
'getNotesDataByProp'
]),
registerLink() {
return this.getNotesDataByProp('registerPath')
return { },
signInLink: newSessionPath, signInLink(){
registerLink: registerPath, return this.getNotesDataByProp('newSessionPath');
}; }
}, }
}; };
</script> </script>
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
}, },
userData: { userData: {
type: Object, type: Object,
required: true, required: false,
default: {}
}, },
}, },
store, store,
......
...@@ -8,7 +8,7 @@ export const getIssueData = state => state.issueData; ...@@ -8,7 +8,7 @@ export const getIssueData = state => state.issueData;
export const getIssueDataByProp = state => prop => state.issueData[prop]; export const getIssueDataByProp = state => prop => state.issueData[prop];
export const getUserData = state => state.userData; 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) => { export const notesById = state => state.notes.reduce((acc, note) => {
note.notes.every(n => Object.assign(acc, { [n.id]: n })); note.notes.every(n => Object.assign(acc, { [n.id]: n }));
......
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