@cratis/showrunner.usher.react 0.0.0-bootstrap.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/Buttons/MyIssuesButton.tsx +78 -0
- package/Buttons/ReportButton.tsx +51 -0
- package/Buttons/buttonModels.ts +55 -0
- package/Buttons/index.ts +6 -0
- package/Correlation/CorrelationTracker.ts +51 -0
- package/Correlation/index.ts +5 -0
- package/Correlation/withCorrelationIdHeader.ts +44 -0
- package/Icons.tsx +29 -0
- package/Issues/IssueView/AccessPanel.tsx +85 -0
- package/Issues/IssueView/GrantAccessDialog.tsx +56 -0
- package/Issues/IssueView/IdentityPanel.tsx +38 -0
- package/Issues/IssueView/IssueActions.tsx +52 -0
- package/Issues/IssueView/IssueConversationPanel.tsx +89 -0
- package/Issues/IssueView/IssueHeader.tsx +69 -0
- package/Issues/IssueView/IssueView.tsx +74 -0
- package/Issues/IssueView/QuestionBanner.tsx +27 -0
- package/Issues/IssueView/ReopenIssueDialog.tsx +37 -0
- package/Issues/IssueView/ShareIdentityDialog.tsx +37 -0
- package/Issues/IssueView/StatusStrip.tsx +42 -0
- package/Issues/IssueView/SupportSessions.tsx +59 -0
- package/Issues/IssueView/index.ts +15 -0
- package/Issues/MyIssues/IssueList.tsx +78 -0
- package/Issues/MyIssues/MyIssuesDialog.tsx +64 -0
- package/Issues/MyIssues/MyIssuesNavigation.ts +61 -0
- package/Issues/MyIssues/index.ts +6 -0
- package/Issues/MyIssuesList.ts +33 -0
- package/Issues/accessStatus.ts +68 -0
- package/Issues/conversationMessages.ts +136 -0
- package/Issues/index.ts +12 -0
- package/Issues/issueStates.ts +69 -0
- package/Issues/sessionActivity.ts +43 -0
- package/Issues/useAccessStatus.ts +24 -0
- package/Issues/webAddress.ts +22 -0
- package/Labels/UsherLabels.ts +365 -0
- package/Labels/defaultUsherLabels.ts +178 -0
- package/Labels/format.ts +13 -0
- package/Labels/index.ts +7 -0
- package/Labels/resolveLabels.ts +36 -0
- package/Provider/UsherBoundary.tsx +30 -0
- package/Provider/UsherContext.ts +109 -0
- package/Provider/UsherProvider.tsx +134 -0
- package/Provider/index.ts +7 -0
- package/Provider/useUsher.ts +72 -0
- package/README.md +72 -0
- package/Reporting/AccessChoice.ts +107 -0
- package/Reporting/AccessFields.tsx +74 -0
- package/Reporting/AccessNotice.tsx +33 -0
- package/Reporting/ReportErrorDialog.tsx +94 -0
- package/Reporting/ReportIssueDialog.tsx +80 -0
- package/Reporting/ReportLimits.ts +24 -0
- package/Reporting/ReportSent.ts +12 -0
- package/Reporting/SentWithReport.tsx +37 -0
- package/Reporting/TechnicalDetails.tsx +60 -0
- package/Reporting/durationOptions.ts +31 -0
- package/Reporting/formatLocation.ts +27 -0
- package/Reporting/index.ts +16 -0
- package/Reporting/reportValues.ts +150 -0
- package/Reporting/useAccessChoice.ts +53 -0
- package/dist/cjs/Buttons/MyIssuesButton.d.ts +14 -0
- package/dist/cjs/Buttons/MyIssuesButton.d.ts.map +1 -0
- package/dist/cjs/Buttons/MyIssuesButton.js +76 -0
- package/dist/cjs/Buttons/MyIssuesButton.js.map +1 -0
- package/dist/cjs/Buttons/ReportButton.d.ts +8 -0
- package/dist/cjs/Buttons/ReportButton.d.ts.map +1 -0
- package/dist/cjs/Buttons/ReportButton.js +34 -0
- package/dist/cjs/Buttons/ReportButton.js.map +1 -0
- package/dist/cjs/Buttons/buttonModels.d.ts +10 -0
- package/dist/cjs/Buttons/buttonModels.d.ts.map +1 -0
- package/dist/cjs/Buttons/buttonModels.js +44 -0
- package/dist/cjs/Buttons/buttonModels.js.map +1 -0
- package/dist/cjs/Buttons/index.d.ts +4 -0
- package/dist/cjs/Buttons/index.d.ts.map +1 -0
- package/dist/cjs/Correlation/CorrelationTracker.d.ts +10 -0
- package/dist/cjs/Correlation/CorrelationTracker.d.ts.map +1 -0
- package/dist/cjs/Correlation/CorrelationTracker.js +50 -0
- package/dist/cjs/Correlation/CorrelationTracker.js.map +1 -0
- package/dist/cjs/Correlation/index.d.ts +3 -0
- package/dist/cjs/Correlation/index.d.ts.map +1 -0
- package/dist/cjs/Correlation/withCorrelationIdHeader.d.ts +6 -0
- package/dist/cjs/Correlation/withCorrelationIdHeader.d.ts.map +1 -0
- package/dist/cjs/Correlation/withCorrelationIdHeader.js +39 -0
- package/dist/cjs/Correlation/withCorrelationIdHeader.js.map +1 -0
- package/dist/cjs/Icons.d.ts +4 -0
- package/dist/cjs/Icons.d.ts.map +1 -0
- package/dist/cjs/Icons.js +53 -0
- package/dist/cjs/Icons.js.map +1 -0
- package/dist/cjs/Issues/IssueView/AccessPanel.d.ts +6 -0
- package/dist/cjs/Issues/IssueView/AccessPanel.d.ts.map +1 -0
- package/dist/cjs/Issues/IssueView/AccessPanel.js +124 -0
- package/dist/cjs/Issues/IssueView/AccessPanel.js.map +1 -0
- package/dist/cjs/Issues/IssueView/GrantAccessDialog.d.ts +6 -0
- package/dist/cjs/Issues/IssueView/GrantAccessDialog.d.ts.map +1 -0
- package/dist/cjs/Issues/IssueView/GrantAccessDialog.js +56 -0
- package/dist/cjs/Issues/IssueView/GrantAccessDialog.js.map +1 -0
- package/dist/cjs/Issues/IssueView/IdentityPanel.d.ts +6 -0
- package/dist/cjs/Issues/IssueView/IdentityPanel.d.ts.map +1 -0
- package/dist/cjs/Issues/IssueView/IdentityPanel.js +45 -0
- package/dist/cjs/Issues/IssueView/IdentityPanel.js.map +1 -0
- package/dist/cjs/Issues/IssueView/IssueActions.d.ts +6 -0
- package/dist/cjs/Issues/IssueView/IssueActions.d.ts.map +1 -0
- package/dist/cjs/Issues/IssueView/IssueActions.js +58 -0
- package/dist/cjs/Issues/IssueView/IssueActions.js.map +1 -0
- package/dist/cjs/Issues/IssueView/IssueConversationPanel.d.ts +6 -0
- package/dist/cjs/Issues/IssueView/IssueConversationPanel.d.ts.map +1 -0
- package/dist/cjs/Issues/IssueView/IssueConversationPanel.js +97 -0
- package/dist/cjs/Issues/IssueView/IssueConversationPanel.js.map +1 -0
- package/dist/cjs/Issues/IssueView/IssueHeader.d.ts +7 -0
- package/dist/cjs/Issues/IssueView/IssueHeader.d.ts.map +1 -0
- package/dist/cjs/Issues/IssueView/IssueHeader.js +94 -0
- package/dist/cjs/Issues/IssueView/IssueHeader.js.map +1 -0
- package/dist/cjs/Issues/IssueView/IssueView.d.ts +7 -0
- package/dist/cjs/Issues/IssueView/IssueView.d.ts.map +1 -0
- package/dist/cjs/Issues/IssueView/IssueView.js +85 -0
- package/dist/cjs/Issues/IssueView/IssueView.js.map +1 -0
- package/dist/cjs/Issues/IssueView/QuestionBanner.d.ts +5 -0
- package/dist/cjs/Issues/IssueView/QuestionBanner.d.ts.map +1 -0
- package/dist/cjs/Issues/IssueView/QuestionBanner.js +24 -0
- package/dist/cjs/Issues/IssueView/QuestionBanner.js.map +1 -0
- package/dist/cjs/Issues/IssueView/ReopenIssueDialog.d.ts +6 -0
- package/dist/cjs/Issues/IssueView/ReopenIssueDialog.d.ts.map +1 -0
- package/dist/cjs/Issues/IssueView/ReopenIssueDialog.js +34 -0
- package/dist/cjs/Issues/IssueView/ReopenIssueDialog.js.map +1 -0
- package/dist/cjs/Issues/IssueView/ShareIdentityDialog.d.ts +6 -0
- package/dist/cjs/Issues/IssueView/ShareIdentityDialog.d.ts.map +1 -0
- package/dist/cjs/Issues/IssueView/ShareIdentityDialog.js +32 -0
- package/dist/cjs/Issues/IssueView/ShareIdentityDialog.js.map +1 -0
- package/dist/cjs/Issues/IssueView/StatusStrip.d.ts +6 -0
- package/dist/cjs/Issues/IssueView/StatusStrip.d.ts.map +1 -0
- package/dist/cjs/Issues/IssueView/StatusStrip.js +31 -0
- package/dist/cjs/Issues/IssueView/StatusStrip.js.map +1 -0
- package/dist/cjs/Issues/IssueView/SupportSessions.d.ts +7 -0
- package/dist/cjs/Issues/IssueView/SupportSessions.d.ts.map +1 -0
- package/dist/cjs/Issues/IssueView/SupportSessions.js +62 -0
- package/dist/cjs/Issues/IssueView/SupportSessions.js.map +1 -0
- package/dist/cjs/Issues/IssueView/index.d.ts +13 -0
- package/dist/cjs/Issues/IssueView/index.d.ts.map +1 -0
- package/dist/cjs/Issues/MyIssues/IssueList.d.ts +7 -0
- package/dist/cjs/Issues/MyIssues/IssueList.d.ts.map +1 -0
- package/dist/cjs/Issues/MyIssues/IssueList.js +92 -0
- package/dist/cjs/Issues/MyIssues/IssueList.js.map +1 -0
- package/dist/cjs/Issues/MyIssues/MyIssuesDialog.d.ts +7 -0
- package/dist/cjs/Issues/MyIssues/MyIssuesDialog.d.ts.map +1 -0
- package/dist/cjs/Issues/MyIssues/MyIssuesDialog.js +79 -0
- package/dist/cjs/Issues/MyIssues/MyIssuesDialog.js.map +1 -0
- package/dist/cjs/Issues/MyIssues/MyIssuesNavigation.d.ts +21 -0
- package/dist/cjs/Issues/MyIssues/MyIssuesNavigation.d.ts.map +1 -0
- package/dist/cjs/Issues/MyIssues/MyIssuesNavigation.js +52 -0
- package/dist/cjs/Issues/MyIssues/MyIssuesNavigation.js.map +1 -0
- package/dist/cjs/Issues/MyIssues/index.d.ts +4 -0
- package/dist/cjs/Issues/MyIssues/index.d.ts.map +1 -0
- package/dist/cjs/Issues/MyIssuesList.d.ts +7 -0
- package/dist/cjs/Issues/MyIssuesList.d.ts.map +1 -0
- package/dist/cjs/Issues/MyIssuesList.js +33 -0
- package/dist/cjs/Issues/MyIssuesList.js.map +1 -0
- package/dist/cjs/Issues/accessStatus.d.ts +13 -0
- package/dist/cjs/Issues/accessStatus.d.ts.map +1 -0
- package/dist/cjs/Issues/accessStatus.js +60 -0
- package/dist/cjs/Issues/accessStatus.js.map +1 -0
- package/dist/cjs/Issues/conversationMessages.d.ts +14 -0
- package/dist/cjs/Issues/conversationMessages.d.ts.map +1 -0
- package/dist/cjs/Issues/conversationMessages.js +131 -0
- package/dist/cjs/Issues/conversationMessages.js.map +1 -0
- package/dist/cjs/Issues/index.d.ts +10 -0
- package/dist/cjs/Issues/index.d.ts.map +1 -0
- package/dist/cjs/Issues/issueStates.d.ts +12 -0
- package/dist/cjs/Issues/issueStates.d.ts.map +1 -0
- package/dist/cjs/Issues/issueStates.js +86 -0
- package/dist/cjs/Issues/issueStates.js.map +1 -0
- package/dist/cjs/Issues/sessionActivity.d.ts +8 -0
- package/dist/cjs/Issues/sessionActivity.d.ts.map +1 -0
- package/dist/cjs/Issues/sessionActivity.js +39 -0
- package/dist/cjs/Issues/sessionActivity.js.map +1 -0
- package/dist/cjs/Issues/useAccessStatus.d.ts +4 -0
- package/dist/cjs/Issues/useAccessStatus.d.ts.map +1 -0
- package/dist/cjs/Issues/useAccessStatus.js +30 -0
- package/dist/cjs/Issues/useAccessStatus.js.map +1 -0
- package/dist/cjs/Issues/webAddress.d.ts +2 -0
- package/dist/cjs/Issues/webAddress.d.ts.map +1 -0
- package/dist/cjs/Issues/webAddress.js +24 -0
- package/dist/cjs/Issues/webAddress.js.map +1 -0
- package/dist/cjs/Labels/UsherLabels.d.ts +177 -0
- package/dist/cjs/Labels/UsherLabels.d.ts.map +1 -0
- package/dist/cjs/Labels/defaultUsherLabels.d.ts +3 -0
- package/dist/cjs/Labels/defaultUsherLabels.d.ts.map +1 -0
- package/dist/cjs/Labels/defaultUsherLabels.js +179 -0
- package/dist/cjs/Labels/defaultUsherLabels.js.map +1 -0
- package/dist/cjs/Labels/format.d.ts +2 -0
- package/dist/cjs/Labels/format.d.ts.map +1 -0
- package/dist/cjs/Labels/format.js +15 -0
- package/dist/cjs/Labels/format.js.map +1 -0
- package/dist/cjs/Labels/index.d.ts +5 -0
- package/dist/cjs/Labels/index.d.ts.map +1 -0
- package/dist/cjs/Labels/resolveLabels.d.ts +3 -0
- package/dist/cjs/Labels/resolveLabels.d.ts.map +1 -0
- package/dist/cjs/Labels/resolveLabels.js +35 -0
- package/dist/cjs/Labels/resolveLabels.js.map +1 -0
- package/dist/cjs/Provider/UsherBoundary.d.ts +6 -0
- package/dist/cjs/Provider/UsherBoundary.d.ts.map +1 -0
- package/dist/cjs/Provider/UsherBoundary.js +24 -0
- package/dist/cjs/Provider/UsherBoundary.js.map +1 -0
- package/dist/cjs/Provider/UsherContext.d.ts +24 -0
- package/dist/cjs/Provider/UsherContext.d.ts.map +1 -0
- package/dist/cjs/Provider/UsherContext.js +41 -0
- package/dist/cjs/Provider/UsherContext.js.map +1 -0
- package/dist/cjs/Provider/UsherProvider.d.ts +14 -0
- package/dist/cjs/Provider/UsherProvider.d.ts.map +1 -0
- package/dist/cjs/Provider/UsherProvider.js +122 -0
- package/dist/cjs/Provider/UsherProvider.js.map +1 -0
- package/dist/cjs/Provider/index.d.ts +5 -0
- package/dist/cjs/Provider/index.d.ts.map +1 -0
- package/dist/cjs/Provider/useUsher.d.ts +13 -0
- package/dist/cjs/Provider/useUsher.d.ts.map +1 -0
- package/dist/cjs/Provider/useUsher.js +31 -0
- package/dist/cjs/Provider/useUsher.js.map +1 -0
- package/dist/cjs/Reporting/AccessChoice.d.ts +13 -0
- package/dist/cjs/Reporting/AccessChoice.d.ts.map +1 -0
- package/dist/cjs/Reporting/AccessChoice.js +113 -0
- package/dist/cjs/Reporting/AccessChoice.js.map +1 -0
- package/dist/cjs/Reporting/AccessFields.d.ts +12 -0
- package/dist/cjs/Reporting/AccessFields.d.ts.map +1 -0
- package/dist/cjs/Reporting/AccessFields.js +79 -0
- package/dist/cjs/Reporting/AccessFields.js.map +1 -0
- package/dist/cjs/Reporting/AccessNotice.d.ts +7 -0
- package/dist/cjs/Reporting/AccessNotice.d.ts.map +1 -0
- package/dist/cjs/Reporting/AccessNotice.js +28 -0
- package/dist/cjs/Reporting/AccessNotice.js.map +1 -0
- package/dist/cjs/Reporting/ReportErrorDialog.d.ts +9 -0
- package/dist/cjs/Reporting/ReportErrorDialog.d.ts.map +1 -0
- package/dist/cjs/Reporting/ReportErrorDialog.js +87 -0
- package/dist/cjs/Reporting/ReportErrorDialog.js.map +1 -0
- package/dist/cjs/Reporting/ReportIssueDialog.d.ts +8 -0
- package/dist/cjs/Reporting/ReportIssueDialog.d.ts.map +1 -0
- package/dist/cjs/Reporting/ReportIssueDialog.js +81 -0
- package/dist/cjs/Reporting/ReportIssueDialog.js.map +1 -0
- package/dist/cjs/Reporting/ReportLimits.d.ts +8 -0
- package/dist/cjs/Reporting/ReportLimits.d.ts.map +1 -0
- package/dist/cjs/Reporting/ReportLimits.js +19 -0
- package/dist/cjs/Reporting/ReportLimits.js.map +1 -0
- package/dist/cjs/Reporting/ReportSent.d.ts +5 -0
- package/dist/cjs/Reporting/ReportSent.d.ts.map +1 -0
- package/dist/cjs/Reporting/SentWithReport.d.ts +7 -0
- package/dist/cjs/Reporting/SentWithReport.d.ts.map +1 -0
- package/dist/cjs/Reporting/SentWithReport.js +40 -0
- package/dist/cjs/Reporting/SentWithReport.js.map +1 -0
- package/dist/cjs/Reporting/TechnicalDetails.d.ts +9 -0
- package/dist/cjs/Reporting/TechnicalDetails.d.ts.map +1 -0
- package/dist/cjs/Reporting/TechnicalDetails.js +75 -0
- package/dist/cjs/Reporting/TechnicalDetails.js.map +1 -0
- package/dist/cjs/Reporting/durationOptions.d.ts +9 -0
- package/dist/cjs/Reporting/durationOptions.d.ts.map +1 -0
- package/dist/cjs/Reporting/durationOptions.js +29 -0
- package/dist/cjs/Reporting/durationOptions.js.map +1 -0
- package/dist/cjs/Reporting/formatLocation.d.ts +7 -0
- package/dist/cjs/Reporting/formatLocation.d.ts.map +1 -0
- package/dist/cjs/Reporting/formatLocation.js +23 -0
- package/dist/cjs/Reporting/formatLocation.js.map +1 -0
- package/dist/cjs/Reporting/index.d.ts +14 -0
- package/dist/cjs/Reporting/index.d.ts.map +1 -0
- package/dist/cjs/Reporting/reportValues.d.ts +22 -0
- package/dist/cjs/Reporting/reportValues.d.ts.map +1 -0
- package/dist/cjs/Reporting/reportValues.js +124 -0
- package/dist/cjs/Reporting/reportValues.js.map +1 -0
- package/dist/cjs/Reporting/useAccessChoice.d.ts +13 -0
- package/dist/cjs/Reporting/useAccessChoice.d.ts.map +1 -0
- package/dist/cjs/Reporting/useAccessChoice.js +41 -0
- package/dist/cjs/Reporting/useAccessChoice.js.map +1 -0
- package/dist/cjs/index.d.ts +8 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +133 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/esm/Buttons/MyIssuesButton.d.ts +14 -0
- package/dist/esm/Buttons/MyIssuesButton.d.ts.map +1 -0
- package/dist/esm/Buttons/MyIssuesButton.js +73 -0
- package/dist/esm/Buttons/MyIssuesButton.js.map +1 -0
- package/dist/esm/Buttons/ReportButton.d.ts +8 -0
- package/dist/esm/Buttons/ReportButton.d.ts.map +1 -0
- package/dist/esm/Buttons/ReportButton.js +32 -0
- package/dist/esm/Buttons/ReportButton.js.map +1 -0
- package/dist/esm/Buttons/buttonModels.d.ts +10 -0
- package/dist/esm/Buttons/buttonModels.d.ts.map +1 -0
- package/dist/esm/Buttons/buttonModels.js +41 -0
- package/dist/esm/Buttons/buttonModels.js.map +1 -0
- package/dist/esm/Buttons/index.d.ts +4 -0
- package/dist/esm/Buttons/index.d.ts.map +1 -0
- package/dist/esm/Buttons/index.js +4 -0
- package/dist/esm/Buttons/index.js.map +1 -0
- package/dist/esm/Correlation/CorrelationTracker.d.ts +10 -0
- package/dist/esm/Correlation/CorrelationTracker.d.ts.map +1 -0
- package/dist/esm/Correlation/CorrelationTracker.js +48 -0
- package/dist/esm/Correlation/CorrelationTracker.js.map +1 -0
- package/dist/esm/Correlation/index.d.ts +3 -0
- package/dist/esm/Correlation/index.d.ts.map +1 -0
- package/dist/esm/Correlation/index.js +3 -0
- package/dist/esm/Correlation/index.js.map +1 -0
- package/dist/esm/Correlation/withCorrelationIdHeader.d.ts +6 -0
- package/dist/esm/Correlation/withCorrelationIdHeader.d.ts.map +1 -0
- package/dist/esm/Correlation/withCorrelationIdHeader.js +36 -0
- package/dist/esm/Correlation/withCorrelationIdHeader.js.map +1 -0
- package/dist/esm/Icons.d.ts +4 -0
- package/dist/esm/Icons.d.ts.map +1 -0
- package/dist/esm/Icons.js +49 -0
- package/dist/esm/Icons.js.map +1 -0
- package/dist/esm/Issues/IssueView/AccessPanel.d.ts +6 -0
- package/dist/esm/Issues/IssueView/AccessPanel.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/AccessPanel.js +122 -0
- package/dist/esm/Issues/IssueView/AccessPanel.js.map +1 -0
- package/dist/esm/Issues/IssueView/GrantAccessDialog.d.ts +6 -0
- package/dist/esm/Issues/IssueView/GrantAccessDialog.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/GrantAccessDialog.js +54 -0
- package/dist/esm/Issues/IssueView/GrantAccessDialog.js.map +1 -0
- package/dist/esm/Issues/IssueView/IdentityPanel.d.ts +6 -0
- package/dist/esm/Issues/IssueView/IdentityPanel.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/IdentityPanel.js +43 -0
- package/dist/esm/Issues/IssueView/IdentityPanel.js.map +1 -0
- package/dist/esm/Issues/IssueView/IssueActions.d.ts +6 -0
- package/dist/esm/Issues/IssueView/IssueActions.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/IssueActions.js +56 -0
- package/dist/esm/Issues/IssueView/IssueActions.js.map +1 -0
- package/dist/esm/Issues/IssueView/IssueConversationPanel.d.ts +6 -0
- package/dist/esm/Issues/IssueView/IssueConversationPanel.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/IssueConversationPanel.js +95 -0
- package/dist/esm/Issues/IssueView/IssueConversationPanel.js.map +1 -0
- package/dist/esm/Issues/IssueView/IssueHeader.d.ts +7 -0
- package/dist/esm/Issues/IssueView/IssueHeader.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/IssueHeader.js +92 -0
- package/dist/esm/Issues/IssueView/IssueHeader.js.map +1 -0
- package/dist/esm/Issues/IssueView/IssueView.d.ts +7 -0
- package/dist/esm/Issues/IssueView/IssueView.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/IssueView.js +83 -0
- package/dist/esm/Issues/IssueView/IssueView.js.map +1 -0
- package/dist/esm/Issues/IssueView/QuestionBanner.d.ts +5 -0
- package/dist/esm/Issues/IssueView/QuestionBanner.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/QuestionBanner.js +22 -0
- package/dist/esm/Issues/IssueView/QuestionBanner.js.map +1 -0
- package/dist/esm/Issues/IssueView/ReopenIssueDialog.d.ts +6 -0
- package/dist/esm/Issues/IssueView/ReopenIssueDialog.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/ReopenIssueDialog.js +32 -0
- package/dist/esm/Issues/IssueView/ReopenIssueDialog.js.map +1 -0
- package/dist/esm/Issues/IssueView/ShareIdentityDialog.d.ts +6 -0
- package/dist/esm/Issues/IssueView/ShareIdentityDialog.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/ShareIdentityDialog.js +30 -0
- package/dist/esm/Issues/IssueView/ShareIdentityDialog.js.map +1 -0
- package/dist/esm/Issues/IssueView/StatusStrip.d.ts +6 -0
- package/dist/esm/Issues/IssueView/StatusStrip.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/StatusStrip.js +29 -0
- package/dist/esm/Issues/IssueView/StatusStrip.js.map +1 -0
- package/dist/esm/Issues/IssueView/SupportSessions.d.ts +7 -0
- package/dist/esm/Issues/IssueView/SupportSessions.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/SupportSessions.js +60 -0
- package/dist/esm/Issues/IssueView/SupportSessions.js.map +1 -0
- package/dist/esm/Issues/IssueView/index.d.ts +13 -0
- package/dist/esm/Issues/IssueView/index.d.ts.map +1 -0
- package/dist/esm/Issues/IssueView/index.js +13 -0
- package/dist/esm/Issues/IssueView/index.js.map +1 -0
- package/dist/esm/Issues/MyIssues/IssueList.d.ts +7 -0
- package/dist/esm/Issues/MyIssues/IssueList.d.ts.map +1 -0
- package/dist/esm/Issues/MyIssues/IssueList.js +90 -0
- package/dist/esm/Issues/MyIssues/IssueList.js.map +1 -0
- package/dist/esm/Issues/MyIssues/MyIssuesDialog.d.ts +7 -0
- package/dist/esm/Issues/MyIssues/MyIssuesDialog.d.ts.map +1 -0
- package/dist/esm/Issues/MyIssues/MyIssuesDialog.js +77 -0
- package/dist/esm/Issues/MyIssues/MyIssuesDialog.js.map +1 -0
- package/dist/esm/Issues/MyIssues/MyIssuesNavigation.d.ts +21 -0
- package/dist/esm/Issues/MyIssues/MyIssuesNavigation.d.ts.map +1 -0
- package/dist/esm/Issues/MyIssues/MyIssuesNavigation.js +49 -0
- package/dist/esm/Issues/MyIssues/MyIssuesNavigation.js.map +1 -0
- package/dist/esm/Issues/MyIssues/index.d.ts +4 -0
- package/dist/esm/Issues/MyIssues/index.d.ts.map +1 -0
- package/dist/esm/Issues/MyIssues/index.js +4 -0
- package/dist/esm/Issues/MyIssues/index.js.map +1 -0
- package/dist/esm/Issues/MyIssuesList.d.ts +7 -0
- package/dist/esm/Issues/MyIssuesList.d.ts.map +1 -0
- package/dist/esm/Issues/MyIssuesList.js +29 -0
- package/dist/esm/Issues/MyIssuesList.js.map +1 -0
- package/dist/esm/Issues/accessStatus.d.ts +13 -0
- package/dist/esm/Issues/accessStatus.d.ts.map +1 -0
- package/dist/esm/Issues/accessStatus.js +54 -0
- package/dist/esm/Issues/accessStatus.js.map +1 -0
- package/dist/esm/Issues/conversationMessages.d.ts +14 -0
- package/dist/esm/Issues/conversationMessages.d.ts.map +1 -0
- package/dist/esm/Issues/conversationMessages.js +125 -0
- package/dist/esm/Issues/conversationMessages.js.map +1 -0
- package/dist/esm/Issues/index.d.ts +10 -0
- package/dist/esm/Issues/index.d.ts.map +1 -0
- package/dist/esm/Issues/index.js +10 -0
- package/dist/esm/Issues/index.js.map +1 -0
- package/dist/esm/Issues/issueStates.d.ts +12 -0
- package/dist/esm/Issues/issueStates.d.ts.map +1 -0
- package/dist/esm/Issues/issueStates.js +81 -0
- package/dist/esm/Issues/issueStates.js.map +1 -0
- package/dist/esm/Issues/sessionActivity.d.ts +8 -0
- package/dist/esm/Issues/sessionActivity.d.ts.map +1 -0
- package/dist/esm/Issues/sessionActivity.js +37 -0
- package/dist/esm/Issues/sessionActivity.js.map +1 -0
- package/dist/esm/Issues/useAccessStatus.d.ts +4 -0
- package/dist/esm/Issues/useAccessStatus.d.ts.map +1 -0
- package/dist/esm/Issues/useAccessStatus.js +28 -0
- package/dist/esm/Issues/useAccessStatus.js.map +1 -0
- package/dist/esm/Issues/webAddress.d.ts +2 -0
- package/dist/esm/Issues/webAddress.d.ts.map +1 -0
- package/dist/esm/Issues/webAddress.js +22 -0
- package/dist/esm/Issues/webAddress.js.map +1 -0
- package/dist/esm/Labels/UsherLabels.d.ts +177 -0
- package/dist/esm/Labels/UsherLabels.d.ts.map +1 -0
- package/dist/esm/Labels/UsherLabels.js +2 -0
- package/dist/esm/Labels/UsherLabels.js.map +1 -0
- package/dist/esm/Labels/defaultUsherLabels.d.ts +3 -0
- package/dist/esm/Labels/defaultUsherLabels.d.ts.map +1 -0
- package/dist/esm/Labels/defaultUsherLabels.js +177 -0
- package/dist/esm/Labels/defaultUsherLabels.js.map +1 -0
- package/dist/esm/Labels/format.d.ts +2 -0
- package/dist/esm/Labels/format.d.ts.map +1 -0
- package/dist/esm/Labels/format.js +13 -0
- package/dist/esm/Labels/format.js.map +1 -0
- package/dist/esm/Labels/index.d.ts +5 -0
- package/dist/esm/Labels/index.d.ts.map +1 -0
- package/dist/esm/Labels/index.js +5 -0
- package/dist/esm/Labels/index.js.map +1 -0
- package/dist/esm/Labels/resolveLabels.d.ts +3 -0
- package/dist/esm/Labels/resolveLabels.d.ts.map +1 -0
- package/dist/esm/Labels/resolveLabels.js +33 -0
- package/dist/esm/Labels/resolveLabels.js.map +1 -0
- package/dist/esm/Provider/UsherBoundary.d.ts +6 -0
- package/dist/esm/Provider/UsherBoundary.d.ts.map +1 -0
- package/dist/esm/Provider/UsherBoundary.js +22 -0
- package/dist/esm/Provider/UsherBoundary.js.map +1 -0
- package/dist/esm/Provider/UsherContext.d.ts +24 -0
- package/dist/esm/Provider/UsherContext.d.ts.map +1 -0
- package/dist/esm/Provider/UsherContext.js +36 -0
- package/dist/esm/Provider/UsherContext.js.map +1 -0
- package/dist/esm/Provider/UsherProvider.d.ts +14 -0
- package/dist/esm/Provider/UsherProvider.d.ts.map +1 -0
- package/dist/esm/Provider/UsherProvider.js +120 -0
- package/dist/esm/Provider/UsherProvider.js.map +1 -0
- package/dist/esm/Provider/index.d.ts +5 -0
- package/dist/esm/Provider/index.d.ts.map +1 -0
- package/dist/esm/Provider/index.js +5 -0
- package/dist/esm/Provider/index.js.map +1 -0
- package/dist/esm/Provider/useUsher.d.ts +13 -0
- package/dist/esm/Provider/useUsher.d.ts.map +1 -0
- package/dist/esm/Provider/useUsher.js +29 -0
- package/dist/esm/Provider/useUsher.js.map +1 -0
- package/dist/esm/Reporting/AccessChoice.d.ts +13 -0
- package/dist/esm/Reporting/AccessChoice.d.ts.map +1 -0
- package/dist/esm/Reporting/AccessChoice.js +106 -0
- package/dist/esm/Reporting/AccessChoice.js.map +1 -0
- package/dist/esm/Reporting/AccessFields.d.ts +12 -0
- package/dist/esm/Reporting/AccessFields.d.ts.map +1 -0
- package/dist/esm/Reporting/AccessFields.js +77 -0
- package/dist/esm/Reporting/AccessFields.js.map +1 -0
- package/dist/esm/Reporting/AccessNotice.d.ts +7 -0
- package/dist/esm/Reporting/AccessNotice.d.ts.map +1 -0
- package/dist/esm/Reporting/AccessNotice.js +26 -0
- package/dist/esm/Reporting/AccessNotice.js.map +1 -0
- package/dist/esm/Reporting/ReportErrorDialog.d.ts +9 -0
- package/dist/esm/Reporting/ReportErrorDialog.d.ts.map +1 -0
- package/dist/esm/Reporting/ReportErrorDialog.js +85 -0
- package/dist/esm/Reporting/ReportErrorDialog.js.map +1 -0
- package/dist/esm/Reporting/ReportIssueDialog.d.ts +8 -0
- package/dist/esm/Reporting/ReportIssueDialog.d.ts.map +1 -0
- package/dist/esm/Reporting/ReportIssueDialog.js +79 -0
- package/dist/esm/Reporting/ReportIssueDialog.js.map +1 -0
- package/dist/esm/Reporting/ReportLimits.d.ts +8 -0
- package/dist/esm/Reporting/ReportLimits.d.ts.map +1 -0
- package/dist/esm/Reporting/ReportLimits.js +17 -0
- package/dist/esm/Reporting/ReportLimits.js.map +1 -0
- package/dist/esm/Reporting/ReportSent.d.ts +5 -0
- package/dist/esm/Reporting/ReportSent.d.ts.map +1 -0
- package/dist/esm/Reporting/ReportSent.js +2 -0
- package/dist/esm/Reporting/ReportSent.js.map +1 -0
- package/dist/esm/Reporting/SentWithReport.d.ts +7 -0
- package/dist/esm/Reporting/SentWithReport.d.ts.map +1 -0
- package/dist/esm/Reporting/SentWithReport.js +38 -0
- package/dist/esm/Reporting/SentWithReport.js.map +1 -0
- package/dist/esm/Reporting/TechnicalDetails.d.ts +9 -0
- package/dist/esm/Reporting/TechnicalDetails.d.ts.map +1 -0
- package/dist/esm/Reporting/TechnicalDetails.js +73 -0
- package/dist/esm/Reporting/TechnicalDetails.js.map +1 -0
- package/dist/esm/Reporting/durationOptions.d.ts +9 -0
- package/dist/esm/Reporting/durationOptions.d.ts.map +1 -0
- package/dist/esm/Reporting/durationOptions.js +27 -0
- package/dist/esm/Reporting/durationOptions.js.map +1 -0
- package/dist/esm/Reporting/formatLocation.d.ts +7 -0
- package/dist/esm/Reporting/formatLocation.d.ts.map +1 -0
- package/dist/esm/Reporting/formatLocation.js +21 -0
- package/dist/esm/Reporting/formatLocation.js.map +1 -0
- package/dist/esm/Reporting/index.d.ts +14 -0
- package/dist/esm/Reporting/index.d.ts.map +1 -0
- package/dist/esm/Reporting/index.js +14 -0
- package/dist/esm/Reporting/index.js.map +1 -0
- package/dist/esm/Reporting/reportValues.d.ts +22 -0
- package/dist/esm/Reporting/reportValues.d.ts.map +1 -0
- package/dist/esm/Reporting/reportValues.js +116 -0
- package/dist/esm/Reporting/reportValues.js.map +1 -0
- package/dist/esm/Reporting/useAccessChoice.d.ts +13 -0
- package/dist/esm/Reporting/useAccessChoice.d.ts.map +1 -0
- package/dist/esm/Reporting/useAccessChoice.js +39 -0
- package/dist/esm/Reporting/useAccessChoice.js.map +1 -0
- package/dist/esm/index.d.ts +8 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +48 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/index.ts +10 -0
- package/package.json +85 -0
- package/styles.css +320 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { ArcConfiguration } from '@cratis/arc.react';
|
|
5
|
+
import { SliceLocation } from '@cratis/arc/reflection';
|
|
6
|
+
import { Guid } from '@cratis/fundamentals';
|
|
7
|
+
import { createContext, useContext } from 'react';
|
|
8
|
+
import { resolveLabels, UsherLabels } from '../Labels/index.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* What {@link UsherProvider} gives the Usher components.
|
|
12
|
+
*/
|
|
13
|
+
export interface UsherContextValue {
|
|
14
|
+
/** Whether an {@link UsherProvider} provides the value; the defaults otherwise. */
|
|
15
|
+
readonly isProvided: boolean;
|
|
16
|
+
|
|
17
|
+
/** The labels to show. */
|
|
18
|
+
readonly labels: UsherLabels;
|
|
19
|
+
|
|
20
|
+
/** The name of the application, shown with what a report sends; empty when not given. */
|
|
21
|
+
readonly applicationName: string;
|
|
22
|
+
|
|
23
|
+
/** The version of the application, sent with every report; empty when not given. */
|
|
24
|
+
readonly applicationVersion: string;
|
|
25
|
+
|
|
26
|
+
/** Whether the report dialogs let support know who the reporter is unless they choose otherwise. */
|
|
27
|
+
readonly shareIdentityByDefault: boolean;
|
|
28
|
+
|
|
29
|
+
/** The locale to format dates and times for; the browser's when not given. */
|
|
30
|
+
readonly locale?: string;
|
|
31
|
+
|
|
32
|
+
/** The Arc configuration without correlation tracking, for Usher's own commands and queries. */
|
|
33
|
+
readonly untrackedArc?: ArcConfiguration;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Gets the correlation ids of the last few Arc commands and queries run, oldest first.
|
|
37
|
+
* @returns The correlation ids.
|
|
38
|
+
*/
|
|
39
|
+
recentCorrelationIds(): Guid[];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Tracks the correlation id of a command or query run, such as one from a `CommandResult`.
|
|
43
|
+
* @param correlationId The correlation id.
|
|
44
|
+
*/
|
|
45
|
+
trackCorrelationId(correlationId: Guid | string): void;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Opens the report a problem dialog.
|
|
49
|
+
* @param location Where in the application the reporter is.
|
|
50
|
+
*/
|
|
51
|
+
reportIssue(location: SliceLocation): void;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Opens the report this error dialog.
|
|
55
|
+
* @param error The error: `ErrorDetails` from `@cratis/showrunner.usher`, or anything thrown.
|
|
56
|
+
* @param location Where in the application the reporter is.
|
|
57
|
+
*/
|
|
58
|
+
reportError(error: unknown, location: SliceLocation): void;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Opens the my issues side sheet with the list of issues.
|
|
62
|
+
* @param location Where in the application the user is, for a problem they report from the side sheet.
|
|
63
|
+
*/
|
|
64
|
+
showMyIssues(location: SliceLocation): void;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Opens the my issues side sheet on one issue.
|
|
68
|
+
* @param issueId The issue.
|
|
69
|
+
*/
|
|
70
|
+
showIssue(issueId: Guid): void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const noop = () => {
|
|
74
|
+
/* Without an UsherProvider there are no dialogs to open. */
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The value without an {@link UsherProvider}: English labels, and nothing to open.
|
|
79
|
+
*/
|
|
80
|
+
export const defaultUsherContextValue: UsherContextValue = {
|
|
81
|
+
isProvided: false,
|
|
82
|
+
labels: resolveLabels(),
|
|
83
|
+
applicationName: '',
|
|
84
|
+
applicationVersion: '',
|
|
85
|
+
shareIdentityByDefault: false,
|
|
86
|
+
recentCorrelationIds: () => [],
|
|
87
|
+
trackCorrelationId: noop,
|
|
88
|
+
reportIssue: noop,
|
|
89
|
+
reportError: noop,
|
|
90
|
+
showMyIssues: noop,
|
|
91
|
+
showIssue: noop
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The React context {@link UsherProvider} provides.
|
|
96
|
+
*/
|
|
97
|
+
export const UsherContext = createContext<UsherContextValue>(defaultUsherContextValue);
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Gets what {@link UsherProvider} provides, or the defaults outside one.
|
|
101
|
+
* @returns The {@link UsherContextValue}.
|
|
102
|
+
*/
|
|
103
|
+
export const useUsherContext = (): UsherContextValue => useContext(UsherContext);
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Gets the labels to show.
|
|
107
|
+
* @returns The {@link UsherLabels}.
|
|
108
|
+
*/
|
|
109
|
+
export const useUsherLabels = (): UsherLabels => useContext(UsherContext).labels;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { ArcContext } from '@cratis/arc.react';
|
|
5
|
+
import { DialogResult, useDialog } from '@cratis/arc.react/dialogs';
|
|
6
|
+
import { SliceLocation } from '@cratis/arc/reflection';
|
|
7
|
+
import { toast } from '@cratis/components/Notifications';
|
|
8
|
+
import { Guid } from '@cratis/fundamentals';
|
|
9
|
+
import { ReactNode, useContext, useMemo, useRef } from 'react';
|
|
10
|
+
import { CorrelationTracker, defaultCorrelationIdHeader, withCorrelationIdHeader } from '../Correlation/index.js';
|
|
11
|
+
import { MyIssuesDialog } from '../Issues/MyIssues/MyIssuesDialog.js';
|
|
12
|
+
import { resolveLabels, UsherLabelOverrides } from '../Labels/index.js';
|
|
13
|
+
import { ReportErrorDialog } from '../Reporting/ReportErrorDialog.js';
|
|
14
|
+
import { ReportIssueDialog } from '../Reporting/ReportIssueDialog.js';
|
|
15
|
+
import { ReportSent } from '../Reporting/ReportSent.js';
|
|
16
|
+
import { toErrorDetails } from '../Reporting/reportValues.js';
|
|
17
|
+
import { UsherContext, UsherContextValue } from './UsherContext.js';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Props for {@link UsherProvider}.
|
|
21
|
+
*/
|
|
22
|
+
export interface UsherProviderProps {
|
|
23
|
+
/** The version of the application, sent with every report. */
|
|
24
|
+
applicationVersion?: string;
|
|
25
|
+
|
|
26
|
+
/** The name of the application, shown with what a report sends. */
|
|
27
|
+
applicationName?: string;
|
|
28
|
+
|
|
29
|
+
/** Whether the report dialogs let support know who the reporter is unless they choose otherwise. Defaults to false. */
|
|
30
|
+
shareIdentityByDefault?: boolean;
|
|
31
|
+
|
|
32
|
+
/** The labels that replace the English defaults, for instance to localize them. */
|
|
33
|
+
labels?: UsherLabelOverrides;
|
|
34
|
+
|
|
35
|
+
/** The locale to format dates and times for; the browser's when not given. */
|
|
36
|
+
locale?: string;
|
|
37
|
+
|
|
38
|
+
/** How many recent correlation ids of Arc commands and queries a report carries. Defaults to 5. */
|
|
39
|
+
correlationIdCount?: number;
|
|
40
|
+
|
|
41
|
+
/** The HTTP header the backend reads the correlation id from. Defaults to `X-Correlation-ID`, as Arc does. */
|
|
42
|
+
correlationIdHeader?: string;
|
|
43
|
+
|
|
44
|
+
/** The application. */
|
|
45
|
+
children?: ReactNode;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Slots Usher into an application: renders the report and my issues dialogs once, gives {@link useUsher} and the
|
|
50
|
+
* Usher buttons what they need, and tracks the correlation ids of the Arc commands and queries the application runs.
|
|
51
|
+
* Render it inside `<Arc>`, the `DialogComponents` registration and a `CratisComponentsProvider` with a toaster.
|
|
52
|
+
*/
|
|
53
|
+
export const UsherProvider = ({
|
|
54
|
+
applicationVersion = '',
|
|
55
|
+
applicationName = '',
|
|
56
|
+
shareIdentityByDefault = false,
|
|
57
|
+
labels,
|
|
58
|
+
locale,
|
|
59
|
+
correlationIdCount = 5,
|
|
60
|
+
correlationIdHeader = defaultCorrelationIdHeader,
|
|
61
|
+
children
|
|
62
|
+
}: UsherProviderProps) => {
|
|
63
|
+
const arc = useContext(ArcContext);
|
|
64
|
+
const tracker = useRef<CorrelationTracker>(undefined);
|
|
65
|
+
if (!tracker.current || tracker.current.capacity !== correlationIdCount) {
|
|
66
|
+
tracker.current = new CorrelationTracker(correlationIdCount);
|
|
67
|
+
}
|
|
68
|
+
const correlationTracker = tracker.current;
|
|
69
|
+
const lastLocation = useRef<SliceLocation>(SliceLocation.empty);
|
|
70
|
+
|
|
71
|
+
const trackedArc = useMemo(() => ({
|
|
72
|
+
...arc,
|
|
73
|
+
httpHeadersCallback: withCorrelationIdHeader(arc.httpHeadersCallback, correlationTracker, correlationIdHeader)
|
|
74
|
+
}), [arc, correlationTracker, correlationIdHeader]);
|
|
75
|
+
|
|
76
|
+
const [ReportIssueDialogWrapper, showReportIssueDialog] = useDialog<ReportSent, Parameters<typeof ReportIssueDialog>[0]>(ReportIssueDialog);
|
|
77
|
+
const [ReportErrorDialogWrapper, showReportErrorDialog] = useDialog<ReportSent, Parameters<typeof ReportErrorDialog>[0]>(ReportErrorDialog);
|
|
78
|
+
const [MyIssuesDialogWrapper, showMyIssuesDialog] = useDialog<object, Parameters<typeof MyIssuesDialog>[0]>(MyIssuesDialog);
|
|
79
|
+
|
|
80
|
+
const resolvedLabels = useMemo(() => resolveLabels(labels), [labels]);
|
|
81
|
+
|
|
82
|
+
const value = useMemo<UsherContextValue>(() => {
|
|
83
|
+
const reportIssue = (location: SliceLocation) => {
|
|
84
|
+
lastLocation.current = location;
|
|
85
|
+
void showReportIssueDialog({ location, correlationIds: correlationTracker.correlationIds }).then(reportSent);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const showIssue = (issueId: Guid) => void showMyIssuesDialog({ issueId, onReportIssue: () => reportIssue(lastLocation.current) });
|
|
89
|
+
|
|
90
|
+
const reportSent = ([result, response]: [DialogResult, ReportSent?]) => {
|
|
91
|
+
if (result !== DialogResult.Ok || !response) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
toast.success({
|
|
96
|
+
title: resolvedLabels.reportSent.title,
|
|
97
|
+
action: { children: resolvedLabels.reportSent.view, onClick: () => showIssue(response.issueId) }
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
isProvided: true,
|
|
103
|
+
labels: resolvedLabels,
|
|
104
|
+
applicationName,
|
|
105
|
+
applicationVersion,
|
|
106
|
+
shareIdentityByDefault,
|
|
107
|
+
locale,
|
|
108
|
+
untrackedArc: arc,
|
|
109
|
+
recentCorrelationIds: () => correlationTracker.correlationIds,
|
|
110
|
+
trackCorrelationId: correlationId => correlationTracker.track(correlationId),
|
|
111
|
+
reportIssue,
|
|
112
|
+
reportError: (error, location) => {
|
|
113
|
+
lastLocation.current = location;
|
|
114
|
+
void showReportErrorDialog({ error: toErrorDetails(error, location), location, correlationIds: correlationTracker.correlationIds }).then(reportSent);
|
|
115
|
+
},
|
|
116
|
+
showMyIssues: location => {
|
|
117
|
+
lastLocation.current = location;
|
|
118
|
+
void showMyIssuesDialog({ onReportIssue: () => reportIssue(location) });
|
|
119
|
+
},
|
|
120
|
+
showIssue
|
|
121
|
+
};
|
|
122
|
+
}, [resolvedLabels, applicationName, applicationVersion, shareIdentityByDefault, locale, arc, correlationTracker, showReportIssueDialog, showReportErrorDialog, showMyIssuesDialog]);
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<UsherContext.Provider value={value}>
|
|
126
|
+
<ArcContext.Provider value={trackedArc}>
|
|
127
|
+
{children}
|
|
128
|
+
</ArcContext.Provider>
|
|
129
|
+
<ReportIssueDialogWrapper />
|
|
130
|
+
<ReportErrorDialogWrapper />
|
|
131
|
+
<MyIssuesDialogWrapper />
|
|
132
|
+
</UsherContext.Provider>
|
|
133
|
+
);
|
|
134
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
export * from './UsherBoundary.js';
|
|
5
|
+
export * from './UsherContext.js';
|
|
6
|
+
export * from './UsherProvider.js';
|
|
7
|
+
export * from './useUsher.js';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { useSliceContext } from '@cratis/arc.react/slices';
|
|
5
|
+
import { Guid } from '@cratis/fundamentals';
|
|
6
|
+
import { useMemo } from 'react';
|
|
7
|
+
import { UsherLabels } from '../Labels/index.js';
|
|
8
|
+
import { useUsherContext } from './UsherContext.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* What {@link useUsher} gives a component.
|
|
12
|
+
*/
|
|
13
|
+
export interface Usher {
|
|
14
|
+
/** The labels Usher shows. */
|
|
15
|
+
readonly labels: UsherLabels;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Opens the report a problem dialog, with where in the application the component is.
|
|
19
|
+
*/
|
|
20
|
+
reportIssue(): void;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Opens the report this error dialog.
|
|
24
|
+
* @param error The error: `ErrorDetails` from `@cratis/showrunner.usher`, such as `errorDetailsFromCommandResult`
|
|
25
|
+
* gives for a failed command, or anything thrown.
|
|
26
|
+
*/
|
|
27
|
+
reportError(error: unknown): void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Opens the my issues side sheet.
|
|
31
|
+
*/
|
|
32
|
+
showMyIssues(): void;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Opens the my issues side sheet on one issue.
|
|
36
|
+
* @param issueId The issue.
|
|
37
|
+
*/
|
|
38
|
+
showIssue(issueId: Guid): void;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Gets the correlation ids of the last few Arc commands and queries run, oldest first.
|
|
42
|
+
* @returns The correlation ids.
|
|
43
|
+
*/
|
|
44
|
+
recentCorrelationIds(): Guid[];
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Tracks the correlation id of a command or query, such as one from a `CommandResult` of a command run outside
|
|
48
|
+
* the application's `<Arc>` context.
|
|
49
|
+
* @param correlationId The correlation id.
|
|
50
|
+
*/
|
|
51
|
+
trackCorrelationId(correlationId: Guid | string): void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Uses Usher from any component inside an {@link UsherProvider}. Reports carry the slice location of the component
|
|
56
|
+
* that calls this hook.
|
|
57
|
+
* @returns The {@link Usher}.
|
|
58
|
+
*/
|
|
59
|
+
export function useUsher(): Usher {
|
|
60
|
+
const context = useUsherContext();
|
|
61
|
+
const location = useSliceContext();
|
|
62
|
+
|
|
63
|
+
return useMemo(() => ({
|
|
64
|
+
labels: context.labels,
|
|
65
|
+
reportIssue: () => context.reportIssue(location),
|
|
66
|
+
reportError: (error: unknown) => context.reportError(error, location),
|
|
67
|
+
showMyIssues: () => context.showMyIssues(location),
|
|
68
|
+
showIssue: (issueId: Guid) => context.showIssue(issueId),
|
|
69
|
+
recentCorrelationIds: () => context.recentCorrelationIds(),
|
|
70
|
+
trackCorrelationId: (correlationId: Guid | string) => context.trackCorrelationId(correlationId)
|
|
71
|
+
}), [context, location]);
|
|
72
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @cratis/showrunner.usher.react
|
|
2
|
+
|
|
3
|
+
React components for Usher, the Showrunner support part: report a problem, report this error, and the my issues side
|
|
4
|
+
sheet with each issue's conversation. Built on `@cratis/components` and the generated proxies in
|
|
5
|
+
`@cratis/showrunner.usher`. How to use it: [Documentation/Usher/react.md](../../../Documentation/Usher/react.md).
|
|
6
|
+
|
|
7
|
+
## Component hierarchy
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
UsherProvider provides UsherContext, wraps ArcContext for correlation tracking, renders the dialogs once
|
|
11
|
+
├── ReportIssueDialog CommandDialog<ReportIssue>
|
|
12
|
+
│ ├── SentWithReport what is sent along: location, version, recent requests
|
|
13
|
+
│ └── AccessFields share identity / grant access / duration, with AccessNotice
|
|
14
|
+
├── ReportErrorDialog CommandDialog<ReportError>
|
|
15
|
+
│ ├── TechnicalDetails collapsed <details>: type, correlation id, stack frames
|
|
16
|
+
│ ├── SentWithReport
|
|
17
|
+
│ └── AccessFields
|
|
18
|
+
└── MyIssuesDialog Dialog placement='end', 720px
|
|
19
|
+
├── IssueList DataTableForObservableQuery<MyIssues>
|
|
20
|
+
└── IssueView also exported on its own
|
|
21
|
+
├── IssueHeader, StatusStrip, QuestionBanner
|
|
22
|
+
├── IssueConversationPanel ChatConversation; AnswerQuestion or AddDetails
|
|
23
|
+
├── IdentityPanel ShareIdentityDialog
|
|
24
|
+
├── AccessPanel GrantAccessDialog, revoke with confirmation, SupportSessions
|
|
25
|
+
└── IssueActions ReopenIssueDialog, withdraw with confirmation
|
|
26
|
+
ReportButton, MyIssuesButton open the dialogs through useUsher()
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Architecture decisions
|
|
30
|
+
|
|
31
|
+
- **One provider, dialogs rendered once.** `UsherProvider` owns the `useDialog` wrappers; the buttons and `useUsher()`
|
|
32
|
+
only call into `UsherContext`. The location of the caller is taken with `useSliceContext()` where `useUsher()` is
|
|
33
|
+
called and passed to the dialog, because the dialogs render at the provider, outside the caller's slice scope.
|
|
34
|
+
- **Correlation tracking through the HTTP headers callback.** Arc has no global observer of command or query results,
|
|
35
|
+
but Arc React hands each command and snapshot query the `httpHeadersCallback` of the nearest `ArcContext`. The
|
|
36
|
+
provider wraps it to add an `X-Correlation-ID` to every request and remember it (`Correlation/`). Arc's backend uses
|
|
37
|
+
the id a request carries. Observable queries go over Arc's shared hub connection and are not tracked.
|
|
38
|
+
- **`UsherBoundary` keeps Usher out of what it reports.** Usher's own components run with the untracked `ArcContext`
|
|
39
|
+
and inside a `<Slice>` boundary, so its requests are not sent with a report and its proxies do not change the slice
|
|
40
|
+
context of the application around them.
|
|
41
|
+
- **Granting access forces sharing identity.** `useAccessChoice` follows the form through `onFieldChange` and forces
|
|
42
|
+
`shareIdentity` through `currentValues`. `shareIdentity` is left out of `initialValues`, because the form merges
|
|
43
|
+
`initialValues` over `currentValues`.
|
|
44
|
+
|
|
45
|
+
## State
|
|
46
|
+
|
|
47
|
+
Decisions live in pure, specified modules; the components render and wire events:
|
|
48
|
+
|
|
49
|
+
| Module | Decides |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `Reporting/AccessChoice.ts` | access choice transitions, forced identity, until when access lasts |
|
|
52
|
+
| `Reporting/reportValues.ts` | the initial values of a report, error details from what was thrown |
|
|
53
|
+
| `Issues/issueStates.ts` | state badges, closed states, status strip step |
|
|
54
|
+
| `Issues/MyIssuesList.ts` | waiting count, closed filter, fix released |
|
|
55
|
+
| `Issues/conversationMessages.ts` | chat authors and message bodies |
|
|
56
|
+
| `Issues/accessStatus.ts` | whether support may sign in, against the clock |
|
|
57
|
+
| `Issues/MyIssues/MyIssuesNavigation.ts` | list or issue, show closed |
|
|
58
|
+
| `Buttons/buttonModels.ts` | text, tooltip and accessible name of the buttons |
|
|
59
|
+
| `Labels/` | English defaults, deep overrides, placeholders |
|
|
60
|
+
|
|
61
|
+
## CSS conventions
|
|
62
|
+
|
|
63
|
+
One stylesheet, `styles.css`, exported as `@cratis/showrunner.usher.react/styles`; the build has no CSS pipeline, so
|
|
64
|
+
components do not import CSS. Classes are prefixed `usher-` with BEM-like element names, and every color, border and
|
|
65
|
+
radius comes from the `--cratis-*` tokens. State is styled through `data-*` attributes (`data-highlighted`,
|
|
66
|
+
`data-reached`, `data-current`).
|
|
67
|
+
|
|
68
|
+
## Extending
|
|
69
|
+
|
|
70
|
+
- A new text: add it to `UsherLabels` and `defaultUsherLabels`; every component reads labels from `UsherContext`.
|
|
71
|
+
- A new conversation entry kind: add its sentence to `ConversationEventLabels` and map it in `conversationMessages.ts`.
|
|
72
|
+
- A new dialog: render its `useDialog` wrapper in `UsherProvider` and add an opener to `UsherContextValue` and `useUsher`.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { AccessDuration } from '@cratis/showrunner.usher';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* What the reporter chose about letting support sign in as them.
|
|
8
|
+
*/
|
|
9
|
+
export interface AccessChoice {
|
|
10
|
+
/** Whether the reporter chose to let support know who they are, apart from granting access. */
|
|
11
|
+
readonly shareIdentity: boolean;
|
|
12
|
+
|
|
13
|
+
/** Whether the reporter lets support sign in as them. */
|
|
14
|
+
readonly grantAccess: boolean;
|
|
15
|
+
|
|
16
|
+
/** For how long. */
|
|
17
|
+
readonly accessDuration: AccessDuration;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Gets the choice before the reporter has chosen anything: no access, for one day once they grant it.
|
|
22
|
+
* @param shareIdentity Whether to let support know who the reporter is unless they choose otherwise.
|
|
23
|
+
* @returns The {@link AccessChoice}.
|
|
24
|
+
*/
|
|
25
|
+
export function initialAccessChoice(shareIdentity: boolean): AccessChoice {
|
|
26
|
+
return { shareIdentity, grantAccess: false, accessDuration: AccessDuration.oneDay };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const durationsInMilliseconds: Record<AccessDuration, number> = {
|
|
30
|
+
[AccessDuration.oneHour]: 60 * 60 * 1000,
|
|
31
|
+
[AccessDuration.oneDay]: 24 * 60 * 60 * 1000,
|
|
32
|
+
[AccessDuration.sevenDays]: 7 * 24 * 60 * 60 * 1000
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Applies a change of a command field to the access choice; changes of other fields leave it as it is. While access is
|
|
37
|
+
* granted, sharing who the reporter is is forced, so a change of it is not the reporter's own choice.
|
|
38
|
+
* @param choice The current {@link AccessChoice}.
|
|
39
|
+
* @param fieldName The name of the command field that changed.
|
|
40
|
+
* @param value Its new value.
|
|
41
|
+
* @returns The new {@link AccessChoice}.
|
|
42
|
+
*/
|
|
43
|
+
export function changeAccessChoice(choice: AccessChoice, fieldName: string, value: unknown): AccessChoice {
|
|
44
|
+
if (fieldName === 'shareIdentity' && !choice.grantAccess) {
|
|
45
|
+
return { ...choice, shareIdentity: value === true };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (fieldName === 'grantAccess') {
|
|
49
|
+
return { ...choice, grantAccess: value === true };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const duration = typeof value === 'string' && value.length > 0 ? Number(value) : value;
|
|
53
|
+
if (fieldName === 'accessDuration' && isAccessDuration(duration)) {
|
|
54
|
+
return { ...choice, accessDuration: duration };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return choice;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Gets whether the command shares who the reporter is: always while access is granted, as granting access always
|
|
62
|
+
* shares who the reporter is, and otherwise as the reporter chose.
|
|
63
|
+
* @param choice The {@link AccessChoice}.
|
|
64
|
+
* @returns The value of the command's `shareIdentity`.
|
|
65
|
+
*/
|
|
66
|
+
export function sharesIdentity(choice: AccessChoice): boolean {
|
|
67
|
+
return choice.grantAccess || choice.shareIdentity;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Gets when access granted now would end. The backend fixes the end itself when it records the grant; this is what
|
|
72
|
+
* the reporter is told before they send.
|
|
73
|
+
* @param duration The {@link AccessDuration}.
|
|
74
|
+
* @param now What time it is.
|
|
75
|
+
* @returns When access would end.
|
|
76
|
+
*/
|
|
77
|
+
export function validUntilFor(duration: AccessDuration, now: Date): Date {
|
|
78
|
+
return new Date(now.getTime() + durationsInMilliseconds[duration]);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Formats a point in time for the access notice and the access panel, such as `27 Oct, 18:10`.
|
|
83
|
+
* @param time The point in time.
|
|
84
|
+
* @param locale The locale to format for; the browser's when not given.
|
|
85
|
+
* @param timeZone The time zone to format in; the browser's when not given.
|
|
86
|
+
* @returns The formatted point in time.
|
|
87
|
+
*/
|
|
88
|
+
export function formatTime(time: Date, locale?: string, timeZone?: string): string {
|
|
89
|
+
const date = new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'short', timeZone }).format(time);
|
|
90
|
+
const clock = new Intl.DateTimeFormat(locale, { hour: '2-digit', minute: '2-digit', hourCycle: 'h23', timeZone }).format(time);
|
|
91
|
+
return `${date}, ${clock}`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Formats the time of day only, such as `18:10`.
|
|
96
|
+
* @param time The point in time.
|
|
97
|
+
* @param locale The locale to format for; the browser's when not given.
|
|
98
|
+
* @param timeZone The time zone to format in; the browser's when not given.
|
|
99
|
+
* @returns The formatted time of day.
|
|
100
|
+
*/
|
|
101
|
+
export function formatClock(time: Date, locale?: string, timeZone?: string): string {
|
|
102
|
+
return new Intl.DateTimeFormat(locale, { hour: '2-digit', minute: '2-digit', hourCycle: 'h23', timeZone }).format(time);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function isAccessDuration(value: unknown): value is AccessDuration {
|
|
106
|
+
return typeof value === 'number' && Object.hasOwn(durationsInMilliseconds, value);
|
|
107
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { CheckboxField, DropdownField, ToggleSwitchField } from '@cratis/components/CommandForm';
|
|
5
|
+
import { AccessDuration } from '@cratis/showrunner.usher';
|
|
6
|
+
import { useId } from 'react';
|
|
7
|
+
import { useUsherLabels } from '../Provider/UsherContext.js';
|
|
8
|
+
import { AccessChoice } from './AccessChoice.js';
|
|
9
|
+
import { AccessNotice } from './AccessNotice.js';
|
|
10
|
+
import { durationOptions } from './durationOptions.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The command values {@link AccessFields} bind to.
|
|
14
|
+
*/
|
|
15
|
+
export interface IdentityAndAccess {
|
|
16
|
+
/** Whether to let support know who the reporter is. */
|
|
17
|
+
shareIdentity: boolean;
|
|
18
|
+
/** Whether to let support sign in as the reporter. */
|
|
19
|
+
grantAccess: boolean;
|
|
20
|
+
/** For how long. */
|
|
21
|
+
accessDuration: AccessDuration;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Props for {@link AccessFields}.
|
|
26
|
+
*/
|
|
27
|
+
export interface AccessFieldsProps {
|
|
28
|
+
/** The reporter's {@link AccessChoice}, as the form follows it. */
|
|
29
|
+
choice: AccessChoice;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The identity and access choices of a report: let support know who the reporter is, and let support sign in as
|
|
34
|
+
* them for a while. Granting access always shares who the reporter is, so the checkbox is checked and disabled while
|
|
35
|
+
* access is granted, and the notice says until when support can act as the reporter.
|
|
36
|
+
*/
|
|
37
|
+
export const AccessFields = <TCommand extends IdentityAndAccess>({ choice }: AccessFieldsProps) => {
|
|
38
|
+
const labels = useUsherLabels();
|
|
39
|
+
const shareDescriptionId = useId();
|
|
40
|
+
const grantDescriptionId = useId();
|
|
41
|
+
const noticeId = useId();
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className='usher-access-fields'>
|
|
45
|
+
<div className='usher-access-fields__choice'>
|
|
46
|
+
<CheckboxField<TCommand>
|
|
47
|
+
value={command => command.shareIdentity}
|
|
48
|
+
label={labels.access.shareIdentity}
|
|
49
|
+
aria-describedby={choice.grantAccess ? `${shareDescriptionId} ${noticeId}` : shareDescriptionId}
|
|
50
|
+
pt={{ input: { disabled: choice.grantAccess } }} />
|
|
51
|
+
<p id={shareDescriptionId} className='usher-access-fields__description'>{labels.access.shareIdentityDescription}</p>
|
|
52
|
+
</div>
|
|
53
|
+
<div className='usher-access-fields__choice'>
|
|
54
|
+
<ToggleSwitchField<TCommand>
|
|
55
|
+
value={command => command.grantAccess}
|
|
56
|
+
label={labels.access.grantAccess}
|
|
57
|
+
aria-describedby={grantDescriptionId} />
|
|
58
|
+
<p id={grantDescriptionId} className='usher-access-fields__description'>{labels.access.grantAccessDescription}</p>
|
|
59
|
+
</div>
|
|
60
|
+
{choice.grantAccess && (
|
|
61
|
+
<div className='usher-access-fields__duration'>
|
|
62
|
+
<DropdownField<TCommand>
|
|
63
|
+
value={command => command.accessDuration}
|
|
64
|
+
title={labels.access.duration}
|
|
65
|
+
aria-describedby={noticeId}
|
|
66
|
+
options={durationOptions(labels)}
|
|
67
|
+
optionValue='value'
|
|
68
|
+
optionLabel='label' />
|
|
69
|
+
<AccessNotice id={noticeId} duration={choice.accessDuration} />
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
|
|
4
|
+
import { Message } from '@cratis/components/Display';
|
|
5
|
+
import { AccessDuration } from '@cratis/showrunner.usher';
|
|
6
|
+
import { format } from '../Labels/index.js';
|
|
7
|
+
import { useUsherContext } from '../Provider/UsherContext.js';
|
|
8
|
+
import { formatTime, validUntilFor } from './AccessChoice.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Props for {@link AccessNotice}.
|
|
12
|
+
*/
|
|
13
|
+
export interface AccessNoticeProps {
|
|
14
|
+
/** The id of the notice, for the controls it describes. */
|
|
15
|
+
id: string;
|
|
16
|
+
|
|
17
|
+
/** For how long access would be granted. */
|
|
18
|
+
duration: AccessDuration;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* States plainly what granting access means: support sees who the reporter is and can act as them until a given time.
|
|
23
|
+
*/
|
|
24
|
+
export const AccessNotice = ({ id, duration }: AccessNoticeProps) => {
|
|
25
|
+
const { labels, locale } = useUsherContext();
|
|
26
|
+
const time = formatTime(validUntilFor(duration, new Date()), locale);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div id={id} className='usher-access-notice'>
|
|
30
|
+
<Message severity='info' live={false} text={format(labels.access.notice, { time })} />
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
};
|