@oneuptime/common 7.0.4453 → 7.0.4518
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/Alert.ts +1 -1
- package/Models/DatabaseModels/AlertCustomField.ts +1 -1
- package/Models/DatabaseModels/BillingPaymentMethod.ts +1 -1
- package/Models/DatabaseModels/DatabaseBaseModel/FileModel.ts +1 -1
- package/Models/DatabaseModels/IncidentCustomField.ts +1 -1
- package/Models/DatabaseModels/MonitorCustomField.ts +1 -1
- package/Models/DatabaseModels/OnCallDutyPolicyCustomField.ts +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceCustomField.ts +1 -1
- package/Models/DatabaseModels/ScheduledMaintenanceTemplate.ts +1 -1
- package/Models/DatabaseModels/StatusPageAnnouncement.ts +1 -1
- package/Models/DatabaseModels/StatusPageCustomField.ts +1 -1
- package/Server/API/FileAPI.ts +2 -2
- package/Server/API/StatusPageAPI.ts +4 -4
- package/Server/Infrastructure/Postgres/SchemaMigrations/1750250435756-MigrationName.ts +59 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Services/BillingPaymentMethodService.ts +1 -1
- package/Server/Utils/Response.ts +1 -1
- package/Server/Utils/Workspace/Slack/Slack.ts +62 -10
- package/Tests/UI/Components/FilePicker.test.tsx +2 -2
- package/UI/Components/Checkbox/Checkbox.tsx +1 -1
- package/UI/Components/CodeEditor/CodeEditor.tsx +3 -2
- package/UI/Components/CustomFields/CustomFieldsDetail.tsx +3 -3
- package/UI/Components/Detail/Detail.tsx +3 -2
- package/UI/Components/Detail/Field.ts +1 -1
- package/UI/Components/Detail/FieldLabel.tsx +1 -1
- package/UI/Components/FilePicker/FilePicker.tsx +2 -2
- package/UI/Components/Forms/Fields/FormField.tsx +2 -1
- package/UI/Components/Forms/ModelForm.tsx +1 -1
- package/UI/Components/Forms/Types/Field.ts +1 -1
- package/UI/Components/Image/Image.tsx +2 -2
- package/UI/Components/ModelDetail/ModelDetail.tsx +1 -1
- package/UI/Components/ModelTable/BaseModelTable.tsx +1 -1
- package/UI/Utils/Markdown.tsx +22 -0
- package/build/dist/Models/DatabaseModels/Alert.js +1 -1
- package/build/dist/Models/DatabaseModels/Alert.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertCustomField.js +2 -2
- package/build/dist/Models/DatabaseModels/AlertCustomField.js.map +1 -1
- package/build/dist/Models/DatabaseModels/BillingPaymentMethod.js +2 -2
- package/build/dist/Models/DatabaseModels/BillingPaymentMethod.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DatabaseBaseModel/FileModel.js +2 -2
- package/build/dist/Models/DatabaseModels/DatabaseBaseModel/FileModel.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentCustomField.js +2 -2
- package/build/dist/Models/DatabaseModels/IncidentCustomField.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MonitorCustomField.js +2 -2
- package/build/dist/Models/DatabaseModels/MonitorCustomField.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyCustomField.js +2 -2
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyCustomField.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceCustomField.js +2 -2
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceCustomField.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceTemplate.js +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenanceTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageAnnouncement.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageCustomField.js +2 -2
- package/build/dist/Models/DatabaseModels/StatusPageCustomField.js.map +1 -1
- package/build/dist/Server/API/FileAPI.js +2 -2
- package/build/dist/Server/API/FileAPI.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +4 -4
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1750250435756-MigrationName.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1750250435756-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/BillingPaymentMethodService.js +1 -1
- package/build/dist/Server/Services/BillingPaymentMethodService.js.map +1 -1
- package/build/dist/Server/Utils/Response.js +1 -1
- package/build/dist/Server/Utils/Response.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +36 -0
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/Tests/UI/Components/FilePicker.test.js +1 -1
- package/build/dist/Tests/UI/Components/FilePicker.test.js.map +1 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js +2 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js +3 -3
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js.map +1 -1
- package/build/dist/UI/Components/Detail/Detail.js +3 -2
- package/build/dist/UI/Components/Detail/Detail.js.map +1 -1
- package/build/dist/UI/Components/FilePicker/FilePicker.js +2 -2
- package/build/dist/UI/Components/FilePicker/FilePicker.js.map +1 -1
- package/build/dist/UI/Components/Forms/Fields/FormField.js.map +1 -1
- package/build/dist/UI/Components/Forms/ModelForm.js +1 -1
- package/build/dist/UI/Components/Forms/ModelForm.js.map +1 -1
- package/build/dist/UI/Components/Image/Image.js +2 -2
- package/build/dist/UI/Components/Image/Image.js.map +1 -1
- package/build/dist/UI/Components/ModelDetail/ModelDetail.js +1 -1
- package/build/dist/UI/Components/ModelDetail/ModelDetail.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Utils/Markdown.js +15 -0
- package/build/dist/UI/Utils/Markdown.js.map +1 -0
- package/package.json +1 -1
|
@@ -217,7 +217,7 @@ export default class Alert extends BaseModel {
|
|
|
217
217
|
type: TableColumnType.Markdown,
|
|
218
218
|
title: "Description",
|
|
219
219
|
description:
|
|
220
|
-
"Short description of this alert. This
|
|
220
|
+
"Short description of this alert. This will be visible on the status page. This is in markdown.",
|
|
221
221
|
})
|
|
222
222
|
@Column({
|
|
223
223
|
nullable: true,
|
|
@@ -218,7 +218,7 @@ export default class AlertCustomField extends BaseModel {
|
|
|
218
218
|
type: ColumnType.ShortText,
|
|
219
219
|
length: ColumnLength.ShortText,
|
|
220
220
|
})
|
|
221
|
-
public
|
|
221
|
+
public customFieldType?: CustomFieldType = undefined;
|
|
222
222
|
|
|
223
223
|
@ColumnAccessControl({
|
|
224
224
|
create: [
|
|
@@ -70,7 +70,7 @@ export default class FileModel extends BaseModel {
|
|
|
70
70
|
type: ColumnType.ShortText,
|
|
71
71
|
length: ColumnLength.ShortText,
|
|
72
72
|
})
|
|
73
|
-
public
|
|
73
|
+
public fileType?: MimeType = undefined;
|
|
74
74
|
|
|
75
75
|
@ColumnAccessControl({
|
|
76
76
|
create: [Permission.CurrentUser],
|
|
@@ -218,7 +218,7 @@ export default class IncidentCustomField extends BaseModel {
|
|
|
218
218
|
type: ColumnType.ShortText,
|
|
219
219
|
length: ColumnLength.ShortText,
|
|
220
220
|
})
|
|
221
|
-
public
|
|
221
|
+
public customFieldType?: CustomFieldType = undefined;
|
|
222
222
|
|
|
223
223
|
@ColumnAccessControl({
|
|
224
224
|
create: [
|
|
@@ -218,7 +218,7 @@ export default class MonitorCustomField extends BaseModel {
|
|
|
218
218
|
type: ColumnType.ShortText,
|
|
219
219
|
length: ColumnLength.ShortText,
|
|
220
220
|
})
|
|
221
|
-
public
|
|
221
|
+
public customFieldType?: CustomFieldType = undefined;
|
|
222
222
|
|
|
223
223
|
@ColumnAccessControl({
|
|
224
224
|
create: [
|
|
@@ -218,7 +218,7 @@ export default class OnCallDutyPolicyCustomField extends BaseModel {
|
|
|
218
218
|
type: ColumnType.ShortText,
|
|
219
219
|
length: ColumnLength.ShortText,
|
|
220
220
|
})
|
|
221
|
-
public
|
|
221
|
+
public customFieldType?: CustomFieldType = undefined;
|
|
222
222
|
|
|
223
223
|
@ColumnAccessControl({
|
|
224
224
|
create: [
|
|
@@ -218,7 +218,7 @@ export default class ScheduledMaintenanceCustomField extends BaseModel {
|
|
|
218
218
|
type: ColumnType.ShortText,
|
|
219
219
|
length: ColumnLength.ShortText,
|
|
220
220
|
})
|
|
221
|
-
public
|
|
221
|
+
public customFieldType?: CustomFieldType = undefined;
|
|
222
222
|
|
|
223
223
|
@ColumnAccessControl({
|
|
224
224
|
create: [
|
|
@@ -287,7 +287,7 @@ export default class ScheduledMaintenanceTemplate extends BaseModel {
|
|
|
287
287
|
type: TableColumnType.Markdown,
|
|
288
288
|
title: "Description",
|
|
289
289
|
description:
|
|
290
|
-
"Description of this scheduled event that will show up on Status Page. This is
|
|
290
|
+
"Description of this scheduled event that will show up on Status Page. This is a markdown field.",
|
|
291
291
|
})
|
|
292
292
|
@Column({
|
|
293
293
|
nullable: true,
|
|
@@ -318,7 +318,7 @@ export default class StatusPageAnnouncement extends BaseModel {
|
|
|
318
318
|
required: true,
|
|
319
319
|
type: TableColumnType.Markdown,
|
|
320
320
|
title: "Announcement Description",
|
|
321
|
-
description: "Text of the announcement. This
|
|
321
|
+
description: "Text of the announcement. This can be in Markdown format.",
|
|
322
322
|
})
|
|
323
323
|
@Column({
|
|
324
324
|
nullable: false,
|
|
@@ -218,7 +218,7 @@ export default class StatusPageCustomField extends BaseModel {
|
|
|
218
218
|
type: ColumnType.ShortText,
|
|
219
219
|
length: ColumnLength.ShortText,
|
|
220
220
|
})
|
|
221
|
-
public
|
|
221
|
+
public customFieldType?: CustomFieldType = undefined;
|
|
222
222
|
|
|
223
223
|
@ColumnAccessControl({
|
|
224
224
|
create: [
|
package/Server/API/FileAPI.ts
CHANGED
|
@@ -31,11 +31,11 @@ export default class FileAPI extends BaseAPI<File, FileServiceType> {
|
|
|
31
31
|
},
|
|
32
32
|
select: {
|
|
33
33
|
file: true,
|
|
34
|
-
|
|
34
|
+
fileType: true,
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
if (!file || !file.file || !file.
|
|
38
|
+
if (!file || !file.file || !file.fileType) {
|
|
39
39
|
return Response.sendErrorResponse(
|
|
40
40
|
req,
|
|
41
41
|
res,
|
|
@@ -246,7 +246,7 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
246
246
|
faviconFile: {
|
|
247
247
|
file: true,
|
|
248
248
|
_id: true,
|
|
249
|
-
|
|
249
|
+
fileType: true,
|
|
250
250
|
name: true,
|
|
251
251
|
},
|
|
252
252
|
},
|
|
@@ -510,19 +510,19 @@ export default class StatusPageAPI extends BaseAPI<
|
|
|
510
510
|
coverImageFile: {
|
|
511
511
|
file: true,
|
|
512
512
|
_id: true,
|
|
513
|
-
|
|
513
|
+
fileType: true,
|
|
514
514
|
name: true,
|
|
515
515
|
},
|
|
516
516
|
faviconFile: {
|
|
517
517
|
file: true,
|
|
518
518
|
_id: true,
|
|
519
|
-
|
|
519
|
+
fileType: true,
|
|
520
520
|
name: true,
|
|
521
521
|
},
|
|
522
522
|
logoFile: {
|
|
523
523
|
file: true,
|
|
524
524
|
_id: true,
|
|
525
|
-
|
|
525
|
+
fileType: true,
|
|
526
526
|
name: true,
|
|
527
527
|
},
|
|
528
528
|
showIncidentsOnStatusPage: true,
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
|
|
3
|
+
export class MigrationName1750250435756 implements MigrationInterface {
|
|
4
|
+
public name = "MigrationName1750250435756";
|
|
5
|
+
|
|
6
|
+
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
7
|
+
await queryRunner.query(
|
|
8
|
+
`ALTER TABLE "File" RENAME COLUMN "type" TO "fileType"`,
|
|
9
|
+
);
|
|
10
|
+
await queryRunner.query(
|
|
11
|
+
`ALTER TABLE "BillingPaymentMethod" RENAME COLUMN "type" TO "paymentMethodType"`,
|
|
12
|
+
);
|
|
13
|
+
await queryRunner.query(
|
|
14
|
+
`ALTER TABLE "IncidentCustomField" RENAME COLUMN "type" TO "customFieldType"`,
|
|
15
|
+
);
|
|
16
|
+
await queryRunner.query(
|
|
17
|
+
`ALTER TABLE "MonitorCustomField" RENAME COLUMN "type" TO "customFieldType"`,
|
|
18
|
+
);
|
|
19
|
+
await queryRunner.query(
|
|
20
|
+
`ALTER TABLE "OnCallDutyPolicyCustomField" RENAME COLUMN "type" TO "customFieldType"`,
|
|
21
|
+
);
|
|
22
|
+
await queryRunner.query(
|
|
23
|
+
`ALTER TABLE "ScheduledMaintenanceCustomField" RENAME COLUMN "type" TO "customFieldType"`,
|
|
24
|
+
);
|
|
25
|
+
await queryRunner.query(
|
|
26
|
+
`ALTER TABLE "StatusPageCustomField" RENAME COLUMN "type" TO "customFieldType"`,
|
|
27
|
+
);
|
|
28
|
+
await queryRunner.query(
|
|
29
|
+
`ALTER TABLE "AlertCustomField" RENAME COLUMN "type" TO "customFieldType"`,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
34
|
+
await queryRunner.query(
|
|
35
|
+
`ALTER TABLE "AlertCustomField" RENAME COLUMN "customFieldType" TO "type"`,
|
|
36
|
+
);
|
|
37
|
+
await queryRunner.query(
|
|
38
|
+
`ALTER TABLE "StatusPageCustomField" RENAME COLUMN "customFieldType" TO "type"`,
|
|
39
|
+
);
|
|
40
|
+
await queryRunner.query(
|
|
41
|
+
`ALTER TABLE "ScheduledMaintenanceCustomField" RENAME COLUMN "customFieldType" TO "type"`,
|
|
42
|
+
);
|
|
43
|
+
await queryRunner.query(
|
|
44
|
+
`ALTER TABLE "OnCallDutyPolicyCustomField" RENAME COLUMN "customFieldType" TO "type"`,
|
|
45
|
+
);
|
|
46
|
+
await queryRunner.query(
|
|
47
|
+
`ALTER TABLE "MonitorCustomField" RENAME COLUMN "customFieldType" TO "type"`,
|
|
48
|
+
);
|
|
49
|
+
await queryRunner.query(
|
|
50
|
+
`ALTER TABLE "IncidentCustomField" RENAME COLUMN "customFieldType" TO "type"`,
|
|
51
|
+
);
|
|
52
|
+
await queryRunner.query(
|
|
53
|
+
`ALTER TABLE "BillingPaymentMethod" RENAME COLUMN "paymentMethodType" TO "type"`,
|
|
54
|
+
);
|
|
55
|
+
await queryRunner.query(
|
|
56
|
+
`ALTER TABLE "File" RENAME COLUMN "fileType" TO "type"`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -137,6 +137,7 @@ import { MigrationName1748456937826 } from "./1748456937826-MigrationName";
|
|
|
137
137
|
import { MigrationName1749065784320 } from "./1749065784320-MigrationName";
|
|
138
138
|
import { MigrationName1749133333893 } from "./1749133333893-MigrationName";
|
|
139
139
|
import { MigrationName1749813704371 } from "./1749813704371-MigrationName";
|
|
140
|
+
import { MigrationName1750250435756 } from "./1750250435756-MigrationName";
|
|
140
141
|
|
|
141
142
|
export default [
|
|
142
143
|
InitialMigration,
|
|
@@ -278,4 +279,5 @@ export default [
|
|
|
278
279
|
MigrationName1749065784320,
|
|
279
280
|
MigrationName1749133333893,
|
|
280
281
|
MigrationName1749813704371,
|
|
282
|
+
MigrationName1750250435756,
|
|
281
283
|
];
|
|
@@ -64,7 +64,7 @@ export class Service extends DatabaseService<Model> {
|
|
|
64
64
|
|
|
65
65
|
billingPaymentMethod.projectId = project.id!;
|
|
66
66
|
|
|
67
|
-
billingPaymentMethod.
|
|
67
|
+
billingPaymentMethod.paymentMethodType = paymentMethod.type;
|
|
68
68
|
billingPaymentMethod.last4Digits = paymentMethod.last4Digits;
|
|
69
69
|
billingPaymentMethod.isDefault = paymentMethod.isDefault;
|
|
70
70
|
billingPaymentMethod.paymentProviderPaymentMethodId = paymentMethod.id;
|
package/Server/Utils/Response.ts
CHANGED
|
@@ -75,7 +75,7 @@ export default class Response {
|
|
|
75
75
|
const oneUptimeResponse: OneUptimeResponse = res as OneUptimeResponse;
|
|
76
76
|
|
|
77
77
|
/** Set the proper content type */
|
|
78
|
-
oneUptimeResponse.set("Content-Type", file.
|
|
78
|
+
oneUptimeResponse.set("Content-Type", file.fileType);
|
|
79
79
|
oneUptimeResponse.status(200);
|
|
80
80
|
/** Return response */
|
|
81
81
|
// readstream.pipe(res);
|
|
@@ -60,6 +60,10 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
60
60
|
Authorization: `Bearer ${data.authToken}`,
|
|
61
61
|
["Content-Type"]: "application/x-www-form-urlencoded",
|
|
62
62
|
},
|
|
63
|
+
{
|
|
64
|
+
retries: 3,
|
|
65
|
+
exponentialBackoff: true,
|
|
66
|
+
},
|
|
63
67
|
);
|
|
64
68
|
|
|
65
69
|
logger.debug("Response from Slack API for getting user info:");
|
|
@@ -122,6 +126,10 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
122
126
|
Authorization: `Bearer ${data.authToken}`,
|
|
123
127
|
["Content-Type"]: "application/json",
|
|
124
128
|
},
|
|
129
|
+
{
|
|
130
|
+
retries: 3,
|
|
131
|
+
exponentialBackoff: true,
|
|
132
|
+
},
|
|
125
133
|
);
|
|
126
134
|
|
|
127
135
|
if (result instanceof HTTPErrorResponse) {
|
|
@@ -202,6 +210,10 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
202
210
|
Authorization: `Bearer ${data.authToken}`,
|
|
203
211
|
["Content-Type"]: "application/x-www-form-urlencoded",
|
|
204
212
|
},
|
|
213
|
+
{
|
|
214
|
+
retries: 3,
|
|
215
|
+
exponentialBackoff: true,
|
|
216
|
+
},
|
|
205
217
|
);
|
|
206
218
|
|
|
207
219
|
logger.debug("Response from Slack API for archiving channel:");
|
|
@@ -245,6 +257,10 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
245
257
|
Authorization: `Bearer ${data.authToken}`,
|
|
246
258
|
["Content-Type"]: "application/x-www-form-urlencoded",
|
|
247
259
|
},
|
|
260
|
+
{
|
|
261
|
+
retries: 3,
|
|
262
|
+
exponentialBackoff: true,
|
|
263
|
+
},
|
|
248
264
|
);
|
|
249
265
|
|
|
250
266
|
logger.debug("Response from Slack API for joining channel:");
|
|
@@ -301,6 +317,10 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
301
317
|
Authorization: `Bearer ${data.authToken}`,
|
|
302
318
|
["Content-Type"]: "application/x-www-form-urlencoded",
|
|
303
319
|
},
|
|
320
|
+
{
|
|
321
|
+
retries: 3,
|
|
322
|
+
exponentialBackoff: true,
|
|
323
|
+
},
|
|
304
324
|
);
|
|
305
325
|
|
|
306
326
|
logger.debug("Response from Slack API for inviting user:");
|
|
@@ -449,6 +469,10 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
449
469
|
Authorization: `Bearer ${data.authToken}`,
|
|
450
470
|
["Content-Type"]: "application/x-www-form-urlencoded",
|
|
451
471
|
},
|
|
472
|
+
{
|
|
473
|
+
retries: 3,
|
|
474
|
+
exponentialBackoff: true,
|
|
475
|
+
},
|
|
452
476
|
);
|
|
453
477
|
|
|
454
478
|
logger.debug("Response from Slack API for getting channel info:");
|
|
@@ -519,6 +543,10 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
519
543
|
Authorization: `Bearer ${data.authToken}`,
|
|
520
544
|
["Content-Type"]: "application/x-www-form-urlencoded",
|
|
521
545
|
},
|
|
546
|
+
{
|
|
547
|
+
retries: 3,
|
|
548
|
+
exponentialBackoff: true,
|
|
549
|
+
},
|
|
522
550
|
);
|
|
523
551
|
|
|
524
552
|
logger.debug("Response from Slack API for getting all channels:");
|
|
@@ -779,6 +807,10 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
779
807
|
Authorization: `Bearer ${data.authToken}`,
|
|
780
808
|
["Content-Type"]: "application/json",
|
|
781
809
|
},
|
|
810
|
+
{
|
|
811
|
+
retries: 3,
|
|
812
|
+
exponentialBackoff: true,
|
|
813
|
+
},
|
|
782
814
|
);
|
|
783
815
|
|
|
784
816
|
logger.debug("Response from Slack API for sending message:");
|
|
@@ -853,6 +885,10 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
853
885
|
Authorization: `Bearer ${data.authToken}`,
|
|
854
886
|
["Content-Type"]: "application/x-www-form-urlencoded",
|
|
855
887
|
},
|
|
888
|
+
{
|
|
889
|
+
retries: 3,
|
|
890
|
+
exponentialBackoff: true,
|
|
891
|
+
},
|
|
856
892
|
);
|
|
857
893
|
|
|
858
894
|
logger.debug("Response from Slack API for creating channel:");
|
|
@@ -1233,6 +1269,10 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
1233
1269
|
Authorization: `Bearer ${data.authToken}`,
|
|
1234
1270
|
["Content-Type"]: "application/x-www-form-urlencoded",
|
|
1235
1271
|
},
|
|
1272
|
+
{
|
|
1273
|
+
retries: 3,
|
|
1274
|
+
exponentialBackoff: true,
|
|
1275
|
+
},
|
|
1236
1276
|
);
|
|
1237
1277
|
|
|
1238
1278
|
if (response instanceof HTTPErrorResponse) {
|
|
@@ -1297,6 +1337,10 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
1297
1337
|
Authorization: `Bearer ${data.authToken}`,
|
|
1298
1338
|
["Content-Type"]: "application/x-www-form-urlencoded",
|
|
1299
1339
|
},
|
|
1340
|
+
{
|
|
1341
|
+
retries: 3,
|
|
1342
|
+
exponentialBackoff: true,
|
|
1343
|
+
},
|
|
1300
1344
|
);
|
|
1301
1345
|
|
|
1302
1346
|
logger.debug("Response from Slack API for getting channel members:");
|
|
@@ -1373,17 +1417,25 @@ export default class SlackUtil extends WorkspaceBase {
|
|
|
1373
1417
|
logger.debug(data);
|
|
1374
1418
|
|
|
1375
1419
|
const apiResult: HTTPResponse<JSONObject> | HTTPErrorResponse | null =
|
|
1376
|
-
await API.post(
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
type: "
|
|
1382
|
-
text:
|
|
1420
|
+
await API.post(
|
|
1421
|
+
data.url,
|
|
1422
|
+
{
|
|
1423
|
+
blocks: [
|
|
1424
|
+
{
|
|
1425
|
+
type: "section",
|
|
1426
|
+
text: {
|
|
1427
|
+
type: "mrkdwn",
|
|
1428
|
+
text: `${data.text}`,
|
|
1429
|
+
},
|
|
1383
1430
|
},
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1431
|
+
],
|
|
1432
|
+
},
|
|
1433
|
+
undefined,
|
|
1434
|
+
{
|
|
1435
|
+
retries: 3,
|
|
1436
|
+
exponentialBackoff: true,
|
|
1437
|
+
},
|
|
1438
|
+
);
|
|
1387
1439
|
|
|
1388
1440
|
logger.debug("Response from Slack API for sending message via webhook:");
|
|
1389
1441
|
logger.debug(apiResult);
|
|
@@ -60,7 +60,7 @@ const mockCreateResponse: MockCreateResponseFunction = async (
|
|
|
60
60
|
{
|
|
61
61
|
file: (await file.arrayBuffer()) as Buffer,
|
|
62
62
|
name: file.name,
|
|
63
|
-
type: file.type,
|
|
63
|
+
type: file.type as MimeType,
|
|
64
64
|
slug: file.name,
|
|
65
65
|
isPublic: true,
|
|
66
66
|
},
|
|
@@ -75,7 +75,7 @@ const mockFileModel: MockFileModelFunction = async (
|
|
|
75
75
|
): Promise<FileModel> => {
|
|
76
76
|
const fileModel: FileModel = new FileModel(new ObjectID("123"));
|
|
77
77
|
fileModel.name = file.name;
|
|
78
|
-
fileModel.
|
|
78
|
+
fileModel.fileType = file.type as MimeType;
|
|
79
79
|
fileModel.slug = file.name;
|
|
80
80
|
fileModel.isPublic = true;
|
|
81
81
|
fileModel.file = (await file.arrayBuffer()) as Buffer;
|
|
@@ -4,7 +4,7 @@ export type CategoryCheckboxValue = string | number | boolean;
|
|
|
4
4
|
|
|
5
5
|
export interface CategoryProps {
|
|
6
6
|
title?: string | ReactElement | undefined;
|
|
7
|
-
description?: string | undefined;
|
|
7
|
+
description?: string | ReactElement | undefined;
|
|
8
8
|
initialValue?: undefined | boolean;
|
|
9
9
|
onChange?: undefined | ((value: boolean, interminate?: boolean) => void);
|
|
10
10
|
value?: boolean | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Editor from "@monaco-editor/react";
|
|
2
2
|
import CodeType from "../../../Types/Code/CodeType";
|
|
3
|
+
import MarkdownUtil from "../../Utils/Markdown";
|
|
3
4
|
import React, {
|
|
4
5
|
FunctionComponent,
|
|
5
6
|
ReactElement,
|
|
@@ -32,7 +33,7 @@ const CodeEditor: FunctionComponent<ComponentProps> = (
|
|
|
32
33
|
let className: string = "";
|
|
33
34
|
|
|
34
35
|
const [placeholder, setPlaceholder] = useState<string>("");
|
|
35
|
-
const [helpText, setHelpText] = useState<string>("");
|
|
36
|
+
const [helpText, setHelpText] = useState<string | ReactElement>("");
|
|
36
37
|
const editorRef: React.MutableRefObject<any> = useRef<any>(null);
|
|
37
38
|
|
|
38
39
|
useEffect(() => {
|
|
@@ -48,7 +49,7 @@ const CodeEditor: FunctionComponent<ComponentProps> = (
|
|
|
48
49
|
useEffect(() => {
|
|
49
50
|
if (props.placeholder) {
|
|
50
51
|
if (props.type === CodeType.Markdown) {
|
|
51
|
-
setHelpText(
|
|
52
|
+
setHelpText(MarkdownUtil.getMarkdownCheatsheet(props.placeholder));
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
if (props.type === CodeType.HTML) {
|
|
@@ -51,7 +51,7 @@ const CustomFieldsDetail: FunctionComponent<ComponentProps> = (
|
|
|
51
51
|
skip: 0,
|
|
52
52
|
select: {
|
|
53
53
|
name: true,
|
|
54
|
-
|
|
54
|
+
customFieldType: true,
|
|
55
55
|
description: true,
|
|
56
56
|
} as any,
|
|
57
57
|
sort: {},
|
|
@@ -134,7 +134,7 @@ const CustomFieldsDetail: FunctionComponent<ComponentProps> = (
|
|
|
134
134
|
key: (schemaItem as any).name,
|
|
135
135
|
title: (schemaItem as any).name,
|
|
136
136
|
description: (schemaItem as any).description,
|
|
137
|
-
fieldType: (schemaItem as any).
|
|
137
|
+
fieldType: (schemaItem as any).customFieldType,
|
|
138
138
|
placeholder: "No data entered",
|
|
139
139
|
};
|
|
140
140
|
})}
|
|
@@ -160,7 +160,7 @@ const CustomFieldsDetail: FunctionComponent<ComponentProps> = (
|
|
|
160
160
|
},
|
|
161
161
|
title: (schemaItem as any).name,
|
|
162
162
|
description: (schemaItem as any).description,
|
|
163
|
-
fieldType: (schemaItem as any).
|
|
163
|
+
fieldType: (schemaItem as any).customFieldType,
|
|
164
164
|
required: false,
|
|
165
165
|
placeholder: "",
|
|
166
166
|
};
|
|
@@ -230,12 +230,13 @@ const Detail: DetailFunction = <T extends GenericObject>(
|
|
|
230
230
|
if (
|
|
231
231
|
props.item[fieldKey] &&
|
|
232
232
|
(props.item[fieldKey] as unknown as FileModel).file &&
|
|
233
|
-
(props.item[fieldKey] as unknown as FileModel).
|
|
233
|
+
(props.item[fieldKey] as unknown as FileModel).fileType
|
|
234
234
|
) {
|
|
235
235
|
const blob: Blob = new Blob(
|
|
236
236
|
[(props.item[fieldKey] as unknown as FileModel).file as Uint8Array],
|
|
237
237
|
{
|
|
238
|
-
type: (props.item[fieldKey] as unknown as FileModel)
|
|
238
|
+
type: (props.item[fieldKey] as unknown as FileModel)
|
|
239
|
+
.fileType as string,
|
|
239
240
|
},
|
|
240
241
|
);
|
|
241
242
|
|
|
@@ -15,7 +15,7 @@ export interface DetailSideLink {
|
|
|
15
15
|
|
|
16
16
|
export interface FieldBase<T> {
|
|
17
17
|
title?: string;
|
|
18
|
-
description?: string;
|
|
18
|
+
description?: string | ReactElement;
|
|
19
19
|
fieldTitleSize?: Size | undefined;
|
|
20
20
|
fieldType?: FieldType;
|
|
21
21
|
dropdownOptions?: Array<DropdownOption> | undefined;
|
|
@@ -10,7 +10,7 @@ export enum Size {
|
|
|
10
10
|
|
|
11
11
|
export interface ComponentProps {
|
|
12
12
|
title?: string | undefined;
|
|
13
|
-
description?: string | undefined;
|
|
13
|
+
description?: string | ReactElement | undefined;
|
|
14
14
|
alignClassName?: string | undefined;
|
|
15
15
|
sideLink?: DetailSideLink | undefined;
|
|
16
16
|
size?: Size | undefined;
|
|
@@ -99,7 +99,7 @@ const FilePicker: FunctionComponent<ComponentProps> = (
|
|
|
99
99
|
const fileBuffer: Uint8Array = new Uint8Array(arrayBuffer);
|
|
100
100
|
fileModel.file = Buffer.from(fileBuffer);
|
|
101
101
|
fileModel.isPublic = false;
|
|
102
|
-
fileModel.
|
|
102
|
+
fileModel.fileType = acceptedFile.type as MimeType;
|
|
103
103
|
|
|
104
104
|
const result: HTTPResponse<FileModel> =
|
|
105
105
|
(await ModelAPI.create<FileModel>({
|
|
@@ -132,7 +132,7 @@ const FilePicker: FunctionComponent<ComponentProps> = (
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
const blob: Blob = new Blob([file.file as Uint8Array], {
|
|
135
|
-
type: file.
|
|
135
|
+
type: file.fileType as string,
|
|
136
136
|
});
|
|
137
137
|
const url: string = URL.createObjectURL(blob);
|
|
138
138
|
|
|
@@ -198,7 +198,8 @@ const FormField: <T extends GenericObject>(
|
|
|
198
198
|
codeType = CodeType.JavaScript;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
let fieldDescription: string | undefined =
|
|
201
|
+
let fieldDescription: string | ReactElement | undefined =
|
|
202
|
+
props.field.description;
|
|
202
203
|
|
|
203
204
|
if (
|
|
204
205
|
props.field.fieldType === FormFieldSchemaType.DateTime ||
|
|
@@ -42,7 +42,7 @@ export interface CategoryCheckboxProps {
|
|
|
42
42
|
export default interface Field<TEntity> {
|
|
43
43
|
name?: string; // form field name, should be unique in thr form. If not provided, the field will be auto generated.
|
|
44
44
|
title?: string;
|
|
45
|
-
description?: string;
|
|
45
|
+
description?: string | ReactElement;
|
|
46
46
|
field?: SelectFormFields<TEntity> | undefined;
|
|
47
47
|
placeholder?: string;
|
|
48
48
|
showEvenIfPermissionDoesNotExist?: boolean; // show this field even if user does not have permissions to view.
|
|
@@ -19,7 +19,7 @@ export interface ComponentProps {
|
|
|
19
19
|
export class ImageFunctions {
|
|
20
20
|
public static getImageURL(file: File): string {
|
|
21
21
|
const blob: Blob = new Blob([file.file as Uint8Array], {
|
|
22
|
-
type: (file as File).
|
|
22
|
+
type: (file as File).fileType as string,
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
const url: string = URL.createObjectURL(blob);
|
|
@@ -54,7 +54,7 @@ const Image: FunctionComponent<ComponentProps> = (
|
|
|
54
54
|
return getImageElement(props.imageUrl.toString());
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
if (props.file && props.file.file && props.file.
|
|
57
|
+
if (props.file && props.file.file && props.file.fileType) {
|
|
58
58
|
const url: string = ImageFunctions.getImageURL(props.file);
|
|
59
59
|
return getImageElement(url);
|
|
60
60
|
}
|
|
@@ -424,7 +424,7 @@ const BaseModelTable: <TBaseModel extends BaseModel | AnalyticsBaseModel>(
|
|
|
424
424
|
(relationSelect as JSONObject)[key] = {
|
|
425
425
|
file: true,
|
|
426
426
|
_id: true,
|
|
427
|
-
|
|
427
|
+
fileType: true,
|
|
428
428
|
name: true,
|
|
429
429
|
};
|
|
430
430
|
} else if (key && model.isEntityColumn(key)) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
import Link from "../Components/Link/Link";
|
|
3
|
+
import URL from "../../Types/API/URL";
|
|
4
|
+
|
|
5
|
+
export default class MarkdownUtil {
|
|
6
|
+
public static getMarkdownCheatsheet(prefix?: string): ReactElement {
|
|
7
|
+
const prefixText: string = prefix ? `${prefix}. ` : "";
|
|
8
|
+
return (
|
|
9
|
+
<p>
|
|
10
|
+
{prefixText}This is in Markdown.{" "}
|
|
11
|
+
<Link
|
|
12
|
+
to={URL.fromString("https://www.markdownguide.org/cheat-sheet/")}
|
|
13
|
+
openInNewTab={true}
|
|
14
|
+
className="underline text-blue-500 hover:text-blue-700"
|
|
15
|
+
>
|
|
16
|
+
Learn more about Markdown syntax
|
|
17
|
+
</Link>
|
|
18
|
+
.
|
|
19
|
+
</p>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -197,7 +197,7 @@ __decorate([
|
|
|
197
197
|
required: false,
|
|
198
198
|
type: TableColumnType.Markdown,
|
|
199
199
|
title: "Description",
|
|
200
|
-
description: "Short description of this alert. This
|
|
200
|
+
description: "Short description of this alert. This will be visible on the status page. This is in markdown.",
|
|
201
201
|
}),
|
|
202
202
|
Column({
|
|
203
203
|
nullable: true,
|