Skip to content

Commit aee172d

Browse files
authored
fix(dashboard): organization members check (#1048)
1 parent 6effd41 commit aee172d

File tree

26 files changed

+229
-131
lines changed

26 files changed

+229
-131
lines changed

.changeset/calm-points-jump.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@lagon/dashboard': patch
3+
---
4+
5+
Fix organization members check

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ storybook-static/
2020
.env
2121
tsconfig.tsbuildinfo
2222
snapshot.bin
23+
.vercel

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/runtime/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
v8 = "0.74.2"
7+
v8 = "0.74.3"
88

99
[dev-dependencies]
1010
tokio = { version = "1", features = ["rt", "time", "macros"] }

crates/runtime_crypto/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
v8 = "0.74.2"
7+
v8 = "0.74.3"
88
anyhow = "1.0.72"
99
rand = "0.8.5"
1010
uuid = { version = "1.4.1", features = ["v4", "fast-rng"] }

crates/runtime_http/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
v8 = "0.74.2"
7+
v8 = "0.74.3"
88
hyper = { version = "0.14.27", features = ["client", "http1", "http2", "tcp"] }
99
anyhow = "1.0.72"
1010
lagon-runtime-v8-utils = { path = "../runtime_v8_utils" }

crates/runtime_isolate/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
v8 = "0.74.2"
7+
v8 = "0.74.3"
88
tokio = { version = "1", features = ["rt-multi-thread"] }
99
futures = "0.3.28"
1010
hyper = { version = "0.14.27", features = ["client"] }

crates/runtime_v8_utils/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
v8 = "0.74.2"
7+
v8 = "0.74.3"
88
anyhow = "1.0.72"
99
hyper = "0.14.27"

docker/Dockerfile.dashboard

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20.4.0-bullseye-slim AS base
1+
FROM node:20.5.0-bullseye-slim AS base
22
RUN corepack enable
33
WORKDIR /app
44

docker/Dockerfile.serverless

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FROM chef AS planner
55
COPY . .
66
RUN cargo chef prepare --recipe-path recipe.json
77

8-
FROM node:20.4.0-bullseye-slim as js-runtime
8+
FROM node:20.5.0-bullseye-slim as js-runtime
99
WORKDIR /app
1010
COPY ./packages/js-runtime/src/ ./src
1111
COPY ./packages/js-runtime/package.json ./

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
"lint-staged": {
2020
"*.{ts,tsx}": "eslint --fix"
2121
},
22-
"packageManager": "pnpm@8.6.9",
22+
"packageManager": "pnpm@8.6.10",
2323
"engines": {
2424
"node": ">=16.0.0",
2525
"pnpm": ">=8.0.0"
2626
},
2727
"devDependencies": {
2828
"@changesets/changelog-github": "^0.4.8",
2929
"@changesets/cli": "^2.26.1",
30-
"@typescript-eslint/eslint-plugin": "^5.59.11",
31-
"@typescript-eslint/parser": "^5.59.11",
32-
"@typescript-eslint/typescript-estree": "^5.59.11",
30+
"@typescript-eslint/eslint-plugin": "^6.2.0",
31+
"@typescript-eslint/parser": "^6.2.0",
32+
"@typescript-eslint/typescript-estree": "^6.2.0",
3333
"c8": "^8.0.0",
3434
"esbuild": "^0.18.7",
3535
"eslint": "^8.38.0",
@@ -38,7 +38,7 @@
3838
"prettier": "^3.0.0",
3939
"prettier-plugin-tailwindcss": "^0.4.1",
4040
"tsup": "^7.1.0",
41-
"turbo": "^1.10.9",
41+
"turbo": "^1.10.11",
4242
"typescript": "^5.1.3",
4343
"vitest": "^0.33.0"
4444
}

packages/dashboard/lib/api/organizations.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ export async function checkCanAddMember({ organizationId, plan }: { organization
8383
});
8484

8585
// We add 1 because the owner isn't counted in the members
86-
// if (organizationMembers + 1 >= plan.organizationMembers) {
87-
// throw new TRPCError({
88-
// code: 'BAD_REQUEST',
89-
// message: `You can only have ${plan.organizationMembers} Members per Organization in your current plan`,
90-
// });
91-
// }
86+
if (organizationMembers + 1 >= plan.organizationMembers) {
87+
throw new TRPCError({
88+
code: 'BAD_REQUEST',
89+
message: `You can only have ${plan.organizationMembers} Members per Organization in your current plan`,
90+
});
91+
}
9292
}

packages/dashboard/lib/pages/function/FunctionDeployments.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { trpc } from 'lib/trpc';
66
import useFunction from 'lib/hooks/useFunction';
77
import { QueryObserverBaseResult } from '@tanstack/react-query';
88
import { useScopedI18n } from 'locales';
9-
import cronstrue from 'cronstrue';
109

