-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Update Status.Entities.ts and Status.Trans.ts
- Update Status.Entities.ts to add a new property "updates" to the IncidentEntityV2 interface. - Update Status.Trans.ts to rename it to Status.Trans.V1.ts and update the Logger name to "TransformerV1". - Add a new file Status.Trans.V2.ts to introduce a new TransformerV2 function for handling v2 status data. - Update Status.tsx to use the appropriate Transformer function based on the value of the environment variable "SD_BACKEND_V2".
- Loading branch information
Showing
4 changed files
with
53 additions
and
13 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Logger } from "~/Helpers/Logger"; | ||
import { EmptyDB } from "./Status"; | ||
import { IncidentEntityV2, StatusEntityV2 } from "./Status.Entities"; | ||
import { IStatusContext } from "./Status.Models"; | ||
|
||
const log = new Logger("Service", "Status", "TransformerV1"); | ||
|
||
/** | ||
* @author Aloento | ||
* @since 1.0.0 | ||
* @version 0.1.0 | ||
*/ | ||
export function TransformerV2({ Components, Events }: { Components: StatusEntityV2[], Events: IncidentEntityV2[] }): IStatusContext { | ||
const db = EmptyDB(); | ||
|
||
if (!Components?.length || !Events?.length) { | ||
log.warn("Empty List."); | ||
return db; | ||
} | ||
|
||
log.info("Status data loaded.", db); | ||
return db; | ||
} |
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