Skip to content

Commit e9e2dd8

Browse files
authored
chore: update tasks to hightide version 0.1.18 (#1270)
* chore: update tasks to hightide version 0.1.8 * chore: update tasks to hightide version 0.1.10 and remove unused dependencies * chore: update tasks to hightide version 0.1.11 and update colum titles * feat: update and apply hightide 0.1.18
1 parent 668310e commit e9e2dd8

File tree

75 files changed

+1427
-1184
lines changed

Some content is hidden

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

75 files changed

+1427
-1184
lines changed

api-services/authentication/useAuth.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ export const ProvideAuth = ({ children }: PropsWithChildren) => {
112112
if (!user) throw new Error('Invalid fake token')
113113
try {
114114
OrganizationService.getForUser().then(organizations => {
115-
console.log(`Found ${organizations.length} organizations for fake token user`)
115+
console.debug(`Found ${organizations.length} organizations for fake token user`)
116116
if (organizations.length > 0) {
117117
const organization = organizations[0]!
118-
console.log(`Using ${organization.longName} for user.`, organization)
118+
console.debug(`Using ${organization.longName} for user.`, organization)
119119
setUser(() => ({
120120
...user,
121121
organization: {
@@ -126,7 +126,7 @@ export const ProvideAuth = ({ children }: PropsWithChildren) => {
126126
setToken(config.fakeToken)
127127
didInit.current = true
128128
} else {
129-
console.log('Creating a new organization')
129+
console.debug('Creating a new organization')
130130
OrganizationService.create({
131131
id: '',
132132

api-services/mutations/tasks/bed_mutations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const useBedCreateMutation = () => {
4343
const res = await APIServices.bed.createBed(req, getAuthenticatedGrpcMetadata())
4444

4545
if (!res.toObject()) {
46-
console.log('error in BedCreate')
46+
console.error('error in BedCreate')
4747
}
4848

4949
return { id: res.getId(), name: bed.name }

api-services/types/tasks/task.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { Translation } from '@helpwave/hightide'
2+
13
export type SubTaskDTO = {
24
id: string,
35
name: string,
@@ -8,7 +10,28 @@ export type CreateSubTaskDTO = SubTaskDTO & {
810
taskId?: string,
911
}
1012

11-
export type TaskStatus = 'done' | 'inProgress' | 'todo'
13+
const taskStatus = ['done', 'inProgress', 'todo'] as const
14+
15+
export type TaskStatus = typeof taskStatus[number]
16+
17+
export type TaskStatusTranslationType = Record<TaskStatus, string>
18+
19+
const taskStatusTranslation: Translation<TaskStatusTranslationType> = {
20+
en: {
21+
todo: 'Todo',
22+
inProgress: 'In Progress',
23+
done: 'Done'
24+
},
25+
de: {
26+
todo: 'Todo',
27+
inProgress: 'In Arbeit',
28+
done: 'Fertig'
29+
}
30+
}
31+
export const TaskStatusUtil = {
32+
taskStatus,
33+
translation: taskStatusTranslation
34+
}
1235

1336
export type TaskDTO = {
1437
id: string,

customer/api/auth/authService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ export const restoreSession = async (): Promise<User | undefined> => {
5050
// If access token is expired, refresh it
5151
if (user.expired) {
5252
try {
53-
console.log('Access token expired, refreshing...')
53+
console.debug('Access token expired, refreshing...')
5454
const refreshedUser = await renewToken()
5555
return refreshedUser ?? undefined
5656
} catch (error) {
57-
console.error('Silent token renewal failed', error)
57+
console.debug('Silent token renewal failed', error)
5858
return
5959
}
6060
}

customer/hooks/useAuth.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const AuthProvider = ({ children }: PropsWithChildren) => {
3232
isLoading: false,
3333
})
3434
onTokenExpiringCallback(async () => {
35-
console.log('Token expiring, refreshing...')
35+
console.debug('Token expiring, refreshing...')
3636
const identity = await renewToken()
3737
setAuthState({
3838
identity: identity ?? undefined,

customer/pages/auth/callback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const AuthCallback: NextPage<PropsForTranslation<AuthCallbackTranslation, AuthCa
4545
const checkAuthCallback = async () => {
4646
// Check if the URL contains OIDC callback params
4747
if (searchParams.get('code') && searchParams.get('state')) {
48-
console.log('Processing OIDC callback...')
48+
console.debug('Processing OIDC callback...')
4949
try {
5050
await handleCallback()
5151
const redirect = searchParams.get('redirect_uri')

pnpm-lock.yaml

Lines changed: 27 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/generate_boilerplate.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ const options = program.opts()
3434
const args = program.args
3535

3636
if(options.debug){
37-
console.log('options', options)
38-
console.log('args', args)
39-
console.log('execute location', process.env.INIT_CWD)
37+
console.debug('options', options)
38+
console.debug('args', args)
39+
console.debug('execute location', process.env.INIT_CWD)
4040
}
4141

4242

@@ -83,15 +83,15 @@ if (fs.existsSync(filePath) && !options.force) {
8383
console.error('Error creating directory:', err)
8484
process.exit(1)
8585
} else {
86-
console.log(`Directory ${dir} created successfully.`)
86+
console.debug(`Directory ${dir} created successfully.`)
8787
}
8888
})
8989
}
9090
fs.writeFile(filePath, file, (err) => {
9191
if (err) {
9292
console.error('Error writing to file:', err)
9393
} else {
94-
console.log(`File ${fileName} created successfully.`)
94+
console.info(`File ${fileName} created successfully.`)
9595
}
9696
})
9797
}

tasks/components/BedInRoomIndicator.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ export const BedInRoomIndicator =
4141
roomName,
4242
bedPosition
4343
}: PropsForTranslation<BedInRoomIndicatorTranslation, BedInRoomIndicatorProps>) => {
44-
const translation = useTranslation(defaultBedInRoomIndicatorTranslation, overwriteTranslation)
44+
const translation = useTranslation([defaultBedInRoomIndicatorTranslation], overwriteTranslation)
4545

4646
return (
4747
<div>
4848
{roomName !== undefined && (
4949
<span className="mb-1">
50-
{`${translation.bed} ${bedPosition + 1} ${translation.in} ${roomName}`}
50+
{`${translation('bed')} ${bedPosition + 1} ${translation('in')} ${roomName}`}
5151
</span>
5252
)}
5353
<div className="row gap-3">

0 commit comments

Comments
 (0)