Skip to content

Commit

Permalink
fix: fix workflow file and prettier issue
Browse files Browse the repository at this point in the history
  • Loading branch information
EiffelFly committed Jul 23, 2024
1 parent 7a3f7c9 commit f6d264a
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 29 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/sdk-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
with:
version: 9
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
Expand All @@ -47,6 +47,6 @@ jobs:

- name: generate mock servers
run: pnpm gen-mocks ${{ inputs.protobuf-branch }}

- name: Run integration tests
run: pnpm test
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const StatefulToggleField = (props: StatefulToggleFieldProps) => {
additionalMessageOnLabel={
state === "STATE_LOADING"
? loadingLabelText
: additionalMessageOnLabel ?? null
: (additionalMessageOnLabel ?? null)
}
description={description ?? ""}
error={error ?? null}
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/components/top-bar/AppTopbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const AppTopbar = ({
</svg>

{me.isSuccess ? (
namespaceSwitch ?? <NamespaceSwitch />
(namespaceSwitch ?? <NamespaceSwitch />)
) : (
<Button
onClick={() => {
Expand Down
6 changes: 3 additions & 3 deletions packages/toolkit/src/components/top-bar/NamespaceSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ export const NamespaceSwitch = () => {
}

return namespacesWithRemainingCredit.length === 0
? namespaces.find((e) => e.id === navigationNamespaceAnchor) ?? null
: namespacesWithRemainingCredit.find(
? (namespaces.find((e) => e.id === navigationNamespaceAnchor) ?? null)
: (namespacesWithRemainingCredit.find(
(e) => e.id === navigationNamespaceAnchor,
) ?? null;
) ?? null);
}, [namespacesWithRemainingCredit, namespaces, navigationNamespaceAnchor]);

// This is to deal with user entering their own setting page, we should
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const CredentialTextField = ({
)}
type="text"
value={
typeof field.value === "object" ? "" : field.value ?? ""
typeof field.value === "object" ? "" : (field.value ?? "")
}
autoComplete="off"
onChange={(e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ export const SingleSelectField = ({
field.onChange(e);
}}
// Sometime airbyte will put "" in their enum, this will break Radix select
value={field.value === "" ? undefined : field.value ?? undefined}
value={
field.value === "" ? undefined : (field.value ?? undefined)
}
disabled={disabled}
>
<Form.Control>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export const TextAreaField = ({
// its value is a string But for foo field its value is a object.
// And some time the foo field is not a object field but a string field,
// we need to deal with it
value={typeof field.value === "object" ? "" : field.value ?? ""}
value={
typeof field.value === "object" ? "" : (field.value ?? "")
}
autoComplete="off"
onChange={(e) => {
field.onChange(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const TextField = ({
)}
type="text"
value={
typeof field.value === "object" ? "" : field.value ?? ""
typeof field.value === "object" ? "" : (field.value ?? "")
}
autoComplete="off"
onChange={(e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export const TextArea = ({
)}
ref={inputRef}
value={
typeof field.value === "object" ? "" : field.value ?? ""
typeof field.value === "object" ? "" : (field.value ?? "")
}
autoComplete="off"
onChange={(e) => {
Expand Down Expand Up @@ -243,7 +243,7 @@ export const TextArea = ({
"${" +
`secret.${InstillCredit.key}` +
"}. You can still bring your own key by input ${secret.your_secret}"
: shortDescription ?? null
: (shortDescription ?? null)
}
/>
<Form.Message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ export const TextField = ({
}}
type="text"
value={
typeof field.value === "object" ? "" : field.value ?? ""
typeof field.value === "object"
? ""
: (field.value ?? "")
}
className={cn(
"nodrag nowheel placeholder:text-semantic-fg-disabled",
Expand Down Expand Up @@ -255,7 +257,7 @@ export const TextField = ({
"${" +
`secret.${InstillCredit.key}` +
"}. You can still bring your own key by input ${secret.your_secret}"
: shortDescription ?? null
: (shortDescription ?? null)
}
/>
<Form.Message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function pickComponentOutputFieldsFromInstillFormTree(
}
} else if (tree._type === "formItem") {
if (tree.path) {
propertyValue = data ? dot.getter(data, tree.path) ?? null : null;
propertyValue = data ? (dot.getter(data, tree.path) ?? null) : null;
}
} else if (tree._type === "arrayArray") {
if (tree.fieldKey) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ export function pickRegularFieldsFromInstillFormTree(
disabled={disabledAll}
description={
selectedConstField
? selectedConstField.description ?? null
: defaultCondition.description ?? null
? (selectedConstField.description ?? null)
: (defaultCondition.description ?? null)
}
size={size}
isHidden={tree.isHidden}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const ModelHubListPageMainView = () => {
</div>
<ModelsList
models={
models.isSuccess ? models.data.pages[pageNumber]?.models ?? [] : []
models.isSuccess ? (models.data.pages[pageNumber]?.models ?? []) : []
}
onModelDelete={models.refetch}
isLoading={isLoadingResource}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export const Share = () => {
id={routeInfo.data.resourceId}
ownerDisplayName={
"user" in pipeline.data.owner
? pipeline.data.owner.user.profile?.displayName ?? null
: pipeline.data.owner.organization.profile?.displayName ?? null
? (pipeline.data.owner.user.profile?.displayName ?? null)
: (pipeline.data.owner.organization.profile?.displayName ?? null)
}
/>
) : null}
Expand Down
4 changes: 2 additions & 2 deletions packages/toolkit/src/view/pipeline/view-pipeline/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export const Menu = ({ pipeline, handleDeletePipeline }: MenuProps) => {
id={routeInfo.data.resourceId}
ownerDisplayName={
"user" in pipeline.owner
? pipeline.owner.user.profile?.displayName ?? null
: pipeline.owner.organization.profile?.displayName ?? null
? (pipeline.owner.user.profile?.displayName ?? null)
: (pipeline.owner.organization.profile?.displayName ?? null)
}
/>
<PublishPipelineDialog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export const PipelinePreview = ({
<ReadOnlyPipelineBuilder
ref={onMount}
pipelineName={pipeline?.name || null}
recipe={activeRelease ? activeRelease.recipe : pipeline?.recipe ?? null}
recipe={activeRelease ? activeRelease.recipe : (pipeline?.recipe ?? null)}
metadata={
activeRelease ? activeRelease.metadata : pipeline?.metadata ?? null
activeRelease ? activeRelease.metadata : (pipeline?.metadata ?? null)
}
className="min-h-80 w-full"
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const ViewPipelines = () => {
<PipelinesList
pipelines={
pipelines.isSuccess
? pipelines.data.pages[pageNumber]?.pipelines ?? []
? (pipelines.data.pages[pageNumber]?.pipelines ?? [])
: []
}
onPipelineDelete={pipelines.refetch}
Expand Down

0 comments on commit f6d264a

Please sign in to comment.