Skip to content

Commit

Permalink
Empty project page for ended trial
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaHegde committed Dec 6, 2024
1 parent 4d13c85 commit b167200
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion runtime/pkg/email/email.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ func (c *Client) SendSubscriptionEnded(opts *SubscriptionEnded) error {
ToName: opts.ToName,
Subject: fmt.Sprintf("Subscription for %s has now ended. Org is hibernated", opts.OrgName),
PreButton: template.HTML(fmt.Sprintf(`
Your cancelled subscription for <b>%s</b> has and its projects are now <a href="https://docs.rilldata.com/home/FAQ#what-is-project-hibernation">hibernating</a>. We hope you enjoyed using Rill Cloud during your time with us.
Your cancelled subscription for <b>%s</b> has ended and its projects are now <a href="https://docs.rilldata.com/home/FAQ#what-is-project-hibernation">hibernating</a>. We hope you enjoyed using Rill Cloud during your time with us.
<br /><br />
If you’d like to reactive your subscription and regain access, you can easily do so at any time by renewing your subscription from here:
`, opts.OrgName)),
Expand Down
9 changes: 8 additions & 1 deletion web-admin/src/routes/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const load = async ({ params, url, route }) => {
}

// If no organization or project, return empty permissions
if (!organization || !project) {
if (!organization) {
return {
organizationPermissions: <V1OrganizationPermissions>{},
projectPermissions: <V1ProjectPermissions>{},
Expand All @@ -70,6 +70,13 @@ export const load = async ({ params, url, route }) => {
}
}

if (!project) {
return {
organizationPermissions,
projectPermissions: <V1ProjectPermissions>{},
};
}

try {
const {
projectPermissions,
Expand Down
11 changes: 7 additions & 4 deletions web-common/src/features/project/ProjectDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ export class ProjectDeployer {

// Project does not yet exist

if (!org && this.useOrg) {
org = this.useOrg;
}

let checkNextOrg = false;
if (!org) {
const { org: inferredOrg, checkNextOrg: inferredCheckNextOrg } =
Expand All @@ -182,6 +178,13 @@ export class ProjectDeployer {
}

private async inferOrg(rillUserOrgs: string[]) {
if (this.useOrg) {
return {
org: this.useOrg,
checkNextOrg: false,
};
}

let org: string | undefined;
let checkNextOrg = false;
if (rillUserOrgs.length === 1) {
Expand Down
3 changes: 1 addition & 2 deletions web-local/src/routes/(misc)/deploy/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
import type { PageData } from "./$types";
export let data: PageData;
$: ({ orgParam } = data);
const deployer = new ProjectDeployer(orgParam);
const deployer = new ProjectDeployer(data.orgParam);
const metadata = deployer.metadata;
const user = deployer.user;
const project = deployer.project;
Expand Down

0 comments on commit b167200

Please sign in to comment.