Skip to content

Conversation

@ShadeWyrm
Copy link
Contributor

@ShadeWyrm ShadeWyrm commented Nov 27, 2025

  1. Provides access to an individual forms audit log.

To access Audit Logs, simply go to the form settings page, and click download activity log!~ Events can take up to 5 minutes to be available in the dynamodb and thus appear in the log.

  1. Moves all Event Log actions "Details" from strings into a shared library for further expansion.

All audit log entries now require a matching type.

  1. Parameterized Audit Log Details

All audit log details entries now require typesafe parameters defined. These are then passed as JSON Params to be translated.

Closes #6283

@github-actions
Copy link
Contributor

@anikbrazeau
Copy link
Member

Do we potentially also need the detailed entities to be defined / captured bilingually as well? Are these currently outside the translation files?

Options/Attributes:

  • ${EN_securityAttribute} / ${FR_securityAttribute}
    • Unclassified/Protected A/Protected B, Non-classifié/Protégé A/Protégé B
  • ${EN_formPurpose} / ${FR_formPurpose}
    • Administrative/Non-administrative, Administratif/Non-administratif
  • ${EN)saveAndResume} / ${FR_saveAndResume}
    • ON/OFF, Activée/Désactivée
  • ${EN_enabled} / ${FR_enabled}
    • ON/OFF, Activée/Désactivée
  • ${EN_throttlingRate} / ${FR_throttlingRate}
    • 500 requests per minute/1000 requests per minute, 500 demandes par minute/1000 demandes par minute
  • ${format}
    • HTML, CSV, JSON

i18n improvements

Co-authored-by: Anik Brazeau <[email protected]>
@ShadeWyrm
Copy link
Contributor Author

Do we potentially also need the detailed entities to be defined / captured bilingually as well? Are these currently outside the translation files?

Right! I'll add a small bit for translating params next.

@anikbrazeau
Copy link
Member

Another possible enhancement:

If we wanted to potentially simplify our lives in the future, we could also store "objects"/"variables" to build out the strings.

Option 1: [ User ] [ Action ] [Object ] [ Detail ] at [ Date ] [ Timestamp ]
Option 2: [ Object ] [ Detail ] by [ User ] at [ Date ] [ Timestamp ]

With [User] = [AccountEmailAddress]
With [Object] = [Asset] or [Setting name]
With [Detail] = [ID] or [From][To]

@ShadeWyrm
Copy link
Contributor Author

Another possible enhancement:

If we wanted to potentially simplify our lives in the future, we could also store "objects"/"variables" to build out the strings.

Option 1: [ User ] [ Action ] [Object ] [ Detail ] at [ Date ] [ Timestamp ] Option 2: [ Object ] [ Detail ] by [ User ] at [ Date ] [ Timestamp ]

With [User] = [AccountEmailAddress] With [Object] = [Asset] or [Setting name] With [Detail] = [ID] or [From][To]

That's what we're doing for the most part.

{"eventDesc":"Updated form name to {{newFormName}}","newFormName":"Form"}

Copy link
Contributor

@bryan-robitaille bryan-robitaille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good to me. Two small suggestions...

});
};

export const getUsersEmails = async (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might suggest to move this to the auditLogs module and make it an internal function _getUserEmails. If another developer were to use the function for a different feature/context it could be problematic from a security perspective.

subject: { type: keyof typeof AuditSubjectType; id?: string },
event: AuditLogEventStrings,
description?: string
...args: T extends keyof AllAuditParams
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we can move to a static signature for the logEvent function. The ...args collector is often used in funtions that can have multiple signatures and then goes through a type check to validate which signature to use. In this case we know the args so I'm wondering if there is a less complex way of typing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Downloading recent activity: Centralize "key actions" then review and translate "detailed" descriptions

4 participants