Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
jbruell committed Feb 12, 2024
1 parent 66e28b4 commit e9afdac
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 27 deletions.
3 changes: 2 additions & 1 deletion src/pages/auth/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {
Alert,
Button,
Card,
Divider, Flex,
Divider,
Flex,
PasswordInput,
Stack,
Text,
Expand Down
9 changes: 5 additions & 4 deletions src/pages/board/[slug].tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import fs from 'fs';
import { GetServerSidePropsContext, InferGetServerSidePropsType } from 'next';
import { env } from 'process';
import { z } from 'zod';
import { Dashboard } from '~/components/Dashboard/Dashboard';
import { BoardLayout } from '~/components/layout/Templates/BoardLayout';
Expand All @@ -11,12 +13,10 @@ import { getServerSideTranslations } from '~/tools/server/getServerSideTranslati
import { checkForSessionOrAskForLogin } from '~/tools/server/loginBuilder';
import { boardNamespaces } from '~/tools/server/translation-namespaces';
import { api } from '~/utils/api';
import { env } from 'process';
import fs from 'fs';

export default function BoardPage({
config: initialConfig,
isDockerEnabled: isDockerEnabled
isDockerEnabled: isDockerEnabled,
}: InferGetServerSidePropsType<typeof getServerSideProps>) {
useInitConfig(initialConfig);

Expand Down Expand Up @@ -65,7 +65,8 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
return result;
}

const isDockerEnabled: boolean = !!env.DOCKER_HOST || !!env.DOCKER_PORT || fs.existsSync('/var/run/docker.sock');
const isDockerEnabled: boolean =
!!env.DOCKER_HOST || !!env.DOCKER_PORT || fs.existsSync('/var/run/docker.sock');

return {
props: {
Expand Down
3 changes: 2 additions & 1 deletion src/pages/board/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
return result;
}

const isDockerEnabled: boolean = !!env.DOCKER_HOST || !!env.DOCKER_PORT || fs.existsSync('/var/run/docker.sock');
const isDockerEnabled: boolean =
!!env.DOCKER_HOST || !!env.DOCKER_PORT || fs.existsSync('/var/run/docker.sock');

return {
props: {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/auth/ldap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type InferrableSearchOptions<
type SearchResultIndex<Attributes extends AttributeConstraint> = Attributes extends string
? Attributes
: Attributes extends readonly string[]
? Attributes[number]
: string;
? Attributes[number]
: string;

type SearchResult<
Attributes extends AttributeConstraint,
Expand Down
6 changes: 3 additions & 3 deletions src/widgets/notebook/NotebookEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ export function Editor({ widget }: { widget: INotebookWidget }) {
addAttributes() {
return {
...this.parent?.(),
target: { default: null }
}
}
target: { default: null },
};
},
}),
StarterKit,
Table.configure({
Expand Down
29 changes: 16 additions & 13 deletions src/widgets/smart-home/entity-state/entity-state.widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,22 @@ function EntityStateTile({ widget }: SmartHomeEntityStateWidgetProps) {
}
);

const attribute = (widget.properties.appendUnit && data?.attributes.unit_of_measurement ?
" " + data?.attributes.unit_of_measurement : ""
)

const displayName = (widget.properties.displayFriendlyName && data?.attributes.friendly_name ?
data?.attributes.friendly_name : widget.properties.displayName
)

const { mutateAsync: mutateTriggerAutomationAsync } = api.smartHomeEntityState.triggerAutomation.useMutation({
onSuccess: () => {
void utils.smartHomeEntityState.invalidate();
},
});
const attribute =
widget.properties.appendUnit && data?.attributes.unit_of_measurement
? ' ' + data?.attributes.unit_of_measurement
: '';

const displayName =
widget.properties.displayFriendlyName && data?.attributes.friendly_name
? data?.attributes.friendly_name
: widget.properties.displayName;

const { mutateAsync: mutateTriggerAutomationAsync } =
api.smartHomeEntityState.triggerAutomation.useMutation({
onSuccess: () => {
void utils.smartHomeEntityState.invalidate();
},
});

const handleClick = async () => {
if (!widget.properties.automationId) {
Expand Down
6 changes: 3 additions & 3 deletions tests/pages/auth/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('login page', () => {
_i18Next: 'hello',
oidcAutoLogin: null,
oidcProviderName: null,
providers: undefined
providers: undefined,
},
});

Expand Down Expand Up @@ -80,7 +80,7 @@ describe('login page', () => {
_i18Next: 'hello',
oidcAutoLogin: null,
oidcProviderName: null,
providers: undefined
providers: undefined,
},
});

Expand Down Expand Up @@ -120,7 +120,7 @@ describe('login page', () => {
_i18Next: 'hello',
oidcAutoLogin: null,
oidcProviderName: null,
providers: undefined
providers: undefined,
},
});

Expand Down

0 comments on commit e9afdac

Please sign in to comment.