mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-15 12:16:22 +00:00
Squashed commit of the following:
commit 00affb306655a543f5d29b3af6361e686b577a97
Author: SabreCat <sabe@habitica.com>
Date: Tue May 2 09:47:25 2023 -0500
fix(tests): account for invite limit changes
commit 47661117f9fd661b8bc8f63b7cc7c8d5f8fa0fd7
Author: SabreCat <sabe@habitica.com>
Date: Mon May 1 17:39:29 2023 -0500
fix(lfp): final polish
commit 6a1e5af1db0dd90be3ced7e223f53c9183a206f5
Merge: 728ed2ddad 9e0777bb42
Author: SabreCat <sabe@habitica.com>
Date: Mon May 1 16:54:12 2023 -0500
Merge branch 'release' into sabrecat/party-seeking
commit 728ed2ddad7f0962d28f1ab0a271e3555b19296c
Author: SabreCat <sabe@habitica.com>
Date: Thu Apr 27 16:51:06 2023 -0500
fix(lfp): loading layout and page visit event
commit 8a56ab329bff922e05963e3ef78fbc26ff273924
Author: SabreCat <sabe@habitica.com>
Date: Wed Apr 26 16:54:46 2023 -0500
fix(faq): copy and style updates
commit 6fd00d7f30150a1802e5a37edbb914ef120caf9a
Author: SabreCat <sabe@habitica.com>
Date: Fri Apr 21 17:12:52 2023 -0500
feat(lfp): fixes, analytics, FAQ
commit 4b5d7304ad7cfc5f72320b23456ed2898e53caac
Author: SabreCat <sabe@habitica.com>
Date: Mon Apr 17 15:13:03 2023 -0500
fix(lfp): smol tweaks
commit 9a5476a2558eb17a603f4aae1b5b2d35773be8b4
Author: SabreCat <sabe@habitica.com>
Date: Thu Apr 13 16:03:33 2023 -0500
feat(lfp): refresh button
commit aa58f5018469f38a9a9d31c3bffa26bb88a8c672
Merge: bbb03d006e c8adf20804
Author: SabreCat <sabe@habitica.com>
Date: Tue Apr 11 17:44:56 2023 -0500
Merge branch 'release' into sabrecat/party-seeking
commit bbb03d006e8b122bb7206bdc778a31de422167bb
Author: SabreCat <sabe@habitica.com>
Date: Tue Apr 4 18:30:50 2023 -0500
fix(lint): whitespace and const
commit 23683ad29a4cce0b0da061ad6c030982034c0a9c
Author: SabreCat <sabe@habitica.com>
Date: Tue Apr 4 17:02:57 2023 -0500
chore(LFP): add analytics
also re-fix loading state
commit 4477d84f5266c87f5583368029b72153f00f0568
Author: SabreCat <sabe@habitica.com>
Date: Mon Apr 3 16:24:26 2023 -0500
fix(LFP): address issues with loading
commit bdc5154f24bb5e50963376c3c0c9cc73c0b05ccc
Merge: 81923eef6f 229ed46425
Author: SabreCat <sabe@habitica.com>
Date: Mon Apr 3 15:58:12 2023 -0500
Merge branch 'release' into sabrecat/party-seeking
commit 81923eef6f0c627d079475a28f9d93d8e4628934
Author: SabreCat <sabe@habitica.com>
Date: Thu Mar 30 16:44:49 2023 -0500
feat(LFP): release candidate
commit fe1f8939fc6b09d36cfaf0b6e5838df04e41009d
Author: SabreCat <sabe@habitica.com>
Date: Wed Mar 29 17:35:54 2023 -0500
WIP(LFP): fixes
commit afc361f5a9f806cbd814ad910d1274e3a6609efd
Merge: d6b5cbdebc 7ede3acd01
Author: SabreCat <sabe@habitica.com>
Date: Wed Mar 29 16:24:39 2023 -0500
Merge branch 'release' into sabrecat/party-seeking
commit d6b5cbdebc2829e9325ea57fb5deeccc128c1635
Author: SabreCat <sabe@habitica.com>
Date: Tue Mar 28 16:13:18 2023 -0500
WIP(LFP): change copy, add close X, fix API response
commit 4274a4625862351ef0ecf33c8a3249ca5ebec7cb
Author: SabreCat <sabe@habitica.com>
Date: Mon Mar 27 17:07:36 2023 -0500
fix(LFP): layout, unset when stopping
commit 95abfcfa5f13c9cce6385206947a47f85b76d11d
Merge: 4a360eedd8 53c536b525
Author: SabreCat <sabe@habitica.com>
Date: Mon Mar 27 16:32:46 2023 -0500
Merge branch 'release' into sabrecat/party-seeking
commit 4a360eedd8b9cf41d3a0fe7a4cfaa72c5bd7bd26
Author: SabreCat <sabe@habitica.com>
Date: Thu Mar 23 16:54:49 2023 -0500
feat(LFP): completed style and infinite scroll
commit bbc439d9d03c9631a450236eb33af66f0428fa50
Author: SabreCat <sabe@habitica.com>
Date: Tue Mar 21 10:40:26 2023 -0500
WIP(LFP): nicer layout, buffs fix
commit 1658688597456663477ab19da61ae1b9bc85cf2a
Merge: 664507434f 027e61a93e
Author: SabreCat <sabe@habitica.com>
Date: Tue Mar 21 09:29:02 2023 -0500
Merge branch 'release' into sabrecat/party-seeking
commit 664507434f2f76e6bf3b61cdc9e3daddb81204af
Author: SabreCat <sabe@habitica.com>
Date: Fri Mar 17 17:13:08 2023 -0500
WIP(LFP): API and client adjustments
commit 2f0b6f2517f9e2d634cb23ee303cfb4542e998ce
Merge: 0db1704325 a16098ccda
Author: SabreCat <sabe@habitica.com>
Date: Fri Mar 17 16:45:13 2023 -0500
Merge branch 'release' into sabrecat/party-seeking
commit 0db1704325c3555f0b5d9c8d1dfc44177e90c093
Author: SabreCat <sabe@habitica.com>
Date: Mon Mar 13 14:48:10 2023 -0500
fix(modal): scrollbar for squashed viewports
commit 733c35192e0a4e31e1bebfdd7488cfc1f7587f36
Author: SabreCat <sabe@habitica.com>
Date: Thu Mar 9 12:51:02 2023 -0600
WIP(party): seekers functional rough
commit d4b854410b557db26eec6e6a26b6d174c02cee3a
Merge: 7fe919825a 0b6b967753
Author: SabreCat <sabe@habitica.com>
Date: Thu Mar 9 10:07:28 2023 -0600
Merge branch 'release' into sabrecat/party-seeking
commit 7fe919825abfb6d518cb93b91f5997d3831bd0b5
Author: SabreCat <sabe@habitica.com>
Date: Thu Mar 2 14:40:09 2023 -0600
feat(party): several adjustments to seeking feature
commit c93900efcf925f7aaa4c4cb56b4451f19adfb1b3
Author: SabreCat <sabe@habitica.com>
Date: Wed Mar 1 20:37:11 2023 -0600
feat(party): initial Seeking API
commit 8bb784daeceb14c23992a6f3af1054a900fc26c1
Merge: e19a661a21 f327795761
Author: SabreCat <sabe@habitica.com>
Date: Wed Mar 1 18:58:20 2023 -0600
Merge branch 'release' into sabrecat/party-seeking
commit e19a661a2163a50307a286379bffb44201ed392e
Author: SabreCat <sabe@habitica.com>
Date: Fri Feb 24 15:51:42 2023 -0600
WIP(parties): add seeking flag and modal toggle
This commit is contained in:
parent
9e0777bb42
commit
e9e4265545
29 changed files with 999 additions and 213 deletions
|
|
@ -258,47 +258,6 @@ describe('POST /group/:groupId/join', () => {
|
|||
await expect(user.get('/user')).to.eventually.have.nested.property('items.quests.basilist', 2);
|
||||
});
|
||||
|
||||
it('deletes previous party where the user was the only member', async () => {
|
||||
const userToInvite = await generateUser();
|
||||
const oldParty = await userToInvite.post('/groups', { // add user to a party
|
||||
name: 'Another Test Party',
|
||||
type: 'party',
|
||||
});
|
||||
|
||||
await expect(checkExistence('groups', oldParty._id)).to.eventually.equal(true);
|
||||
await user.post(`/groups/${party._id}/invite`, {
|
||||
uuids: [userToInvite._id],
|
||||
});
|
||||
await userToInvite.post(`/groups/${party._id}/join`);
|
||||
|
||||
await expect(user.get('/user')).to.eventually.have.nested.property('party._id', party._id);
|
||||
await expect(checkExistence('groups', oldParty._id)).to.eventually.equal(false);
|
||||
});
|
||||
|
||||
it('does not allow user to leave a party if a quest was active and they were the only member', async () => {
|
||||
const userToInvite = await generateUser();
|
||||
const oldParty = await userToInvite.post('/groups', { // add user to a party
|
||||
name: 'Another Test Party',
|
||||
type: 'party',
|
||||
});
|
||||
|
||||
await userToInvite.update({
|
||||
[`items.quests.${PET_QUEST}`]: 1,
|
||||
});
|
||||
await userToInvite.post(`/groups/${oldParty._id}/quests/invite/${PET_QUEST}`);
|
||||
|
||||
await expect(checkExistence('groups', oldParty._id)).to.eventually.equal(true);
|
||||
await user.post(`/groups/${party._id}/invite`, {
|
||||
uuids: [userToInvite._id],
|
||||
});
|
||||
|
||||
await expect(userToInvite.post(`/groups/${party._id}/join`)).to.eventually.be.rejected.and.eql({
|
||||
code: 401,
|
||||
error: 'NotAuthorized',
|
||||
message: t('messageCannotLeaveWhileQuesting'),
|
||||
});
|
||||
});
|
||||
|
||||
it('invites joining member to active quest', async () => {
|
||||
await user.update({
|
||||
[`items.quests.${PET_QUEST}`]: 1,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { v4 as generateUUID } from 'uuid';
|
||||
import nconf from 'nconf';
|
||||
import {
|
||||
createAndPopulateGroup,
|
||||
generateUser,
|
||||
generateGroup,
|
||||
translate as t,
|
||||
|
|
@ -581,20 +582,7 @@ describe('Post /groups/:groupId/invite', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('allow inviting a user to a party if they are partying solo', async () => {
|
||||
const userToInvite = await generateUser();
|
||||
await userToInvite.post('/groups', { // add user to a party
|
||||
name: 'Another Test Party',
|
||||
type: 'party',
|
||||
});
|
||||
|
||||
await inviter.post(`/groups/${party._id}/invite`, {
|
||||
uuids: [userToInvite._id],
|
||||
});
|
||||
expect((await userToInvite.get('/user')).invitations.parties[0].id).to.equal(party._id);
|
||||
});
|
||||
|
||||
it('allow inviting a user to 2 different parties', async () => {
|
||||
it('allows inviting a user to 2 different parties', async () => {
|
||||
// Create another inviter
|
||||
const inviter2 = await generateUser();
|
||||
|
||||
|
|
@ -635,29 +623,47 @@ describe('Post /groups/:groupId/invite', () => {
|
|||
});
|
||||
expect((await userToInvite.get('/user')).invitations.parties[0].id).to.equal(party._id);
|
||||
});
|
||||
});
|
||||
|
||||
describe('party size limits', () => {
|
||||
let party, partyLeader;
|
||||
|
||||
beforeEach(async () => {
|
||||
group = await createAndPopulateGroup({
|
||||
groupDetails: {
|
||||
name: 'Test Party',
|
||||
type: 'party',
|
||||
privacy: 'private',
|
||||
},
|
||||
// Generate party with 20 members
|
||||
members: PARTY_LIMIT_MEMBERS - 10,
|
||||
});
|
||||
party = group.group;
|
||||
partyLeader = group.groupLeader;
|
||||
});
|
||||
|
||||
it('allows 30 members in a party', async () => {
|
||||
const invitesToGenerate = [];
|
||||
// Generate 29 users to invite (29 + leader = 30 members)
|
||||
for (let i = 0; i < PARTY_LIMIT_MEMBERS - 1; i += 1) {
|
||||
// Generate 10 new invites
|
||||
for (let i = 1; i < 10; i += 1) {
|
||||
invitesToGenerate.push(generateUser());
|
||||
}
|
||||
const generatedInvites = await Promise.all(invitesToGenerate);
|
||||
// Invite users
|
||||
expect(await inviter.post(`/groups/${party._id}/invite`, {
|
||||
expect(await partyLeader.post(`/groups/${party._id}/invite`, {
|
||||
uuids: generatedInvites.map(invite => invite._id),
|
||||
})).to.be.an('array');
|
||||
}).timeout(10000);
|
||||
|
||||
it('does not allow 30+ members in a party', async () => {
|
||||
it('does not allow >30 members in a party', async () => {
|
||||
const invitesToGenerate = [];
|
||||
// Generate 30 users to invite (30 + leader = 31 members)
|
||||
for (let i = 0; i < PARTY_LIMIT_MEMBERS; i += 1) {
|
||||
// Generate 11 invites
|
||||
for (let i = 1; i < 11; i += 1) {
|
||||
invitesToGenerate.push(generateUser());
|
||||
}
|
||||
const generatedInvites = await Promise.all(invitesToGenerate);
|
||||
// Invite users
|
||||
await expect(inviter.post(`/groups/${party._id}/invite`, {
|
||||
await expect(partyLeader.post(`/groups/${party._id}/invite`, {
|
||||
uuids: generatedInvites.map(invite => invite._id),
|
||||
}))
|
||||
.to.eventually.be.rejected.and.eql({
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
.icon-16 {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
.icon-10 {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.icon-12 {
|
||||
|
|
@ -34,21 +34,26 @@
|
|||
height: 12px;
|
||||
}
|
||||
|
||||
.icon-16 {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.icon-24 {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.icon-32 {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.icon-48 {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.icon-10 {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
.inline {
|
||||
display: inline-block;
|
||||
}
|
||||
|
|
|
|||
1
website/client/src/assets/svg/sync-2.svg
Normal file
1
website/client/src/assets/svg/sync-2.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path id="b" d="m10,6h6V0h-2v2.72C12.49.99,10.3,0,8,0,3.59,0,0,3.59,0,8s3.59,8,8,8c2.69,0,5.2-1.35,6.68-3.6l-1.67-1.1c-1.11,1.69-2.99,2.71-5.01,2.7-3.31,0-6-2.69-6-6s2.69-6,6-6c1.72,0,3.33.74,4.46,2h-2.46v2Z" fill-rule="evenodd"/></svg>
|
||||
|
After Width: | Height: | Size: 341 B |
|
|
@ -11,9 +11,12 @@
|
|||
<div class="quest_screen"></div>
|
||||
<div class="row heading">
|
||||
<div class="col-12 text-center pr-5 pl-5">
|
||||
<h2 v-once>
|
||||
<h1
|
||||
v-once
|
||||
class="mb-2"
|
||||
>
|
||||
{{ $t('playInPartyTitle') }}
|
||||
</h2>
|
||||
</h1>
|
||||
<p
|
||||
v-once
|
||||
class="mb-4"
|
||||
|
|
@ -22,67 +25,91 @@
|
|||
</p>
|
||||
<button
|
||||
v-once
|
||||
class="btn btn-primary"
|
||||
class="btn btn-primary px-4 mb-2"
|
||||
@click="createParty()"
|
||||
>
|
||||
{{ $t('createParty') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<close-x
|
||||
@close="close()"
|
||||
/>
|
||||
</div>
|
||||
<div class="row grey-row">
|
||||
<div class="col-12 text-center">
|
||||
<div class="col-12 text-center px-0">
|
||||
<div class="join-party"></div>
|
||||
<h2 v-once>
|
||||
{{ $t('wantToJoinPartyTitle') }}
|
||||
</h2>
|
||||
<p v-html="$t('wantToJoinPartyDescription')"></p>
|
||||
<div
|
||||
class="form-group"
|
||||
@click="copyUsername"
|
||||
<h1
|
||||
v-once
|
||||
class="mb-2"
|
||||
>
|
||||
<div class="d-flex align-items-center">
|
||||
<label
|
||||
v-once
|
||||
class="mr-3"
|
||||
>{{ $t('username') }}</label>
|
||||
<div class="flex-grow-1">
|
||||
<div class="input-group-prepend input-group-text">
|
||||
@
|
||||
<div class="text">
|
||||
{{ user.auth.local.username }}
|
||||
</div>
|
||||
<div
|
||||
class="svg-icon copy-icon"
|
||||
v-html="icons.copy"
|
||||
></div>
|
||||
<div
|
||||
v-once
|
||||
class="small"
|
||||
>
|
||||
{{ $t('copy') }}
|
||||
</div>
|
||||
</div>
|
||||
{{ $t('wantToJoinPartyTitle') }}
|
||||
</h1>
|
||||
<p
|
||||
v-once
|
||||
class="mb-4"
|
||||
v-html="$t('partyFinderDescription')"
|
||||
>
|
||||
</p>
|
||||
<div
|
||||
v-if="seeking"
|
||||
>
|
||||
<div
|
||||
class="green-bar mb-3"
|
||||
>
|
||||
{{ $t('currentlyLookingForParty') }}
|
||||
</div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<div
|
||||
class="red-link"
|
||||
@click="seekParty()"
|
||||
>
|
||||
{{ $t('leave') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
v-else
|
||||
class="btn btn-primary px-4 mt-2 mb-1"
|
||||
@click="seekParty()"
|
||||
>
|
||||
{{ $t('lookForParty') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</b-modal>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
#create-party-modal .modal-body {
|
||||
padding: 0rem 0.75rem;
|
||||
}
|
||||
<style lang="scss">
|
||||
#create-party-modal {
|
||||
display: flex !important;
|
||||
overflow-y: hidden;
|
||||
|
||||
#create-party-modal .modal-dialog {
|
||||
width: 35.75rem;
|
||||
}
|
||||
@media (max-height: 770px) {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#create-party-modal .modal-header {
|
||||
padding: 0;
|
||||
border-bottom: 0px;
|
||||
.modal-body {
|
||||
padding: 0rem 0.75rem;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
width: 566px;
|
||||
margin: auto;
|
||||
|
||||
@media (max-height: 826px) {
|
||||
margin-top: 56px;
|
||||
}
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
padding: 0;
|
||||
border-bottom: 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -107,15 +134,27 @@
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
.green-bar {
|
||||
height: 32px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
line-height: 1.71;
|
||||
text-align: center;
|
||||
color: $green-1;
|
||||
background-color: $green-100;
|
||||
border-radius: 2px;
|
||||
padding: 4px 0px 4px 0px;
|
||||
}
|
||||
|
||||
.grey-row {
|
||||
background-color: $gray-700;
|
||||
color: #4e4a57;
|
||||
padding: 2em;
|
||||
border-radius: 0px 0px 2px 2px;
|
||||
border-radius: 0px 0px 8px 8px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: $gray-100;
|
||||
h1 {
|
||||
color: $purple-300;
|
||||
}
|
||||
|
||||
.header-wrap {
|
||||
|
|
@ -132,10 +171,6 @@
|
|||
border-radius: 2px 2px 0 0;
|
||||
image-rendering: optimizequality;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: $purple-200;
|
||||
}
|
||||
}
|
||||
|
||||
.heading {
|
||||
|
|
@ -182,6 +217,21 @@
|
|||
margin: 0.75rem auto 0.75rem 0.25rem;
|
||||
}
|
||||
|
||||
p {
|
||||
line-height: 1.71;
|
||||
}
|
||||
|
||||
.red-link {
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
line-height: 1.71;
|
||||
text-align: center;
|
||||
color: $maroon-50;
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.small {
|
||||
color: $gray-200;
|
||||
margin: auto 0.5rem auto 0.25rem;
|
||||
|
|
@ -192,21 +242,35 @@
|
|||
import { mapState } from '@/libs/store';
|
||||
import * as Analytics from '@/libs/analytics';
|
||||
import notifications from '@/mixins/notifications';
|
||||
import closeX from '../ui/closeX';
|
||||
|
||||
import copyIcon from '@/assets/svg/copy.svg';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
closeX,
|
||||
},
|
||||
mixins: [notifications],
|
||||
data () {
|
||||
return {
|
||||
icons: Object.freeze({
|
||||
copy: copyIcon,
|
||||
}),
|
||||
seeking: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({ user: 'user.data' }),
|
||||
},
|
||||
mounted () {
|
||||
this.seeking = Boolean(this.user.party.seeking);
|
||||
Analytics.track({
|
||||
eventName: 'Start a Party button',
|
||||
eventAction: 'Start a Party button',
|
||||
eventCategory: 'behavior',
|
||||
hitType: 'event',
|
||||
}, { trackOnClient: true });
|
||||
},
|
||||
methods: {
|
||||
async createParty () {
|
||||
const group = {
|
||||
|
|
@ -223,7 +287,10 @@ export default {
|
|||
});
|
||||
|
||||
this.$root.$emit('bv::hide::modal', 'create-party-modal');
|
||||
this.$router.push('/party');
|
||||
await this.$router.push('/party');
|
||||
},
|
||||
close () {
|
||||
this.$root.$emit('bv::hide::modal', 'create-party-modal');
|
||||
},
|
||||
copyUsername () {
|
||||
if (navigator.clipboard) {
|
||||
|
|
@ -238,6 +305,12 @@ export default {
|
|||
}
|
||||
this.text(this.$t('usernameCopied'));
|
||||
},
|
||||
seekParty () {
|
||||
this.$store.dispatch('user:set', {
|
||||
'party.seeking': !this.user.party.seeking ? new Date() : null,
|
||||
});
|
||||
this.seeking = !this.seeking;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -542,7 +542,8 @@ export default {
|
|||
await this.$store.dispatch('guilds:leave', data);
|
||||
|
||||
if (this.isParty) {
|
||||
this.$router.push({ name: 'tasks' });
|
||||
await this.$router.push({ name: 'tasks' });
|
||||
window.location.reload(true);
|
||||
}
|
||||
},
|
||||
upgradeGroup () {
|
||||
|
|
|
|||
351
website/client/src/components/groups/lookingForParty.vue
Normal file
351
website/client/src/components/groups/lookingForParty.vue
Normal file
|
|
@ -0,0 +1,351 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="d-flex justify-content-center">
|
||||
<div
|
||||
v-if="seekers.length > 0"
|
||||
class="fit-content mx-auto mt-4"
|
||||
>
|
||||
<div class="d-flex align-items-center">
|
||||
<h1 v-once class="my-auto mr-auto"> {{ $t('findPartyMembers') }}</h1>
|
||||
<div
|
||||
class="btn btn-secondary btn-sync ml-auto my-auto pl-2 pr-3 d-flex"
|
||||
@click="refreshList()"
|
||||
>
|
||||
<div class="svg-icon icon-16 color my-auto mr-2" v-html="icons.sync"></div>
|
||||
<div class="ml-auto"> {{ $t('refreshList') }} </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-wrap seeker-list">
|
||||
<div
|
||||
v-for="(seeker, index) in seekers"
|
||||
:key="seeker._id"
|
||||
class="seeker"
|
||||
>
|
||||
<div class="d-flex">
|
||||
<avatar
|
||||
:member="seeker"
|
||||
:hideClassBadge="true"
|
||||
@click.native="showMemberModal(seeker._id)"
|
||||
class="mr-3 mb-2"
|
||||
/>
|
||||
<div class="card-data">
|
||||
<user-link
|
||||
:user-id="seeker._id"
|
||||
:name="seeker.profile.name"
|
||||
:backer="seeker.backer"
|
||||
:contributor="seeker.contributor"
|
||||
/>
|
||||
<div class="small-with-border pb-2 mb-2">
|
||||
@{{ seeker.auth.local.username }} • {{ $t('level') }} {{ seeker.stats.lvl }}
|
||||
</div>
|
||||
<div
|
||||
class="d-flex"
|
||||
>
|
||||
<strong v-once> {{ $t('classLabel') }} </strong>
|
||||
<span
|
||||
class="svg-icon d-inline-block icon-16 my-auto mx-2"
|
||||
v-html="icons[seeker.stats.class]"
|
||||
>
|
||||
</span>
|
||||
<strong
|
||||
:class="`${seeker.stats.class}-color`"
|
||||
>
|
||||
{{ $t(seeker.stats.class) }}
|
||||
</strong>
|
||||
</div>
|
||||
<div>
|
||||
<strong v-once class="mr-2"> {{ $t('checkinsLabel') }} </strong>
|
||||
{{ seeker.loginIncentives }}
|
||||
</div>
|
||||
<div>
|
||||
<strong v-once class="mr-2"> {{ $t('languageLabel') }} </strong>
|
||||
{{ displayLanguage(seeker.preferences.language) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<strong
|
||||
v-if="!seeker.invited"
|
||||
@click="inviteUser(seeker._id, index)"
|
||||
class="btn btn-primary w-100"
|
||||
>
|
||||
{{ $t('inviteToParty') }}
|
||||
</strong>
|
||||
<div
|
||||
v-else
|
||||
@click="rescindInvite(seeker._id, index)"
|
||||
class="btn btn-success w-100"
|
||||
v-html="$t('invitedToYourParty')"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<mugen-scroll
|
||||
v-show="loading"
|
||||
:handler="infiniteScrollTrigger"
|
||||
:should-handle="!loading && canLoadMore"
|
||||
:threshold="1"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="seekers.length === 0 && !loading"
|
||||
class="d-flex flex-column empty-state text-center my-5"
|
||||
>
|
||||
<div class="gray-circle mb-3 mx-auto d-flex">
|
||||
<div
|
||||
class="svg-icon icon-32 color m-auto"
|
||||
v-html="icons.users"
|
||||
>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<strong class="mb-1"> {{ $t('findMorePartyMembers') }} </strong>
|
||||
<div v-html="$t('noOneLooking')"></div>
|
||||
</div>
|
||||
</div>
|
||||
<h2
|
||||
v-show="loading"
|
||||
class="loading"
|
||||
:class="seekers.length === 0 ? 'mt-3' : 'mt-0'"
|
||||
>
|
||||
{{ $t('loading') }}
|
||||
</h2>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '~@/assets/scss/colors.scss';
|
||||
|
||||
h1 {
|
||||
color: $purple-300;
|
||||
}
|
||||
|
||||
strong {
|
||||
line-height: 1.71;
|
||||
}
|
||||
.avatar {
|
||||
background-color: $gray-600;
|
||||
}
|
||||
|
||||
.btn-success {
|
||||
box-shadow: none;
|
||||
color: $green-1;
|
||||
font-weight: normal;
|
||||
|
||||
&:not(:disabled):not(.disabled):active {
|
||||
color: $green-1;
|
||||
}
|
||||
}
|
||||
|
||||
.btn-sync {
|
||||
min-width: 128px;
|
||||
max-height: 32px;
|
||||
|
||||
.svg-icon {
|
||||
color: $gray-200;
|
||||
}
|
||||
}
|
||||
|
||||
.card-data {
|
||||
width: 267px;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
color: $gray-100;
|
||||
line-height: 1.71;
|
||||
}
|
||||
|
||||
.fit-content {
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.gray-circle {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
color: $gray-600;
|
||||
background-color: $gray-200;
|
||||
border-radius: 100px;
|
||||
|
||||
.icon-32 {
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.loading {
|
||||
text-align: center;
|
||||
color: $purple-300;
|
||||
}
|
||||
|
||||
.seeker-list {
|
||||
max-width: 920px;
|
||||
|
||||
@media (max-width: 962px) {
|
||||
max-width: 464px;
|
||||
};
|
||||
|
||||
.seeker {
|
||||
width: 448px;
|
||||
margin-bottom: 24px;
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 3px 0 rgba(26, 24, 29, 0.12), 0 1px 2px 0 rgba(26, 24, 29, 0.24);
|
||||
|
||||
&:first-of-type {
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
@media (min-width: 963px) {
|
||||
&:nth-child(2) {
|
||||
margin-top: 24px;
|
||||
}
|
||||
&:nth-child(even) {
|
||||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.small-with-border {
|
||||
border-bottom: 1px solid $gray-500;
|
||||
color: $gray-100;
|
||||
font-size: 12px;
|
||||
font-weight: normal;
|
||||
line-height: 1.33;
|
||||
}
|
||||
|
||||
.healer-color {
|
||||
color: $yellow-10;
|
||||
}
|
||||
|
||||
.rogue-color {
|
||||
color: $purple-200;
|
||||
}
|
||||
|
||||
.warrior-color {
|
||||
color: $red-50;
|
||||
}
|
||||
|
||||
.wizard-color {
|
||||
color: $blue-10;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash/debounce';
|
||||
import MugenScroll from 'vue-mugen-scroll';
|
||||
import Avatar from '../avatar';
|
||||
import userLink from '../userLink';
|
||||
import { mapState } from '@/libs/store';
|
||||
|
||||
import syncIcon from '@/assets/svg/sync-2.svg';
|
||||
import usersIcon from '@/assets/svg/users.svg';
|
||||
import warriorIcon from '@/assets/svg/warrior.svg';
|
||||
import rogueIcon from '@/assets/svg/rogue.svg';
|
||||
import healerIcon from '@/assets/svg/healer.svg';
|
||||
import wizardIcon from '@/assets/svg/wizard.svg';
|
||||
|
||||
import * as Analytics from '@/libs/analytics';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Avatar,
|
||||
MugenScroll,
|
||||
userLink,
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
canLoadMore: true,
|
||||
loading: true,
|
||||
page: 0,
|
||||
party: {},
|
||||
seekers: [],
|
||||
icons: Object.freeze({
|
||||
warrior: warriorIcon,
|
||||
rogue: rogueIcon,
|
||||
healer: healerIcon,
|
||||
sync: syncIcon,
|
||||
users: usersIcon,
|
||||
wizard: wizardIcon,
|
||||
}),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
availableLanguages: 'i18n.availableLanguages',
|
||||
user: 'user.data',
|
||||
}),
|
||||
},
|
||||
async mounted () {
|
||||
try {
|
||||
this.party = await this.$store.dispatch('guilds:getGroup', { groupId: this.user.party._id });
|
||||
} catch {
|
||||
this.$router.push('/');
|
||||
}
|
||||
if (!this.party._id || this.party.leader._id !== this.user._id) {
|
||||
this.$router.push('/');
|
||||
} else {
|
||||
this.$store.dispatch('common:setTitle', {
|
||||
section: this.$t('lookingForPartyTitle'),
|
||||
});
|
||||
this.seekers = await this.$store.dispatch('party:lookingForParty');
|
||||
await Analytics.track({
|
||||
hitType: 'event',
|
||||
eventName: 'View Find Members',
|
||||
eventAction: 'View Find Members',
|
||||
eventCategory: 'behavior',
|
||||
}, { trackOnClient: true });
|
||||
this.canLoadMore = this.seekers.length === 30;
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
displayLanguage (languageCode) {
|
||||
const language = this.availableLanguages.find(lang => lang.code === languageCode);
|
||||
if (language) {
|
||||
return language.name;
|
||||
}
|
||||
return languageCode;
|
||||
},
|
||||
infiniteScrollTrigger () {
|
||||
if (this.canLoadMore) {
|
||||
this.loading = true;
|
||||
}
|
||||
|
||||
this.loadMore();
|
||||
},
|
||||
async inviteUser (userId, index) {
|
||||
await this.$store.dispatch('guilds:invite', {
|
||||
invitationDetails: {
|
||||
inviter: this.user.profile.name,
|
||||
uuids: [userId],
|
||||
},
|
||||
groupId: this.party._id,
|
||||
});
|
||||
this.seekers[index].invited = true;
|
||||
},
|
||||
loadMore: debounce(async function loadMoreDebounce () {
|
||||
this.page += 1;
|
||||
const addlSeekers = await this.$store.dispatch('party:lookingForParty', { page: this.page });
|
||||
this.seekers = this.seekers.concat(addlSeekers);
|
||||
this.canLoadMore = this.seekers.length % 30 === 0;
|
||||
this.loading = false;
|
||||
}, 1000),
|
||||
async refreshList () {
|
||||
this.loading = true;
|
||||
this.page = 0;
|
||||
this.seekers = await this.$store.dispatch('party:lookingForParty');
|
||||
this.canLoadMore = this.seekers.length === 30;
|
||||
this.loading = false;
|
||||
},
|
||||
async rescindInvite (userId, index) {
|
||||
await this.$store.dispatch('members:removeMember', {
|
||||
memberId: userId,
|
||||
groupId: this.party._id,
|
||||
});
|
||||
this.seekers[index].invited = false;
|
||||
},
|
||||
showMemberModal (userId) {
|
||||
this.$router.push({ name: 'userProfile', params: { userId } });
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="sidebar px-4">
|
||||
<div>
|
||||
<div class="buttons-wrapper">
|
||||
<div class="button-container button-with-menu-row">
|
||||
<div class="button-container d-flex">
|
||||
<button
|
||||
v-if="!isMember"
|
||||
class="btn btn-success btn-success"
|
||||
|
|
@ -203,10 +203,6 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
.button-with-menu-row {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.menuIcon {
|
||||
width: 4px;
|
||||
height: 1rem;
|
||||
|
|
|
|||
|
|
@ -51,20 +51,20 @@
|
|||
</div>
|
||||
<div
|
||||
v-else
|
||||
class="no-party d-none d-md-flex justify-content-center text-center mr-4"
|
||||
class="no-party d-none d-md-flex justify-content-center text-center mr-4"
|
||||
>
|
||||
<div class="align-self-center">
|
||||
<h3>{{ $t('battleWithFriends') }}</h3>
|
||||
<h3>{{ user.party._id ? $t('questWithOthers') : $t('battleWithFriends') }}</h3>
|
||||
<span
|
||||
class="small-text"
|
||||
v-html="$t('inviteFriendsParty')"
|
||||
v-html="user.party._id ? $t('inviteFriendsParty') : $t('startPartyDetail')"
|
||||
></span>
|
||||
<br>
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
@click="createOrInviteParty()"
|
||||
>
|
||||
{{ user.party._id ? $t('inviteFriends') : $t('startAParty') }}
|
||||
{{ user.party._id ? $t('findPartyMembers') : $t('getStarted') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -234,7 +234,7 @@ export default {
|
|||
},
|
||||
createOrInviteParty () {
|
||||
if (this.user.party._id) {
|
||||
this.$root.$emit('inviteModal::inviteToGroup', this.user.party);
|
||||
this.$router.push('/looking-for-party');
|
||||
} else {
|
||||
this.$root.$emit('bv::show::modal', 'create-party-modal');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@
|
|||
</div>
|
||||
</li>
|
||||
<b-nav-item
|
||||
v-if="user.party._id"
|
||||
v-if="user.party._id && user._id !== partyLeaderId"
|
||||
class="topbar-item"
|
||||
:class="{'active': $route.path.startsWith('/party')}"
|
||||
tag="li"
|
||||
|
|
@ -156,6 +156,36 @@
|
|||
>
|
||||
{{ $t('party') }}
|
||||
</b-nav-item>
|
||||
<li
|
||||
v-if="user.party._id && user._id === partyLeaderId"
|
||||
class="topbar-item droppable"
|
||||
:class="{'active': $route.path.startsWith('/party')}"
|
||||
>
|
||||
<div
|
||||
class="chevron rotate"
|
||||
@click="dropdownMobile($event)"
|
||||
>
|
||||
<div
|
||||
v-once
|
||||
class="chevron-icon-down"
|
||||
v-html="icons.chevronDown"
|
||||
></div>
|
||||
</div>
|
||||
<router-link
|
||||
class="nav-link"
|
||||
:to="{name: 'party'}"
|
||||
>
|
||||
{{ $t('party') }}
|
||||
</router-link>
|
||||
<div class="topbar-dropdown">
|
||||
<router-link
|
||||
class="topbar-dropdown-item dropdown-item"
|
||||
:to="{name: 'lookingForParty'}"
|
||||
>
|
||||
{{ $t('lookingForPartyTitle') }}
|
||||
</router-link>
|
||||
</div>
|
||||
</li>
|
||||
<b-nav-item
|
||||
v-if="!user.party._id"
|
||||
class="topbar-item"
|
||||
|
|
@ -768,6 +798,7 @@ export default {
|
|||
return {
|
||||
isUserDropdownOpen: false,
|
||||
menuIsOpen: false,
|
||||
partyLeaderId: null,
|
||||
icons: Object.freeze({
|
||||
gem: gemIcon,
|
||||
gold: goldIcon,
|
||||
|
|
@ -796,8 +827,9 @@ export default {
|
|||
};
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.getUserGroupPlans();
|
||||
async mounted () {
|
||||
await this.getUserGroupPlans();
|
||||
await this.getUserParty();
|
||||
Array.from(document.getElementById('menu_collapse').getElementsByTagName('a')).forEach(link => {
|
||||
link.addEventListener('click', this.closeMenu);
|
||||
});
|
||||
|
|
@ -805,6 +837,9 @@ export default {
|
|||
link.addEventListener('mouseenter', this.dropdownDesktop);
|
||||
link.addEventListener('mouseleave', this.dropdownDesktop);
|
||||
});
|
||||
this.$root.$on('update-party', () => {
|
||||
this.getUserParty();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
modForm () {
|
||||
|
|
@ -816,6 +851,12 @@ export default {
|
|||
async getUserGroupPlans () {
|
||||
await this.$store.dispatch('guilds:getGroupPlans');
|
||||
},
|
||||
async getUserParty () {
|
||||
if (this.user.party._id) {
|
||||
await this.$store.dispatch('party:getParty');
|
||||
this.partyLeaderId = this.$store.state.party.data.leader._id;
|
||||
}
|
||||
},
|
||||
openPartyModal () {
|
||||
this.$root.$emit('bv::show::modal', 'create-party-modal');
|
||||
},
|
||||
|
|
|
|||
|
|
@ -34,11 +34,13 @@
|
|||
<script>
|
||||
import BaseNotification from './base';
|
||||
import { mapState } from '@/libs/store';
|
||||
import sync from '@/mixins/sync';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
BaseNotification,
|
||||
},
|
||||
mixins: [sync],
|
||||
props: {
|
||||
notification: {
|
||||
type: Object,
|
||||
|
|
@ -73,6 +75,7 @@ export default {
|
|||
}
|
||||
|
||||
await this.$store.dispatch('guilds:join', { groupId: group.id, type: 'party' });
|
||||
this.sync();
|
||||
this.$router.push('/party');
|
||||
},
|
||||
reject () {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,19 @@
|
|||
class="faq-question"
|
||||
>
|
||||
<h2
|
||||
v-once
|
||||
v-if="index === 0"
|
||||
>
|
||||
{{ $t('general') }}
|
||||
</h2>
|
||||
<h2
|
||||
v-once
|
||||
v-if="entry.heading === 'party-with-friends'"
|
||||
id="parties"
|
||||
>
|
||||
{{ $t('parties') }}
|
||||
</h2>
|
||||
<h3
|
||||
v-once
|
||||
v-b-toggle="entry.heading"
|
||||
role="tab"
|
||||
|
|
@ -24,7 +37,7 @@
|
|||
@click="handleClick($event)"
|
||||
>
|
||||
{{ entry.question }}
|
||||
</h2>
|
||||
</h3>
|
||||
<b-collapse
|
||||
:id="entry.heading"
|
||||
:visible="isVisible(entry.heading)"
|
||||
|
|
@ -49,25 +62,36 @@
|
|||
</template>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.card-body {
|
||||
margin-bottom: 1em;
|
||||
h2 {
|
||||
color: #34313a;
|
||||
border-bottom: 1px solid #e1e0e3;
|
||||
margin-top: 24px;
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
.faq-question h2 {
|
||||
cursor: pointer;
|
||||
}
|
||||
.faq-question {
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #4F2A93;
|
||||
}
|
||||
|
||||
.faq-question .card-body {
|
||||
padding: 0;
|
||||
}
|
||||
h3 {
|
||||
font-size: 16px;
|
||||
font-weight: normal;
|
||||
line-height: 1.75;
|
||||
cursor: pointer;
|
||||
|
||||
.static-wrapper .faq-question h2 {
|
||||
margin: 0 0 16px 0;
|
||||
}
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.faq-question a {
|
||||
text-decoration: none;
|
||||
color: #4F2A93;
|
||||
.card-body {
|
||||
padding: 0;
|
||||
font-size: 14px;
|
||||
line-height: 1.71;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 768px) {
|
||||
|
|
|
|||
|
|
@ -198,10 +198,6 @@
|
|||
color: $purple-200;
|
||||
}
|
||||
|
||||
li, p {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.media img {
|
||||
margin: 1em;
|
||||
}
|
||||
|
|
|
|||
46
website/client/src/components/ui/closeX.vue
Normal file
46
website/client/src/components/ui/closeX.vue
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<template>
|
||||
<div
|
||||
class="modal-close"
|
||||
@click="$emit('close')"
|
||||
>
|
||||
<div
|
||||
class="svg-icon svg-close color"
|
||||
v-html="icons.close"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.modal-close {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
top: 16px;
|
||||
cursor: pointer;
|
||||
|
||||
.svg-close {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
vertical-align: middle;
|
||||
opacity: 0.75;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import close from '@/assets/svg/close.svg';
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
icons: Object.freeze({
|
||||
close,
|
||||
}),
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
@ -2,13 +2,13 @@
|
|||
<router-link
|
||||
v-if="displayName"
|
||||
v-b-tooltip.hover.top="tierTitle"
|
||||
class="leader user-link"
|
||||
class="leader user-link d-flex"
|
||||
:to="{'name': 'userProfile', 'params': {'userId': id}}"
|
||||
:class="levelStyle()"
|
||||
>
|
||||
{{ displayName }}
|
||||
<div
|
||||
class="svg-icon"
|
||||
class="svg-icon icon-12"
|
||||
v-html="tierIcon()"
|
||||
></div>
|
||||
</router-link>
|
||||
|
|
@ -37,10 +37,15 @@
|
|||
color: $gray-50;
|
||||
}
|
||||
|
||||
&[class*="tier"] .svg-icon {
|
||||
margin-top: 5px;
|
||||
}
|
||||
&.npc .svg-icon {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.svg-icon {
|
||||
width: 10px;
|
||||
display: inline-block;
|
||||
margin-left: .5em;
|
||||
margin-left: 6px;
|
||||
|
||||
&:empty {
|
||||
display: none;
|
||||
|
|
|
|||
|
|
@ -72,13 +72,14 @@ const ItemsPage = () => import(/* webpackChunkName: "inventory" */'@/components/
|
|||
const EquipmentPage = () => import(/* webpackChunkName: "inventory" */'@/components/inventory/equipment/index');
|
||||
const StablePage = () => import(/* webpackChunkName: "inventory" */'@/components/inventory/stable/index');
|
||||
|
||||
// Guilds
|
||||
// Guilds & Parties
|
||||
const GuildIndex = () => import(/* webpackChunkName: "guilds" */ '@/components/groups/index');
|
||||
const TavernPage = () => import(/* webpackChunkName: "guilds" */ '@/components/groups/tavern');
|
||||
const MyGuilds = () => import(/* webpackChunkName: "guilds" */ '@/components/groups/myGuilds');
|
||||
const GuildsDiscoveryPage = () => import(/* webpackChunkName: "guilds" */ '@/components/groups/discovery');
|
||||
const GroupPage = () => import(/* webpackChunkName: "guilds" */ '@/components/groups/group');
|
||||
const GroupPlansAppPage = () => import(/* webpackChunkName: "guilds" */ '@/components/groups/groupPlan');
|
||||
const LookingForParty = () => import(/* webpackChunkName: "guilds" */ '@/components/groups/lookingForParty');
|
||||
|
||||
// Group Plans
|
||||
const GroupPlanIndex = () => import(/* webpackChunkName: "group-plans" */ '@/components/group-plans/index');
|
||||
|
|
@ -157,6 +158,7 @@ const router = new VueRouter({
|
|||
],
|
||||
},
|
||||
{ name: 'party', path: '/party', component: GroupPage },
|
||||
{ name: 'lookingForParty', path: '/looking-for-party', component: LookingForParty },
|
||||
{ name: 'groupPlan', path: '/group-plans', component: GroupPlansAppPage },
|
||||
{
|
||||
name: 'groupPlanDetail',
|
||||
|
|
@ -433,6 +435,10 @@ router.beforeEach(async (to, from, next) => {
|
|||
}
|
||||
}
|
||||
|
||||
if (to.name === 'party') {
|
||||
router.app.$root.$emit('update-party');
|
||||
}
|
||||
|
||||
// Redirect old guild urls
|
||||
if (to.hash.indexOf('#/options/groups/guilds/') !== -1) {
|
||||
const splits = to.hash.split('/');
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import axios from 'axios';
|
||||
import { loadAsyncResource } from '@/libs/asyncResource';
|
||||
|
||||
export function getMembers (store, forceLoad = false) {
|
||||
|
|
@ -23,3 +24,14 @@ export function getParty (store, forceLoad = false) {
|
|||
forceLoad,
|
||||
});
|
||||
}
|
||||
|
||||
export async function lookingForParty (store, payload) {
|
||||
let response;
|
||||
if (payload && payload.page) {
|
||||
response = await axios.get(`api/v4/looking-for-party?page=${payload.page}`);
|
||||
} else {
|
||||
response = await axios.get('api/v4/looking-for-party');
|
||||
}
|
||||
|
||||
return response.data.data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"frequentlyAskedQuestions": "Frequently Asked Questions",
|
||||
"general": "General",
|
||||
|
||||
"faqQuestion0": "I'm confused. Where do I get an overview?",
|
||||
"iosFaqAnswer0": "First, you'll set up tasks that you want to do in your everyday life. Then, as you complete the tasks in real life and check them off, you'll earn experience and gold. Gold is used to buy equipment and some items, as well as custom rewards. Experience causes your character to level up and unlock content such as Pets, Skills, and Quests! You can customize your character under Menu > Customize Avatar.\n\n Some basic ways to interact: click the (+) in the upper-right-hand corner to add a new task. Tap on an existing task to edit it, and swipe left on a task to delete it. You can sort tasks using Tags in the upper-left-hand corner, and expand and contract checklists by clicking on the checklist bubble.",
|
||||
|
|
@ -26,10 +27,10 @@
|
|||
"androidFaqAnswer4": "There are several things that can cause you to take damage. First, if you left Dailies incomplete overnight and didn't check them off in the screen that popped up the next morning, those unfinished Dailies will damage you. Second, if you tap a bad Habit, it will damage you. Finally, if you are in a Boss Battle with your Party and one of your Party mates did not complete all their Dailies, the Boss will attack you.\n\n The main way to heal is to gain a level, which restores all your health. You can also buy a Health Potion with gold from the Rewards tab on the Tasks page. Plus, at level 10 or above, you can choose to become a Healer, and then you will learn healing skills. If you are in a Party with a Healer, they can heal you as well.",
|
||||
"webFaqAnswer4": "There are several things that can cause you to take damage. First, if you left Dailies incomplete overnight and didn't check them off in the screen that popped up the next morning, those unfinished Dailies will damage you. Second, if you click a bad Habit, it will damage you. Finally, if you are in a Boss Battle with your party and one of your party mates did not complete all their Dailies, the Boss will attack you. The main way to heal is to gain a level, which restores all your Health. You can also buy a Health Potion with Gold from the Rewards column. Plus, at level 10 or above, you can choose to become a Healer, and then you will learn healing skills. Other Healers can heal you as well if you are in a Party with them. Learn more by clicking \"Party\" in the navigation bar.",
|
||||
|
||||
"faqQuestion5": "How do I play Habitica with my friends?",
|
||||
"faqQuestion5": "Can I play Habitica with others?",
|
||||
"iosFaqAnswer5": "The best way is to invite them to a Party with you! Parties can go on Quests, battle monsters, and cast skills to support each other.\n\nIf you want to start your own Party, go to Menu > [Party](https://habitica.com/party) and tap \"Create New Party\". Then scroll down and tap \"Invite a Member\" to invite your friends by entering their @username. If you want to join someone else’s Party, just give them your @username and they can invite you!\n\nYou and your friends can also join Guilds, which are public chat rooms that bring people together based on shared interests! There are a lot of helpful and fun communities, be sure to check them out.\n\nIf you’re feeling more competitive, you and your friends can create or join Challenges to take on a set of tasks. There are all sorts of public Challenges available that span a wide array of interests and goals. Some public Challenges will even award Gem prizes if you’re selected as the winner.",
|
||||
"androidFaqAnswer5": "The best way is to invite them to a Party with you! Parties can go on quests, battle monsters, and cast skills to support each other. Go to the [website](https://habitica.com/) to create one if you don't already have a Party. You can also join guilds together (Social > Guilds). Guilds are chat rooms focusing on a shared interest or the pursuit of a common goal, and can be public or private. You can join as many guilds as you'd like, but only one party.\n\n For more detailed info, check out the wiki pages on [Parties](https://habitica.fandom.com/wiki/Party) and [Guilds](https://habitica.fandom.com/wiki/Guilds).",
|
||||
"webFaqAnswer5": "The best way is to invite them to a Party with you by clicking \"Party\" in the navigation bar! Parties can go on quests, battle monsters, and cast skills to support each other. You can also join Guilds together (click on \"Guilds\" in the navigation bar). Guilds are chat rooms focusing on a shared interest or the pursuit of a common goal, and can be public or private. You can join as many Guilds as you'd like, but only one Party. For more detailed info, check out the wiki pages on [Parties](https://habitica.fandom.com/wiki/Party) and [Guilds](https://habitica.fandom.com/wiki/Guilds).",
|
||||
"webFaqAnswer5": "Yes, with Parties! You can start your own Party or join an existing one. Partying with other Habitica players is a great way to take on Quests, receive buffs from Party members’ skills, and boost your motivation with additional accountability.",
|
||||
|
||||
"faqQuestion6": "How do I get a Pet or Mount?",
|
||||
"iosFaqAnswer6": "Every time you complete a task, you'll have a random chance at receiving an Egg, a Hatching Potion, or a piece of Pet Food. They will be stored in Menu > Items.\n\nTo hatch a Pet, you'll need an Egg and a Hatching Potion. Tap on the Egg to determine the species you want to hatch, and select \"Hatch Egg.\" Then choose a Hatching Potion to determine its color! Go to Menu > Pets and click your new Pet to equip it to your Avatar. \n\n You can also grow your Pets into Mounts by feeding them under Menu > Pets. Tap on a Pet, and select \"Feed Pet\"! You'll have to feed a Pet many times before it becomes a Mount, but if you can figure out its favorite food, it will grow more quickly. Use trial and error, or [see the spoilers here](https://habitica.fandom.com/wiki/Food#Food_Preferences). Once you have a Mount, go to Menu > Mounts and tap on it to equip it to your Avatar.\n\nYou can also get Eggs for Quest Pets by completing certain Quests (to learn more about Quests, see [How do I fight monsters and go on Quests](https://habitica.com/static/faq/9)).",
|
||||
|
|
@ -46,10 +47,10 @@
|
|||
"androidFaqAnswer8": "The blue bar that appeared when you hit level 10 and chose a Class is your Mana bar. As you continue to level up, you will unlock special Skills that cost Mana to use. Each Class has different Skills, which appear after level 11 under Menu > Skills. Unlike your health bar, your Mana bar does not reset when you gain a level. Instead, Mana is gained when you complete Good Habits, Dailies, and To Do's, and lost when you indulge bad Habits. You'll also regain some Mana overnight -- the more Dailies you completed, the more you will gain.",
|
||||
"webFaqAnswer8": "The blue bar that appeared when you hit level 10 and chose a Class is your Mana bar. As you continue to level up, you will unlock special Skills that cost Mana to use. Each Class has different Skills, which appear after level 11 in the action bar at the bottom of the screen. Unlike your Health bar, your Mana bar does not reset when you gain a level. Instead, Mana is gained when you complete good Habits, Dailies, and To Do's, and lost when you indulge bad Habits. You'll also regain some Mana overnight -- the more Dailies you completed, the more you will gain.",
|
||||
|
||||
"faqQuestion9": "How do I fight monsters and go on Quests?",
|
||||
"iosFaqAnswer9": "First, you need to join or start a Party (see [How to play Habitica with my friends](https://habitica.com/static/faq/5)). Although you can battle monsters alone, we recommend playing in a group, because this will make Quests much easier. Plus, having a friend to cheer you on as you accomplish your tasks is very motivating!\n\n Next, you need a Quest Scroll, which are stored under Menu > Items. There are three ways to get a scroll:\n\n - At level 15, you get a Quest-line, aka three linked quests. More Quest-lines unlock at levels 30, 40, and 60 respectively. \n - When you invite people to your Party, you'll be rewarded with the Basi-List Scroll!\n - You can buy Quests from the Quests Shop for Gold and Gems.\n\n To battle the Boss or collect items for a Collection Quest, simply complete your tasks normally, and they will be tallied into damage overnight. (Reloading by pulling down on the screen may be required to see the Boss's health bar go down.) If you are fighting a Boss and you missed any Dailies, the Boss will damage your Party at the same time that you damage the Boss. \n\n After level 11 Mages and Warriors will gain Skills that allow them to deal additional damage to the Boss, so these are excellent classes to choose at level 10 if you want to be a heavy hitter.",
|
||||
"androidFaqAnswer9": "First, you need to join or start a Party (see above). Although you can battle monsters alone, we recommend playing in a group, because this will make Quests much easier. Plus, having a friend to cheer you on as you accomplish your tasks is very motivating!\n\n Next, you need a Quest Scroll, which are stored under Menu > Items. There are three ways to get a scroll:\n\n - At level 15, you get a Quest-line, aka three linked quests. More Quest-lines unlock at levels 30, 40, and 60 respectively. \n - When you invite people to your Party, you'll be rewarded with the Basi-List Scroll!\n - You can buy Quests from the Quests Shop for Gold and Gems.\n\n To battle the Boss or collect items for a Collection Quest, simply complete your tasks normally, and they will be tallied into damage overnight. (Reloading by pulling down on the screen may be required to see the Boss's health bar go down.) If you are fighting a Boss and you missed any Dailies, the Boss will damage your Party at the same time that you damage the Boss. \n\n After level 11 Mages and Warriors will gain Skills that allow them to deal additional damage to the Boss, so these are excellent classes to choose at level 10 if you want to be a heavy hitter.",
|
||||
"webFaqAnswer9": "First, you need to join or start a Party by clicking \"Party\" in the navigation bar. Although you can battle monsters alone, we recommend playing in a group, because this will make quests much easier. Plus, having a friend to cheer you on as you accomplish your tasks is very motivating! Next, you need a Quest Scroll, which are stored under Inventory > Quests. There are four ways to get a scroll:\n * When you invite people to your Party, you'll be rewarded with the Basi-List Scroll!\n * At level 15, you get a Quest-line, i.e., three linked quests. More Quest-lines unlock at levels 30, 40, and 60 respectively.\n * You can buy Quests from the Quests Shop (Shops > Quests) for Gold and Gems.\n * When you check in to Habitica a certain number of times, you'll be rewarded with Quest Scrolls. You earn a Scroll during your 1st, 7th, 22nd, and 40th check-ins.\n To battle the Boss or collect items for a Collection Quest, simply complete your tasks normally, and they will be tallied into damage overnight. (Reloading may be required to see the Boss's Health bar go down.) If you are fighting a Boss and you missed any Dailies, the Boss will damage your Party at the same time that you damage the Boss. After level 11 Mages and Warriors will gain Skills that allow them to deal additional damage to the Boss, so these are excellent classes to choose at level 10 if you want to be a heavy hitter.",
|
||||
"faqQuestion9": "How do I take on Quests?",
|
||||
"iosFaqAnswer9": "First, you need to join or start a Party by selecting \"Party\" in the navigation. Although you can take on Quests alone, we recommend playing with others to make the Quest faster and boost your motivation with extra accountability.\n\nOnce you’re in a Party, you can invite Party members to any Quest scrolls in your Inventory. After everyone accepts, the Quest will begin. To progress, complete your tasks as you normally would! You’ll either build up damage against a monster if you’re taking on a Boss Quest, or have a chance to find items if you’re taking on a Collection Quest. All pending progress is applied the next day.\n\nWhen your Party members do enough damage or collect all items, the Quest ends and everyone will receive their rewards!",
|
||||
"androidFaqAnswer9": "First, you need to join or start a Party by selecting \"Party\" in the navigation. Although you can take on Quests alone, we recommend playing with others to make the Quest faster and boost your motivation with extra accountability.\n\nOnce you’re in a Party, you can invite Party members to any Quest scrolls in your Inventory. After everyone accepts, the Quest will begin. To progress, complete your tasks as you normally would! You’ll either build up damage against a monster if you’re taking on a Boss Quest, or have a chance to find items if you’re taking on a Collection Quest. All pending progress is applied the next day.\n\nWhen your Party members do enough damage or collect all items, the Quest ends and everyone will receive their rewards!",
|
||||
"webFaqAnswer9": "First, you need to join or start a Party by selecting \"Party\" in the navigation. Although you can take on Quests alone, we recommend playing with others to make the Quest faster and boost your motivation with extra accountability.\n\nOnce you’re in a Party, you can invite Party members to any Quest scrolls in your Inventory. After everyone accepts, the Quest will begin. To progress, complete your tasks as you normally would! You’ll either build up damage against a monster if you’re taking on a Boss Quest, or have a chance to find items if you’re taking on a Collection Quest. All pending progress is applied the next day.\n\nWhen your Party members do enough damage or collect all items, the Quest ends and everyone will receive their rewards!",
|
||||
|
||||
"faqQuestion10": "What are Gems, and how do I get them?",
|
||||
"iosFaqAnswer10": "Gems are purchased with real money from Menu > Purchase Gems. When you buy Gems, you are helping us to keep Habitica running. We’re very grateful for every bit of support!\n\n In addition to buying Gems directly, there are three other ways players can gain Gems:\n\n * Win a Challenge that has been set up by another player. Go to Menu > Challenges to join some.\n * Subscribe and unlock the ability to buy a certain number of Gems per month.\n * Contribute your skills to the Habitica project. See this wiki page for more details: [Contributing to Habitica](https://habitica.fandom.com/wiki/Contributing_to_Habitica).\n\n Keep in mind that items purchased with Gems do not offer any statistical advantages, so players can still make use of the app without them!",
|
||||
|
|
@ -71,6 +72,63 @@
|
|||
"androidFaqAnswer13": "## How do Group Plans work?\n\nA [Group Plan](/group-plans) gives your Party or Guild access to a shared task board that’s similar to your personal task board! It’s a shared Habitica experience where tasks can be created and checked off by anyone in the group.\n\nThere are also features available like member roles, status view, and task assigning that give you a more controlled experience. [Visit our wiki](https://habitica.fandom.com/wiki/Group_Plans) to learn more about our Group Plans’ features!\n\n## Who benefits from a Group Plan?\n\nGroup Plans work best when you have a small team of people who want to collaborate together. We recommend 2-5 members.\n\nGroup Plans are great for families, whether it’s a parent and child or you and a partner. Shared goals, chores, or responsibilities are easy to keep track of on one board.\n\nGroup Plans can also be useful for teams of colleagues that have shared goals, or managers that want to introduce their employees to gamification.\n\n## Quick tips for using Groups\n\nHere are some quick tips to get you started with your new Group. We’ll provide more details in the following sections:\n\n* Make a member a manager to give them the ability to create and edit tasks\n* Leave tasks unassigned if anyone can complete it and it only needs done once\n* Assign a task to one person to make sure no one else can complete their task\n* Assign a task to multiple people if they all need to complete it\n* Toggle the ability to display shared tasks on your personal board to not miss anything\n* You get rewarded for the tasks you complete, even multi-assigned\n* Task completion rewards aren’t shared or split between Team members\n* Use task color on the team board to judge the average completion rate of tasks\n* Regularly review the tasks on your Team Board to make sure they are still relevant\n* Missing a Daily won’t damage you or your team, but the task will degrade in color\n\n## How can others in the group create tasks?\n\nOnly the group leader and managers can create tasks. If you’d like a group member to be able to create tasks, then you should promote them to be a manager by going to the Group Information tab, viewing the member list, and clicking the dot icon by their name.\n\n## How does assigning a task work?\n\nGroup Plans give you the unique ability to assign tasks to other group members. Assigning a task is great for delegating. If you assign a task to someone, then other members are prevented from completing it.\n\nYou can also assign a task to multiple people if it needs to be completed by more than one member. For example, if everyone has to brush their teeth, create a task and assign it to each group member. They will all be able to check it off and get their individual rewards for doing so. The main task will show as complete once everyone checks it off.\n\n## How do unassigned tasks work?\n\nUnassigned tasks can be completed by anyone in the group, so leave a task unassigned to allow any member to complete it. For example, taking out the trash. Whoever takes out the trash can check off the unassigned task and it will show as completed for everyone.\n\n## How does the synchronized day reset work?\n\nShared tasks will reset at the same time for everyone to keep the shared task board in sync. This time is visible on the shared task board and is determined by the group leader’s day start time. Because shared tasks reset automatically, you will not get a chance to complete yesterday’s uncompleted shared Dailies when you check in the next morning.\n\nShared Dailies will not do damage if they are missed, however they will degrade in color to help visualize progress. We don’t want the shared experience to be a negative one!\n\n## How do I use my Group on the mobile apps?\n\nWhile the mobile apps don’t fully support all Group Plans functionality yet, you can still complete shared tasks from the iOS and Android app by copying the tasks onto your personal task board. You can switch this preference on from Settings in the mobile apps or from the group task board on the browser version. Now open and assigned shared tasks will display on your personal task board across all platforms.\n\n## What’s the difference between a Group’s shared tasks and Challenges?\n\nGroup Plan shared task boards are more dynamic than Challenges, in that they can constantly be updated and interacted with. Challenges are great if you have one set of tasks to send out to many people.\n\nGroup Plans are also a paid feature, while Challenges are available free to everyone.\n\nYou cannot assign specific tasks in Challenges, and Challenges do not have a shared day reset. In general, Challenges offer less control and direct interaction.",
|
||||
"webFaqAnswer13": "## How do Group Plans work?\n\nA [Group Plan](/group-plans) gives your Party or Guild access to a shared task board that’s similar to your personal task board! It’s a shared Habitica experience where tasks can be created and checked off by anyone in the group.\n\nThere are also features available like member roles, status view, and task assigning that give you a more controlled experience. [Visit our wiki](https://habitica.fandom.com/wiki/Group_Plans) to learn more about our Group Plans’ features!\n\n## Who benefits from a Group Plan?\n\nGroup Plans work best when you have a small team of people who want to collaborate together. We recommend 2-5 members.\n\nGroup Plans are great for families, whether it’s a parent and child or you and a partner. Shared goals, chores, or responsibilities are easy to keep track of on one board.\n\nGroup Plans can also be useful for teams of colleagues that have shared goals, or managers that want to introduce their employees to gamification.\n\n## Quick tips for using Groups\n\nHere are some quick tips to get you started with your new Group. We’ll provide more details in the following sections:\n\n* Make a member a manager to give them the ability to create and edit tasks\n* Leave tasks unassigned if anyone can complete it and it only needs done once\n* Assign a task to one person to make sure no one else can complete their task\n* Assign a task to multiple people if they all need to complete it\n* Toggle the ability to display shared tasks on your personal board to not miss anything\n* You get rewarded for the tasks you complete, even multi-assigned\n* Task completion rewards aren’t shared or split between Team members\n* Use task color on the team board to judge the average completion rate of tasks\n* Regularly review the tasks on your Team Board to make sure they are still relevant\n* Missing a Daily won’t damage you or your team, but the task will degrade in color\n\n## How can others in the group create tasks?\n\nOnly the group leader and managers can create tasks. If you’d like a group member to be able to create tasks, then you should promote them to be a manager by going to the Group Information tab, viewing the member list, and clicking the dot icon by their name.\n\n## How does assigning a task work?\n\nGroup Plans give you the unique ability to assign tasks to other group members. Assigning a task is great for delegating. If you assign a task to someone, then other members are prevented from completing it.\n\nYou can also assign a task to multiple people if it needs to be completed by more than one member. For example, if everyone has to brush their teeth, create a task and assign it to each group member. They will all be able to check it off and get their individual rewards for doing so. The main task will show as complete once everyone checks it off.\n\n## How do unassigned tasks work?\n\nUnassigned tasks can be completed by anyone in the group, so leave a task unassigned to allow any member to complete it. For example, taking out the trash. Whoever takes out the trash can check off the unassigned task and it will show as completed for everyone.\n\n## How does the synchronized day reset work?\n\nShared tasks will reset at the same time for everyone to keep the shared task board in sync. This time is visible on the shared task board and is determined by the group leader’s day start time. Because shared tasks reset automatically, you will not get a chance to complete yesterday’s uncompleted shared Dailies when you check in the next morning.\n\nShared Dailies will not do damage if they are missed, however they will degrade in color to help visualize progress. We don’t want the shared experience to be a negative one!\n\n## How do I use my Group on the mobile apps?\n\nWhile the mobile apps don’t fully support all Group Plans functionality yet, you can still complete shared tasks from the iOS and Android app by copying the tasks onto your personal task board. You can switch this preference on from Settings in the mobile apps or from the group task board on the browser version. Now open and assigned shared tasks will display on your personal task board across all platforms.\n\n## What’s the difference between a Group’s shared tasks and Challenges?\n\nGroup Plan shared task boards are more dynamic than Challenges, in that they can constantly be updated and interacted with. Challenges are great if you have one set of tasks to send out to many people.\n\nGroup Plans are also a paid feature, while Challenges are available free to everyone.\n\nYou cannot assign specific tasks in Challenges, and Challenges do not have a shared day reset. In general, Challenges offer less control and direct interaction.",
|
||||
|
||||
"parties": "Parties",
|
||||
|
||||
"faqQuestion14": "How do I find a Party when I'm not in one?",
|
||||
"iosFaqAnswer14": "If you want to experience Habitica with others but don’t know other players, searching for a Party is your best option! If you already know other players that have a Party, you can share your @username with them to be invited. Alternatively, you can create a new Party and invite them with their @username or email address.\n\nTo create or search for a Party, select “Party” in the navigation then choose the option that works for you.",
|
||||
"androidFaqAnswer14": "If you want to experience Habitica with others but don’t know other players, searching for a Party is your best option! If you already know other players that have a Party, you can share your @username with them to be invited. Alternatively, you can create a new Party and invite them with their @username or email address.\n\nTo create or search for a Party, select “Party” in the navigation then choose the option that works for you.",
|
||||
"webFaqAnswer14": "If you want to experience Habitica with others but don’t know other players, searching for a Party is your best option! If you already know other players that have a Party, you can share your @username with them to be invited. Alternatively, you can create a new Party and invite them with their @username or email address.\n\nTo create or search for a Party, select “Party” in the navigation then choose the option that works for you.",
|
||||
|
||||
"faqQuestion15": "How does searching for a Party work?",
|
||||
"iosFaqAnswer15": "After selecting “Look for a Party” in the Party pop-up, you’ll be added to a list of players that want to join a Party. Party leaders can view this list and send invitations. Once you receive an invitation, you can accept it from your notifications to join the Party of your choosing!\n\nYou may get multiple invitations to different Parties. However, you can only be a member of one Party at a time.",
|
||||
"androidFaqAnswer15": "After selecting “Look for a Party” in the Party pop-up, you’ll be added to a list of players that want to join a Party. Party leaders can view this list and send invitations. Once you receive an invitation, you can accept it from your notifications to join the Party of your choosing!\n\nYou may get multiple invitations to different Parties. However, you can only be a member of one Party at a time.",
|
||||
"webFaqAnswer15": "After selecting “Look for a Party” in the Party pop-up, you’ll be added to a list of players that want to join a Party. Party leaders can view this list and send invitations. Once you receive an invitation, you can accept it from your notifications to join the Party of your choosing!\n\nYou may get multiple invitations to different Parties. However, you can only be a member of one Party at a time.",
|
||||
|
||||
"faqQuestion16": "How long can I search for a Party after joining the list?",
|
||||
"iosFaqAnswer16": "You will remain in the list until you accept an invite to a Party or don’t login for 7 days, whichever comes first.",
|
||||
"androidFaqAnswer16": "You will remain in the list until you accept an invite to a Party or don’t login for 7 days, whichever comes first.",
|
||||
"webFaqAnswer16": "You will remain in the list until you accept an invite to a Party or don’t login for 7 days, whichever comes first.",
|
||||
|
||||
"faqQuestion17": "Can I stop searching for a Party?",
|
||||
"iosFaqAnswer17": "You can leave the list at any time. To stop searching for Party on the website, select the “Party” link in the navigation then click “Leave” in the pop-up.",
|
||||
"androidFaqAnswer17": "You can leave the list at any time. To stop searching for Party on the website, select the “Party” link in the navigation then click “Leave” in the pop-up.",
|
||||
"webFaqAnswer17": "You can leave the list at any time. To stop searching for Party on the website, select the “Party” link in the navigation then click “Leave” in the pop-up.",
|
||||
|
||||
"faqQuestion18": "I have a Party, how do I find more members?",
|
||||
"iosFaqAnswer18": "If you are using Habitica’s website, select “Find Members” from the Party dropdown. This will display a list of Habitica players that are actively looking for a Party and can be invited to join.\n\nYou'll see some information, such as language, class, level, and how many days they have used Habitica to help find a good fit for your Party. If you’d like to chat with someone before sending an invite, you can view their Profile and send a message.",
|
||||
"androidFaqAnswer18": "If you are using Habitica’s website, select “Find Members” from the Party dropdown. This will display a list of Habitica players that are actively looking for a Party and can be invited to join.\n\nYou'll see some information, such as language, class, level, and how many days they have used Habitica to help find a good fit for your Party. If you’d like to chat with someone before sending an invite, you can view their Profile and send a message.",
|
||||
"webFaqAnswer18": "If you are using Habitica’s website, select “Find Members” from the Party dropdown. This will display a list of Habitica players that are actively looking for a Party and can be invited to join.\n\nYou'll see some information, such as language, class, level, and how many days they have used Habitica to help find a good fit for your Party. If you’d like to chat with someone before sending an invite, you can view their Profile and send a message.",
|
||||
|
||||
"faqQuestion19": "How many members can I invite to my Party?",
|
||||
"iosFaqAnswer19": "Parties have a maximum limit of 30 members and a minimum of 1 member. Pending invites count towards the member count. For example, 29 members and 1 pending invite would count as 30 members. To clear a pending invite, the invited player must accept or decline, or the Party leader must cancel the invite.",
|
||||
"androidFaqAnswer19": "Parties have a maximum limit of 30 members and a minimum of 1 member. Pending invites count towards the member count. For example, 29 members and 1 pending invite would count as 30 members. To clear a pending invite, the invited player must accept or decline, or the Party leader must cancel the invite.",
|
||||
"webFaqAnswer19": "Parties have a maximum limit of 30 members and a minimum of 1 member. Pending invites count towards the member count. For example, 29 members and 1 pending invite would count as 30 members. To clear a pending invite, the invited player must accept or decline, or the Party leader must cancel the invite.",
|
||||
|
||||
"faqQuestion20": "Can I invite someone I already know?",
|
||||
"iosFaqAnswer20": "Yes! If you already have a Habitica player’s username or email address, you can invite them to join your Party. Here’s how to send an invite on the different platforms:\n\n## On Habitica’s website\n\nNavigate to your Party and click “Invite to Party” on the right-hand side of the page.\n\n## On iOS and Android\n\nTap “Party” from the Menu. Scroll to the Members section and tap “Invite a Member”.",
|
||||
"androidFaqAnswer20": "Yes! If you already have a Habitica player’s username or email address, you can invite them to join your Party. Here’s how to send an invite on the different platforms:\n\n## On Habitica’s website\n\nNavigate to your Party and click “Invite to Party” on the right-hand side of the page.\n\n## On iOS and Android\n\nTap “Party” from the Menu. Scroll to the Members section and tap “Invite a Member”.",
|
||||
"webFaqAnswer20": "Yes! If you already have a Habitica player’s username or email address, you can invite them to join your Party. Here’s how to send an invite on the different platforms:\n\n## On Habitica’s website\n\nNavigate to your Party and click “Invite to Party” on the right-hand side of the page.\n\n## On iOS and Android\n\nTap “Party” from the Menu. Scroll to the Members section and tap “Invite a Member”.",
|
||||
|
||||
"faqQuestion21": "How do I cancel a pending invitation to my Party?",
|
||||
"iosFaqAnswer21": "To cancel a pending invitation on Habitica’s website:\n\n1. Click on Member list when viewing your Party\n\n2. Click the “Invites” tab\n\n3. Click the three dots beside the user’s invite you wish to cancel\n\n4. Choose “Cancel Invite”\n\n\n\nYou’ll be able to cancel a pending invitation from the mobile apps soon as well!",
|
||||
"androidFaqAnswer21": "To cancel a pending invitation on Habitica’s website:\n\n1. Click on Member list when viewing your Party\n\n2. Click the “Invites” tab\n\n3. Click the three dots beside the user’s invite you wish to cancel\n\n4. Choose “Cancel Invite”\n\n\n\nYou’ll be able to cancel a pending invitation from the mobile apps soon as well!",
|
||||
"webFaqAnswer21": "To cancel a pending invitation on Habitica’s website:\n\n1. Click on Member list when viewing your Party\n\n2. Click the “Invites” tab\n\n3. Click the three dots beside the user’s invite you wish to cancel\n\n4. Choose “Cancel Invite”\n\n\n\nYou’ll be able to cancel a pending invitation from the mobile apps soon as well!",
|
||||
|
||||
"faqQuestion22": "How do I stop unwanted invitations?",
|
||||
"iosFaqAnswer22": "Once you join a Party you’ll stop receiving any more invitations. If you want to prevent invites and future communications from a specific player, view their profile and click the Block button.\n\nIf you encounter a situation where you believe another player has broken our Community Guidelines in their name, profile, or a message they sent, please report any messages or reach out to us at admin@habitica.com.",
|
||||
"androidFaqAnswer22": "Once you join a Party you’ll stop receiving any more invitations. If you want to prevent invites and future communications from a specific player, view their profile and click the Block button.\n\nIf you encounter a situation where you believe another player has broken our Community Guidelines in their name, profile, or a message they sent, please report any messages or reach out to us at admin@habitica.com.",
|
||||
"webFaqAnswer22": "Once you join a Party you’ll stop receiving any more invitations. If you want to prevent invites and future communications from a specific player, view their profile and click the Block button.\n\nIf you encounter a situation where you believe another player has broken our Community Guidelines in their name, profile, or a message they sent, please report any messages or reach out to us at admin@habitica.com.",
|
||||
|
||||
"faqQuestion23": "How do I filter the list of members searching for a Party?",
|
||||
"iosFaqAnswer23": "At the moment there is no way to filter the list of members searching for a Party. However, we have plans to introduce filters in the future, such as class, level, and language.",
|
||||
"androidFaqAnswer23": "At the moment there is no way to filter the list of members searching for a Party. However, we have plans to introduce filters in the future, such as class, level, and language.",
|
||||
"webFaqAnswer23": "At the moment there is no way to filter the list of members searching for a Party. However, we have plans to introduce filters in the future, such as class, level, and language.",
|
||||
|
||||
"faqQuestion24": "How do I search for a Party on Android or iOS?",
|
||||
"iosFaqAnswer24": "We’re working on adding the ability to search for a Party and find Party members on mobile soon! Keep an eye out for Android version 4.2 and iOS version 3.8.",
|
||||
"androidFaqAnswer24": "We’re working on adding the ability to search for a Party and find Party members on mobile soon! Keep an eye out for Android version 4.2 and iOS version 3.8.",
|
||||
"webFaqAnswer24": "We’re working on adding the ability to search for a Party and find Party members on mobile soon! Keep an eye out for Android version 4.2 and iOS version 3.8.",
|
||||
|
||||
"iosFaqStillNeedHelp": "If you have a question that isn't on this list or on the [Wiki FAQ](https://habitica.fandom.com/wiki/FAQ), come ask in the Tavern chat under Menu > Tavern! We're happy to help.",
|
||||
"androidFaqStillNeedHelp": "If you have a question that isn't on this list or on the [Wiki FAQ](https://habitica.fandom.com/wiki/FAQ), come ask in the Tavern chat under Menu > Tavern! We're happy to help.",
|
||||
"webFaqStillNeedHelp": "If you have a question that isn't on this list or on the [Wiki FAQ](https://habitica.fandom.com/wiki/FAQ), come ask in the [Habitica Help guild](https://habitica.com/groups/guild/5481ccf3-5d2d-48a9-a871-70a7380cee5a)! We're happy to help."
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@
|
|||
"joinToday": "Join Habitica Today",
|
||||
"featuredIn": "Featured in",
|
||||
"signup": "Sign Up",
|
||||
"getStarted": "Get Started!",
|
||||
"getStarted": "Get Started",
|
||||
"mobileApps": "Mobile Apps",
|
||||
"learnMore": "Learn More",
|
||||
"translateHabitica": "Translate Habitica"
|
||||
|
|
|
|||
|
|
@ -213,6 +213,7 @@
|
|||
"loadEarlierMessages": "Load Earlier Messages",
|
||||
"askQuestion": "Ask a Question",
|
||||
"emptyReportBugMessage": "Report Bug Message missing",
|
||||
"refreshList": "Refresh List",
|
||||
"leaveHabitica": "You are about to leave Habitica.com",
|
||||
"leaveHabiticaText": "Habitica is not responsible for the content of any linked website that is not owned or operated by HabitRPG.<br>Please note that these websites' practices may differ from Habitica’s community guidelines.",
|
||||
"skipExternalLinkModal": "Hold CTRL (Windows) or Command (Mac) when clicking a link to skip this modal."
|
||||
|
|
|
|||
|
|
@ -138,7 +138,9 @@
|
|||
"sendGiftSubscription": "<%= months %> Month(s): $<%= price %> USD",
|
||||
"gemGiftsAreOptional": "Please note that Habitica will never require you to gift gems to other players. Begging people for gems is a <strong>violation of the Community Guidelines</strong>, and all such instances should be reported to <%= hrefTechAssistanceEmail %>.",
|
||||
"giftMessageTooLong": "The maximum length for gift messages is <%= maxGiftMessageLength %>.",
|
||||
"battleWithFriends": "Battle Monsters With Friends",
|
||||
"battleWithFriends": "Play Habitica with Others",
|
||||
"questWithOthers": "Take on Quests with Others",
|
||||
"startPartyDetail": "Start your own Party or join an existing one <br/>to take on Quests and boost your motivation!",
|
||||
"startAParty": "Start a Party",
|
||||
"partyUpName": "Party Up",
|
||||
"partyOnName": "Party On",
|
||||
|
|
@ -174,6 +176,7 @@
|
|||
"usernamesMustBeAnArray": "Username invites must be an array.",
|
||||
"canOnlyInviteMaxInvites": "You can only invite \"<%= maxInvites %>\" at a time",
|
||||
"partyExceedsMembersLimit": "Party size is limited to <%= maxMembersParty %> members",
|
||||
"partyExceedsInvitesLimit": "A Party may only have up to <%= maxInvites %> pending invitations.",
|
||||
"onlyCreatorOrAdminCanDeleteChat": "Not authorized to delete this message!",
|
||||
"onlyGroupLeaderCanEditTasks": "Not authorized to manage tasks!",
|
||||
"onlyGroupTasksCanBeAssigned": "Only group tasks can be assigned",
|
||||
|
|
@ -289,17 +292,20 @@
|
|||
"noGuildsParagraph2": "Click the Discover tab to see recommended Guilds based on your interests, browse Habitica's public Guilds, or create your own Guild.",
|
||||
"noGuildsMatchFilters": "We couldn't find any matching Guilds.",
|
||||
"privateDescription": "A private Guild will not be displayed in Habitica's Guild directory. New members can be added by invitation only.",
|
||||
"removeInvite": "Remove Invitation",
|
||||
"removeInvite": "Cancel Invite",
|
||||
"removeMember": "Remove Member",
|
||||
"sendMessage": "Send Message",
|
||||
"promoteToLeader": "Transfer Ownership",
|
||||
"inviteFriendsParty": "Inviting friends to your Party will grant you an exclusive <br/> Quest Scroll to battle the Basi-List together!",
|
||||
"inviteFriendsParty": "Invite another player to your Party<br/> and receive the exclusive Basi-List Quest Scroll.",
|
||||
"createParty": "Create a Party",
|
||||
"inviteMembersNow": "Would you like to invite members now?",
|
||||
"playInPartyTitle": "Play Habitica in a Party!",
|
||||
"playInPartyDescription": "Take on amazing quests with friends or on your own. Battle monsters, create Challenges, and help yourself stay accountable through Parties.",
|
||||
"wantToJoinPartyTitle": "Want to join a Party?",
|
||||
"playInPartyDescription": "Take on amazing Quests with friends or on your own. Battle monsters, create Challenges, and help yourself stay accountable through Parties.",
|
||||
"wantToJoinPartyTitle": "Looking for a Party?",
|
||||
"wantToJoinPartyDescription": "Give your username to a friend who already has a Party, or head to the <a href='/groups/guild/f2db2a7f-13c5-454d-b3ee-ea1f5089e601'>Party Wanted Guild</a> to meet potential comrades!",
|
||||
"lookForParty": "Look for a Party",
|
||||
"currentlyLookingForParty": "You’re looking for a Party!",
|
||||
"partyFinderDescription": "Want to join a Party with others but don’t know any other players? Let Party leaders know you’re looking for an invite!",
|
||||
"copy": "Copy",
|
||||
"questOwnerRewards": "Quest Owner Rewards",
|
||||
"updateParty": "Update Party",
|
||||
|
|
@ -403,5 +409,13 @@
|
|||
"newGroupsBullet10b": "<strong>Assign a task to one member</strong> so only they can complete it",
|
||||
"newGroupsBullet10c": "<strong>Assign a task to multiple members</strong> if they all need to complete it",
|
||||
"newGroupsVisitFAQ": "Visit the <a href='/static/faq#group-plans' target='_blank'>FAQ</a> from the Help dropdown for more guidance.",
|
||||
"newGroupsEnjoy": "We hope you enjoy the new Group Plans experience!"
|
||||
"newGroupsEnjoy": "We hope you enjoy the new Group Plans experience!",
|
||||
"checkinsLabel": "Check-ins:",
|
||||
"classLabel": "Class:",
|
||||
"languageLabel": "Language:",
|
||||
"invitedToYourParty": "<strong>Invited to Your Party!</strong> Click to Undo",
|
||||
"lookingForPartyTitle": "Find Members",
|
||||
"findMorePartyMembers": "Find More Members",
|
||||
"findPartyMembers": "Find Party Members",
|
||||
"noOneLooking": "There’s no one looking for a Party right now.<br>You can check back later!"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@
|
|||
"toDo": "To Do",
|
||||
"tourStatsPage": "This is your Stats page! Earn achievements by completing the listed tasks.",
|
||||
"tourTavernPage": "Welcome to the Tavern, an all-ages chat room! You can keep your Dailies from hurting you in case of illness or travel by clicking \"Pause Damage\". Come say hi!",
|
||||
"tourPartyPage": "Your Party will help you stay accountable. Invite friends to unlock a Quest Scroll!",
|
||||
"tourPartyPage": "Welcome to your new Party! You can invite other players to your Party by username, email, or from a list of players looking for a Party to earn the exclusive Basi-List Quest Scroll.<br/><br/>Select <a href='/static/faq#parties'>FAQ</a> from the Help dropdown to learn more about how Parties work.",
|
||||
"tourGuildsPage": "Guilds are common-interest chat groups created by the players, for the players. Browse through the list and join the Guilds that interest you. Be sure to check out the popular Habitica Help: Ask a Question guild, where anyone can ask questions about Habitica!",
|
||||
"tourChallengesPage": "Challenges are themed task lists created by users! Joining a Challenge will add its tasks to your account. Compete against other users to win Gem prizes!",
|
||||
"tourMarketPage": "Every time you complete a task, you'll have a random chance at receiving an Egg, a Hatching Potion, or a piece of Pet Food. You can also buy these items here.",
|
||||
|
|
|
|||
|
|
@ -21,10 +21,6 @@ const questionList = [
|
|||
heading: 'health',
|
||||
translationIndex: 4,
|
||||
},
|
||||
{
|
||||
heading: 'party-with-friends',
|
||||
translationIndex: 5,
|
||||
},
|
||||
{
|
||||
heading: 'pets-mounts',
|
||||
translationIndex: 6,
|
||||
|
|
@ -52,7 +48,54 @@ const questionList = [
|
|||
{
|
||||
heading: 'group-plans',
|
||||
translationIndex: 13,
|
||||
excludedPlatforms: ['android', 'ios'],
|
||||
},
|
||||
{
|
||||
heading: 'party-with-friends',
|
||||
translationIndex: 5,
|
||||
},
|
||||
{
|
||||
heading: 'party-detail-1',
|
||||
translationIndex: 14,
|
||||
},
|
||||
{
|
||||
heading: 'party-detail-2',
|
||||
translationIndex: 15,
|
||||
},
|
||||
{
|
||||
heading: 'party-detail-3',
|
||||
translationIndex: 16,
|
||||
},
|
||||
{
|
||||
heading: 'party-detail-4',
|
||||
translationIndex: 17,
|
||||
},
|
||||
{
|
||||
heading: 'party-detail-5',
|
||||
translationIndex: 18,
|
||||
},
|
||||
{
|
||||
heading: 'party-detail-6',
|
||||
translationIndex: 19,
|
||||
},
|
||||
{
|
||||
heading: 'party-detail-7',
|
||||
translationIndex: 20,
|
||||
},
|
||||
{
|
||||
heading: 'party-detail-8',
|
||||
translationIndex: 21,
|
||||
},
|
||||
{
|
||||
heading: 'party-detail-9',
|
||||
translationIndex: 22,
|
||||
},
|
||||
{
|
||||
heading: 'party-detail-10',
|
||||
translationIndex: 23,
|
||||
},
|
||||
{
|
||||
heading: 'party-detail-11',
|
||||
translationIndex: 24,
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ export default {
|
|||
groupRemainOrLeaveChallenges: 'req.query.keep must be either "remain-in-challenges" or "leave-challenges"',
|
||||
managerIdRequired: 'req.body.managerId must contain a User ID.',
|
||||
noPrivAccess: 'You don\'t have the required privileges.',
|
||||
notPartyLeader: 'You are not the leader of a Party.',
|
||||
|
||||
eventRequired: '"req.params.event" is required.',
|
||||
countRequired: '"req.query.count" is required.',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import _ from 'lodash';
|
||||
import nconf from 'nconf';
|
||||
import moment from 'moment';
|
||||
import { authWithHeaders } from '../../middlewares/auth';
|
||||
import {
|
||||
model as Group,
|
||||
|
|
@ -719,6 +720,25 @@ api.joinGroup = {
|
|||
}
|
||||
}
|
||||
|
||||
const analyticsObject = {
|
||||
uuid: user._id,
|
||||
hitType: 'event',
|
||||
category: 'behavior',
|
||||
owner: false,
|
||||
groupId: group._id,
|
||||
groupType: group.type,
|
||||
privacy: group.privacy,
|
||||
headers: req.headers,
|
||||
invited: isUserInvited,
|
||||
};
|
||||
if (group.type === 'party') {
|
||||
analyticsObject.seekingParty = Boolean(user.party.seeking);
|
||||
}
|
||||
if (group.privacy === 'public') {
|
||||
analyticsObject.groupName = group.name;
|
||||
}
|
||||
user.party.seeking = undefined;
|
||||
|
||||
if (inviter) promises.push(inviter.save());
|
||||
promises = await Promise.all(promises);
|
||||
|
||||
|
|
@ -733,22 +753,6 @@ api.joinGroup = {
|
|||
response.leader = leader.toJSON({ minimize: true });
|
||||
}
|
||||
|
||||
const analyticsObject = {
|
||||
uuid: user._id,
|
||||
hitType: 'event',
|
||||
category: 'behavior',
|
||||
owner: false,
|
||||
groupId: group._id,
|
||||
groupType: group.type,
|
||||
privacy: group.privacy,
|
||||
headers: req.headers,
|
||||
invited: isUserInvited,
|
||||
};
|
||||
|
||||
if (group.privacy === 'public') {
|
||||
analyticsObject.groupName = group.name;
|
||||
}
|
||||
|
||||
res.analytics.track('join group', analyticsObject);
|
||||
|
||||
res.respond(200, response);
|
||||
|
|
@ -1204,17 +1208,6 @@ api.inviteToGroup = {
|
|||
results.push(...usernameResults);
|
||||
}
|
||||
|
||||
const analyticsObject = {
|
||||
uuid: user._id,
|
||||
hitType: 'event',
|
||||
category: 'behavior',
|
||||
groupId: group._id,
|
||||
groupType: group.type,
|
||||
headers: req.headers,
|
||||
};
|
||||
|
||||
res.analytics.track('group invite', analyticsObject);
|
||||
|
||||
res.respond(200, results);
|
||||
},
|
||||
};
|
||||
|
|
@ -1362,4 +1355,88 @@ api.getGroupPlans = {
|
|||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @api {get} /api/v3/looking-for-party Get users in search of parties
|
||||
* @apiName GetLookingForParty
|
||||
* @apiGroup Group
|
||||
*
|
||||
* @apiParam (Query) {Number} [page] Page number, defaults to 0
|
||||
*
|
||||
* @apiSuccess {Object[]} data An array of users looking for a party
|
||||
*
|
||||
* @apiError (400) {BadRequest} notPartyLeader You are not the leader of a Party.
|
||||
*/
|
||||
api.getLookingForParty = {
|
||||
method: 'GET',
|
||||
url: '/looking-for-party',
|
||||
middlewares: [authWithHeaders()],
|
||||
async handler (req, res) {
|
||||
const USERS_PER_PAGE = 30;
|
||||
const { user } = res.locals;
|
||||
|
||||
req.checkQuery('page').optional().isInt({ min: 0 }, apiError('queryPageInteger'));
|
||||
const PAGE = req.query.page || 0;
|
||||
const PAGE_START = USERS_PER_PAGE * PAGE;
|
||||
|
||||
const partyLed = await Group
|
||||
.findOne({
|
||||
type: 'party',
|
||||
leader: user._id,
|
||||
})
|
||||
.select('_id')
|
||||
.exec();
|
||||
|
||||
if (!partyLed) {
|
||||
throw new BadRequest(apiError('notPartyLeader'));
|
||||
}
|
||||
|
||||
const seekers = await User
|
||||
.find({
|
||||
'party.seeking': { $exists: true },
|
||||
'auth.timestamps.loggedin': {
|
||||
$gt: moment().subtract(7, 'days').toDate(),
|
||||
},
|
||||
})
|
||||
// eslint-disable-next-line no-multi-str
|
||||
.select('_id auth.blocked auth.local.username auth.timestamps backer contributor.level \
|
||||
flags.chatRevoked flags.classSelected inbox.blocks invitations.party items.gear.costume \
|
||||
items.gear.equipped loginIncentives party._id preferences.background preferences.chair \
|
||||
preferences.costume preferences.hair preferences.shirt preferences.size preferences.skin \
|
||||
preferences.language profile.name stats.buffs stats.class stats.lvl')
|
||||
.sort('-auth.timestamps.loggedin')
|
||||
.exec();
|
||||
|
||||
const filteredSeekers = seekers.filter(seeker => {
|
||||
if (seeker.party._id) return false;
|
||||
if (seeker.invitations.party.id) return false;
|
||||
if (seeker.flags.chatRevoked) return false;
|
||||
if (seeker.auth.blocked) return false;
|
||||
if (seeker.inbox.blocks.indexOf(user._id) !== -1) return false;
|
||||
if (user.inbox.blocks.indexOf(seeker._id) !== -1) return false;
|
||||
return true;
|
||||
}).slice(PAGE_START, PAGE_START + USERS_PER_PAGE);
|
||||
|
||||
const cleanedSeekers = filteredSeekers.map(seeker => ({
|
||||
_id: seeker._id,
|
||||
auth: {
|
||||
local: {
|
||||
username: seeker.auth.local.username,
|
||||
},
|
||||
timestamps: seeker.auth.timestamps,
|
||||
},
|
||||
backer: seeker.backer,
|
||||
contributor: seeker.contributor,
|
||||
flags: seeker.flags,
|
||||
invited: false,
|
||||
items: seeker.items,
|
||||
loginIncentives: seeker.loginIncentives,
|
||||
preferences: seeker.preferences,
|
||||
profile: seeker.profile,
|
||||
stats: seeker.stats,
|
||||
}));
|
||||
|
||||
res.respond(200, cleanedSeekers);
|
||||
},
|
||||
};
|
||||
|
||||
export default api;
|
||||
|
|
|
|||
|
|
@ -87,10 +87,9 @@ async function inviteUserToParty (userToInvite, group, inviter, res) {
|
|||
}
|
||||
|
||||
if (userToInvite.party._id) {
|
||||
const userParty = await Group.getGroup({ user: userToInvite, groupId: 'party', fields: 'memberCount' });
|
||||
const userParty = await Group.getGroup({ user: userToInvite, groupId: 'party', fields: '_id' });
|
||||
|
||||
// Allow user to be invited to a new party when they're partying solo
|
||||
if (userParty && userParty.memberCount !== 1) throw new NotAuthorized(res.t('userAlreadyInAParty', { userId: uuid, username: userToInvite.profile.name }));
|
||||
if (userParty) throw new NotAuthorized(res.t('userAlreadyInAParty', { userId: uuid, username: userToInvite.profile.name }));
|
||||
}
|
||||
|
||||
const partyInvite = { id: group._id, name: group.name, inviter: inviter._id };
|
||||
|
|
@ -142,6 +141,22 @@ async function inviteByUUID (uuid, group, inviter, req, res) {
|
|||
));
|
||||
}
|
||||
|
||||
const analyticsObject = {
|
||||
hitType: 'event',
|
||||
category: 'behavior',
|
||||
uuid: inviter._id,
|
||||
invitee: uuid,
|
||||
groupId: group._id,
|
||||
groupType: group.type,
|
||||
headers: req.headers,
|
||||
};
|
||||
|
||||
if (group.type === 'party') {
|
||||
analyticsObject.seekingParty = Boolean(userToInvite.party.seeking);
|
||||
}
|
||||
|
||||
res.analytics.track('group invite', analyticsObject);
|
||||
|
||||
return addInvitationToUser(userToInvite, group, inviter, res);
|
||||
}
|
||||
|
||||
|
|
@ -189,6 +204,18 @@ async function inviteByEmail (invite, group, inviter, req, res) {
|
|||
const userIsUnsubscribed = await EmailUnsubscription.findOne({ email: invite.email }).exec();
|
||||
const groupLabel = group.type === 'guild' ? '-guild' : '';
|
||||
if (!userIsUnsubscribed) sendTxnEmail(invite, `invite-friend${groupLabel}`, variables);
|
||||
|
||||
const analyticsObject = {
|
||||
hitType: 'event',
|
||||
category: 'behavior',
|
||||
uuid: inviter._id,
|
||||
invitee: 'email',
|
||||
groupId: group._id,
|
||||
groupType: group.type,
|
||||
headers: req.headers,
|
||||
};
|
||||
|
||||
res.analytics.track('group invite', analyticsObject);
|
||||
}
|
||||
|
||||
return userReturnInfo;
|
||||
|
|
@ -214,6 +241,23 @@ async function inviteByUserName (username, group, inviter, req, res) {
|
|||
{ userId: userToInvite._id, username: userToInvite.profile.name },
|
||||
));
|
||||
}
|
||||
|
||||
const analyticsObject = {
|
||||
hitType: 'event',
|
||||
category: 'behavior',
|
||||
uuid: inviter._id,
|
||||
invitee: userToInvite._id,
|
||||
groupId: group._id,
|
||||
groupType: group.type,
|
||||
headers: req.headers,
|
||||
};
|
||||
|
||||
if (group.type === 'party') {
|
||||
analyticsObject.seekingParty = Boolean(userToInvite.party.seeking);
|
||||
}
|
||||
|
||||
res.analytics.track('group invite', analyticsObject);
|
||||
|
||||
return addInvitationToUser(userToInvite, group, inviter, res);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ const updatablePaths = [
|
|||
'party.orderAscending',
|
||||
'party.quest.completed',
|
||||
'party.quest.RSVPNeeded',
|
||||
'party.seeking',
|
||||
|
||||
'preferences',
|
||||
'profile',
|
||||
|
|
@ -120,7 +121,17 @@ async function checkNewInputForProfanity (user, res, newValue) {
|
|||
export async function update (req, res, { isV3 = false }) {
|
||||
const { user } = res.locals;
|
||||
|
||||
let promisesForTagsRemoval = [];
|
||||
const promisesForTagsRemoval = [];
|
||||
|
||||
if (req.body['party.seeking'] !== undefined && req.body['party.seeking'] !== null) {
|
||||
user.invitations.party = {};
|
||||
user.invitations.parties = [];
|
||||
res.analytics.track('Starts Looking for Party', {
|
||||
uuid: user._id,
|
||||
hitType: 'event',
|
||||
category: 'behavior',
|
||||
});
|
||||
}
|
||||
|
||||
if (req.body['profile.name'] !== undefined) {
|
||||
const newName = req.body['profile.name'];
|
||||
|
|
@ -170,7 +181,14 @@ export async function update (req, res, { isV3 = false }) {
|
|||
throw new NotAuthorized(res.t('mustPurchaseToSet', { val, key }));
|
||||
}
|
||||
|
||||
if (key === 'tags') {
|
||||
if (key === 'party.seeking' && val === null) {
|
||||
user.party.seeking = undefined;
|
||||
res.analytics.track('Leaves Looking for Party', {
|
||||
uuid: user._id,
|
||||
hitType: 'event',
|
||||
category: 'behavior',
|
||||
});
|
||||
} else if (key === 'tags') {
|
||||
if (!Array.isArray(val)) throw new BadRequest('Tag list must be an array.');
|
||||
|
||||
const removedTagsIds = [];
|
||||
|
|
@ -200,13 +218,13 @@ export async function update (req, res, { isV3 = false }) {
|
|||
// Remove from all the tasks
|
||||
// NOTE each tag to remove requires a query
|
||||
|
||||
promisesForTagsRemoval = removedTagsIds.map(tagId => Tasks.Task.update({
|
||||
promisesForTagsRemoval.push(removedTagsIds.map(tagId => Tasks.Task.update({
|
||||
userId: user._id,
|
||||
}, {
|
||||
$pull: {
|
||||
tags: tagId,
|
||||
},
|
||||
}, { multi: true }).exec());
|
||||
}, { multi: true }).exec()));
|
||||
} else if (key === 'flags.newStuff' && val === false) {
|
||||
// flags.newStuff was removed from the user schema and is only returned for compatibility
|
||||
// reasons but we're keeping the ability to set it in API v3
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ const { questSeriesAchievements } = shared.content;
|
|||
const { Schema } = mongoose;
|
||||
|
||||
export const INVITES_LIMIT = 100; // must not be greater than MAX_EMAIL_INVITES_BY_USER
|
||||
export const PARTY_PENDING_LIMIT = 10;
|
||||
export const { TAVERN_ID } = shared;
|
||||
|
||||
const NO_CHAT_NOTIFICATIONS = [TAVERN_ID];
|
||||
|
|
@ -487,6 +488,9 @@ schema.statics.validateInvitations = async function getInvitationErr (invites, r
|
|||
query['invitations.party.id'] = group._id;
|
||||
// @TODO invitations are now stored like this: `'invitations.parties': []`
|
||||
const groupInvites = await User.countDocuments(query).exec();
|
||||
if (groupInvites + totalInvites > PARTY_PENDING_LIMIT) {
|
||||
throw new BadRequest(res.t('partyExceedsInvitesLimit', { maxInvites: PARTY_PENDING_LIMIT }));
|
||||
}
|
||||
memberCount += groupInvites;
|
||||
|
||||
// Counting the members that are going to be invited by email and uuids
|
||||
|
|
|
|||
|
|
@ -502,6 +502,7 @@ export default new Schema({
|
|||
// invite is accepted or rejected, quest starts, or quest is cancelled
|
||||
RSVPNeeded: { $type: Boolean, default: false },
|
||||
},
|
||||
seeking: Date,
|
||||
},
|
||||
preferences: {
|
||||
dayStart: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue