Skip to content

Commit a8a1b31

Browse files
authored
Update UI for new service modify behaviour (#348)
Signed-off-by: Nik Nasr <[email protected]>
1 parent db4cf75 commit a8a1b31

File tree

90 files changed

+2517
-602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2517
-602
lines changed

apps/web-ui/app/root.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@ import {
2323
HealthCheckNotification,
2424
HealthIndicator,
2525
} from '@restate/features/health';
26-
import {
27-
DeleteDeployment,
28-
DeploymentDetails,
29-
ServicePlayground,
30-
ServiceDetails,
31-
SERVICE_PLAYGROUND_QUERY_PARAM,
32-
SERVICE_QUERY_PARAM,
33-
DEPLOYMENT_QUERY_PARAM,
34-
} from '@restate/features/overview-route';
3526
import { Spinner } from '@restate/ui/loading';
3627
import {
3728
InvocationActions,
@@ -46,6 +37,17 @@ import {
4637
import { EditState } from '@restate/features/edit-state';
4738
import { FeatureFlags } from '@restate/util/feature-flag';
4839
import { QueryClient } from '@tanstack/react-query';
40+
import {
41+
DEPLOYMENT_QUERY_PARAM,
42+
DeleteDeployment,
43+
} from '@restate/features/deployment';
44+
import {
45+
SERVICE_PLAYGROUND_QUERY_PARAM,
46+
SERVICE_QUERY_PARAM,
47+
ServicePlayground,
48+
} from '@restate/features/service';
49+
import { DeploymentDetails } from '@restate/features/deployment-details';
50+
import { EditService, ServiceDetails } from '@restate/features/service-details';
4951

5052
export const links: LinksFunction = () => [
5153
// TODO: move to the its own lib
@@ -242,6 +244,7 @@ export default function App() {
242244
<ServicePlayground />
243245
<InvocationPanel />
244246
<StatePanel />
247+
<EditService />
245248
<InvocationActions />
246249
<Support />
247250
</EditState>

libs/data-access/admin-api/src/lib/api/type.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,12 @@ export function getEndpoint(deployment?: Deployment) {
104104
return deployment.arn;
105105
}
106106
}
107+
export function getProtocolType(deployment?: Deployment) {
108+
if (!deployment) {
109+
return undefined;
110+
}
111+
if (isHttpDeployment(deployment)) {
112+
return deployment.protocol_type;
113+
}
114+
return 'RequestResponse';
115+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"presets": [
3+
[
4+
"@nx/react/babel",
5+
{
6+
"runtime": "automatic",
7+
"useBuiltIns": "usage"
8+
}
9+
]
10+
],
11+
"plugins": []
12+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# deployment-details
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Running unit tests
6+
7+
Run `nx test deployment-details` to execute the unit tests via [Vitest](https://vitest.dev/).
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const nx = require('@nx/eslint-plugin');
2+
const baseConfig = require('../../../eslint.config.js');
3+
4+
module.exports = [
5+
...baseConfig,
6+
...nx.configs['flat/react'],
7+
{
8+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
9+
// Override or add rules here
10+
rules: {},
11+
},
12+
];
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "deployment-details",
3+
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "libs/features/deployment-details/src",
5+
"projectType": "library",
6+
"tags": [],
7+
"// targets": "to see all targets run: nx show project deployment-details --web",
8+
"targets": {}
9+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './lib/DeploymentDetails';

libs/features/overview-route/src/lib/Details/Deployment.tsx renamed to libs/features/deployment-details/src/lib/DeploymentDetails.tsx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import {
55
ComplementaryFooter,
66
useParamValue,
77
} from '@restate/ui/layout';
8-
import {
9-
DELETE_DEPLOYMENT_QUERY_PARAM,
10-
DEPLOYMENT_QUERY_PARAM,
11-
} from '../constants';
128
import { useSearchParams } from 'react-router';
139
import { Section, SectionContent, SectionTitle } from '@restate/ui/section';
1410
import { Icon, IconName } from '@restate/ui/icons';
@@ -17,18 +13,23 @@ import {
1713
getEndpoint,
1814
isHttpDeployment,
1915
isLambdaDeployment,
16+
getProtocolType,
2017
} from '@restate/data-access/admin-api';
2118
import { InlineTooltip, TruncateWithTooltip } from '@restate/ui/tooltip';
22-
import { MiniService } from '../MiniService';
2319
import {
2420
ProtocolTypeExplainer,
2521
ServiceCompatibility,
2622
} from '@restate/features/explainers';
2723
import { ErrorBanner } from '@restate/ui/error';
2824
import { Copy } from '@restate/ui/copy';
2925
import { Badge } from '@restate/ui/badge';
30-
import { SDK } from './SDK';
3126
import { useDeploymentDetails } from '@restate/data-access/admin-api-hooks';
27+
import { MiniService } from '@restate/features/service';
28+
import {
29+
DEPLOYMENT_QUERY_PARAM,
30+
DELETE_DEPLOYMENT_QUERY_PARAM,
31+
SDK,
32+
} from '@restate/features/deployment';
3233

3334
export function DeploymentDetails() {
3435
return (
@@ -270,13 +271,3 @@ function Header({ name, value }: { name: string; value: string }) {
270271
</div>
271272
);
272273
}
273-
274-
function getProtocolType(deployment?: Deployment) {
275-
if (!deployment) {
276-
return undefined;
277-
}
278-
if (isHttpDeployment(deployment)) {
279-
return deployment.protocol_type;
280-
}
281-
return 'RequestResponse';
282-
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"jsx": "react-jsx",
4+
"allowJs": false,
5+
"esModuleInterop": false,
6+
"allowSyntheticDefaultImports": true,
7+
"strict": true
8+
},
9+
"files": [],
10+
"include": [],
11+
"references": [
12+
{
13+
"path": "./tsconfig.lib.json"
14+
},
15+
{
16+
"path": "./tsconfig.spec.json"
17+
}
18+
],
19+
"extends": "../../../tsconfig.base.json"
20+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../../dist/out-tsc",
5+
"types": [
6+
"node",
7+
"@nx/react/typings/cssmodule.d.ts",
8+
"@nx/react/typings/image.d.ts",
9+
"../../../@types/global-env.d.ts"
10+
]
11+
},
12+
"exclude": [
13+
"**/*.spec.ts",
14+
"**/*.test.ts",
15+
"**/*.spec.tsx",
16+
"**/*.test.tsx",
17+
"**/*.spec.js",
18+
"**/*.test.js",
19+
"**/*.spec.jsx",
20+
"**/*.test.jsx",
21+
"vite.config.ts",
22+
"vite.config.mts",
23+
"vitest.config.ts",
24+
"vitest.config.mts",
25+
"src/**/*.test.ts",
26+
"src/**/*.spec.ts",
27+
"src/**/*.test.tsx",
28+
"src/**/*.spec.tsx",
29+
"src/**/*.test.js",
30+
"src/**/*.spec.js",
31+
"src/**/*.test.jsx",
32+
"src/**/*.spec.jsx"
33+
],
34+
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
35+
}

0 commit comments

Comments
 (0)