Commit e9afdac 1 parent 66e28b4 commit e9afdac Copy full SHA for e9afdac
File tree 7 files changed +33
-27
lines changed
7 files changed +33
-27
lines changed Original file line number Diff line number Diff line change 2
2
Alert ,
3
3
Button ,
4
4
Card ,
5
- Divider , Flex ,
5
+ Divider ,
6
+ Flex ,
6
7
PasswordInput ,
7
8
Stack ,
8
9
Text ,
Original file line number Diff line number Diff line change
1
+ import fs from 'fs' ;
1
2
import { GetServerSidePropsContext , InferGetServerSidePropsType } from 'next' ;
3
+ import { env } from 'process' ;
2
4
import { z } from 'zod' ;
3
5
import { Dashboard } from '~/components/Dashboard/Dashboard' ;
4
6
import { BoardLayout } from '~/components/layout/Templates/BoardLayout' ;
@@ -11,12 +13,10 @@ import { getServerSideTranslations } from '~/tools/server/getServerSideTranslati
11
13
import { checkForSessionOrAskForLogin } from '~/tools/server/loginBuilder' ;
12
14
import { boardNamespaces } from '~/tools/server/translation-namespaces' ;
13
15
import { api } from '~/utils/api' ;
14
- import { env } from 'process' ;
15
- import fs from 'fs' ;
16
16
17
17
export default function BoardPage ( {
18
18
config : initialConfig ,
19
- isDockerEnabled : isDockerEnabled
19
+ isDockerEnabled : isDockerEnabled ,
20
20
} : InferGetServerSidePropsType < typeof getServerSideProps > ) {
21
21
useInitConfig ( initialConfig ) ;
22
22
@@ -65,7 +65,8 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
65
65
return result ;
66
66
}
67
67
68
- const isDockerEnabled : boolean = ! ! env . DOCKER_HOST || ! ! env . DOCKER_PORT || fs . existsSync ( '/var/run/docker.sock' ) ;
68
+ const isDockerEnabled : boolean =
69
+ ! ! env . DOCKER_HOST || ! ! env . DOCKER_PORT || fs . existsSync ( '/var/run/docker.sock' ) ;
69
70
70
71
return {
71
72
props : {
Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
46
46
return result ;
47
47
}
48
48
49
- const isDockerEnabled : boolean = ! ! env . DOCKER_HOST || ! ! env . DOCKER_PORT || fs . existsSync ( '/var/run/docker.sock' ) ;
49
+ const isDockerEnabled : boolean =
50
+ ! ! env . DOCKER_HOST || ! ! env . DOCKER_PORT || fs . existsSync ( '/var/run/docker.sock' ) ;
50
51
51
52
return {
52
53
props : {
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ type InferrableSearchOptions<
20
20
type SearchResultIndex < Attributes extends AttributeConstraint > = Attributes extends string
21
21
? Attributes
22
22
: Attributes extends readonly string [ ]
23
- ? Attributes [ number ]
24
- : string ;
23
+ ? Attributes [ number ]
24
+ : string ;
25
25
26
26
type SearchResult <
27
27
Attributes extends AttributeConstraint ,
Original file line number Diff line number Diff line change @@ -99,9 +99,9 @@ export function Editor({ widget }: { widget: INotebookWidget }) {
99
99
addAttributes ( ) {
100
100
return {
101
101
...this . parent ?.( ) ,
102
- target : { default : null }
103
- }
104
- }
102
+ target : { default : null } ,
103
+ } ;
104
+ } ,
105
105
} ) ,
106
106
StarterKit ,
107
107
Table . configure ( {
Original file line number Diff line number Diff line change @@ -68,19 +68,22 @@ function EntityStateTile({ widget }: SmartHomeEntityStateWidgetProps) {
68
68
}
69
69
) ;
70
70
71
- const attribute = ( widget . properties . appendUnit && data ?. attributes . unit_of_measurement ?
72
- " " + data ?. attributes . unit_of_measurement : ""
73
- )
74
-
75
- const displayName = ( widget . properties . displayFriendlyName && data ?. attributes . friendly_name ?
76
- data ?. attributes . friendly_name : widget . properties . displayName
77
- )
78
-
79
- const { mutateAsync : mutateTriggerAutomationAsync } = api . smartHomeEntityState . triggerAutomation . useMutation ( {
80
- onSuccess : ( ) => {
81
- void utils . smartHomeEntityState . invalidate ( ) ;
82
- } ,
83
- } ) ;
71
+ const attribute =
72
+ widget . properties . appendUnit && data ?. attributes . unit_of_measurement
73
+ ? ' ' + data ?. attributes . unit_of_measurement
74
+ : '' ;
75
+
76
+ const displayName =
77
+ widget . properties . displayFriendlyName && data ?. attributes . friendly_name
78
+ ? data ?. attributes . friendly_name
79
+ : widget . properties . displayName ;
80
+
81
+ const { mutateAsync : mutateTriggerAutomationAsync } =
82
+ api . smartHomeEntityState . triggerAutomation . useMutation ( {
83
+ onSuccess : ( ) => {
84
+ void utils . smartHomeEntityState . invalidate ( ) ;
85
+ } ,
86
+ } ) ;
84
87
85
88
const handleClick = async ( ) => {
86
89
if ( ! widget . properties . automationId ) {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ describe('login page', () => {
40
40
_i18Next : 'hello' ,
41
41
oidcAutoLogin : null ,
42
42
oidcProviderName : null ,
43
- providers : undefined
43
+ providers : undefined ,
44
44
} ,
45
45
} ) ;
46
46
@@ -80,7 +80,7 @@ describe('login page', () => {
80
80
_i18Next : 'hello' ,
81
81
oidcAutoLogin : null ,
82
82
oidcProviderName : null ,
83
- providers : undefined
83
+ providers : undefined ,
84
84
} ,
85
85
} ) ;
86
86
@@ -120,7 +120,7 @@ describe('login page', () => {
120
120
_i18Next : 'hello' ,
121
121
oidcAutoLogin : null ,
122
122
oidcProviderName : null ,
123
- providers : undefined
123
+ providers : undefined ,
124
124
} ,
125
125
} ) ;
126
126
You can’t perform that action at this time.
0 commit comments