Client fixes aug 31 (#9010)

* Separated private message model

* Added markdown to profile

* Add color backgrounds

* Added broken challenge flow

* Added summary field to getgroups

* Fixed group form information loading

* Updated autocomplete to use chat

* Fixed npc styles

* Fixed onload mentions
This commit is contained in:
Keith Holliday
2017-08-31 16:14:09 -06:00
committed by GitHub
parent 87d57dab13
commit cdd3bc3cd6
12 changed files with 322 additions and 114 deletions

View File

@@ -14,7 +14,7 @@ div.autocomplete-selection(v-if='searchResults.length > 0', :style='autocomplete
import groupBy from 'lodash/groupBy';
export default {
props: ['selections', 'text', 'coords', 'groupId', 'chat'],
props: ['selections', 'text', 'coords', 'chat'],
data () {
return {
currentSearch: '',
@@ -43,6 +43,9 @@ export default {
});
},
},
mounted () {
this.grabUserNames();
},
watch: {
text (newText) {
if (newText[newText.length - 1] !== '@') return;
@@ -50,22 +53,19 @@ export default {
this.currentSearchPosition = newText.length - 1;
},
chat () {
this.grabUserNames();
},
},
methods: {
grabUserNames () {
let usersThatMessage = groupBy(this.chat, 'user');
for (let userName in usersThatMessage) {
if (this.tmpSelections.indexOf(userName) === -1) {
let systemMessage = userName === 'undefined';
if (!systemMessage && this.tmpSelections.indexOf(userName) === -1) {
this.tmpSelections.push(userName);
}
}
},
async groupId () {
if (!this.groupId) return;
let members = await this.$store.dispatch('members:getGroupMembers', {groupId: this.groupId});
this.tmpSelections = members.map((member) => {
return member.profile.name;
});
},
},
methods: {
select (result) {
let newText = this.text.slice(0, this.currentSearchPosition + 1) + result;
this.searchActive = false;