Skip to content

chore: update tasks to hightide version 0.1.11 #1270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api-services/authentication/useAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ export const ProvideAuth = ({ children }: PropsWithChildren) => {
if (!user) throw new Error('Invalid fake token')
try {
OrganizationService.getForUser().then(organizations => {
console.log(`Found ${organizations.length} organizations for fake token user`)
console.debug(`Found ${organizations.length} organizations for fake token user`)
if (organizations.length > 0) {
const organization = organizations[0]!
console.log(`Using ${organization.longName} for user.`, organization)
console.debug(`Using ${organization.longName} for user.`, organization)
setUser(() => ({
...user,
organization: {
Expand All @@ -126,7 +126,7 @@ export const ProvideAuth = ({ children }: PropsWithChildren) => {
setToken(config.fakeToken)
didInit.current = true
} else {
console.log('Creating a new organization')
console.debug('Creating a new organization')
OrganizationService.create({
id: '',
email: '[email protected]',
Expand Down
2 changes: 1 addition & 1 deletion api-services/mutations/tasks/bed_mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const useBedCreateMutation = () => {
const res = await APIServices.bed.createBed(req, getAuthenticatedGrpcMetadata())

if (!res.toObject()) {
console.log('error in BedCreate')
console.error('error in BedCreate')
}

return { id: res.getId(), name: bed.name }
Expand Down
25 changes: 24 additions & 1 deletion api-services/types/tasks/task.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { Translation } from '@helpwave/hightide'

export type SubTaskDTO = {
id: string,
name: string,
Expand All @@ -8,7 +10,28 @@ export type CreateSubTaskDTO = SubTaskDTO & {
taskId?: string,
}

export type TaskStatus = 'done' | 'inProgress' | 'todo'
const taskStatus = ['done', 'inProgress', 'todo'] as const

export type TaskStatus = typeof taskStatus[number]

export type TaskStatusTranslationType = Record<TaskStatus, string>

const taskStatusTranslation: Translation<TaskStatusTranslationType> = {
en: {
todo: 'Todo',
inProgress: 'In Progress',
done: 'Done'
},
de: {
todo: 'Todo',
inProgress: 'In Arbeit',
done: 'Fertig'
}
}
export const TaskStatusUtil = {
taskStatus,
translation: taskStatusTranslation
}

export type TaskDTO = {
id: string,
Expand Down
4 changes: 2 additions & 2 deletions customer/api/auth/authService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ export const restoreSession = async (): Promise<User | undefined> => {
// If access token is expired, refresh it
if (user.expired) {
try {
console.log('Access token expired, refreshing...')
console.debug('Access token expired, refreshing...')
const refreshedUser = await renewToken()
return refreshedUser ?? undefined
} catch (error) {
console.error('Silent token renewal failed', error)
console.debug('Silent token renewal failed', error)
return
}
}
Expand Down
2 changes: 1 addition & 1 deletion customer/hooks/useAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const AuthProvider = ({ children }: PropsWithChildren) => {
isLoading: false,
})
onTokenExpiringCallback(async () => {
console.log('Token expiring, refreshing...')
console.debug('Token expiring, refreshing...')
const identity = await renewToken()
setAuthState({
identity: identity ?? undefined,
Expand Down
2 changes: 1 addition & 1 deletion customer/pages/auth/callback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const AuthCallback: NextPage<PropsForTranslation<AuthCallbackTranslation, AuthCa
const checkAuthCallback = async () => {
// Check if the URL contains OIDC callback params
if (searchParams.get('code') && searchParams.get('state')) {
console.log('Processing OIDC callback...')
console.debug('Processing OIDC callback...')
try {
await handleCallback()
const redirect = searchParams.get('redirect_uri')
Expand Down
90 changes: 27 additions & 63 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions scripts/generate_boilerplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ const options = program.opts()
const args = program.args

if(options.debug){
console.log('options', options)
console.log('args', args)
console.log('execute location', process.env.INIT_CWD)
console.debug('options', options)
console.debug('args', args)
console.debug('execute location', process.env.INIT_CWD)
}


Expand Down Expand Up @@ -83,15 +83,15 @@ if (fs.existsSync(filePath) && !options.force) {
console.error('Error creating directory:', err)
process.exit(1)
} else {
console.log(`Directory ${dir} created successfully.`)
console.debug(`Directory ${dir} created successfully.`)
}
})
}
fs.writeFile(filePath, file, (err) => {
if (err) {
console.error('Error writing to file:', err)
} else {
console.log(`File ${fileName} created successfully.`)
console.info(`File ${fileName} created successfully.`)
}
})
}
4 changes: 2 additions & 2 deletions tasks/components/BedInRoomIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ export const BedInRoomIndicator =
roomName,
bedPosition
}: PropsForTranslation<BedInRoomIndicatorTranslation, BedInRoomIndicatorProps>) => {
const translation = useTranslation(defaultBedInRoomIndicatorTranslation, overwriteTranslation)
const translation = useTranslation([defaultBedInRoomIndicatorTranslation], overwriteTranslation)

return (
<div>
{roomName !== undefined && (
<span className="mb-1">
{`${translation.bed} ${bedPosition + 1} ${translation.in} ${roomName}`}
{`${translation('bed')} ${bedPosition + 1} ${translation('in')} ${roomName}`}
</span>
)}
<div className="row gap-3">
Expand Down
Loading
Loading