@oneuptime/common 9.2.27 → 9.3.0
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/AIAgent.ts +589 -0
- package/Models/DatabaseModels/AIAgentOwnerTeam.ts +434 -0
- package/Models/DatabaseModels/AIAgentOwnerUser.ts +433 -0
- package/Models/DatabaseModels/AIAgentTask.ts +549 -0
- package/Models/DatabaseModels/AIAgentTaskLog.ts +417 -0
- package/Models/DatabaseModels/AIAgentTaskPullRequest.ts +731 -0
- package/Models/DatabaseModels/AIAgentTaskTelemetryException.ts +388 -0
- package/Models/DatabaseModels/Index.ts +15 -0
- package/Models/DatabaseModels/Monitor.ts +33 -0
- package/Models/DatabaseModels/Project.ts +25 -0
- package/Models/DatabaseModels/TelemetryException.ts +1 -1
- package/Server/API/AIAgentAPI.ts +200 -0
- package/Server/API/AIAgentDataAPI.ts +692 -0
- package/Server/API/AIAgentTaskAPI.ts +286 -0
- package/Server/API/AIAgentTaskLogAPI.ts +165 -0
- package/Server/API/AIAgentTaskPullRequestAPI.ts +14 -0
- package/Server/API/GitHubAPI.ts +25 -7
- package/Server/API/TelemetryExceptionAPI.ts +169 -0
- package/Server/EnvironmentConfig.ts +3 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766590916627-MigrationName.ts +195 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766600860972-MigrationName.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766606720183-MigrationName.ts +17 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766688107858-MigrationName.ts +63 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766754182870-MigrationName.ts +75 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766774689743-MigrationName.ts +157 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766777986427-MigrationName.ts +33 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766918848434-AddAIAgentIsDefault.ts +27 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766923324521-MigrationName.ts +37 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1766958924188-AddGitHubAppInstallationIdToProject.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1767009661768-MigrationName.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +22 -0
- package/Server/Services/AIAgentOwnerTeamService.ts +10 -0
- package/Server/Services/AIAgentOwnerUserService.ts +10 -0
- package/Server/Services/AIAgentService.ts +564 -0
- package/Server/Services/AIAgentTaskLogService.ts +10 -0
- package/Server/Services/AIAgentTaskPullRequestService.ts +10 -0
- package/Server/Services/AIAgentTaskService.ts +178 -0
- package/Server/Services/AIAgentTaskTelemetryExceptionService.ts +39 -0
- package/Server/Services/Index.ts +10 -0
- package/Server/Services/TelemetryExceptionService.ts +162 -0
- package/Server/Utils/Monitor/MonitorResource.ts +228 -0
- package/Server/Utils/PushNotificationUtil.ts +29 -0
- package/Server/Utils/WhatsAppTemplateUtil.ts +6 -0
- package/Tests/UI/Components/Badge.test.tsx +5 -5
- package/Tests/UI/Components/Card.test.tsx +4 -8
- package/Tests/UI/Components/HiddenText.test.tsx +2 -5
- package/Tests/UI/Components/SideMenuItem.test.tsx +4 -2
- package/Types/AI/AIAgentTaskMetadata.ts +25 -0
- package/Types/AI/AIAgentTaskStatus.ts +65 -0
- package/Types/AI/AIAgentTaskType.ts +40 -0
- package/Types/Email/EmailTemplateType.ts +2 -0
- package/Types/Monitor/MonitorEvaluationSummary.ts +2 -1
- package/Types/NotificationSetting/NotificationSettingEventType.ts +4 -0
- package/Types/Permission.ts +176 -0
- package/Types/WhatsApp/WhatsAppTemplates.ts +9 -0
- package/UI/Components/AIAgent/AIAgent.tsx +69 -0
- package/UI/Components/Badge/Badge.tsx +9 -5
- package/UI/Components/Banner/Banner.tsx +1 -1
- package/UI/Components/Card/Card.tsx +14 -12
- package/UI/Components/CodeBlock/CodeBlock.tsx +47 -4
- package/UI/Components/Detail/Detail.tsx +239 -49
- package/UI/Components/Detail/FieldLabel.tsx +35 -11
- package/UI/Components/Detail/PlaceholderText.tsx +18 -1
- package/UI/Components/Footer/Footer.tsx +9 -7
- package/UI/Components/Header/Header.tsx +4 -3
- package/UI/Components/Header/HeaderIconDropdownButton.tsx +13 -11
- package/UI/Components/Header/IconDropdown/IconDropdownItem.tsx +3 -3
- package/UI/Components/Header/IconDropdown/IconDropdownMenu.tsx +1 -1
- package/UI/Components/Header/ProjectPicker/CreateNewProjectButton.tsx +4 -4
- package/UI/Components/Header/ProjectPicker/ProjectPicker.tsx +6 -6
- package/UI/Components/Header/ProjectPicker/ProjectPickerFilterBox.tsx +3 -3
- package/UI/Components/Header/ProjectPicker/ProjectPickerMenu.tsx +1 -1
- package/UI/Components/Header/ProjectPicker/ProjectPickerMenuItem.tsx +4 -4
- package/UI/Components/HeaderAlert/HeaderAlert.tsx +32 -32
- package/UI/Components/HeaderAlert/HeaderAlertGroup.tsx +1 -7
- package/UI/Components/HiddenText/HiddenText.tsx +98 -27
- package/UI/Components/Icon/Icon.tsx +12 -9
- package/UI/Components/InfoCard/InfoCard.tsx +7 -3
- package/UI/Components/ModelTable/BaseModelTable.tsx +1 -1
- package/UI/Components/ObjectID/ObjectIDView.tsx +73 -0
- package/UI/Components/Page/Page.tsx +3 -5
- package/UI/Components/SideMenu/SideMenu.tsx +175 -40
- package/UI/Components/SideMenu/SideMenuDivider.tsx +17 -0
- package/UI/Components/SideMenu/SideMenuItem.tsx +111 -158
- package/UI/Components/SideMenu/SideMenuSection.tsx +53 -3
- package/UI/Components/Table/Table.tsx +1 -1
- package/UI/Components/Types/FieldType.ts +2 -0
- package/UI/Config.ts +5 -0
- package/build/dist/Models/DatabaseModels/AIAgent.js +614 -0
- package/build/dist/Models/DatabaseModels/AIAgent.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentOwnerTeam.js +452 -0
- package/build/dist/Models/DatabaseModels/AIAgentOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentOwnerUser.js +451 -0
- package/build/dist/Models/DatabaseModels/AIAgentOwnerUser.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentTask.js +580 -0
- package/build/dist/Models/DatabaseModels/AIAgentTask.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskLog.js +438 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskLog.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js +771 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskPullRequest.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskTelemetryException.js +404 -0
- package/build/dist/Models/DatabaseModels/AIAgentTaskTelemetryException.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Index.js +14 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Monitor.js +34 -0
- package/build/dist/Models/DatabaseModels/Monitor.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +26 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryException.js +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryException.js.map +1 -1
- package/build/dist/Server/API/AIAgentAPI.js +141 -0
- package/build/dist/Server/API/AIAgentAPI.js.map +1 -0
- package/build/dist/Server/API/AIAgentDataAPI.js +415 -0
- package/build/dist/Server/API/AIAgentDataAPI.js.map +1 -0
- package/build/dist/Server/API/AIAgentTaskAPI.js +199 -0
- package/build/dist/Server/API/AIAgentTaskAPI.js.map +1 -0
- package/build/dist/Server/API/AIAgentTaskLogAPI.js +106 -0
- package/build/dist/Server/API/AIAgentTaskLogAPI.js.map +1 -0
- package/build/dist/Server/API/AIAgentTaskPullRequestAPI.js +9 -0
- package/build/dist/Server/API/AIAgentTaskPullRequestAPI.js.map +1 -0
- package/build/dist/Server/API/GitHubAPI.js +23 -8
- package/build/dist/Server/API/GitHubAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryExceptionAPI.js +120 -0
- package/build/dist/Server/API/TelemetryExceptionAPI.js.map +1 -0
- package/build/dist/Server/EnvironmentConfig.js +2 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766590916627-MigrationName.js +74 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766590916627-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766600860972-MigrationName.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766600860972-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766606720183-MigrationName.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766606720183-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766688107858-MigrationName.js +28 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766688107858-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766754182870-MigrationName.js +32 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766754182870-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766774689743-MigrationName.js +60 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766774689743-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766777986427-MigrationName.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766777986427-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766918848434-AddAIAgentIsDefault.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766918848434-AddAIAgentIsDefault.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766923324521-MigrationName.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766923324521-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766958924188-AddGitHubAppInstallationIdToProject.js +16 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1766958924188-AddGitHubAppInstallationIdToProject.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1767009661768-MigrationName.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1767009661768-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Services/AIAgentOwnerTeamService.js +9 -0
- package/build/dist/Server/Services/AIAgentOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/AIAgentOwnerUserService.js +9 -0
- package/build/dist/Server/Services/AIAgentOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/AIAgentService.js +471 -0
- package/build/dist/Server/Services/AIAgentService.js.map +1 -0
- package/build/dist/Server/Services/AIAgentTaskLogService.js +9 -0
- package/build/dist/Server/Services/AIAgentTaskLogService.js.map +1 -0
- package/build/dist/Server/Services/AIAgentTaskPullRequestService.js +9 -0
- package/build/dist/Server/Services/AIAgentTaskPullRequestService.js.map +1 -0
- package/build/dist/Server/Services/AIAgentTaskService.js +158 -0
- package/build/dist/Server/Services/AIAgentTaskService.js.map +1 -0
- package/build/dist/Server/Services/AIAgentTaskTelemetryExceptionService.js +36 -0
- package/build/dist/Server/Services/AIAgentTaskTelemetryExceptionService.js.map +1 -0
- package/build/dist/Server/Services/Index.js +10 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/TelemetryExceptionService.js +137 -0
- package/build/dist/Server/Services/TelemetryExceptionService.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +168 -0
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/PushNotificationUtil.js +21 -0
- package/build/dist/Server/Utils/PushNotificationUtil.js.map +1 -1
- package/build/dist/Server/Utils/WhatsAppTemplateUtil.js +4 -0
- package/build/dist/Server/Utils/WhatsAppTemplateUtil.js.map +1 -1
- package/build/dist/Tests/UI/Components/Badge.test.js +5 -5
- package/build/dist/Tests/UI/Components/Badge.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/Card.test.js +4 -8
- package/build/dist/Tests/UI/Components/Card.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/HiddenText.test.js +2 -3
- package/build/dist/Tests/UI/Components/HiddenText.test.js.map +1 -1
- package/build/dist/Tests/UI/Components/SideMenuItem.test.js +3 -2
- package/build/dist/Tests/UI/Components/SideMenuItem.test.js.map +1 -1
- package/build/dist/Types/AI/AIAgentTaskMetadata.js +6 -0
- package/build/dist/Types/AI/AIAgentTaskMetadata.js.map +1 -0
- package/build/dist/Types/AI/AIAgentTaskStatus.js +51 -0
- package/build/dist/Types/AI/AIAgentTaskStatus.js.map +1 -0
- package/build/dist/Types/AI/AIAgentTaskType.js +29 -0
- package/build/dist/Types/AI/AIAgentTaskType.js.map +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js +2 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js +3 -0
- package/build/dist/Types/NotificationSetting/NotificationSettingEventType.js.map +1 -1
- package/build/dist/Types/Permission.js +160 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/WhatsApp/WhatsAppTemplates.js +6 -0
- package/build/dist/Types/WhatsApp/WhatsAppTemplates.js.map +1 -1
- package/build/dist/UI/Components/AIAgent/AIAgent.js +32 -0
- package/build/dist/UI/Components/AIAgent/AIAgent.js.map +1 -0
- package/build/dist/UI/Components/Badge/Badge.js +9 -5
- package/build/dist/UI/Components/Badge/Badge.js.map +1 -1
- package/build/dist/UI/Components/Banner/Banner.js +1 -1
- package/build/dist/UI/Components/Banner/Banner.js.map +1 -1
- package/build/dist/UI/Components/Card/Card.js +12 -12
- package/build/dist/UI/Components/Card/Card.js.map +1 -1
- package/build/dist/UI/Components/CodeBlock/CodeBlock.js +22 -2
- package/build/dist/UI/Components/CodeBlock/CodeBlock.js.map +1 -1
- package/build/dist/UI/Components/Detail/Detail.js +117 -37
- package/build/dist/UI/Components/Detail/Detail.js.map +1 -1
- package/build/dist/UI/Components/Detail/FieldLabel.js +12 -7
- package/build/dist/UI/Components/Detail/FieldLabel.js.map +1 -1
- package/build/dist/UI/Components/Detail/PlaceholderText.js +4 -1
- package/build/dist/UI/Components/Detail/PlaceholderText.js.map +1 -1
- package/build/dist/UI/Components/Footer/Footer.js +6 -6
- package/build/dist/UI/Components/Footer/Footer.js.map +1 -1
- package/build/dist/UI/Components/Header/Header.js +4 -3
- package/build/dist/UI/Components/Header/Header.js.map +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +7 -7
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
- package/build/dist/UI/Components/Header/IconDropdown/IconDropdownItem.js +3 -3
- package/build/dist/UI/Components/Header/IconDropdown/IconDropdownItem.js.map +1 -1
- package/build/dist/UI/Components/Header/IconDropdown/IconDropdownMenu.js +1 -1
- package/build/dist/UI/Components/Header/IconDropdown/IconDropdownMenu.js.map +1 -1
- package/build/dist/UI/Components/Header/ProjectPicker/CreateNewProjectButton.js +4 -4
- package/build/dist/UI/Components/Header/ProjectPicker/CreateNewProjectButton.js.map +1 -1
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPicker.js +6 -6
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPicker.js.map +1 -1
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPickerFilterBox.js +2 -2
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPickerFilterBox.js.map +1 -1
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPickerMenu.js +1 -1
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPickerMenu.js.map +1 -1
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPickerMenuItem.js +4 -4
- package/build/dist/UI/Components/Header/ProjectPicker/ProjectPickerMenuItem.js.map +1 -1
- package/build/dist/UI/Components/HeaderAlert/HeaderAlert.js +31 -29
- package/build/dist/UI/Components/HeaderAlert/HeaderAlert.js.map +1 -1
- package/build/dist/UI/Components/HeaderAlert/HeaderAlertGroup.js +1 -3
- package/build/dist/UI/Components/HeaderAlert/HeaderAlertGroup.js.map +1 -1
- package/build/dist/UI/Components/HiddenText/HiddenText.js +33 -14
- package/build/dist/UI/Components/HiddenText/HiddenText.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +3 -4
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js +3 -3
- package/build/dist/UI/Components/InfoCard/InfoCard.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/Components/ObjectID/ObjectIDView.js +30 -0
- package/build/dist/UI/Components/ObjectID/ObjectIDView.js.map +1 -0
- package/build/dist/UI/Components/Page/Page.js +3 -3
- package/build/dist/UI/Components/Page/Page.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenu.js +82 -17
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuDivider.js +7 -0
- package/build/dist/UI/Components/SideMenu/SideMenuDivider.js.map +1 -0
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js +68 -97
- package/build/dist/UI/Components/SideMenu/SideMenuItem.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenuSection.js +18 -3
- package/build/dist/UI/Components/SideMenu/SideMenuSection.js.map +1 -1
- package/build/dist/UI/Components/Table/Table.js +1 -1
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Types/FieldType.js +2 -0
- package/build/dist/UI/Components/Types/FieldType.js.map +1 -1
- package/build/dist/UI/Config.js +2 -0
- package/build/dist/UI/Config.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import Icon, { SizeProp, ThickProp } from "../Icon/Icon";
|
|
2
|
+
import Tooltip from "../Tooltip/Tooltip";
|
|
3
|
+
import IconProp from "../../../Types/Icon/IconProp";
|
|
4
|
+
import React, { FunctionComponent, ReactElement, useState } from "react";
|
|
5
|
+
|
|
6
|
+
export interface ComponentProps {
|
|
7
|
+
objectId: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const ObjectIDView: FunctionComponent<ComponentProps> = (
|
|
11
|
+
props: ComponentProps,
|
|
12
|
+
): ReactElement => {
|
|
13
|
+
const [copied, setCopied] = useState<boolean>(false);
|
|
14
|
+
|
|
15
|
+
const handleCopy: () => Promise<void> = async (): Promise<void> => {
|
|
16
|
+
await navigator.clipboard?.writeText(props.objectId);
|
|
17
|
+
setCopied(true);
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
setCopied(false);
|
|
20
|
+
}, 2000);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
className="inline-flex items-center gap-2 group/objectid cursor-pointer"
|
|
26
|
+
onClick={handleCopy}
|
|
27
|
+
role="button"
|
|
28
|
+
tabIndex={0}
|
|
29
|
+
onKeyDown={async (e: React.KeyboardEvent) => {
|
|
30
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
31
|
+
await handleCopy();
|
|
32
|
+
}
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<Tooltip text={copied ? "Copied!" : "Click to copy"}>
|
|
36
|
+
<div
|
|
37
|
+
className={`inline-flex items-center gap-2 px-2.5 py-1.5 rounded-md font-mono text-sm transition-all duration-200 ${
|
|
38
|
+
copied
|
|
39
|
+
? "bg-green-50 border border-green-200 text-green-700"
|
|
40
|
+
: "bg-gray-50 border border-gray-200 text-gray-700 hover:bg-gray-100 hover:border-gray-300"
|
|
41
|
+
}`}
|
|
42
|
+
>
|
|
43
|
+
<code className="break-all">{props.objectId}</code>
|
|
44
|
+
<div
|
|
45
|
+
className={`flex-shrink-0 transition-all duration-200 ${
|
|
46
|
+
copied
|
|
47
|
+
? "text-green-500"
|
|
48
|
+
: "text-gray-400 group-hover/objectid:text-gray-600"
|
|
49
|
+
}`}
|
|
50
|
+
>
|
|
51
|
+
{copied ? (
|
|
52
|
+
<Icon
|
|
53
|
+
icon={IconProp.CheckCircle}
|
|
54
|
+
size={SizeProp.Small}
|
|
55
|
+
thick={ThickProp.Thick}
|
|
56
|
+
className="h-3.5 w-3.5"
|
|
57
|
+
/>
|
|
58
|
+
) : (
|
|
59
|
+
<Icon
|
|
60
|
+
icon={IconProp.Copy}
|
|
61
|
+
size={SizeProp.Small}
|
|
62
|
+
thick={ThickProp.Thick}
|
|
63
|
+
className="h-3.5 w-3.5"
|
|
64
|
+
/>
|
|
65
|
+
)}
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</Tooltip>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default ObjectIDView;
|
|
@@ -96,16 +96,14 @@ const Page: FunctionComponent<ComponentProps> = (
|
|
|
96
96
|
|
|
97
97
|
{props.sideMenu && (
|
|
98
98
|
<main className="mx-auto max-w-full pb-10">
|
|
99
|
-
<div className="
|
|
99
|
+
<div className="flex flex-col md:flex-row md:gap-4 lg:gap-5">
|
|
100
100
|
{props.sideMenu}
|
|
101
101
|
|
|
102
102
|
{!props.isLoading && (
|
|
103
|
-
<div className="space-y-6
|
|
104
|
-
{props.children}
|
|
105
|
-
</div>
|
|
103
|
+
<div className="space-y-6 flex-1 min-w-0">{props.children}</div>
|
|
106
104
|
)}
|
|
107
105
|
{props.isLoading && (
|
|
108
|
-
<div className="
|
|
106
|
+
<div className="flex-1 min-w-0">
|
|
109
107
|
<PageLoader isVisible={true} />
|
|
110
108
|
</div>
|
|
111
109
|
)}
|
|
@@ -4,7 +4,7 @@ import React, {
|
|
|
4
4
|
useState,
|
|
5
5
|
useEffect,
|
|
6
6
|
} from "react";
|
|
7
|
-
import
|
|
7
|
+
import Icon from "../Icon/Icon";
|
|
8
8
|
import IconProp from "../../../Types/Icon/IconProp";
|
|
9
9
|
import useComponentOutsideClick from "../../Types/UseComponentOutsideClick";
|
|
10
10
|
import Navigation from "../../Utils/Navigation";
|
|
@@ -37,12 +37,17 @@ export interface SideMenuItemProps {
|
|
|
37
37
|
export interface SideMenuSectionProps {
|
|
38
38
|
title: string;
|
|
39
39
|
items: SideMenuItemProps[];
|
|
40
|
+
icon?: IconProp;
|
|
41
|
+
defaultCollapsed?: boolean;
|
|
42
|
+
collapsible?: boolean;
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
export interface ComponentProps {
|
|
43
46
|
sections?: SideMenuSectionProps[];
|
|
44
47
|
items?: SideMenuItemProps[];
|
|
45
48
|
className?: string;
|
|
49
|
+
header?: ReactElement;
|
|
50
|
+
footer?: ReactElement;
|
|
46
51
|
// Keep children support for backward compatibility
|
|
47
52
|
children?: ReactElement | Array<ReactElement>;
|
|
48
53
|
}
|
|
@@ -89,19 +94,29 @@ const SideMenu: FunctionComponent<ComponentProps> = (props: ComponentProps) => {
|
|
|
89
94
|
const findActiveMenuItem: () => {
|
|
90
95
|
sectionTitle?: string;
|
|
91
96
|
itemTitle?: string;
|
|
97
|
+
icon?: IconProp;
|
|
92
98
|
} = (): {
|
|
93
99
|
sectionTitle?: string;
|
|
94
100
|
itemTitle?: string;
|
|
101
|
+
icon?: IconProp;
|
|
95
102
|
} => {
|
|
96
103
|
// Check sections first
|
|
97
104
|
if (props.sections) {
|
|
98
105
|
for (const section of props.sections) {
|
|
99
106
|
for (const item of section.items) {
|
|
100
107
|
if (Navigation.isOnThisPage(item.link.to)) {
|
|
101
|
-
|
|
108
|
+
const result: {
|
|
109
|
+
sectionTitle: string;
|
|
110
|
+
itemTitle: string;
|
|
111
|
+
icon?: IconProp;
|
|
112
|
+
} = {
|
|
102
113
|
sectionTitle: section.title,
|
|
103
114
|
itemTitle: item.link.title,
|
|
104
115
|
};
|
|
116
|
+
if (item.icon) {
|
|
117
|
+
result.icon = item.icon;
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
105
120
|
}
|
|
106
121
|
}
|
|
107
122
|
}
|
|
@@ -111,9 +126,16 @@ const SideMenu: FunctionComponent<ComponentProps> = (props: ComponentProps) => {
|
|
|
111
126
|
if (props.items) {
|
|
112
127
|
for (const item of props.items) {
|
|
113
128
|
if (Navigation.isOnThisPage(item.link.to)) {
|
|
114
|
-
|
|
129
|
+
const result: {
|
|
130
|
+
itemTitle: string;
|
|
131
|
+
icon?: IconProp;
|
|
132
|
+
} = {
|
|
115
133
|
itemTitle: item.link.title,
|
|
116
134
|
};
|
|
135
|
+
if (item.icon) {
|
|
136
|
+
result.icon = item.icon;
|
|
137
|
+
}
|
|
138
|
+
return result;
|
|
117
139
|
}
|
|
118
140
|
}
|
|
119
141
|
}
|
|
@@ -124,10 +146,11 @@ const SideMenu: FunctionComponent<ComponentProps> = (props: ComponentProps) => {
|
|
|
124
146
|
const activeItem: {
|
|
125
147
|
sectionTitle?: string;
|
|
126
148
|
itemTitle?: string;
|
|
149
|
+
icon?: IconProp;
|
|
127
150
|
} = findActiveMenuItem();
|
|
128
151
|
const displayText: string =
|
|
129
152
|
activeItem.sectionTitle && activeItem.itemTitle
|
|
130
|
-
? `${activeItem.sectionTitle}
|
|
153
|
+
? `${activeItem.sectionTitle} / ${activeItem.itemTitle}`
|
|
131
154
|
: activeItem.itemTitle || "Navigation";
|
|
132
155
|
|
|
133
156
|
// Re-run active item detection when location changes
|
|
@@ -146,11 +169,30 @@ const SideMenu: FunctionComponent<ComponentProps> = (props: ComponentProps) => {
|
|
|
146
169
|
if (props.sections) {
|
|
147
170
|
props.sections.forEach(
|
|
148
171
|
(section: SideMenuSectionProps, sectionIndex: number) => {
|
|
172
|
+
// Build section props conditionally to avoid undefined values
|
|
173
|
+
const sectionProps: {
|
|
174
|
+
key: string;
|
|
175
|
+
title: string;
|
|
176
|
+
icon?: IconProp;
|
|
177
|
+
defaultCollapsed?: boolean;
|
|
178
|
+
collapsible?: boolean;
|
|
179
|
+
} = {
|
|
180
|
+
key: `section-${sectionIndex}`,
|
|
181
|
+
title: section.title,
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
if (section.icon) {
|
|
185
|
+
sectionProps.icon = section.icon;
|
|
186
|
+
}
|
|
187
|
+
if (section.defaultCollapsed !== undefined) {
|
|
188
|
+
sectionProps.defaultCollapsed = section.defaultCollapsed;
|
|
189
|
+
}
|
|
190
|
+
if (section.collapsible !== undefined) {
|
|
191
|
+
sectionProps.collapsible = section.collapsible;
|
|
192
|
+
}
|
|
193
|
+
|
|
149
194
|
content.push(
|
|
150
|
-
<SideMenuSection
|
|
151
|
-
key={`section-${sectionIndex}`}
|
|
152
|
-
title={section.title}
|
|
153
|
-
>
|
|
195
|
+
<SideMenuSection {...sectionProps}>
|
|
154
196
|
{section.items.map(
|
|
155
197
|
(item: SideMenuItemProps, itemIndex: number) => {
|
|
156
198
|
// If item has modelType, render CountModelSideMenuItem
|
|
@@ -250,40 +292,105 @@ const SideMenu: FunctionComponent<ComponentProps> = (props: ComponentProps) => {
|
|
|
250
292
|
return (
|
|
251
293
|
<div className="md:hidden mb-6">
|
|
252
294
|
{/* Mobile toggle button */}
|
|
253
|
-
<
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
295
|
+
<button
|
|
296
|
+
type="button"
|
|
297
|
+
onClick={() => {
|
|
298
|
+
setIsMobileMenuOpen(!isMobileMenuVisible);
|
|
299
|
+
}}
|
|
300
|
+
className={`
|
|
301
|
+
w-full flex items-center justify-between
|
|
302
|
+
px-3 py-2.5
|
|
303
|
+
bg-white rounded-xl
|
|
304
|
+
border border-gray-200
|
|
305
|
+
shadow-sm
|
|
306
|
+
transition-all duration-200
|
|
307
|
+
${isMobileMenuVisible ? "ring-2 ring-indigo-100 border-indigo-200" : "hover:border-gray-300"}
|
|
308
|
+
`}
|
|
309
|
+
aria-expanded={isMobileMenuVisible}
|
|
310
|
+
aria-label={
|
|
311
|
+
isMobileMenuVisible
|
|
312
|
+
? "Close navigation menu"
|
|
313
|
+
: "Open navigation menu"
|
|
314
|
+
}
|
|
315
|
+
data-testid="mobile-sidemenu-toggle"
|
|
316
|
+
>
|
|
317
|
+
<div className="flex items-center gap-2 min-w-0">
|
|
318
|
+
{activeItem.icon && (
|
|
319
|
+
<div className="flex items-center justify-center w-6 h-6 rounded-md bg-indigo-50 text-indigo-600 flex-shrink-0">
|
|
320
|
+
<Icon icon={activeItem.icon} className="h-3.5 w-3.5" />
|
|
321
|
+
</div>
|
|
322
|
+
)}
|
|
323
|
+
<div className="min-w-0">
|
|
324
|
+
<p className="text-xs text-gray-400 font-medium">Navigate to</p>
|
|
325
|
+
<h3 className="text-sm font-semibold text-gray-900 truncate">
|
|
326
|
+
{displayText}
|
|
327
|
+
</h3>
|
|
328
|
+
</div>
|
|
258
329
|
</div>
|
|
259
|
-
<Button
|
|
260
|
-
buttonStyle={ButtonStyleType.OUTLINE}
|
|
261
|
-
onClick={() => {
|
|
262
|
-
setIsMobileMenuOpen(!isMobileMenuVisible);
|
|
263
|
-
}}
|
|
264
|
-
className="p-2 flex-shrink-0"
|
|
265
|
-
icon={isMobileMenuVisible ? IconProp.Close : IconProp.Bars3}
|
|
266
|
-
dataTestId="mobile-sidemenu-toggle"
|
|
267
|
-
tooltip={
|
|
268
|
-
isMobileMenuVisible
|
|
269
|
-
? "Close navigation menu"
|
|
270
|
-
: "Open navigation menu"
|
|
271
|
-
}
|
|
272
|
-
/>
|
|
273
|
-
</div>
|
|
274
|
-
|
|
275
|
-
{/* Mobile collapsible menu */}
|
|
276
|
-
{isMobileMenuVisible && (
|
|
277
330
|
<div
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
331
|
+
className={`
|
|
332
|
+
flex items-center justify-center
|
|
333
|
+
w-6 h-6 rounded-md
|
|
334
|
+
transition-all duration-200
|
|
335
|
+
${isMobileMenuVisible ? "bg-indigo-100 text-indigo-600" : "bg-gray-100 text-gray-500"}
|
|
336
|
+
`}
|
|
282
337
|
>
|
|
283
|
-
<
|
|
284
|
-
{
|
|
285
|
-
|
|
338
|
+
<Icon
|
|
339
|
+
icon={isMobileMenuVisible ? IconProp.Close : IconProp.Bars3}
|
|
340
|
+
className="h-3.5 w-3.5"
|
|
341
|
+
/>
|
|
286
342
|
</div>
|
|
343
|
+
</button>
|
|
344
|
+
|
|
345
|
+
{/* Mobile collapsible menu with overlay */}
|
|
346
|
+
{isMobileMenuVisible && (
|
|
347
|
+
<>
|
|
348
|
+
{/* Backdrop */}
|
|
349
|
+
<div
|
|
350
|
+
className="fixed inset-0 bg-black/20 z-40 animate-in fade-in duration-200"
|
|
351
|
+
onClick={() => {
|
|
352
|
+
setIsMobileMenuOpen(false);
|
|
353
|
+
}}
|
|
354
|
+
/>
|
|
355
|
+
|
|
356
|
+
{/* Menu Panel */}
|
|
357
|
+
<div
|
|
358
|
+
ref={mobileMenuRef}
|
|
359
|
+
className={`
|
|
360
|
+
relative z-50
|
|
361
|
+
mt-2
|
|
362
|
+
bg-white rounded-xl
|
|
363
|
+
border border-gray-200
|
|
364
|
+
shadow-xl
|
|
365
|
+
overflow-hidden
|
|
366
|
+
animate-in slide-in-from-top-2 fade-in duration-200
|
|
367
|
+
`}
|
|
368
|
+
role="navigation"
|
|
369
|
+
aria-label="Main navigation"
|
|
370
|
+
>
|
|
371
|
+
{/* Optional Header */}
|
|
372
|
+
{props.header && (
|
|
373
|
+
<div className="px-3 py-2 border-b border-gray-100 bg-gray-50/50">
|
|
374
|
+
{props.header}
|
|
375
|
+
</div>
|
|
376
|
+
)}
|
|
377
|
+
|
|
378
|
+
{/* Menu Items */}
|
|
379
|
+
<nav
|
|
380
|
+
className="p-2 max-h-[60vh] overflow-y-auto"
|
|
381
|
+
onClick={handleMenuItemClick}
|
|
382
|
+
>
|
|
383
|
+
<div className="space-y-0.5">{renderMenuContent()}</div>
|
|
384
|
+
</nav>
|
|
385
|
+
|
|
386
|
+
{/* Optional Footer */}
|
|
387
|
+
{props.footer && (
|
|
388
|
+
<div className="px-3 py-2 border-t border-gray-100 bg-gray-50/50">
|
|
389
|
+
{props.footer}
|
|
390
|
+
</div>
|
|
391
|
+
)}
|
|
392
|
+
</div>
|
|
393
|
+
</>
|
|
287
394
|
)}
|
|
288
395
|
</div>
|
|
289
396
|
);
|
|
@@ -292,11 +399,39 @@ const SideMenu: FunctionComponent<ComponentProps> = (props: ComponentProps) => {
|
|
|
292
399
|
// Desktop view
|
|
293
400
|
return (
|
|
294
401
|
<aside
|
|
295
|
-
className={`hidden md:block
|
|
402
|
+
className={`hidden md:block w-52 lg:w-60 flex-shrink-0 mb-10 ${props.className || ""}`}
|
|
296
403
|
role="navigation"
|
|
297
404
|
aria-label="Main navigation"
|
|
298
405
|
>
|
|
299
|
-
<
|
|
406
|
+
<div className="sticky top-6">
|
|
407
|
+
<div
|
|
408
|
+
className={`
|
|
409
|
+
bg-white rounded-2xl
|
|
410
|
+
border border-gray-200/80
|
|
411
|
+
shadow-sm
|
|
412
|
+
overflow-hidden
|
|
413
|
+
`}
|
|
414
|
+
>
|
|
415
|
+
{/* Optional Header */}
|
|
416
|
+
{props.header && (
|
|
417
|
+
<div className="px-3 py-3 border-b border-gray-100 bg-gradient-to-b from-gray-50 to-white">
|
|
418
|
+
{props.header}
|
|
419
|
+
</div>
|
|
420
|
+
)}
|
|
421
|
+
|
|
422
|
+
{/* Menu Content */}
|
|
423
|
+
<nav className="p-2">
|
|
424
|
+
<div className="space-y-0.5">{renderMenuContent()}</div>
|
|
425
|
+
</nav>
|
|
426
|
+
|
|
427
|
+
{/* Optional Footer */}
|
|
428
|
+
{props.footer && (
|
|
429
|
+
<div className="px-3 py-2 border-t border-gray-100 bg-gray-50/50">
|
|
430
|
+
{props.footer}
|
|
431
|
+
</div>
|
|
432
|
+
)}
|
|
433
|
+
</div>
|
|
434
|
+
</div>
|
|
300
435
|
</aside>
|
|
301
436
|
);
|
|
302
437
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { FunctionComponent } from "react";
|
|
2
|
+
|
|
3
|
+
export interface ComponentProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
const SideMenuDivider: FunctionComponent<ComponentProps> = (
|
|
8
|
+
props: ComponentProps,
|
|
9
|
+
) => {
|
|
10
|
+
return (
|
|
11
|
+
<div className={`my-3 px-3 ${props.className || ""}`}>
|
|
12
|
+
<div className="h-px bg-gradient-to-r from-transparent via-gray-200 to-transparent" />
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default SideMenuDivider;
|