finish linting client
This commit is contained in:
@@ -2,13 +2,15 @@
|
||||
<div class="standard-page container">
|
||||
<div
|
||||
v-for="(category, key) in achievements"
|
||||
:key="key"
|
||||
class="row"
|
||||
>
|
||||
<h2 class="col-12">
|
||||
{{ $t(key+'Achievs') }}
|
||||
</h2>
|
||||
<div
|
||||
v-for="achievment in category.achievements"
|
||||
v-for="(achievment, achievmentKey) in category.achievements"
|
||||
:key="achievmentKey"
|
||||
class="col-3 text-center"
|
||||
>
|
||||
<div
|
||||
@@ -46,13 +48,19 @@
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<h2>Challeges Won</h2>
|
||||
<div v-for="chal in user.achievements.challenges">
|
||||
<div
|
||||
v-for="chal in user.achievements.challenges"
|
||||
:key="chal"
|
||||
>
|
||||
<span>{{ chal }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<h2>Quests Completed</h2>
|
||||
<div v-for="(value, key) in user.achievements.quests">
|
||||
<div
|
||||
v-for="(value, key) in user.achievements.quests"
|
||||
:key="key"
|
||||
>
|
||||
<span>{{ content.quests[k].text() }}</span>
|
||||
<span>{{ value }}</span>
|
||||
</div>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<toggle-switch
|
||||
class="float-right"
|
||||
:label="optTextSet.switchDescription"
|
||||
:checked="!this.user.inbox.optOut"
|
||||
:checked="!user.inbox.optOut"
|
||||
:hover-text="optTextSet.popoverText"
|
||||
@change="toggleOpt()"
|
||||
/>
|
||||
@@ -80,6 +80,7 @@
|
||||
>
|
||||
<div
|
||||
v-for="conversation in filtersConversations"
|
||||
:key="conversation.key"
|
||||
class="conversation"
|
||||
:class="{active: selectedConversation.key === conversation.key}"
|
||||
@click="selectConversation(conversation.key)"
|
||||
@@ -103,7 +104,8 @@
|
||||
<div
|
||||
class="messagePreview"
|
||||
>
|
||||
{{ conversation.lastMessageText ? removeTags(parseMarkdown(conversation.lastMessageText)) : '' }}
|
||||
{{ conversation.lastMessageText
|
||||
? removeTags(parseMarkdown(conversation.lastMessageText)) : '' }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -421,12 +423,14 @@ export default {
|
||||
}
|
||||
// Create conversation objects
|
||||
const convos = [];
|
||||
for (const key in inboxGroup) {
|
||||
for (const key of Object.keys(inboxGroup)) {
|
||||
const recentMessage = inboxGroup[key][0];
|
||||
|
||||
const convoModel = {
|
||||
key: recentMessage.uuid,
|
||||
name: recentMessage.user, // Handles case where from user sent the only message or the to user sent the only message
|
||||
// Handles case where from user sent
|
||||
// the only message or the to user sent the only message
|
||||
name: recentMessage.user,
|
||||
username: !recentMessage.text ? recentMessage.username : recentMessage.toUserName,
|
||||
date: recentMessage.timestamp,
|
||||
lastMessageText: recentMessage.text,
|
||||
@@ -439,14 +443,15 @@ export default {
|
||||
|
||||
return convos;
|
||||
},
|
||||
// Separate from selectedConversation which is not computed so messages don't update automatically
|
||||
// Separate from selectedConversation which
|
||||
// is not computed so messages don't update automatically
|
||||
selectedConversationMessages () {
|
||||
// Vue-subscribe to changes
|
||||
const subScribeToUpdate = this.messagesLoading || this.updateConversionsCounter > -1;
|
||||
|
||||
const selectedConversationKey = this.selectedConversation.key;
|
||||
const selectedConversation = this.messagesByConversation[selectedConversationKey];
|
||||
this.messages = selectedConversation || []; // eslint-disable-line vue/no-side-effects-in-computed-properties
|
||||
this.messages = selectedConversation || []; // eslint-disable-line vue/no-side-effects-in-computed-properties, max-len
|
||||
|
||||
const ordered = orderBy(this.messages, [m => m.timestamp], ['asc']);
|
||||
|
||||
@@ -462,7 +467,10 @@ export default {
|
||||
|
||||
const filtered = subScribeToUpdate && !this.search
|
||||
? this.conversations
|
||||
: filter(this.conversations, conversation => conversation.name.toLowerCase().indexOf(this.search.toLowerCase()) !== -1);
|
||||
: filter(
|
||||
this.conversations,
|
||||
conversation => conversation.name.toLowerCase().indexOf(this.search.toLowerCase()) !== -1,
|
||||
);
|
||||
|
||||
const ordered = orderBy(filtered, [o => moment(o.date).toDate()], ['desc']);
|
||||
|
||||
@@ -677,9 +685,9 @@ export default {
|
||||
const res = await axios.get(requestUrl);
|
||||
const loadedMessages = res.data.data;
|
||||
|
||||
this.messagesByConversation[this.selectedConversation.key] = this.messagesByConversation[this.selectedConversation.key] || [];
|
||||
this.messagesByConversation[this.selectedConversation.key] = this.messagesByConversation[this.selectedConversation.key] || []; // eslint-disable-line max-len
|
||||
const loadedMessagesToAdd = loadedMessages
|
||||
.filter(m => this.messagesByConversation[this.selectedConversation.key].findIndex(mI => mI.id === m.id) === -1);
|
||||
.filter(m => this.messagesByConversation[this.selectedConversation.key].findIndex(mI => mI.id === m.id) === -1); // eslint-disable-line max-len
|
||||
this.messagesByConversation[this.selectedConversation.key].push(...loadedMessagesToAdd);
|
||||
|
||||
// only show the load more Button if the max count was returned
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
></div>
|
||||
</button>
|
||||
<button
|
||||
v-if="user._id !== this.userLoggedIn._id && userLoggedIn.inbox.blocks.indexOf(user._id) === -1"
|
||||
v-if="user._id !== userLoggedIn._id && userLoggedIn.inbox.blocks.indexOf(user._id) === -1"
|
||||
v-b-tooltip.hover.right="$t('blockWarning')"
|
||||
class="btn btn-secondary remove-icon"
|
||||
@click="blockUser()"
|
||||
@@ -37,7 +37,7 @@
|
||||
></div>
|
||||
</button>
|
||||
<button
|
||||
v-if="user._id !== this.userLoggedIn._id && userLoggedIn.inbox.blocks.indexOf(user._id) !== -1"
|
||||
v-if="user._id !== userLoggedIn._id && userLoggedIn.inbox.blocks.indexOf(user._id) !== -1"
|
||||
v-b-tooltip.hover.right="$t('unblock')"
|
||||
class="btn btn-secondary positive-icon"
|
||||
@click="unblockUser()"
|
||||
@@ -48,7 +48,7 @@
|
||||
></div>
|
||||
</button>
|
||||
<button
|
||||
v-if="this.userLoggedIn.contributor.admin"
|
||||
v-if="userLoggedIn.contributor.admin"
|
||||
v-b-tooltip.hover.right="'Admin - Toggle Tools'"
|
||||
class="btn btn-secondary positive-icon"
|
||||
@click="toggleAdminTools()"
|
||||
@@ -60,7 +60,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div
|
||||
v-if="this.userLoggedIn.contributor.admin && adminToolsLoaded"
|
||||
v-if="userLoggedIn.contributor.admin && adminToolsLoaded"
|
||||
class="row admin-profile-actions"
|
||||
>
|
||||
<div class="col-12 text-right">
|
||||
@@ -299,22 +299,24 @@
|
||||
>
|
||||
<div
|
||||
v-for="(category, key) in achievements"
|
||||
:key="key"
|
||||
class="row"
|
||||
>
|
||||
<h2 class="col-12 text-center">
|
||||
{{ $t(key+'Achievs') }}
|
||||
</h2>
|
||||
<div
|
||||
v-for="(achievement, key) in category.achievements"
|
||||
v-for="(achievement, achievKey) in category.achievements"
|
||||
:key="achievKey"
|
||||
class="col-12 col-md-3 text-center"
|
||||
>
|
||||
<div
|
||||
:id="key + '-achievement'"
|
||||
:id="achievKey + '-achievement'"
|
||||
class="box achievement-container"
|
||||
:class="{'achievement-unearned': !achievement.earned}"
|
||||
>
|
||||
<b-popover
|
||||
:target="'#' + key + '-achievement'"
|
||||
:target="'#' + achievKey + '-achievement'"
|
||||
triggers="hover"
|
||||
placement="top"
|
||||
>
|
||||
@@ -355,7 +357,10 @@
|
||||
<h2 class="text-center">
|
||||
{{ $t('challengesWon') }}
|
||||
</h2>
|
||||
<div v-for="chal in user.achievements.challenges">
|
||||
<div
|
||||
v-for="chal in user.achievements.challenges"
|
||||
:key="chal"
|
||||
>
|
||||
<span v-markdown="chal"></span>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -368,7 +373,10 @@
|
||||
<h2 class="text-center">
|
||||
{{ $t('questsCompleted') }}
|
||||
</h2>
|
||||
<div v-for="(value, key) in user.achievements.quests">
|
||||
<div
|
||||
v-for="(value, key) in user.achievements.quests"
|
||||
:key="key"
|
||||
>
|
||||
<span>{{ content.quests[key].text() }} ({{ value }})</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -781,7 +789,7 @@ export default {
|
||||
},
|
||||
selectPage (page) {
|
||||
this.selectedPage = page;
|
||||
history.replaceState(null, null, '');
|
||||
window.history.replaceState(null, null, '');
|
||||
},
|
||||
sendMessage () {
|
||||
this.$root.$emit('habitica::new-inbox-message', {
|
||||
@@ -810,7 +818,8 @@ export default {
|
||||
if (!currentLoginDay) return 0;
|
||||
const previousRewardDay = currentLoginDay.prevRewardKey;
|
||||
const { nextRewardAt } = currentLoginDay;
|
||||
return ((this.user.loginIncentives - previousRewardDay) / (nextRewardAt - previousRewardDay)) * 100;
|
||||
return ((this.user.loginIncentives - previousRewardDay)
|
||||
/ (nextRewardAt - previousRewardDay)) * 100;
|
||||
},
|
||||
save () {
|
||||
const values = {};
|
||||
|
||||
@@ -50,7 +50,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
onShown () {
|
||||
history.pushState('', null, this.path);
|
||||
window.history.pushState('', null, this.path);
|
||||
},
|
||||
onHidden () {
|
||||
if (this.$route.path !== window.location.pathname) {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<div class="well">
|
||||
<div
|
||||
v-for="(label, key) in equipTypes"
|
||||
:key="key"
|
||||
class="col-12 col-md-4 item-wrapper"
|
||||
>
|
||||
<div
|
||||
@@ -22,7 +23,8 @@
|
||||
<div :class="`shop_${equippedItems[key]}`"></div>
|
||||
</div>
|
||||
<b-popover
|
||||
v-if="label !== 'skip' && equippedItems[key] && equippedItems[key].indexOf('base_0') === -1"
|
||||
v-if="label !== 'skip'
|
||||
&& equippedItems[key] && equippedItems[key].indexOf('base_0') === -1"
|
||||
:target="key"
|
||||
triggers="hover"
|
||||
:placement="'bottom'"
|
||||
@@ -51,6 +53,7 @@
|
||||
<!-- Use similar for loop for costume items, except show background if label is 'skip'.-->
|
||||
<div
|
||||
v-for="(label, key) in equipTypes"
|
||||
:key="key"
|
||||
class="col-12 col-md-4 item-wrapper"
|
||||
>
|
||||
<!-- Append a "C" to the key name since HTML IDs have to be unique.-->
|
||||
@@ -72,7 +75,8 @@
|
||||
<div :class="'icon_background_' + user.preferences.background"></div>
|
||||
</div>
|
||||
<b-popover
|
||||
v-if="label !== 'skip' && costumeItems[key] && costumeItems[key].indexOf('base_0') === -1"
|
||||
v-if="label !== 'skip'
|
||||
&& costumeItems[key] && costumeItems[key].indexOf('base_0') === -1"
|
||||
:target="key + 'C'"
|
||||
triggers="hover"
|
||||
:placement="'bottom'"
|
||||
@@ -177,6 +181,7 @@
|
||||
</h2>
|
||||
<div
|
||||
v-for="(statInfo, stat) in stats"
|
||||
:key="stat"
|
||||
class="col-12 col-md-6"
|
||||
>
|
||||
<div class="row col-12 stats-column">
|
||||
@@ -257,6 +262,7 @@
|
||||
<div class="row">
|
||||
<div
|
||||
v-for="(statInfo, stat) in allocateStatsList"
|
||||
:key="stat"
|
||||
class="col-12 col-md-3"
|
||||
>
|
||||
<div class="box white row col-12">
|
||||
@@ -300,7 +306,7 @@
|
||||
:disabled="loading"
|
||||
@click="saveAttributes()"
|
||||
>
|
||||
{{ this.loading ? $t('loading') : $t('save') }}
|
||||
{{ loading ? $t('loading') : $t('save') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -424,21 +430,23 @@ export default {
|
||||
},
|
||||
formatAnimal (animalName, type) {
|
||||
if (type === 'pet') {
|
||||
if (Content.petInfo.hasOwnProperty(animalName)) {
|
||||
if (Content.petInfo[animalName]) {
|
||||
return Content.petInfo[animalName].text();
|
||||
}
|
||||
return this.$t('noActivePet');
|
||||
} if (type === 'mount') {
|
||||
if (Content.mountInfo.hasOwnProperty(animalName)) {
|
||||
if (Content.mountInfo[animalName]) {
|
||||
return Content.mountInfo[animalName].text();
|
||||
}
|
||||
return this.$t('noActiveMount');
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
formatBackground (background) {
|
||||
const bg = Content.appearances.background;
|
||||
|
||||
if (bg.hasOwnProperty(background)) {
|
||||
if (bg[background]) {
|
||||
return `${bg[background].text()} (${this.$t(bg[background].set.text)})`;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,19 +55,26 @@
|
||||
<div v-if="user.flags.itemsEnabled">
|
||||
<h3>Battle Gear</h3>
|
||||
<ul>
|
||||
<!-- eslint-disable vue/no-use-v-if-with-v-for -->
|
||||
<li
|
||||
v-for="(key, itemType) in user.items.gear.equipped"
|
||||
v-for="(key) in user.items.gear.equipped"
|
||||
v-if="flatGear[key]"
|
||||
:key="key"
|
||||
>
|
||||
<!-- eslint-enable vue/no-use-v-if-with-v-for -->
|
||||
<strong>{{ flatGear[key].text() }}</strong>
|
||||
<strong
|
||||
v-if="flatGear[key].str || flatGear[key].con || flatGear[key].per || flatGear[key].int"
|
||||
v-if="flatGear[key].str
|
||||
|| flatGear[key].con || flatGear[key].per || flatGear[key].int"
|
||||
>
|
||||
:
|
||||
<!-- eslint-disable vue/no-use-v-if-with-v-for -->
|
||||
<span
|
||||
v-for="stat in ['str','con','per','int']"
|
||||
v-if="flatGear[key][stat]"
|
||||
:key="stat"
|
||||
>{{ flatGear[key][stat] }} {{ $t(stat) }} </span>
|
||||
<!-- eslint-enable vue/no-use-v-if-with-v-for -->
|
||||
</strong>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -136,6 +143,7 @@
|
||||
</h3>
|
||||
<div
|
||||
v-for="(statInfo, stat) in stats"
|
||||
:key="stat"
|
||||
class="row"
|
||||
>
|
||||
<div class="col-4">
|
||||
@@ -246,7 +254,10 @@
|
||||
<input
|
||||
v-model="user.preferences.automaticAllocation"
|
||||
type="checkbox"
|
||||
@change="set({'preferences.automaticAllocation': user.preferences.automaticAllocation, 'preferences.allocationMode': 'taskbased'})"
|
||||
@change="set({
|
||||
'preferences.automaticAllocation': user.preferences.automaticAllocation,
|
||||
'preferences.allocationMode': 'taskbased'
|
||||
})"
|
||||
>
|
||||
<span
|
||||
class="hint"
|
||||
@@ -313,7 +324,8 @@
|
||||
</div>
|
||||
</form>
|
||||
<div
|
||||
v-if="user.preferences.automaticAllocation && !(user.preferences.allocationMode === 'taskbased') && (user.stats.points > 0)"
|
||||
v-if="user.preferences.automaticAllocation
|
||||
&& !(user.preferences.allocationMode === 'taskbased') && (user.stats.points > 0)"
|
||||
>
|
||||
<button
|
||||
class="btn btn-primary btn-xs"
|
||||
@@ -331,6 +343,7 @@
|
||||
</div>
|
||||
<div
|
||||
v-for="(statInfo, stat) in allocateStatsList"
|
||||
:key="stat"
|
||||
class="row"
|
||||
>
|
||||
<div class="col-8">
|
||||
|
||||
Reference in New Issue
Block a user