feat(platform): use alert events api surface
This commit is contained in:
@@ -226,7 +226,7 @@ export function Dashboard({
|
||||
api.vehicleServiceSummary().then(setServiceSummary),
|
||||
api.vehicleCoverage(new URLSearchParams({ limit: '8' })).then((page) => setCoverage(page.items)),
|
||||
api.vehicleRealtime(new URLSearchParams({ limit: '8' })).then((page) => setLocations(page.items)),
|
||||
api.qualityIssues(new URLSearchParams({ limit: '5' })).then((page) => setQualityIssues(page.items))
|
||||
api.alertEvents(new URLSearchParams({ limit: '5' })).then((page) => setQualityIssues(page.items))
|
||||
];
|
||||
Promise.allSettled(tasks)
|
||||
.then((results) => {
|
||||
|
||||
@@ -73,7 +73,7 @@ export function NotificationRules() {
|
||||
const load = () => {
|
||||
setLoading(true);
|
||||
Promise.all([
|
||||
api.qualityNotificationPlan(new URLSearchParams({ limit: '50' })),
|
||||
api.alertEventNotificationPlan(new URLSearchParams({ limit: '50' })),
|
||||
api.opsHealth().catch(() => null)
|
||||
])
|
||||
.then(([nextPlan, nextHealth]) => {
|
||||
|
||||
@@ -539,7 +539,7 @@ export function Quality({
|
||||
const params = qualityParams(values);
|
||||
params.set('limit', String(pageSize));
|
||||
params.set('offset', String((page - 1) * pageSize));
|
||||
api.qualityIssues(params)
|
||||
api.alertEvents(params)
|
||||
.then((nextPage) => {
|
||||
setIssues(nextPage.items);
|
||||
setPagination({ currentPage: page, pageSize, total: nextPage.total });
|
||||
@@ -550,7 +550,7 @@ export function Quality({
|
||||
|
||||
const loadSummary = (values: Record<string, string> = filters) => {
|
||||
setLoadingSummary(true);
|
||||
api.qualitySummary(qualityParams(values))
|
||||
api.alertEventSummary(qualityParams(values))
|
||||
.then(setSummary)
|
||||
.catch((error: Error) => Toast.error(error.message))
|
||||
.finally(() => setLoadingSummary(false));
|
||||
@@ -569,7 +569,7 @@ export function Quality({
|
||||
const loadNotificationPlan = (values: Record<string, string> = filters, pageSize = pagination.pageSize) => {
|
||||
const params = qualityParams(values);
|
||||
params.set('limit', String(pageSize));
|
||||
api.qualityNotificationPlan(params)
|
||||
api.alertEventNotificationPlan(params)
|
||||
.then((plan) => {
|
||||
if (Array.isArray(plan.rules) && Array.isArray(plan.policies) && Array.isArray(plan.priorityIssues)) {
|
||||
setNotificationPlan(plan);
|
||||
|
||||
Reference in New Issue
Block a user