To learn more about our {{ input.teamType?.name }} plan, click below to contact our sales team.
@@ -68,9 +77,9 @@ import billingApi from '../../api/billing.js'
import teamApi from '../../api/team.js'
import teamTypesApi from '../../api/teamTypes.js'
import teamsApi from '../../api/teams.js'
-import FormHeading from '../../components/FormHeading.vue'
import FormRow from '../../components/FormRow.vue'
+import TeamTypeTile from '../../components/TeamTypeTile.vue'
import Alerts from '../../services/alerts.js'
import slugify from '../../utils/slugify.js'
@@ -96,7 +105,8 @@ export default {
needsBilling: false,
newTeam: null,
errors: {},
- pendingSlugCheck: null
+ pendingSlugCheck: null,
+ presetTeamType: false
}
},
watch: {
@@ -127,7 +137,7 @@ export default {
}
},
computed: {
- ...mapState('account', ['user', 'team', 'features']),
+ ...mapState('account', ['user', 'team', 'teams', 'features']),
formValid () {
return this.input.teamTypeId && this.input.name && this.input.slug && !this.pendingSlugCheck && !this.input.slugError && !this.errors.name
},
@@ -146,11 +156,22 @@ export default {
async created () {
const teamTypesPromise = await teamTypesApi.getTeamTypes()
- this.teamTypes = (await teamTypesPromise).types
+ this.teamTypes = (await teamTypesPromise).types.sort((a, b) => a.order - b.order)
this.input.teamTypeId = this.teamTypes[0].id
+
+ if (this.$route.query.teamType) {
+ this.input.teamTypeId = this.$route.query.teamType
+ for (const teamType of this.teamTypes) {
+ if (teamType.id === this.input.teamTypeId) {
+ this.presetTeamType = teamType
+ break
+ }
+ }
+ }
},
mounted () {
this.mounted = true
+ // was a team type pre-determined
},
methods: {
createTeam () {
@@ -161,6 +182,17 @@ export default {
slug: this.input.slug || this.input.defaultSlug,
type: this.input.teamTypeId
}
+ // Check if we should set the trial flag
+ if (
+ // TeamType has trial mode enabled
+ this.input.teamType.properties?.trial?.active &&
+ // User has no other teams
+ this.teams.length === 0 &&
+ // User is less than a week old
+ (Date.now() - (new Date(this.user.createdAt)).getTime()) < 1000 * 60 * 60 * 24 * 7
+ ) {
+ opts.trial = true
+ }
teamApi.create(opts).then(async result => {
await this.$store.dispatch('account/refreshTeams')
@@ -215,8 +247,8 @@ export default {
},
components: {
FormRow,
- FormHeading,
- ExternalLinkIcon
+ ExternalLinkIcon,
+ 'team-type-tile': TeamTypeTile
}
}
diff --git a/frontend/src/ui-components/stylesheets/ff-components.scss b/frontend/src/ui-components/stylesheets/ff-components.scss
index 505e619cce..bf4c9691df 100644
--- a/frontend/src/ui-components/stylesheets/ff-components.scss
+++ b/frontend/src/ui-components/stylesheets/ff-components.scss
@@ -665,7 +665,7 @@ li.ff-list-item {
}
&.active {
border: 2px solid var(--ff-tile-selection-color);
- svg {
+ .ff-tile-selection-option--header svg {
fill: var(--ff-tile-selection-color);
}
}
diff --git a/test/e2e/frontend/cypress/tests/invitations.spec.js b/test/e2e/frontend/cypress/tests/invitations.spec.js
index 7071a71f93..ff0b769e75 100644
--- a/test/e2e/frontend/cypress/tests/invitations.spec.js
+++ b/test/e2e/frontend/cypress/tests/invitations.spec.js
@@ -21,14 +21,15 @@ describe('FlowFuse platform invitees', () => {
})
it('can reject an invitation to a new team', () => {
- // should show one pending invite
cy.get('[data-el="desktop-nav-right"]').within(() => {
cy.get('[data-el="notification-pill"]').should('have.text', '2')
+ cy.get('[data-el="notifications-button"]').click()
})
+ cy.get('[data-el="notifications-drawer"]').should('be.visible')
+ cy.get('[data-el="invitation-message"]').eq(0).click()
+
// user should see a message
- cy.get('[data-nav="team-invites"]').should('be.visible')
- cy.get('[data-nav="team-invites"]').click()
cy.url().should('include', '/account/teams/invitations')
@@ -49,12 +50,12 @@ describe('FlowFuse platform invitees', () => {
it('can accept an invitation to a new team and is navigated to the team\'s dashboard', () => {
// should show one pending invite
cy.get('[data-el="desktop-nav-right"]').within(() => {
- cy.get('[data-el="notification-pill"]').should('have.text', '1')
+ cy.get('[data-el="notifications-button"]').click()
})
- // user should see a message
- cy.get('[data-nav="team-invites"]').should('be.visible')
- cy.get('[data-nav="team-invites"]').click()
+ cy.get('[data-el="notifications-drawer"]').should('be.visible')
+ cy.get('[data-action="show-read-check"]').click()
+ cy.get('[data-el="invitation-message"]').eq(0).click()
cy.url().should('include', '/account/teams/invitations')