Invites can now be managed to some extent
This commit is contained in:
@@ -74,16 +74,48 @@
|
||||
</v-btn>
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
<v-card-actions>
|
||||
<v-spacer />
|
||||
<v-layout
|
||||
row
|
||||
justify-end
|
||||
>
|
||||
<v-btn
|
||||
flat
|
||||
color="accent"
|
||||
@click="signOut"
|
||||
>
|
||||
Sign Out
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-layout>
|
||||
<template v-if="invites.length">
|
||||
<v-divider class="mt-3 mb-3" />
|
||||
<v-subheader>
|
||||
<h1>
|
||||
Invites
|
||||
</h1>
|
||||
</v-subheader>
|
||||
<v-list>
|
||||
<template
|
||||
v-for="(invite, index) in invites"
|
||||
>
|
||||
<v-list-tile
|
||||
:key="invite._id"
|
||||
:data-id="invite._id"
|
||||
@click="clickInvite(invite)"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title>
|
||||
{{ invite.inviteeName || invite.invitee || 'Available' }}
|
||||
</v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
<v-list-tile-action>
|
||||
<v-icon>mail_outline</v-icon>
|
||||
</v-list-tile-action>
|
||||
</v-list-tile>
|
||||
<v-divider
|
||||
:key="index"
|
||||
/>
|
||||
</template>
|
||||
</v-list>
|
||||
</template>
|
||||
</v-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -114,6 +146,20 @@
|
||||
darkMode(){
|
||||
return this.user && this.user.darkMode;
|
||||
},
|
||||
invites(){
|
||||
let usernames = {};
|
||||
Meteor.users.find({}).forEach(user => {
|
||||
usernames[user._id] = user.username;
|
||||
});
|
||||
return Invites.find({
|
||||
inviter: Meteor.userId(),
|
||||
}, {
|
||||
sort: {dateConfirmed: 1},
|
||||
}).map(invite => {
|
||||
invite.inviteeName = usernames[invite.invitee];
|
||||
return invite;
|
||||
});
|
||||
}
|
||||
},
|
||||
data(){ return {
|
||||
showApiKey: false,
|
||||
@@ -154,6 +200,13 @@
|
||||
if(error) this.emailVerificationError = error.reason;
|
||||
});
|
||||
},
|
||||
clickInvite(invite){
|
||||
this.$store.commit('pushDialogStack', {
|
||||
component: 'invite-dialog',
|
||||
elementId: invite._id,
|
||||
data: {inviteId: invite._id},
|
||||
});
|
||||
},
|
||||
linkWithPatreon,
|
||||
},
|
||||
}
|
||||
|
||||
22
app/imports/ui/pages/InviteError.vue
Normal file
22
app/imports/ui/pages/InviteError.vue
Normal file
@@ -0,0 +1,22 @@
|
||||
<template lang="html">
|
||||
<div>
|
||||
Invite Error!
|
||||
<p>
|
||||
{{ error.reason || error.message || error }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
error: {
|
||||
type: [Object, String],
|
||||
required: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
</style>
|
||||
13
app/imports/ui/pages/InviteSuccess.vue
Normal file
13
app/imports/ui/pages/InviteSuccess.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template lang="html">
|
||||
<div>
|
||||
Invite Success! You can now use DiceCloud.
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="css" scoped>
|
||||
</style>
|
||||
@@ -85,7 +85,6 @@
|
||||
|
||||
<script>
|
||||
import { Meteor } from 'meteor/meteor'
|
||||
import router from '/imports/ui/router.js';
|
||||
export default{
|
||||
data: () => ({
|
||||
valid: true,
|
||||
@@ -108,7 +107,7 @@
|
||||
if (error){
|
||||
this.error = error.reason;
|
||||
} else {
|
||||
router.push('characterList');
|
||||
this.$router.push(this.$route.query.redirect || 'characterList');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -119,7 +118,7 @@
|
||||
console.error(error);
|
||||
this.googleError = error.message;
|
||||
} else {
|
||||
router.push('characterList');
|
||||
this.$router.push(this.$route.query.redirect || 'characterList');
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -129,7 +128,7 @@
|
||||
console.error(error);
|
||||
this.patreonError = error.message;
|
||||
} else {
|
||||
router.push('characterList');
|
||||
this.$router.push(this.$route.query.redirect || 'characterList');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user