feat: persist resized column widths (#1017)
* feat: persist resized column widths Closes #981 * test: mock company and person view fields
This commit is contained in:
@ -132,6 +132,7 @@ export class AbilityFactory {
|
||||
|
||||
// ViewField
|
||||
can(AbilityAction.Read, 'ViewField', { workspaceId: workspace.id });
|
||||
can(AbilityAction.Create, 'ViewField', { workspaceId: workspace.id });
|
||||
can(AbilityAction.Update, 'ViewField', { workspaceId: workspace.id });
|
||||
|
||||
return build();
|
||||
|
||||
@ -95,6 +95,7 @@ import {
|
||||
UpdateAttachmentAbilityHandler,
|
||||
} from './handlers/attachment.ability-handler';
|
||||
import {
|
||||
CreateViewFieldAbilityHandler,
|
||||
ReadViewFieldAbilityHandler,
|
||||
UpdateViewFieldAbilityHandler,
|
||||
} from './handlers/view-field.ability-handler';
|
||||
@ -184,6 +185,7 @@ import {
|
||||
DeletePipelineProgressAbilityHandler,
|
||||
// ViewField
|
||||
ReadViewFieldAbilityHandler,
|
||||
CreateViewFieldAbilityHandler,
|
||||
UpdateViewFieldAbilityHandler,
|
||||
],
|
||||
exports: [
|
||||
@ -268,6 +270,7 @@ import {
|
||||
DeletePipelineProgressAbilityHandler,
|
||||
// ViewField
|
||||
ReadViewFieldAbilityHandler,
|
||||
CreateViewFieldAbilityHandler,
|
||||
UpdateViewFieldAbilityHandler,
|
||||
],
|
||||
})
|
||||
|
||||
@ -28,6 +28,29 @@ export class ReadViewFieldAbilityHandler implements IAbilityHandler {
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class CreateViewFieldAbilityHandler implements IAbilityHandler {
|
||||
constructor(private readonly prismaService: PrismaService) {}
|
||||
|
||||
async handle(ability: AppAbility, context: ExecutionContext) {
|
||||
const gqlContext = GqlExecutionContext.create(context);
|
||||
const args = gqlContext.getArgs();
|
||||
|
||||
const allowed = await relationAbilityChecker(
|
||||
'ViewField',
|
||||
ability,
|
||||
this.prismaService.client,
|
||||
args,
|
||||
);
|
||||
|
||||
if (!allowed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return ability.can(AbilityAction.Create, 'ViewField');
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class UpdateViewFieldAbilityHandler implements IAbilityHandler {
|
||||
constructor(private readonly prismaService: PrismaService) {}
|
||||
|
||||
Reference in New Issue
Block a user