-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
674694c
commit 931488a
Showing
43 changed files
with
619 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
// Place your opensource workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | ||
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | ||
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | ||
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | ||
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | ||
// Placeholders with the same ids are connected. | ||
// Example: | ||
"component styles": { | ||
"scope": "typescript,typescriptreact", | ||
"prefix": "styles snippet", | ||
"body": [ | ||
"import type { StyletronCSSObject, StyletronCSSObjectOf } from \"@/hooks/useStyletronClasses\";", | ||
"const cssStylesObj = {", | ||
" ${1:classname}: (theme) => ({", | ||
" $2", | ||
" }),", | ||
"} satisfies StyletronCSSObject;", | ||
"", | ||
"export const cssStyles: StyletronCSSObjectOf<typeof cssStylesObj> = cssStylesObj;" | ||
], | ||
"description": "Create base structure for component styletron styles", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,3 @@ | ||
import DomainPage from "@/containers/domains-page/domains-page"; | ||
import type { DomainData } from "@/containers/domains-page/domains-page.types"; | ||
import grpcClient from "@/utils/grpc-client"; | ||
import { unstable_cache } from "next/cache"; | ||
|
||
const getCachedDomains = unstable_cache( | ||
async () => grpcClient.listDomains({}), | ||
['cluster-domains'], | ||
{ revalidate: 60 } | ||
); | ||
|
||
export default async function Domains() { | ||
const { domains } = await getCachedDomains() as { domains: Array<DomainData> } | ||
return ( | ||
<DomainPage domains={domains} /> | ||
); | ||
} | ||
export default DomainPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import DomainPage from "@/containers/domains-page/domains-page"; | ||
|
||
export default DomainPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,29 @@ | ||
"use client" | ||
import { HeadingXSmall } from "baseui/typography"; | ||
import { ThemeConsumer, styled } from "baseui"; | ||
import AlertIcon from "baseui/icon/alert"; | ||
|
||
const StyledContainer = styled('div', ({ $theme }) => { | ||
return { | ||
flex: 1, | ||
display: "flex", | ||
flexDirection: "column", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
gap: $theme.sizing.scale800, | ||
padding: `${$theme.sizing.scale900} ${$theme.sizing.scale600}`, | ||
}; | ||
}); | ||
|
||
export default function HomePageError({ | ||
error | ||
}: Readonly<{ | ||
error: Error; | ||
}>) { | ||
return ( | ||
<div> | ||
A problem {error.message} | ||
</div> | ||
<StyledContainer> | ||
<AlertIcon size={64} /> | ||
<HeadingXSmall>Something went wrong</HeadingXSmall> | ||
</StyledContainer> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"use client" | ||
import { ProgressBar, ProgressBarOverrides } from "baseui/progress-bar"; | ||
|
||
const progressOverrides = { | ||
BarContainer: { | ||
style: { margin: 0 } | ||
} | ||
} satisfies ProgressBarOverrides; | ||
|
||
export default function HomePageLoading() { | ||
return ( | ||
<ProgressBar overrides={progressOverrides} infinite /> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/components/section-loading-indicator/section-loading-indicator.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { StyletronCSSObject, StyletronCSSObjectOf } from "@/hooks/useStyletronClasses"; | ||
|
||
const cssStylesObj = { | ||
spinnerContainer: (theme) => ({ | ||
padding: `${theme.sizing.scale1200} 0px`, | ||
display: "flex", | ||
alignItems: "center", | ||
justifyContent: "center" | ||
}), | ||
} satisfies StyletronCSSObject; | ||
|
||
export const cssStyles: StyletronCSSObjectOf<typeof cssStylesObj> = cssStylesObj; |
14 changes: 14 additions & 0 deletions
14
src/components/section-loading-indicator/section-loading-indicator.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"use client"; | ||
import useStyletronClasses from "@/hooks/useStyletronClasses"; | ||
import { Spinner, SIZE, type SpinnerProps } from "baseui/spinner"; | ||
import { cssStyles } from "./section-loading-indicator.styles"; | ||
|
||
export default function SectionLoadingIndicator(props: SpinnerProps) { | ||
const { cls } = useStyletronClasses(cssStyles); | ||
|
||
return ( | ||
<div className={cls.spinnerContainer}> | ||
<Spinner $size={props.$size || SIZE.medium} /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const envClusterNames = process.env.CADENCE_CLUSTERS_NAMES; | ||
|
||
const CLUSTER_NAMES: Array<string> = envClusterNames ? envClusterNames.split(',').filter((c) => Boolean(c.trim())).map((c) => c.trim()) : ['default']; | ||
|
||
export default CLUSTER_NAMES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import GRPC_PEERS from "../grpc/grpc-peers"; | ||
import GRPC_SERVICES_NAMES from "../grpc/grpc-services-names"; | ||
import CLUSTER_NAMES from "./cluster-names"; | ||
import { ClusterConfig, ClustersConfigs } from "./clusters-configs.types"; | ||
|
||
const configsHasSameLength = [GRPC_PEERS, GRPC_SERVICES_NAMES].every((config) => config.length === CLUSTER_NAMES.length) | ||
if (!configsHasSameLength) throw new Error('Failed to build cluster configuration: cluster names, grpc peers & service names count doesn\'t match'); | ||
|
||
const CLUSTERS_CONFIGS: ClustersConfigs = CLUSTER_NAMES.map((clusterName, i) => { | ||
return { | ||
clusterName: clusterName, | ||
grpc: { | ||
peer: GRPC_PEERS[i], | ||
serviceName: GRPC_SERVICES_NAMES[i], | ||
metadata: {}, | ||
}, | ||
|
||
} satisfies ClusterConfig | ||
}) | ||
|
||
|
||
export default CLUSTERS_CONFIGS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { GRPCRequestConfig, GRPCServiceConfig } from "@/utils/grpc/grpc-service"; | ||
|
||
export type ClusterConfig = { | ||
clusterName: string; | ||
grpc: GRPCRequestConfig & Pick<GRPCServiceConfig, "peer">; | ||
} | ||
|
||
export type ClustersConfigs = Array<ClusterConfig>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const envPeers = process.env.CADENCE_GRPC_PEERS; | ||
|
||
const GRPC_PEERS: Array<string> = envPeers ? envPeers.split(',').filter((p) => Boolean(p.trim())).map((p) => p.trim()) : ['127.0.0.1:7933']; | ||
|
||
|
||
export default GRPC_PEERS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const GRPC_PROTO_DIR_BASE_PATH = 'src/idl/proto'; | ||
|
||
export default GRPC_PROTO_DIR_BASE_PATH; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const GRPC_SERVICES_CONFIGS = { | ||
adminServiceConfig: { | ||
schemaPath: 'uber/cadence/admin/v1/service.proto', | ||
servicePath: 'uber.cadence.admin.v1.AdminAPI', | ||
}, | ||
domainServiceConfig: { | ||
schemaPath: 'uber/cadence/api/v1/service_domain.proto', | ||
servicePath: 'uber.cadence.api.v1.DomainAPI', | ||
}, | ||
visibilityServiceConfig: { | ||
schemaPath: 'uber/cadence/api/v1/service_visibility.proto', | ||
servicePath: 'uber.cadence.api.v1.VisibilityAPI', | ||
}, | ||
workflowServiceConfig: { | ||
schemaPath: 'uber/cadence/api/v1/service_workflow.proto', | ||
servicePath: 'uber.cadence.api.v1.WorkflowAPI', | ||
}, | ||
}; | ||
|
||
export default GRPC_SERVICES_CONFIGS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
const envServicesNames = process.env.CADENCE_GRPC_SERVICES_NAMES; | ||
const GRPC_SERVICES_NAMES = envServicesNames ? envServicesNames.split(',').filter((s) => Boolean(s.trim())).map((s) => s.trim()) : ['cadence-frontend']; | ||
|
||
|
||
export default GRPC_SERVICES_NAMES; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.