Skip to content
Closed
2 changes: 1 addition & 1 deletion apps/client/scripts/generate-icons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

echo "Create temporary file"
FILE=$(mktemp -p . --suffix=".js")
FILE=$(mktemp ./icons.XXXXXX).js && : > ${FILE}
Comment thread
shikanime marked this conversation as resolved.

echo "Add header"
tee -a ${FILE} << EOF
Expand Down
1 change: 1 addition & 0 deletions apps/server-nestjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"@ts-rest/open-api": "catalog:runtime",
"cache-manager": "catalog:runtime",
"date-fns": "catalog:runtime",
"effect": "catalog:runtime",
"fastify": "catalog:runtime",
"fastify-keycloak-adapter": "catalog:runtime",
"json-2-csv": "catalog:runtime",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { describe, expect, it } from 'vitest'
import { generateClusterWhereInput } from './cluster-queries.utils'

describe('generateClusterWhereInput', () => {
it('returns an empty where for anonymous listing', () => {
expect(generateClusterWhereInput()).toEqual({})
expect(generateClusterWhereInput(undefined)).toEqual({})

Check warning on line 7 in apps/server-nestjs/src/modules/cluster/cluster-queries.utils.spec.ts

View check run for this annotation

cloud-pi-native-sonarqube / SonarQube Code Analysis

apps/server-nestjs/src/modules/cluster/cluster-queries.utils.spec.ts#L7

Remove this redundant "undefined".
})

it('returns the four authorization OR arms for a user', () => {
const userId = 'user-1'
const where = generateClusterWhereInput(userId)

expect(where.OR).toEqual([
{ privacy: 'public' },
{ projects: { some: { members: { some: { userId } } } } },
{ projects: { some: { ownerId: userId } } },
{ environments: { some: { project: { members: { some: { userId } } } } } },
])
})
})
7 changes: 6 additions & 1 deletion apps/server-nestjs/src/modules/cluster/cluster.module.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import { Module } from '@nestjs/common'
import { AppEventsModule } from '../events/app-events.module'
import { AuthModule } from '../infrastructure/auth/auth.module'
import { ConfigModule } from '@nestjs/config'
import { baseConfigFactory } from '../../config/base.config'
import { DatabaseModule } from '../infrastructure/database/database.module'
import { EventsModule } from '../infrastructure/events/events.module'
import { UserPermissionModule } from '../infrastructure/permission/user/user.module'
import { LogModule } from '../log/log.module'
import { ClusterController } from './cluster.controller'
import { ClusterService } from './cluster.service'

@Module({
imports: [
AppEventsModule,
AuthModule,
DatabaseModule,
ConfigModule.forFeature(baseConfigFactory),
DatabaseModule, EventsModule,
EventsModule,
Comment thread
shikanime marked this conversation as resolved.
LogModule,
UserPermissionModule,
],
controllers: [ClusterController],
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/contracts/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,4 @@ export const clusterContract = contractInstance.router({
})

export type ClusterAssociatedEnvironments = ClientInferResponseBody<typeof clusterContract.getClusterEnvironments, 200>
export type ClusterList = ClientInferResponseBody<typeof clusterContract.listClusters, 200>
14 changes: 14 additions & 0 deletions pnpm-lock.yaml

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

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ catalogs:
"@gitbeaker/rest": ^40.6.0
"@gouvfr/dsfr": ^1.14.4
"@gouvminint/vue-dsfr": ^8.19.0
effect: ^3.22.2
"@himenon/argocd-typescript-openapi": ^1.2.2
"@iconify-json/ri": ^1.2.10
"@iconify/vue": ^4.3.0
Expand Down Expand Up @@ -199,3 +200,4 @@ catalogs:
stylelint-config-standard: ^40.0.0
typescript-eslint: ^8.57.0
vue-eslint-parser: ^10.4.0
catalog:
Loading