1110
type FunctionDeploymentsProps = {
1211
func: ReturnType<typeof useFunction>['data'];

packages/dashboard/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@prisma/client": "^5.0.0",
2424
"@radix-ui/react-alert-dialog": "^1.0.0",
2525
"@radix-ui/react-tabs": "^1.0.0",
26-
"@react-email/button": "^0.0.9",
26+
"@react-email/button": "^0.0.10",
2727
"@react-email/container": "0.0.8",
2828
"@react-email/head": "^0.0.5",
2929
"@react-email/hr": "^0.0.5",

packages/integrations/astro/src/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { AstroAdapter, AstroIntegration } from 'astro';
1+
import type { AstroAdapter, AstroConfig, AstroIntegration } from 'astro';
22
import esbuild from 'esbuild';
33
import * as fs from 'node:fs/promises';
44
import * as path from 'node:path';
@@ -19,7 +19,8 @@ export function getAdapter(args?: Options): AstroAdapter {
1919
}
2020

2121
export default function createIntegration(args?: Options): AstroIntegration {
22-
let _buildConfig: any;
22+
let _buildConfig: AstroConfig['build'];
23+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2324
let _vite: any;
2425
return {
2526
name: '@lagon/astro',

packages/integrations/remix/src/handler.ts

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export function createRequestHandler({ build, mode }: { build: ServerBuild; mode
88
return async (request: Request) => {
99
try {
1010
return handleRequest(request);
11+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1112
} catch (e: any) {
1213
if (process.env.NODE_ENV === 'development') {
1314
return new Response(e.message || e.toString(), {

packages/js-runtime/src/runtime/encoding/TextEncoder.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
globalThis.TextEncoder = class {
44
readonly encoding = 'utf-8';
55

6+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
67
encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult {
78
// TODO
89
throw new Error('Not implemented');

packages/js-runtime/src/runtime/global/file.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
// @ts-ignore
2020
globalThis.FileReader = class extends EventTarget {
2121
readonly error: DOMException | null = null;
22-
onabort: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null = null;
23-
onerror: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null = null;
24-
onload: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null = null;
25-
onloadend: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null = null;
26-
onloadstart: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null = null;
27-
onprogress: ((this: FileReader, ev: ProgressEvent<FileReader>) => any) | null = null;
22+
onabort: ((this: FileReader, ev: ProgressEvent<FileReader>) => unknown) | null = null;
23+
onerror: ((this: FileReader, ev: ProgressEvent<FileReader>) => unknown) | null = null;
24+
onload: ((this: FileReader, ev: ProgressEvent<FileReader>) => unknown) | null = null;
25+
onloadend: ((this: FileReader, ev: ProgressEvent<FileReader>) => unknown) | null = null;
26+
onloadstart: ((this: FileReader, ev: ProgressEvent<FileReader>) => unknown) | null = null;
27+
onprogress: ((this: FileReader, ev: ProgressEvent<FileReader>) => unknown) | null = null;
2828
readonly readyState: number = FileReader.EMPTY;
2929
readonly result: string | ArrayBuffer | null = null;
3030

@@ -55,6 +55,7 @@
5555
this.read(blob.text(), btoa);
5656
}
5757

58+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
5859
readAsText(blob: Blob, encoding?: string) {
5960
this.read(blob.text());
6061
}

packages/js-runtime/src/runtime/http/FormData.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
}
3636
}
3737

38-
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any) {
38+
forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: unknown) {
3939
this.fields.forEach((values, key) => {
4040
values.forEach(value => {
4141
callbackfn.call(thisArg, value, key, this);

packages/js-runtime/src/runtime/http/Headers.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
(globalThis => {
22
const SET_COOKIE = 'set-cookie';
33
const CONTENT_TYPE = 'content-type';
4-
// eslint-disable-next-line no-control-regex
5-
const NORMALIZE_VALUE_REGEX = new RegExp('^[\x0A\x0D\x09\x20]+|[\x0A\x0D\x09\x20]+$', 'g');
64

75
globalThis.Headers = class {
86
private h: [string, string][] = [];
@@ -157,7 +155,7 @@
157155
}
158156
}
159157

160-
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) {
158+
forEach(callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: unknown) {
161159
for (const [key, value] of this.entries()) {
162160
callbackfn.call(thisArg, value, key, this);
163161
}

packages/js-runtime/src/runtime/http/URL.ts

+2
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@
7070
}
7171
}
7272

73+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7374
static createObjectURL(obj: Blob): string {
7475
// TODO
7576
throw new Error('Not implemented');
7677
}
7778

79+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
7880
static revokeObjectURL(url: string) {
7981
// TODO
8082
throw new Error('Not implemented');

packages/js-runtime/src/runtime/http/URLSearchParams.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
}
156156
}
157157

158-
forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any) {
158+
forEach(callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: unknown) {
159159
for (const [name, value] of this.list) {
160160
callbackfn.call(thisArg, value, name, this);
161161
}

packages/ui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@storybook/testing-library": "^0.2.0",
3131
"@types/react": "^18.0.9",
3232
"autoprefixer": "^10.4.7",
33-
"class-variance-authority": "^0.6.0",
33+
"class-variance-authority": "^0.7.0",
3434
"final-form": "^4.20.7",
3535
"next": "13.4.12",
3636
"postcss": "^8.4.22",

packages/ui/src/components/Form/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ type FormProps = {
88
onSubmit: FinalFormFormProps['onSubmit'];
99
onSubmitSuccess: FinalFormFormProps['onSubmit'];
1010
onSubmitError?: FinalFormFormProps['onSubmit'];
11+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1112
children: ReactNode | (({ form, values }: { form: FormApi; values: Record<string, any> }) => ReactNode);
1213
};
1314

0 commit comments

Comments
 (0)