@oneuptime/common 7.0.4877 → 7.0.4892
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/Incident.ts +55 -9
- package/Models/DatabaseModels/IncidentPublicNote.ts +54 -9
- package/Models/DatabaseModels/IncidentStateTimeline.ts +55 -9
- package/Models/DatabaseModels/Index.ts +0 -2
- package/Models/DatabaseModels/ProjectUser.ts +2 -2
- package/Models/DatabaseModels/ScheduledMaintenance.ts +55 -9
- package/Models/DatabaseModels/ScheduledMaintenancePublicNote.ts +54 -9
- package/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.ts +55 -9
- package/Models/DatabaseModels/StatusPage.ts +10 -0
- package/Models/DatabaseModels/StatusPageAnnouncement.ts +52 -7
- package/Server/Infrastructure/Postgres/SchemaMigrations/1754412708044-MigrationName.ts +149 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1754415281937-MigrationName.ts +149 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1754484441975-UpdateSubscriberNotificationStatusToEnum.ts +249 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1754484441976-RenameSubscriberNotificationFailedReasonToStatusMessage.ts +56 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
- package/Server/Services/DatabaseService.ts +5 -0
- package/Server/Services/IncidentPublicNoteService.ts +16 -0
- package/Server/Services/IncidentService.ts +44 -1
- package/Server/Services/IncidentStateTimelineService.ts +18 -1
- package/Server/Services/ScheduledMaintenancePublicNoteService.ts +16 -0
- package/Server/Services/ScheduledMaintenanceService.ts +48 -4
- package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +14 -1
- package/Server/Services/StatusPageAnnouncementService.ts +46 -0
- package/Types/StatusPage/StatusPageSubscriberNotificationStatus.ts +9 -0
- package/UI/Components/Charts/ChartLibrary/BarChart/BarChart.tsx +991 -0
- package/UI/Components/Charts/ChartLibrary/SparkChart/SparkChart.tsx +367 -0
- package/UI/Components/Checkbox/CheckboxViewer.tsx +7 -18
- package/UI/Components/IconText/IconText.tsx +91 -0
- package/UI/Components/IconText/Index.ts +3 -0
- package/UI/Components/Modal/ConfirmModal.tsx +1 -1
- package/build/dist/Models/DatabaseModels/Incident.js +56 -11
- package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentPublicNote.js +56 -11
- package/build/dist/Models/DatabaseModels/IncidentPublicNote.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js +56 -11
- package/build/dist/Models/DatabaseModels/IncidentStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +0 -1
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ProjectUser.js +2 -2
- package/build/dist/Models/DatabaseModels/ProjectUser.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +56 -11
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenancePublicNote.js +56 -11
- package/build/dist/Models/DatabaseModels/ScheduledMaintenancePublicNote.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js +56 -11
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceStateTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPage.js +10 -0
- package/build/dist/Models/DatabaseModels/StatusPage.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js +54 -9
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1754412708044-MigrationName.js +56 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1754412708044-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1754415281937-MigrationName.js +56 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1754415281937-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1754484441975-UpdateSubscriberNotificationStatusToEnum.js +108 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1754484441975-UpdateSubscriberNotificationStatusToEnum.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1754484441976-RenameSubscriberNotificationFailedReasonToStatusMessage.js +24 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1754484441976-RenameSubscriberNotificationFailedReasonToStatusMessage.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +4 -0
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentPublicNoteService.js +12 -0
- package/build/dist/Server/Services/IncidentPublicNoteService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +34 -1
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +16 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenancePublicNoteService.js +12 -0
- package/build/dist/Server/Services/ScheduledMaintenancePublicNoteService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceService.js +38 -2
- package/build/dist/Server/Services/ScheduledMaintenanceService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +14 -1
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageAnnouncementService.js +37 -0
- package/build/dist/Server/Services/StatusPageAnnouncementService.js.map +1 -1
- package/build/dist/Types/StatusPage/StatusPageSubscriberNotificationStatus.js +10 -0
- package/build/dist/Types/StatusPage/StatusPageSubscriberNotificationStatus.js.map +1 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js +436 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/BarChart/BarChart.js.map +1 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/SparkChart/SparkChart.js +99 -0
- package/build/dist/UI/Components/Charts/ChartLibrary/SparkChart/SparkChart.js.map +1 -0
- package/build/dist/UI/Components/Checkbox/CheckboxViewer.js +3 -5
- package/build/dist/UI/Components/Checkbox/CheckboxViewer.js.map +1 -1
- package/build/dist/UI/Components/IconText/IconText.js +38 -0
- package/build/dist/UI/Components/IconText/IconText.js.map +1 -0
- package/build/dist/UI/Components/IconText/Index.js +3 -0
- package/build/dist/UI/Components/IconText/Index.js.map +1 -0
- package/build/dist/UI/Components/Modal/ConfirmModal.js +1 -1
- package/build/dist/UI/Components/Modal/ConfirmModal.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
// Tremor Spark Chart [v1.0.0]
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
+
|
|
4
|
+
"use client";
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import {
|
|
8
|
+
Area,
|
|
9
|
+
Bar,
|
|
10
|
+
Line,
|
|
11
|
+
AreaChart as RechartsAreaChart,
|
|
12
|
+
BarChart as RechartsBarChart,
|
|
13
|
+
LineChart as RechartsLineChart,
|
|
14
|
+
ResponsiveContainer,
|
|
15
|
+
XAxis,
|
|
16
|
+
YAxis,
|
|
17
|
+
} from "recharts";
|
|
18
|
+
|
|
19
|
+
import type { AxisDomain } from "recharts/types/util/types";
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
AvailableChartColors,
|
|
23
|
+
type AvailableChartColorsKeys,
|
|
24
|
+
constructCategoryColors,
|
|
25
|
+
getColorClassName,
|
|
26
|
+
} from "../Utils/ChartColors";
|
|
27
|
+
import { cx } from "../Utils/Cx";
|
|
28
|
+
import { getYAxisDomain } from "../Utils/GetYAxisDomain";
|
|
29
|
+
|
|
30
|
+
//#region SparkAreaChart
|
|
31
|
+
|
|
32
|
+
interface SparkAreaChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
33
|
+
data: Record<string, any>[];
|
|
34
|
+
categories: string[];
|
|
35
|
+
index: string;
|
|
36
|
+
colors?: AvailableChartColorsKeys[];
|
|
37
|
+
autoMinValue?: boolean;
|
|
38
|
+
minValue?: number;
|
|
39
|
+
maxValue?: number;
|
|
40
|
+
connectNulls?: boolean;
|
|
41
|
+
type?: "default" | "stacked" | "percent";
|
|
42
|
+
fill?: "gradient" | "solid" | "none";
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const SparkAreaChart: React.ForwardRefExoticComponent<
|
|
46
|
+
SparkAreaChartProps & React.RefAttributes<HTMLDivElement>
|
|
47
|
+
> = React.forwardRef<HTMLDivElement, SparkAreaChartProps>(
|
|
48
|
+
(
|
|
49
|
+
props: SparkAreaChartProps,
|
|
50
|
+
forwardedRef: React.Ref<HTMLDivElement>,
|
|
51
|
+
): React.ReactElement => {
|
|
52
|
+
const {
|
|
53
|
+
data = [],
|
|
54
|
+
categories = [],
|
|
55
|
+
index,
|
|
56
|
+
colors = AvailableChartColors,
|
|
57
|
+
autoMinValue = false,
|
|
58
|
+
minValue,
|
|
59
|
+
maxValue,
|
|
60
|
+
connectNulls = false,
|
|
61
|
+
type = "default",
|
|
62
|
+
className,
|
|
63
|
+
fill = "gradient",
|
|
64
|
+
...other
|
|
65
|
+
} = props;
|
|
66
|
+
|
|
67
|
+
const categoryColors: Map<string, AvailableChartColorsKeys> =
|
|
68
|
+
constructCategoryColors(categories, colors);
|
|
69
|
+
const yAxisDomain: AxisDomain = getYAxisDomain(
|
|
70
|
+
autoMinValue,
|
|
71
|
+
minValue,
|
|
72
|
+
maxValue,
|
|
73
|
+
);
|
|
74
|
+
const stacked: boolean = type === "stacked" || type === "percent";
|
|
75
|
+
const areaId: string = React.useId();
|
|
76
|
+
|
|
77
|
+
const getFillContent: (
|
|
78
|
+
fillType: SparkAreaChartProps["fill"],
|
|
79
|
+
) => React.ReactElement = (
|
|
80
|
+
fillType: SparkAreaChartProps["fill"],
|
|
81
|
+
): React.ReactElement => {
|
|
82
|
+
switch (fillType) {
|
|
83
|
+
case "none":
|
|
84
|
+
return <stop stopColor="currentColor" stopOpacity={0} />;
|
|
85
|
+
case "gradient":
|
|
86
|
+
return (
|
|
87
|
+
<>
|
|
88
|
+
<stop offset="5%" stopColor="currentColor" stopOpacity={0.4} />
|
|
89
|
+
<stop offset="95%" stopColor="currentColor" stopOpacity={0} />
|
|
90
|
+
</>
|
|
91
|
+
);
|
|
92
|
+
case "solid":
|
|
93
|
+
return <stop stopColor="currentColor" stopOpacity={0.3} />;
|
|
94
|
+
default:
|
|
95
|
+
return <stop stopColor="currentColor" stopOpacity={0.3} />;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<div
|
|
101
|
+
ref={forwardedRef}
|
|
102
|
+
className={cx("h-12 w-28", className)}
|
|
103
|
+
data-tremor-id="tremor-raw"
|
|
104
|
+
{...other}
|
|
105
|
+
>
|
|
106
|
+
<ResponsiveContainer>
|
|
107
|
+
<RechartsAreaChart
|
|
108
|
+
data={data}
|
|
109
|
+
margin={{
|
|
110
|
+
bottom: 1,
|
|
111
|
+
left: 1,
|
|
112
|
+
right: 1,
|
|
113
|
+
top: 1,
|
|
114
|
+
}}
|
|
115
|
+
{...(type === "percent" && { stackOffset: "expand" })}
|
|
116
|
+
>
|
|
117
|
+
<XAxis hide dataKey={index} />
|
|
118
|
+
<YAxis hide={true} domain={yAxisDomain as AxisDomain} />
|
|
119
|
+
|
|
120
|
+
{categories.map((category: string) => {
|
|
121
|
+
const categoryId: string = `${areaId}-${category.replace(/[^a-zA-Z0-9]/g, "")}`;
|
|
122
|
+
return (
|
|
123
|
+
<React.Fragment key={category}>
|
|
124
|
+
<defs>
|
|
125
|
+
<linearGradient
|
|
126
|
+
key={category}
|
|
127
|
+
className={cx(
|
|
128
|
+
getColorClassName(
|
|
129
|
+
categoryColors.get(
|
|
130
|
+
category,
|
|
131
|
+
) as AvailableChartColorsKeys,
|
|
132
|
+
"text",
|
|
133
|
+
),
|
|
134
|
+
)}
|
|
135
|
+
id={categoryId}
|
|
136
|
+
x1="0"
|
|
137
|
+
y1="0"
|
|
138
|
+
x2="0"
|
|
139
|
+
y2="1"
|
|
140
|
+
>
|
|
141
|
+
{getFillContent(fill)}
|
|
142
|
+
</linearGradient>
|
|
143
|
+
</defs>
|
|
144
|
+
<Area
|
|
145
|
+
className={cx(
|
|
146
|
+
getColorClassName(
|
|
147
|
+
categoryColors.get(
|
|
148
|
+
category,
|
|
149
|
+
) as AvailableChartColorsKeys,
|
|
150
|
+
"stroke",
|
|
151
|
+
),
|
|
152
|
+
)}
|
|
153
|
+
dot={false}
|
|
154
|
+
strokeOpacity={1}
|
|
155
|
+
name={category}
|
|
156
|
+
type="linear"
|
|
157
|
+
dataKey={category}
|
|
158
|
+
stroke=""
|
|
159
|
+
strokeWidth={2}
|
|
160
|
+
strokeLinejoin="round"
|
|
161
|
+
strokeLinecap="round"
|
|
162
|
+
isAnimationActive={false}
|
|
163
|
+
connectNulls={connectNulls}
|
|
164
|
+
{...(stacked && { stackId: "stack" })}
|
|
165
|
+
fill={`url(#${categoryId})`}
|
|
166
|
+
/>
|
|
167
|
+
</React.Fragment>
|
|
168
|
+
);
|
|
169
|
+
})}
|
|
170
|
+
</RechartsAreaChart>
|
|
171
|
+
</ResponsiveContainer>
|
|
172
|
+
</div>
|
|
173
|
+
);
|
|
174
|
+
},
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
SparkAreaChart.displayName = "SparkAreaChart";
|
|
178
|
+
|
|
179
|
+
//#region SparkLineChart
|
|
180
|
+
|
|
181
|
+
interface SparkLineChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
182
|
+
data: Record<string, any>[];
|
|
183
|
+
categories: string[];
|
|
184
|
+
index: string;
|
|
185
|
+
colors?: AvailableChartColorsKeys[];
|
|
186
|
+
autoMinValue?: boolean;
|
|
187
|
+
minValue?: number;
|
|
188
|
+
maxValue?: number;
|
|
189
|
+
connectNulls?: boolean;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const SparkLineChart: React.ForwardRefExoticComponent<
|
|
193
|
+
SparkLineChartProps & React.RefAttributes<HTMLDivElement>
|
|
194
|
+
> = React.forwardRef<HTMLDivElement, SparkLineChartProps>(
|
|
195
|
+
(
|
|
196
|
+
props: SparkLineChartProps,
|
|
197
|
+
forwardedRef: React.Ref<HTMLDivElement>,
|
|
198
|
+
): React.ReactElement => {
|
|
199
|
+
const {
|
|
200
|
+
data = [],
|
|
201
|
+
categories = [],
|
|
202
|
+
index,
|
|
203
|
+
colors = AvailableChartColors,
|
|
204
|
+
autoMinValue = false,
|
|
205
|
+
minValue,
|
|
206
|
+
maxValue,
|
|
207
|
+
connectNulls = false,
|
|
208
|
+
className,
|
|
209
|
+
...other
|
|
210
|
+
} = props;
|
|
211
|
+
|
|
212
|
+
const categoryColors: Map<string, AvailableChartColorsKeys> =
|
|
213
|
+
constructCategoryColors(categories, colors);
|
|
214
|
+
const yAxisDomain: AxisDomain = getYAxisDomain(
|
|
215
|
+
autoMinValue,
|
|
216
|
+
minValue,
|
|
217
|
+
maxValue,
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
return (
|
|
221
|
+
<div
|
|
222
|
+
ref={forwardedRef}
|
|
223
|
+
className={cx("h-12 w-28", className)}
|
|
224
|
+
data-tremor-id="tremor-raw"
|
|
225
|
+
{...other}
|
|
226
|
+
>
|
|
227
|
+
<ResponsiveContainer>
|
|
228
|
+
<RechartsLineChart
|
|
229
|
+
data={data}
|
|
230
|
+
margin={{
|
|
231
|
+
bottom: 1,
|
|
232
|
+
left: 1,
|
|
233
|
+
right: 1,
|
|
234
|
+
top: 1,
|
|
235
|
+
}}
|
|
236
|
+
>
|
|
237
|
+
<XAxis hide dataKey={index} />
|
|
238
|
+
<YAxis hide={true} domain={yAxisDomain as AxisDomain} />
|
|
239
|
+
{categories.map((category: string) => {
|
|
240
|
+
return (
|
|
241
|
+
<Line
|
|
242
|
+
className={cx(
|
|
243
|
+
getColorClassName(
|
|
244
|
+
categoryColors.get(category) as AvailableChartColorsKeys,
|
|
245
|
+
"stroke",
|
|
246
|
+
),
|
|
247
|
+
)}
|
|
248
|
+
dot={false}
|
|
249
|
+
strokeOpacity={1}
|
|
250
|
+
key={category}
|
|
251
|
+
name={category}
|
|
252
|
+
type="linear"
|
|
253
|
+
dataKey={category}
|
|
254
|
+
stroke=""
|
|
255
|
+
strokeWidth={2}
|
|
256
|
+
strokeLinejoin="round"
|
|
257
|
+
strokeLinecap="round"
|
|
258
|
+
isAnimationActive={false}
|
|
259
|
+
connectNulls={connectNulls}
|
|
260
|
+
/>
|
|
261
|
+
);
|
|
262
|
+
})}
|
|
263
|
+
</RechartsLineChart>
|
|
264
|
+
</ResponsiveContainer>
|
|
265
|
+
</div>
|
|
266
|
+
);
|
|
267
|
+
},
|
|
268
|
+
);
|
|
269
|
+
|
|
270
|
+
SparkLineChart.displayName = "SparkLineChart";
|
|
271
|
+
|
|
272
|
+
//#region SparkBarChart
|
|
273
|
+
|
|
274
|
+
interface BarChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
275
|
+
data: Record<string, any>[];
|
|
276
|
+
index: string;
|
|
277
|
+
categories: string[];
|
|
278
|
+
colors?: AvailableChartColorsKeys[];
|
|
279
|
+
autoMinValue?: boolean;
|
|
280
|
+
minValue?: number;
|
|
281
|
+
maxValue?: number;
|
|
282
|
+
barCategoryGap?: string | number;
|
|
283
|
+
type?: "default" | "stacked" | "percent";
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const SparkBarChart: React.ForwardRefExoticComponent<
|
|
287
|
+
BarChartProps & React.RefAttributes<HTMLDivElement>
|
|
288
|
+
> = React.forwardRef<HTMLDivElement, BarChartProps>(
|
|
289
|
+
(
|
|
290
|
+
props: BarChartProps,
|
|
291
|
+
forwardedRef: React.Ref<HTMLDivElement>,
|
|
292
|
+
): React.ReactElement => {
|
|
293
|
+
const {
|
|
294
|
+
data = [],
|
|
295
|
+
categories = [],
|
|
296
|
+
index,
|
|
297
|
+
colors = AvailableChartColors,
|
|
298
|
+
autoMinValue = false,
|
|
299
|
+
minValue,
|
|
300
|
+
maxValue,
|
|
301
|
+
barCategoryGap,
|
|
302
|
+
type = "default",
|
|
303
|
+
className,
|
|
304
|
+
...other
|
|
305
|
+
} = props;
|
|
306
|
+
|
|
307
|
+
const categoryColors: Map<string, AvailableChartColorsKeys> =
|
|
308
|
+
constructCategoryColors(categories, colors);
|
|
309
|
+
|
|
310
|
+
const yAxisDomain: AxisDomain = getYAxisDomain(
|
|
311
|
+
autoMinValue,
|
|
312
|
+
minValue,
|
|
313
|
+
maxValue,
|
|
314
|
+
);
|
|
315
|
+
const stacked: boolean = type === "stacked" || type === "percent";
|
|
316
|
+
|
|
317
|
+
return (
|
|
318
|
+
<div
|
|
319
|
+
ref={forwardedRef}
|
|
320
|
+
className={cx("h-12 w-28", className)}
|
|
321
|
+
data-tremor-id="tremor-raw"
|
|
322
|
+
{...other}
|
|
323
|
+
>
|
|
324
|
+
<ResponsiveContainer>
|
|
325
|
+
<RechartsBarChart
|
|
326
|
+
data={data}
|
|
327
|
+
margin={{
|
|
328
|
+
bottom: 1,
|
|
329
|
+
left: 1,
|
|
330
|
+
right: 1,
|
|
331
|
+
top: 1,
|
|
332
|
+
}}
|
|
333
|
+
{...(type === "percent" && { stackOffset: "expand" })}
|
|
334
|
+
{...(barCategoryGap !== undefined && { barCategoryGap })}
|
|
335
|
+
>
|
|
336
|
+
<XAxis hide dataKey={index} />
|
|
337
|
+
<YAxis hide={true} domain={yAxisDomain as AxisDomain} />
|
|
338
|
+
|
|
339
|
+
{categories.map((category: string) => {
|
|
340
|
+
return (
|
|
341
|
+
<Bar
|
|
342
|
+
className={cx(
|
|
343
|
+
getColorClassName(
|
|
344
|
+
categoryColors.get(category) as AvailableChartColorsKeys,
|
|
345
|
+
"fill",
|
|
346
|
+
),
|
|
347
|
+
)}
|
|
348
|
+
key={category}
|
|
349
|
+
name={category}
|
|
350
|
+
type="linear"
|
|
351
|
+
dataKey={category}
|
|
352
|
+
{...(stacked && { stackId: "stack" })}
|
|
353
|
+
isAnimationActive={false}
|
|
354
|
+
fill=""
|
|
355
|
+
/>
|
|
356
|
+
);
|
|
357
|
+
})}
|
|
358
|
+
</RechartsBarChart>
|
|
359
|
+
</ResponsiveContainer>
|
|
360
|
+
</div>
|
|
361
|
+
);
|
|
362
|
+
},
|
|
363
|
+
);
|
|
364
|
+
|
|
365
|
+
SparkBarChart.displayName = "SparkBarChart";
|
|
366
|
+
|
|
367
|
+
export { SparkAreaChart, SparkLineChart, SparkBarChart };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import IconText from "../IconText/IconText";
|
|
2
2
|
import { Green, Red } from "../../../Types/BrandColors";
|
|
3
3
|
import IconProp from "../../../Types/Icon/IconProp";
|
|
4
4
|
import React, { FunctionComponent, ReactElement } from "react";
|
|
@@ -12,23 +12,12 @@ const CheckboxViewer: FunctionComponent<ComponentProps> = (
|
|
|
12
12
|
props: ComponentProps,
|
|
13
13
|
): ReactElement => {
|
|
14
14
|
return (
|
|
15
|
-
<div>
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
icon={IconProp.CheckCircle}
|
|
22
|
-
color={Green}
|
|
23
|
-
/>
|
|
24
|
-
) : (
|
|
25
|
-
<Icon className="h-5 w-5" icon={IconProp.CircleClose} color={Red} />
|
|
26
|
-
)}
|
|
27
|
-
</div>
|
|
28
|
-
<div className="text-sm text-gray-900 flex justify-left">
|
|
29
|
-
{props.text}
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
15
|
+
<div className="h-6">
|
|
16
|
+
<IconText
|
|
17
|
+
text={props.text}
|
|
18
|
+
icon={props.isChecked ? IconProp.CheckCircle : IconProp.CircleClose}
|
|
19
|
+
iconColor={props.isChecked ? Green : Red}
|
|
20
|
+
/>
|
|
32
21
|
</div>
|
|
33
22
|
);
|
|
34
23
|
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import Icon, { SizeProp } from "../Icon/Icon";
|
|
2
|
+
import Color from "../../../Types/Color";
|
|
3
|
+
import IconProp from "../../../Types/Icon/IconProp";
|
|
4
|
+
import React, { FunctionComponent, ReactElement } from "react";
|
|
5
|
+
|
|
6
|
+
export interface ComponentProps {
|
|
7
|
+
text: string;
|
|
8
|
+
icon: IconProp;
|
|
9
|
+
iconColor?: Color | null;
|
|
10
|
+
textColor?: Color | null;
|
|
11
|
+
iconSize?: SizeProp;
|
|
12
|
+
iconClassName?: string;
|
|
13
|
+
textClassName?: string;
|
|
14
|
+
containerClassName?: string;
|
|
15
|
+
spacing?: "sm" | "md" | "lg";
|
|
16
|
+
alignment?: "left" | "center" | "right";
|
|
17
|
+
onClick?: (() => void) | undefined;
|
|
18
|
+
"data-testid"?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const IconText: FunctionComponent<ComponentProps> = ({
|
|
22
|
+
text,
|
|
23
|
+
icon,
|
|
24
|
+
iconColor = null,
|
|
25
|
+
textColor = null,
|
|
26
|
+
iconSize = SizeProp.Regular,
|
|
27
|
+
iconClassName = "h-5 w-5",
|
|
28
|
+
textClassName = "text-sm text-gray-900",
|
|
29
|
+
containerClassName = "",
|
|
30
|
+
spacing = "sm",
|
|
31
|
+
alignment = "left",
|
|
32
|
+
onClick,
|
|
33
|
+
"data-testid": dataTestId,
|
|
34
|
+
}: ComponentProps): ReactElement => {
|
|
35
|
+
const getSpacingClass: () => string = (): string => {
|
|
36
|
+
switch (spacing) {
|
|
37
|
+
case "sm":
|
|
38
|
+
return "gap-1";
|
|
39
|
+
case "md":
|
|
40
|
+
return "gap-2";
|
|
41
|
+
case "lg":
|
|
42
|
+
return "gap-3";
|
|
43
|
+
default:
|
|
44
|
+
return "gap-1";
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const getAlignmentClass: () => string = (): string => {
|
|
49
|
+
switch (alignment) {
|
|
50
|
+
case "center":
|
|
51
|
+
return "justify-center";
|
|
52
|
+
case "right":
|
|
53
|
+
return "justify-end";
|
|
54
|
+
case "left":
|
|
55
|
+
default:
|
|
56
|
+
return "justify-start";
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const handleClick: () => void = (): void => {
|
|
61
|
+
if (onClick) {
|
|
62
|
+
onClick();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div
|
|
68
|
+
className={`flex items-center ${getSpacingClass()} ${getAlignmentClass()} ${containerClassName}`}
|
|
69
|
+
onClick={handleClick}
|
|
70
|
+
data-testid={dataTestId}
|
|
71
|
+
style={{ cursor: onClick ? "pointer" : "default" }}
|
|
72
|
+
>
|
|
73
|
+
<div className="flex-shrink-0">
|
|
74
|
+
<Icon
|
|
75
|
+
className={iconClassName}
|
|
76
|
+
icon={icon}
|
|
77
|
+
color={iconColor}
|
|
78
|
+
size={iconSize}
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
<div
|
|
82
|
+
className={`flex ${getAlignmentClass()} ${textClassName}`}
|
|
83
|
+
style={{ color: textColor?.toString() || "inherit" }}
|
|
84
|
+
>
|
|
85
|
+
{text}
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default IconText;
|
|
@@ -35,6 +35,7 @@ import TenantColumn from "../../Types/Database/TenantColumn";
|
|
|
35
35
|
import IconProp from "../../Types/Icon/IconProp";
|
|
36
36
|
import ObjectID from "../../Types/ObjectID";
|
|
37
37
|
import Permission from "../../Types/Permission";
|
|
38
|
+
import StatusPageSubscriberNotificationStatus from "../../Types/StatusPage/StatusPageSubscriberNotificationStatus";
|
|
38
39
|
import { Column, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, } from "typeorm";
|
|
39
40
|
let Incident = class Incident extends BaseModel {
|
|
40
41
|
constructor() {
|
|
@@ -57,7 +58,8 @@ let Incident = class Incident extends BaseModel {
|
|
|
57
58
|
this.incidentSeverityId = undefined;
|
|
58
59
|
this.changeMonitorStatusTo = undefined;
|
|
59
60
|
this.changeMonitorStatusToId = undefined;
|
|
60
|
-
this.
|
|
61
|
+
this.subscriberNotificationStatusOnIncidentCreated = undefined;
|
|
62
|
+
this.subscriberNotificationStatusMessage = undefined;
|
|
61
63
|
this.shouldStatusPageSubscribersBeNotifiedOnIncidentCreated = undefined;
|
|
62
64
|
this.customFields = undefined;
|
|
63
65
|
this.isOwnerNotifiedOfResourceCreation = undefined;
|
|
@@ -697,30 +699,73 @@ __decorate([
|
|
|
697
699
|
], Incident.prototype, "changeMonitorStatusToId", void 0);
|
|
698
700
|
__decorate([
|
|
699
701
|
ColumnAccessControl({
|
|
700
|
-
create: [
|
|
702
|
+
create: [
|
|
703
|
+
Permission.ProjectOwner,
|
|
704
|
+
Permission.ProjectAdmin,
|
|
705
|
+
Permission.ProjectMember,
|
|
706
|
+
Permission.CreateProjectIncident,
|
|
707
|
+
],
|
|
701
708
|
read: [
|
|
702
709
|
Permission.ProjectOwner,
|
|
703
710
|
Permission.ProjectAdmin,
|
|
704
711
|
Permission.ProjectMember,
|
|
705
712
|
Permission.ReadProjectIncident,
|
|
706
713
|
],
|
|
707
|
-
update: [
|
|
714
|
+
update: [
|
|
715
|
+
Permission.ProjectOwner,
|
|
716
|
+
Permission.ProjectAdmin,
|
|
717
|
+
Permission.ProjectMember,
|
|
718
|
+
Permission.EditProjectIncident,
|
|
719
|
+
],
|
|
708
720
|
}),
|
|
709
721
|
TableColumn({
|
|
710
722
|
isDefaultValueColumn: true,
|
|
711
723
|
computed: true,
|
|
712
724
|
hideColumnInDocumentation: true,
|
|
713
|
-
type: TableColumnType.
|
|
714
|
-
title: "
|
|
715
|
-
description: "
|
|
716
|
-
defaultValue:
|
|
725
|
+
type: TableColumnType.ShortText,
|
|
726
|
+
title: "Subscriber Notification Status",
|
|
727
|
+
description: "Status of notification sent to subscribers about this incident",
|
|
728
|
+
defaultValue: StatusPageSubscriberNotificationStatus.Pending,
|
|
717
729
|
}),
|
|
718
730
|
Column({
|
|
719
|
-
type: ColumnType.
|
|
720
|
-
default:
|
|
731
|
+
type: ColumnType.ShortText,
|
|
732
|
+
default: StatusPageSubscriberNotificationStatus.Pending,
|
|
721
733
|
}),
|
|
722
|
-
__metadata("design:type",
|
|
723
|
-
], Incident.prototype, "
|
|
734
|
+
__metadata("design:type", String)
|
|
735
|
+
], Incident.prototype, "subscriberNotificationStatusOnIncidentCreated", void 0);
|
|
736
|
+
__decorate([
|
|
737
|
+
ColumnAccessControl({
|
|
738
|
+
create: [
|
|
739
|
+
Permission.ProjectOwner,
|
|
740
|
+
Permission.ProjectAdmin,
|
|
741
|
+
Permission.ProjectMember,
|
|
742
|
+
Permission.CreateProjectIncident,
|
|
743
|
+
],
|
|
744
|
+
read: [
|
|
745
|
+
Permission.ProjectOwner,
|
|
746
|
+
Permission.ProjectAdmin,
|
|
747
|
+
Permission.ProjectMember,
|
|
748
|
+
Permission.ReadProjectIncident,
|
|
749
|
+
],
|
|
750
|
+
update: [
|
|
751
|
+
Permission.ProjectOwner,
|
|
752
|
+
Permission.ProjectAdmin,
|
|
753
|
+
Permission.ProjectMember,
|
|
754
|
+
Permission.EditProjectIncident,
|
|
755
|
+
],
|
|
756
|
+
}),
|
|
757
|
+
TableColumn({
|
|
758
|
+
type: TableColumnType.VeryLongText,
|
|
759
|
+
title: "Notification Status Message",
|
|
760
|
+
description: "Status message for subscriber notifications - includes success messages, failure reasons, or skip reasons",
|
|
761
|
+
required: false,
|
|
762
|
+
}),
|
|
763
|
+
Column({
|
|
764
|
+
type: ColumnType.VeryLongText,
|
|
765
|
+
nullable: true,
|
|
766
|
+
}),
|
|
767
|
+
__metadata("design:type", String)
|
|
768
|
+
], Incident.prototype, "subscriberNotificationStatusMessage", void 0);
|
|
724
769
|
__decorate([
|
|
725
770
|
ColumnAccessControl({
|
|
726
771
|
create: [
|