File tree Expand file tree Collapse file tree
frontend/src/transformers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 * @returns Array of snapshots with user details applied
77 */
88function applySystemUserDetails ( snapshots , owner ) {
9- // For any snapshots that have no user and match the autoSnapshot name format
10- // we mimic a user so that the table can display the device name and a suitable image
11- // NOTE: Any changes to the below regex should be reflected in forge/db/controllers/ProjectSnapshot.js
12- const autoSnapshotRegex = / ^ A u t o S n a p s h o t - \d { 4 } - \d { 2 } - \d { 2 } \d { 2 } : \d { 2 } : \d { 2 } $ / // e.g "Auto Snapshot - 2023-02-01 12:34:56"
9+ // For any snapshots that have no user we mimic a system-user so that the table can display the device name and a suitable image
1310 return snapshots . map ( ( snapshot ) => {
14- if ( ! snapshot . user && autoSnapshotRegex . test ( snapshot . name ) ) {
11+ if ( ! snapshot . user ) {
1512 snapshot . user = {
1613 name : owner ?. name || ( snapshot . project || snapshot . device || { } ) . name || 'Unknown' ,
1714 username : 'Auto Snapshot' ,
You can’t perform that action at this time.
0 commit comments