forked from mosip/inji-wallet
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(INJI-397)error message for deleted vcfile (mosip#875)
* fix(INJI-397)error message for deleted vcfile * fix(INJI-397)refactor:log activity event * fix(INJI-397)refactor:log activity event * fix(INJI-397)refactor:comparing VCMetadata Signed-off-by: Tilak Puli <[email protected]>
- Loading branch information
1 parent
1f7f832
commit 26f1391
Showing
18 changed files
with
197 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
enum ActivityLogType { | ||
TAMPERED_VC_REMOVED = 'TAMPERED_VC_REMOVED', | ||
} | ||
|
||
export class ActivityLog { | ||
_vcKey: string; | ||
timestamp: number; | ||
deviceName: string; | ||
vcLabel: string; | ||
type: ActivityLogType | string; | ||
|
||
constructor({ | ||
_vcKey = '', | ||
type = '', | ||
timestamp = Date.now(), | ||
deviceName = '', | ||
vcLabel = '', | ||
} = {}) { | ||
this._vcKey = _vcKey; | ||
this.type = type; | ||
this.timestamp = timestamp; | ||
this.deviceName = deviceName; | ||
this.vcLabel = vcLabel; | ||
} | ||
|
||
static logTamperedVCs() { | ||
return { | ||
_vcKey: '', | ||
type: ActivityLogType.TAMPERED_VC_REMOVED, | ||
timestamp: Date.now(), | ||
deviceName: '', | ||
vcLabel: '', | ||
}; | ||
} | ||
} | ||
|
||
export function getActionText(activity: ActivityLog, t) { | ||
return activity.vcLabel | ||
? `${activity.vcLabel} ${t(activity.type)}` | ||
: `${t(activity.type)}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.