mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-30 09:06:37 +00:00
fix: say which team a seat's plan belongs to, paid or free
A provisioned account read as a plain "Free" plan with an "Upgrade for more features" badge: nothing said the account belongs to a team, and the prompt asked for an upgrade only its owner can buy. Its free tier is not the free plan either — org_seat_free is half the allowance. The card now names the team on both paths: a paid seat keeps its tier and status and gains "Managed by <team>", and a seat with no tier reads "Team account" instead of an upgrade pitch.
This commit is contained in:
@@ -21,7 +21,7 @@ import UIWindowSaveAccount from '../UIWindowSaveAccount.js';
|
||||
import { formatCredits, formatDollarsFromMicrocents, usageIsCredits } from './credits.js';
|
||||
import { usageBudget } from './usageBudget.js';
|
||||
import { appIconAttrs } from '../../helpers/appIcon.js';
|
||||
import { isOrgSeat } from './orgSeat.js';
|
||||
import { isOrgSeat, orgSeatTeamName } from './orgSeat.js';
|
||||
|
||||
// How long a completed usage load stays fresh enough to skip a repeat. Long
|
||||
// enough to absorb the init/onActivate/routing burst on a single dashboard
|
||||
@@ -463,6 +463,8 @@ const TabHome = {
|
||||
subscription.status === 'cancel_pending' ||
|
||||
pastDue);
|
||||
const planName = subscription?.tier || 'free';
|
||||
const seat = isOrgSeat(window.user);
|
||||
const teamName = orgSeatTeamName(window.user);
|
||||
const trialEnds = trialing
|
||||
? formatTrialEnd(subscription.trialEndsAt)
|
||||
: null;
|
||||
@@ -515,14 +517,25 @@ const TabHome = {
|
||||
}
|
||||
$el_window.find('.bento-plan-upgrade').text('Manage →').show();
|
||||
} else {
|
||||
$badge.text('Upgrade for more features').addClass('free');
|
||||
$badge
|
||||
.text(
|
||||
seat
|
||||
? i18n('plan_team_seat')
|
||||
: 'Upgrade for more features',
|
||||
)
|
||||
.addClass('free');
|
||||
// Reset the label too — otherwise it keeps saying "Manage →"
|
||||
// after a subscription lapses/cancels.
|
||||
$el_window.find('.bento-plan-upgrade').text('Upgrade →').show();
|
||||
}
|
||||
|
||||
// A seat cannot change its plan, so name who can.
|
||||
if (seat && teamName) {
|
||||
$note.text(i18n('plan_team_managed', [teamName])).show();
|
||||
}
|
||||
|
||||
// A seat's plan is the team's; the link only reaches a refusal.
|
||||
if ( isOrgSeat(window.user) ) {
|
||||
if (seat) {
|
||||
$el_window.find('.bento-plan-upgrade').hide();
|
||||
}
|
||||
|
||||
|
||||
@@ -539,6 +539,8 @@ const en = {
|
||||
storage_usage: 'Storage Usage',
|
||||
storage_puter_used: 'used by Puter',
|
||||
'your_plan': 'Your Plan',
|
||||
plan_team_seat: 'Team account',
|
||||
plan_team_managed: 'Managed by %%',
|
||||
taking_longer_than_usual: 'Taking a little longer than usual. Please wait...',
|
||||
teams: 'Teams',
|
||||
teams_subtitle: 'The accounts your team pays for',
|
||||
|
||||
Reference in New Issue
Block a user