feat: NoValue is bot properly created the backend (#9110)

`No Value` view groups wasn't properly created when we select a group by
field metadata, this PR fix the issue.
Also a script is added to backfill the current view groups.

---------

Co-authored-by: Marie <51697796+ijreilly@users.noreply.github.com>
This commit is contained in:
Jérémy M
2024-12-18 12:26:38 +01:00
committed by GitHub
parent d895468ebe
commit 3b48920314
7 changed files with 178 additions and 53 deletions

View File

@ -6,6 +6,7 @@ import { Repository } from 'typeorm';
import { ActiveWorkspacesCommandRunner } from 'src/database/commands/active-workspaces.command';
import { BaseCommandOptions } from 'src/database/commands/base.command';
import { RecordPositionBackfillCommand } from 'src/database/commands/upgrade-version/0-40/0-40-record-position-backfill.command';
import { ViewGroupNoValueBackfillCommand } from 'src/database/commands/upgrade-version/0-40/0-40-view-group-no-value-backfill.command';
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';
import { SyncWorkspaceMetadataCommand } from 'src/engine/workspace-manager/workspace-sync-metadata/commands/sync-workspace-metadata.command';
@ -18,6 +19,7 @@ export class UpgradeTo0_40Command extends ActiveWorkspacesCommandRunner {
@InjectRepository(Workspace, 'core')
protected readonly workspaceRepository: Repository<Workspace>,
private readonly recordPositionBackfillCommand: RecordPositionBackfillCommand,
private readonly viewGroupNoValueBackfillCommand: ViewGroupNoValueBackfillCommand,
private readonly syncWorkspaceMetadataCommand: SyncWorkspaceMetadataCommand,
) {
super(workspaceRepository);
@ -34,6 +36,12 @@ export class UpgradeTo0_40Command extends ActiveWorkspacesCommandRunner {
workspaceIds,
);
await this.viewGroupNoValueBackfillCommand.executeActiveWorkspacesCommand(
passedParam,
options,
workspaceIds,
);
await this.syncWorkspaceMetadataCommand.executeActiveWorkspacesCommand(
passedParam,
{