team members limitation frontend/backend

This commit is contained in:
Čarodej
2021-11-26 10:53:30 +01:00
parent 5626a054da
commit 459087337c
16 changed files with 335 additions and 66 deletions

View File

@@ -91,6 +91,7 @@
import InfoBox from "../Others/Forms/InfoBox";
import {events} from '/resources/js/bus'
import axios from "axios";
import {mapGetters} from "vuex";
export default {
name: 'CreateTeamFolderPopup',
@@ -109,6 +110,9 @@
InfoBox,
},
computed: {
...mapGetters([
'user'
]),
popupTitle() {
return this.item ? this.$t('Convert as Team Folder') : this.$t('Create Team Folder')
},
@@ -198,6 +202,17 @@
return
}
// Get team folder limitations
let limit = this.user.data.meta.limitations.max_team_members
if (limit.percentage >= 100 && ! limit.meta.allowed_emails.includes(email)) {
this.$refs.teamFolderForm.setErrors({
'Email': this.$t("You have to upgrade your account to add this new member.")
});
return
}
this.$refs.teamFolderForm.reset()
this.invitations.push({

View File

@@ -80,6 +80,7 @@
import InfoBox from "../Others/Forms/InfoBox";
import {events} from '/resources/js/bus'
import axios from "axios";
import {mapGetters} from "vuex";
export default {
name: 'EditTeamFolderPopup',
@@ -98,6 +99,9 @@
InfoBox,
},
computed: {
...mapGetters([
'user'
]),
isDisabledSubmit() {
return Object.values(this.members).length === 0 && Object.values(this.invitations).length === 0
}
@@ -157,6 +161,17 @@
});
}
// Get team folder limitations
let limit = this.user.data.meta.limitations.max_team_members
if (limit.percentage >= 100 && ! limit.meta.allowed_emails.includes(email)) {
this.$refs.teamFolderForm.setErrors({
'Email': this.$t("You have to upgrade your account to add this new member.")
});
return
}
this.$refs.teamFolderForm.reset()
this.invitations.push({