@atlaskit/profilecard 26.19.8 → 26.20.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/CHANGELOG.md +72 -0
- package/build-agg-user-query/package.json +10 -0
- package/dist/cjs/client/AGGQuery.js +37 -0
- package/dist/cjs/client/AgentForbiddenError.js +28 -0
- package/dist/cjs/client/HeaderProcessor.js +1 -0
- package/dist/cjs/client/ProfileCardClient.js +11 -20
- package/dist/cjs/client/Query.js +1 -0
- package/dist/cjs/client/RovoAgentCardClient.js +38 -50
- package/dist/cjs/client/TeamCentralCardClient.js +5 -12
- package/dist/cjs/client/TeamProfileCardClient.js +2 -2
- package/dist/cjs/client/UserProfileCardClient.js +30 -54
- package/dist/cjs/client/addHeaders.js +16 -0
- package/dist/cjs/client/aggUserQuery.js +11 -0
- package/dist/cjs/client/aggUserQueryString.js +7 -0
- package/dist/cjs/client/ariPrefix.js +7 -0
- package/dist/cjs/client/buildAggUserQuery.js +18 -0
- package/dist/cjs/client/buildGatewayQuery.js +22 -0
- package/dist/cjs/client/buildHeaders.js +11 -0
- package/dist/cjs/client/buildReportingLinesQuery.js +14 -0
- package/dist/cjs/client/convertTeam.js +27 -0
- package/dist/cjs/client/defaultConfig.js +9 -0
- package/dist/cjs/client/directoryGraphqlQuery.js +37 -0
- package/dist/cjs/client/extractIdFromAri.js +14 -0
- package/dist/cjs/client/gatewayQueryV2.js +11 -0
- package/dist/cjs/client/{errorUtils.js → getErrorAttributes.js} +12 -15
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +3 -3
- package/dist/cjs/client/getTeamFromAGG.js +8 -64
- package/dist/cjs/client/graphQLQuery.js +66 -0
- package/dist/cjs/client/graphqlUtils.js +1 -125
- package/dist/cjs/client/handleAGGErrors.js +10 -0
- package/dist/cjs/client/handleDirectoryGraphQLErrors.js +10 -0
- package/dist/cjs/client/id.js +9 -0
- package/dist/cjs/client/idToAri.js +15 -0
- package/dist/cjs/client/idToAriSafe.js +14 -0
- package/dist/cjs/client/index.js +17 -4
- package/dist/cjs/client/maybeCreateTeamCentralClient.js +22 -0
- package/dist/cjs/client/modifyResponse.js +40 -0
- package/dist/cjs/components/Agent/AgentProfileCard.js +4 -4
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +2 -2
- package/dist/cjs/components/Agent/hooks/duplicateFetch.js +2 -169
- package/dist/cjs/components/Agent/hooks/fetchActivationId.js +57 -0
- package/dist/cjs/components/Agent/hooks/fetchDuplicateAgentMutation.js +74 -0
- package/dist/cjs/components/Agent/hooks/fetchHasVersionCapability.js +60 -0
- package/dist/cjs/components/Agent/hooks/firstCharUpper.js +9 -0
- package/dist/cjs/components/Agent/hooks/useAgentActions.js +2 -212
- package/dist/cjs/components/Agent/hooks/useAgentUrlActions.js +219 -0
- package/dist/cjs/components/Agent/utils/getAtlassianStudioAgentDuplicateUrl.js +10 -0
- package/dist/cjs/components/Agent/utils/getAtlassianStudioAgentEditUrl.js +10 -0
- package/dist/cjs/components/Agent/utils/getStudioHost.js +14 -0
- package/dist/cjs/components/Agent/utils/getStudioPath.js +19 -0
- package/dist/cjs/components/Agent/utils/index.js +3 -28
- package/dist/cjs/components/Team/TeamProfileCard.js +2 -2
- package/dist/cjs/components/Team/index.js +5 -0
- package/dist/cjs/components/User/LoadingView.js +31 -0
- package/dist/cjs/components/User/ProfileCard.js +21 -242
- package/dist/cjs/components/User/ProfileCardDetails.js +6 -6
- package/dist/cjs/components/User/ProfileCardResourced.js +2 -2
- package/dist/cjs/components/User/ProfilecardInternal.js +234 -0
- package/dist/cjs/components/User/index.js +7 -0
- package/dist/cjs/components/common/LoadingState.js +2 -1
- package/dist/cjs/components/common/ProfileCardTrigger.js +2 -1
- package/dist/cjs/components/team-profile-card/main.js +9 -3
- package/dist/cjs/components/team-profile-card/team-actions/index.js +2 -2
- package/dist/cjs/index.js +5 -6
- package/dist/cjs/internal/isValidDate.js +12 -0
- package/dist/cjs/internal/relative-date.js +2 -7
- package/dist/cjs/mocks/get-time-string.js +16 -0
- package/dist/cjs/mocks/get-weekday.js +15 -0
- package/dist/cjs/mocks/mock-profile-client.js +7 -5
- package/dist/cjs/mocks/mock-team-client.js +2 -2
- package/dist/cjs/mocks/profile-data.js +32 -31
- package/dist/cjs/mocks/random.js +9 -0
- package/dist/cjs/mocks/simple-mock-clients.js +4 -3
- package/dist/cjs/mocks/static-team-data.js +33 -0
- package/dist/cjs/mocks/team-data.js +8 -33
- package/dist/cjs/styled/Card.js +1 -0
- package/dist/cjs/styled/Error.js +1 -0
- package/dist/cjs/styled/ReportingLines.js +1 -0
- package/dist/cjs/styled/TeamCard.js +1 -0
- package/dist/cjs/styled/TeamTrigger.js +1 -0
- package/dist/cjs/styled/UserTrigger.js +1 -0
- package/dist/cjs/util/AGGError.js +37 -0
- package/dist/cjs/util/AGGErrors.js +34 -0
- package/dist/cjs/util/AnalyticsEventPayload.js +1 -0
- package/dist/cjs/util/DirectoryGraphQLError.js +36 -0
- package/dist/cjs/util/DirectoryGraphQLErrors.js +34 -0
- package/dist/cjs/util/GenericAttributes.js +1 -0
- package/dist/cjs/util/HttpError.js +27 -0
- package/dist/cjs/util/actionClicked.js +15 -0
- package/dist/cjs/util/agentRequestAnalytics.js +15 -0
- package/dist/cjs/util/analytics.js +5 -134
- package/dist/cjs/util/cardTriggered.js +23 -0
- package/dist/cjs/util/createEvent.js +30 -0
- package/dist/cjs/util/errorRetryClicked.js +15 -0
- package/dist/cjs/util/getActionSubject.js +19 -0
- package/dist/cjs/util/moreActionsClicked.js +15 -0
- package/dist/cjs/util/moreMembersClicked.js +15 -0
- package/dist/cjs/util/profileCardRendered.js +15 -0
- package/dist/cjs/util/reportingLinesClicked.js +15 -0
- package/dist/cjs/util/teamAvatarClicked.js +15 -0
- package/dist/cjs/util/teamRequestAnalytics.js +15 -0
- package/dist/cjs/util/userRequestAnalytics.js +15 -0
- package/dist/es2019/client/AGGQuery.js +12 -0
- package/dist/es2019/client/AgentForbiddenError.js +8 -0
- package/dist/es2019/client/HeaderProcessor.js +0 -0
- package/dist/es2019/client/ProfileCardClient.js +10 -19
- package/dist/es2019/client/Query.js +0 -0
- package/dist/es2019/client/RovoAgentCardClient.js +3 -10
- package/dist/es2019/client/TeamCentralCardClient.js +2 -31
- package/dist/es2019/client/TeamProfileCardClient.js +1 -1
- package/dist/es2019/client/UserProfileCardClient.js +15 -102
- package/dist/es2019/client/addHeaders.js +10 -0
- package/dist/es2019/client/aggUserQuery.js +31 -0
- package/dist/es2019/client/aggUserQueryString.js +28 -0
- package/dist/es2019/client/ariPrefix.js +1 -0
- package/dist/es2019/client/buildAggUserQuery.js +10 -0
- package/dist/es2019/client/buildGatewayQuery.js +15 -0
- package/dist/es2019/client/buildHeaders.js +5 -0
- package/dist/es2019/client/buildReportingLinesQuery.js +30 -0
- package/dist/es2019/client/convertTeam.js +21 -0
- package/dist/es2019/client/defaultConfig.js +3 -0
- package/dist/es2019/client/directoryGraphqlQuery.js +12 -0
- package/dist/es2019/client/extractIdFromAri.js +8 -0
- package/dist/es2019/client/gatewayQueryV2.js +30 -0
- package/dist/es2019/client/{errorUtils.js → getErrorAttributes.js} +4 -7
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +2 -2
- package/dist/es2019/client/getTeamFromAGG.js +4 -80
- package/dist/es2019/client/graphQLQuery.js +24 -0
- package/dist/es2019/client/graphqlUtils.js +0 -47
- package/dist/es2019/client/handleAGGErrors.js +4 -0
- package/dist/es2019/client/handleDirectoryGraphQLErrors.js +4 -0
- package/dist/es2019/client/id.js +1 -0
- package/dist/es2019/client/idToAri.js +9 -0
- package/dist/es2019/client/idToAriSafe.js +6 -0
- package/dist/es2019/client/index.js +22 -2
- package/dist/es2019/client/maybeCreateTeamCentralClient.js +14 -0
- package/dist/es2019/client/modifyResponse.js +32 -0
- package/dist/es2019/components/Agent/AgentProfileCard.js +2 -2
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +1 -1
- package/dist/es2019/components/Agent/hooks/duplicateFetch.js +1 -121
- package/dist/es2019/components/Agent/hooks/fetchActivationId.js +35 -0
- package/dist/es2019/components/Agent/hooks/fetchDuplicateAgentMutation.js +49 -0
- package/dist/es2019/components/Agent/hooks/fetchHasVersionCapability.js +39 -0
- package/dist/es2019/components/Agent/hooks/firstCharUpper.js +1 -0
- package/dist/es2019/components/Agent/hooks/useAgentActions.js +1 -182
- package/dist/es2019/components/Agent/hooks/useAgentUrlActions.js +186 -0
- package/dist/es2019/components/Agent/utils/getAtlassianStudioAgentDuplicateUrl.js +2 -0
- package/dist/es2019/components/Agent/utils/getAtlassianStudioAgentEditUrl.js +2 -0
- package/dist/es2019/components/Agent/utils/getStudioHost.js +8 -0
- package/dist/es2019/components/Agent/utils/getStudioPath.js +13 -0
- package/dist/es2019/components/Agent/utils/index.js +2 -23
- package/dist/es2019/components/Team/TeamProfileCard.js +1 -1
- package/dist/es2019/components/Team/index.js +6 -0
- package/dist/es2019/components/User/LoadingView.js +19 -0
- package/dist/es2019/components/User/ProfileCard.js +12 -221
- package/dist/es2019/components/User/ProfileCardDetails.js +1 -1
- package/dist/es2019/components/User/ProfileCardResourced.js +1 -1
- package/dist/es2019/components/User/ProfilecardInternal.js +207 -0
- package/dist/es2019/components/User/index.js +8 -0
- package/dist/es2019/components/common/LoadingState.js +2 -1
- package/dist/es2019/components/common/ProfileCardTrigger.js +2 -1
- package/dist/es2019/components/team-profile-card/main.js +8 -1
- package/dist/es2019/components/team-profile-card/team-actions/index.js +1 -1
- package/dist/es2019/i18n/index.js +91 -0
- package/dist/es2019/index.js +4 -2
- package/dist/es2019/internal/isValidDate.js +4 -0
- package/dist/es2019/internal/relative-date.js +1 -4
- package/dist/es2019/mocks/{util.js → get-time-string.js} +1 -9
- package/dist/es2019/mocks/get-weekday.js +9 -0
- package/dist/es2019/mocks/index.js +13 -0
- package/dist/es2019/mocks/mock-profile-client.js +4 -2
- package/dist/es2019/mocks/mock-team-client.js +1 -1
- package/dist/es2019/mocks/profile-data.js +2 -1
- package/dist/es2019/mocks/random.js +1 -0
- package/dist/es2019/mocks/simple-mock-clients.js +3 -2
- package/dist/es2019/mocks/static-team-data.js +21 -0
- package/dist/es2019/mocks/team-data.js +6 -26
- package/dist/es2019/styled/Card.js +1 -0
- package/dist/es2019/styled/Error.js +1 -0
- package/dist/es2019/styled/ReportingLines.js +1 -0
- package/dist/es2019/styled/TeamCard.js +1 -0
- package/dist/es2019/styled/TeamTrigger.js +1 -0
- package/dist/es2019/styled/UserTrigger.js +1 -0
- package/dist/es2019/util/AGGError.js +16 -0
- package/dist/es2019/util/AGGErrors.js +12 -0
- package/dist/es2019/util/AnalyticsEventPayload.js +0 -0
- package/dist/es2019/util/DirectoryGraphQLError.js +14 -0
- package/dist/es2019/util/DirectoryGraphQLErrors.js +12 -0
- package/dist/es2019/util/GenericAttributes.js +0 -0
- package/dist/es2019/util/HttpError.js +7 -0
- package/dist/es2019/util/actionClicked.js +8 -0
- package/dist/es2019/util/agentRequestAnalytics.js +7 -0
- package/dist/es2019/util/analytics.js +4 -107
- package/dist/es2019/util/cardTriggered.js +15 -0
- package/dist/es2019/util/createEvent.js +18 -0
- package/dist/es2019/util/errorRetryClicked.js +8 -0
- package/dist/es2019/util/getActionSubject.js +13 -0
- package/dist/es2019/util/moreActionsClicked.js +8 -0
- package/dist/es2019/util/moreMembersClicked.js +8 -0
- package/dist/es2019/util/profileCardRendered.js +8 -0
- package/dist/es2019/util/reportingLinesClicked.js +8 -0
- package/dist/es2019/util/teamAvatarClicked.js +8 -0
- package/dist/es2019/util/teamRequestAnalytics.js +7 -0
- package/dist/es2019/util/userRequestAnalytics.js +7 -0
- package/dist/esm/client/AGGQuery.js +31 -0
- package/dist/esm/client/AgentForbiddenError.js +21 -0
- package/dist/esm/client/HeaderProcessor.js +0 -0
- package/dist/esm/client/ProfileCardClient.js +10 -17
- package/dist/esm/client/Query.js +0 -0
- package/dist/esm/client/RovoAgentCardClient.js +27 -39
- package/dist/esm/client/TeamCentralCardClient.js +2 -9
- package/dist/esm/client/TeamProfileCardClient.js +1 -1
- package/dist/esm/client/UserProfileCardClient.js +17 -51
- package/dist/esm/client/addHeaders.js +10 -0
- package/dist/esm/client/aggUserQuery.js +4 -0
- package/dist/esm/client/aggUserQueryString.js +1 -0
- package/dist/esm/client/ariPrefix.js +1 -0
- package/dist/esm/client/buildAggUserQuery.js +12 -0
- package/dist/esm/client/buildGatewayQuery.js +16 -0
- package/dist/esm/client/buildHeaders.js +5 -0
- package/dist/esm/client/buildReportingLinesQuery.js +8 -0
- package/dist/esm/client/convertTeam.js +22 -0
- package/dist/esm/client/defaultConfig.js +3 -0
- package/dist/esm/client/directoryGraphqlQuery.js +31 -0
- package/dist/esm/client/extractIdFromAri.js +8 -0
- package/dist/esm/client/gatewayQueryV2.js +5 -0
- package/dist/esm/client/{errorUtils.js → getErrorAttributes.js} +5 -8
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +2 -2
- package/dist/esm/client/getTeamFromAGG.js +4 -59
- package/dist/esm/client/graphQLQuery.js +59 -0
- package/dist/esm/client/graphqlUtils.js +0 -118
- package/dist/esm/client/handleAGGErrors.js +4 -0
- package/dist/esm/client/handleDirectoryGraphQLErrors.js +4 -0
- package/dist/esm/client/id.js +3 -0
- package/dist/esm/client/idToAri.js +9 -0
- package/dist/esm/client/idToAriSafe.js +8 -0
- package/dist/esm/client/index.js +22 -2
- package/dist/esm/client/maybeCreateTeamCentralClient.js +15 -0
- package/dist/esm/client/modifyResponse.js +33 -0
- package/dist/esm/components/Agent/AgentProfileCard.js +2 -2
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +1 -1
- package/dist/esm/components/Agent/hooks/duplicateFetch.js +1 -167
- package/dist/esm/components/Agent/hooks/fetchActivationId.js +51 -0
- package/dist/esm/components/Agent/hooks/fetchDuplicateAgentMutation.js +68 -0
- package/dist/esm/components/Agent/hooks/fetchHasVersionCapability.js +54 -0
- package/dist/esm/components/Agent/hooks/firstCharUpper.js +3 -0
- package/dist/esm/components/Agent/hooks/useAgentActions.js +1 -210
- package/dist/esm/components/Agent/hooks/useAgentUrlActions.js +212 -0
- package/dist/esm/components/Agent/utils/getAtlassianStudioAgentDuplicateUrl.js +4 -0
- package/dist/esm/components/Agent/utils/getAtlassianStudioAgentEditUrl.js +4 -0
- package/dist/esm/components/Agent/utils/getStudioHost.js +8 -0
- package/dist/esm/components/Agent/utils/getStudioPath.js +13 -0
- package/dist/esm/components/Agent/utils/index.js +2 -27
- package/dist/esm/components/Team/TeamProfileCard.js +1 -1
- package/dist/esm/components/Team/index.js +6 -0
- package/dist/esm/components/User/LoadingView.js +22 -0
- package/dist/esm/components/User/ProfileCard.js +12 -239
- package/dist/esm/components/User/ProfileCardDetails.js +1 -1
- package/dist/esm/components/User/ProfileCardResourced.js +1 -1
- package/dist/esm/components/User/ProfilecardInternal.js +225 -0
- package/dist/esm/components/User/index.js +8 -0
- package/dist/esm/components/common/LoadingState.js +2 -1
- package/dist/esm/components/common/ProfileCardTrigger.js +2 -1
- package/dist/esm/components/team-profile-card/main.js +8 -1
- package/dist/esm/components/team-profile-card/team-actions/index.js +1 -1
- package/dist/esm/i18n/index.js +91 -0
- package/dist/esm/index.js +4 -2
- package/dist/esm/internal/isValidDate.js +5 -0
- package/dist/esm/internal/relative-date.js +1 -5
- package/dist/esm/mocks/{util.js → get-time-string.js} +1 -11
- package/dist/esm/mocks/get-weekday.js +9 -0
- package/dist/esm/mocks/index.js +13 -0
- package/dist/esm/mocks/mock-profile-client.js +4 -2
- package/dist/esm/mocks/mock-team-client.js +1 -1
- package/dist/esm/mocks/profile-data.js +2 -1
- package/dist/esm/mocks/random.js +3 -0
- package/dist/esm/mocks/simple-mock-clients.js +3 -2
- package/dist/esm/mocks/static-team-data.js +27 -0
- package/dist/esm/mocks/team-data.js +6 -32
- package/dist/esm/styled/Card.js +1 -0
- package/dist/esm/styled/Error.js +1 -0
- package/dist/esm/styled/ReportingLines.js +1 -0
- package/dist/esm/styled/TeamCard.js +1 -0
- package/dist/esm/styled/TeamTrigger.js +1 -0
- package/dist/esm/styled/UserTrigger.js +1 -0
- package/dist/esm/util/AGGError.js +30 -0
- package/dist/esm/util/AGGErrors.js +27 -0
- package/dist/esm/util/AnalyticsEventPayload.js +0 -0
- package/dist/esm/util/DirectoryGraphQLError.js +29 -0
- package/dist/esm/util/DirectoryGraphQLErrors.js +27 -0
- package/dist/esm/util/GenericAttributes.js +0 -0
- package/dist/esm/util/HttpError.js +20 -0
- package/dist/esm/util/actionClicked.js +10 -0
- package/dist/esm/util/agentRequestAnalytics.js +9 -0
- package/dist/esm/util/analytics.js +4 -132
- package/dist/esm/util/cardTriggered.js +17 -0
- package/dist/esm/util/createEvent.js +24 -0
- package/dist/esm/util/errorRetryClicked.js +10 -0
- package/dist/esm/util/getActionSubject.js +13 -0
- package/dist/esm/util/moreActionsClicked.js +10 -0
- package/dist/esm/util/moreMembersClicked.js +10 -0
- package/dist/esm/util/profileCardRendered.js +10 -0
- package/dist/esm/util/reportingLinesClicked.js +10 -0
- package/dist/esm/util/teamAvatarClicked.js +10 -0
- package/dist/esm/util/teamRequestAnalytics.js +9 -0
- package/dist/esm/util/userRequestAnalytics.js +9 -0
- package/dist/types/client/AGGQuery.d.ts +8 -0
- package/dist/types/client/AgentForbiddenError.d.ts +4 -0
- package/dist/types/client/HeaderProcessor.d.ts +1 -0
- package/dist/types/client/ProfileCardClient.d.ts +8 -3
- package/dist/types/client/Query.d.ts +4 -0
- package/dist/types/client/RovoAgentCardClient.d.ts +0 -4
- package/dist/types/client/TeamCentralCardClient.d.ts +0 -6
- package/dist/types/client/UserProfileCardClient.d.ts +9 -16
- package/dist/types/client/addHeaders.d.ts +1 -0
- package/dist/types/client/aggUserQuery.d.ts +2 -0
- package/dist/types/client/aggUserQueryString.d.ts +1 -0
- package/dist/types/client/ariPrefix.d.ts +1 -0
- package/dist/types/client/buildAggUserQuery.d.ts +6 -0
- package/dist/types/client/buildGatewayQuery.d.ts +12 -0
- package/dist/types/client/buildHeaders.d.ts +1 -0
- package/dist/types/client/buildReportingLinesQuery.d.ts +6 -0
- package/dist/types/client/convertTeam.d.ts +3 -0
- package/dist/types/client/defaultConfig.d.ts +3 -0
- package/dist/types/client/directoryGraphqlQuery.d.ts +8 -0
- package/dist/types/client/extractIdFromAri.d.ts +1 -0
- package/dist/types/client/gatewayQueryV2.d.ts +1 -0
- package/dist/types/client/getErrorAttributes.d.ts +6 -0
- package/dist/types/client/getTeamFromAGG.d.ts +1 -21
- package/dist/types/client/graphQLQuery.d.ts +3 -0
- package/dist/types/client/graphqlUtils.d.ts +0 -18
- package/dist/types/client/handleAGGErrors.d.ts +1 -0
- package/dist/types/client/handleDirectoryGraphQLErrors.d.ts +1 -0
- package/dist/types/client/id.d.ts +2 -0
- package/dist/types/client/idToAri.d.ts +4 -0
- package/dist/types/client/idToAriSafe.d.ts +1 -0
- package/dist/types/client/index.d.ts +18 -2
- package/dist/types/client/maybeCreateTeamCentralClient.d.ts +3 -0
- package/dist/types/client/modifyResponse.d.ts +10 -0
- package/dist/types/components/Agent/hooks/duplicateFetch.d.ts +1 -24
- package/dist/types/components/Agent/hooks/fetchActivationId.d.ts +5 -0
- package/dist/types/components/Agent/hooks/fetchDuplicateAgentMutation.d.ts +11 -0
- package/dist/types/components/Agent/hooks/fetchHasVersionCapability.d.ts +8 -0
- package/dist/types/components/Agent/hooks/firstCharUpper.d.ts +1 -0
- package/dist/types/components/Agent/hooks/useAgentActions.d.ts +1 -16
- package/dist/types/components/Agent/hooks/useAgentUrlActions.d.ts +15 -0
- package/dist/types/components/Agent/utils/getAtlassianStudioAgentDuplicateUrl.d.ts +1 -0
- package/dist/types/components/Agent/utils/getAtlassianStudioAgentEditUrl.d.ts +1 -0
- package/dist/types/components/Agent/utils/getStudioHost.d.ts +1 -0
- package/dist/types/components/Agent/utils/getStudioPath.d.ts +1 -0
- package/dist/types/components/Agent/utils/index.d.ts +2 -4
- package/dist/types/components/Team/index.d.ts +3 -0
- package/dist/types/components/User/LoadingView.d.ts +3 -0
- package/dist/types/components/User/ProfileCard.d.ts +9 -4
- package/dist/types/components/User/ProfilecardInternal.d.ts +3 -0
- package/dist/types/components/User/index.d.ts +6 -0
- package/dist/types/components/team-profile-card/main.d.ts +5 -0
- package/dist/types/i18n/index.d.ts +90 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/internal/isValidDate.d.ts +1 -0
- package/dist/types/internal/relative-date.d.ts +0 -1
- package/dist/types/mocks/get-time-string.d.ts +1 -0
- package/dist/types/mocks/get-weekday.d.ts +4 -0
- package/dist/types/mocks/index.d.ts +12 -0
- package/dist/types/mocks/random.d.ts +1 -0
- package/dist/types/mocks/simple-mock-clients.d.ts +1 -1
- package/dist/types/mocks/static-team-data.d.ts +8 -0
- package/dist/types/mocks/team-data.d.ts +10 -7
- package/dist/types/types.d.ts +1 -1
- package/dist/types/util/AGGError.d.ts +15 -0
- package/dist/types/util/AGGErrors.d.ts +6 -0
- package/dist/types/util/AnalyticsEventPayload.d.ts +1 -0
- package/dist/types/util/DirectoryGraphQLError.d.ts +14 -0
- package/dist/types/util/DirectoryGraphQLErrors.d.ts +6 -0
- package/dist/types/util/GenericAttributes.d.ts +1 -0
- package/dist/types/util/HttpError.d.ts +5 -0
- package/dist/types/util/actionClicked.d.ts +13 -0
- package/dist/types/util/agentRequestAnalytics.d.ts +9 -0
- package/dist/types/util/analytics.d.ts +3 -97
- package/dist/types/util/cardTriggered.d.ts +7 -0
- package/dist/types/util/createEvent.d.ts +7 -0
- package/dist/types/util/errorRetryClicked.d.ts +8 -0
- package/dist/types/util/getActionSubject.d.ts +1 -0
- package/dist/types/util/moreActionsClicked.d.ts +10 -0
- package/dist/types/util/moreMembersClicked.d.ts +9 -0
- package/dist/types/util/profileCardRendered.d.ts +16 -0
- package/dist/types/util/reportingLinesClicked.d.ts +9 -0
- package/dist/types/util/teamAvatarClicked.d.ts +11 -0
- package/dist/types/util/teamRequestAnalytics.d.ts +9 -0
- package/dist/types/util/userRequestAnalytics.d.ts +9 -0
- package/loading-view/package.json +10 -0
- package/main/package.json +4 -4
- package/modify-response/package.json +10 -0
- package/package.json +2 -2
- package/profile-card-client/package.json +4 -4
- package/profile-card-resourced/package.json +10 -0
- package/profilecard-internal/package.json +10 -0
- package/dist/cjs/components/Error/index.js +0 -27
- package/dist/cjs/components/Icon/index.js +0 -13
- package/dist/cjs/components/team-profile-card/index.js +0 -12
- package/dist/cjs/entry-points/ProfileCardClient.js +0 -13
- package/dist/cjs/entry-points/main.js +0 -12
- package/dist/cjs/mocks/util.js +0 -26
- package/dist/cjs/util/errors.js +0 -105
- package/dist/es2019/components/Error/index.js +0 -3
- package/dist/es2019/components/Icon/index.js +0 -1
- package/dist/es2019/components/team-profile-card/index.js +0 -1
- package/dist/es2019/entry-points/ProfileCardClient.js +0 -1
- package/dist/es2019/entry-points/main.js +0 -1
- package/dist/es2019/util/errors.js +0 -59
- package/dist/esm/components/Error/index.js +0 -3
- package/dist/esm/components/Icon/index.js +0 -1
- package/dist/esm/components/team-profile-card/index.js +0 -1
- package/dist/esm/entry-points/ProfileCardClient.js +0 -1
- package/dist/esm/entry-points/main.js +0 -1
- package/dist/esm/util/errors.js +0 -98
- package/dist/types/client/errorUtils.d.ts +0 -5
- package/dist/types/components/Error/index.d.ts +0 -3
- package/dist/types/components/Icon/index.d.ts +0 -1
- package/dist/types/components/team-profile-card/index.d.ts +0 -1
- package/dist/types/entry-points/ProfileCardClient.d.ts +0 -1
- package/dist/types/entry-points/main.d.ts +0 -1
- package/dist/types/mocks/util.d.ts +0 -6
- package/dist/types/util/errors.d.ts +0 -43
|
@@ -1,210 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
-
import { useCallback } from 'react';
|
|
8
|
-
import { getATLContextUrl } from '@atlaskit/atlassian-context/get-atl-context-url';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
|
-
import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers/post-message-to-pubsub';
|
|
11
|
-
import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
|
|
12
|
-
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics/use-analytics-events';
|
|
13
|
-
import { encodeParamsToUrl } from '../../../util/url';
|
|
14
|
-
import { getAtlassianStudioAgentDuplicateUrl, getAtlassianStudioAgentEditUrl, getStudioPath } from '../utils';
|
|
15
|
-
import { fetchHasVersionCapability, fetchActivationId, fetchDuplicateAgentMutation } from './duplicateFetch';
|
|
16
|
-
export var firstCharUpper = function firstCharUpper(str) {
|
|
17
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
18
|
-
};
|
|
19
|
-
var ROVO_PARAM_PREFIX = 'rovoChat';
|
|
20
|
-
var createRovoParams = function createRovoParams(params) {
|
|
21
|
-
var rovoParams = {};
|
|
22
|
-
Object.entries(params).forEach(function (_ref) {
|
|
23
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
24
|
-
key = _ref2[0],
|
|
25
|
-
value = _ref2[1];
|
|
26
|
-
rovoParams["".concat(ROVO_PARAM_PREFIX).concat(firstCharUpper(key))] = encodeURIComponent(value);
|
|
27
|
-
});
|
|
28
|
-
return rovoParams;
|
|
29
|
-
};
|
|
30
|
-
export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
|
|
31
|
-
var cloudId = _ref3.cloudId,
|
|
32
|
-
email = _ref3.email,
|
|
33
|
-
source = _ref3.source;
|
|
34
|
-
var _useRovoPostMessageTo = useRovoPostMessageToPubsub(),
|
|
35
|
-
publishWithPostMessage = _useRovoPostMessageTo.publishWithPostMessage;
|
|
36
|
-
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
37
|
-
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
38
|
-
var onEditAgent = useCallback(function (agentId) {
|
|
39
|
-
var url = getAtlassianStudioAgentEditUrl(cloudId, agentId, email);
|
|
40
|
-
window.open(url, '_blank', 'noopener, noreferrer');
|
|
41
|
-
fireEvent('ui.button.clicked.editAgentButton', {
|
|
42
|
-
agentId: agentId,
|
|
43
|
-
source: source
|
|
44
|
-
});
|
|
45
|
-
}, [cloudId, email, fireEvent, source]);
|
|
46
|
-
var onCopyAgent = function onCopyAgent(agentId) {
|
|
47
|
-
var url = "".concat(window.location.origin, "/people/agent/").concat(agentId);
|
|
48
|
-
var urlWithParams = encodeParamsToUrl(url, {
|
|
49
|
-
cloudId: cloudId
|
|
50
|
-
});
|
|
51
|
-
navigator.clipboard.writeText(urlWithParams);
|
|
52
|
-
fireEvent('ui.button.clicked.copyAgentLinkButton', {
|
|
53
|
-
agentId: agentId,
|
|
54
|
-
source: source
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
var onDuplicateAgent = useCallback( /*#__PURE__*/function () {
|
|
58
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(agentId) {
|
|
59
|
-
var legacyDuplicateUrl, hasVersionCapability, activationId, agentAri, result;
|
|
60
|
-
return _regeneratorRuntime.wrap(function (_context) {
|
|
61
|
-
while (1) switch (_context.prev = _context.next) {
|
|
62
|
-
case 0:
|
|
63
|
-
fireEvent('ui.button.clicked.duplicateAgentButton', {
|
|
64
|
-
agentId: agentId,
|
|
65
|
-
source: source
|
|
66
|
-
});
|
|
67
|
-
legacyDuplicateUrl = getAtlassianStudioAgentDuplicateUrl(cloudId, agentId, email); // When versioning FG is off, use legacy duplicate flow
|
|
68
|
-
if (fg('rovo_agent_versioning_enabled')) {
|
|
69
|
-
_context.next = 1;
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
window.open(legacyDuplicateUrl, '_blank', 'noopener, noreferrer');
|
|
73
|
-
return _context.abrupt("return");
|
|
74
|
-
case 1:
|
|
75
|
-
_context.next = 2;
|
|
76
|
-
return fetchHasVersionCapability(cloudId);
|
|
77
|
-
case 2:
|
|
78
|
-
hasVersionCapability = _context.sent;
|
|
79
|
-
if (hasVersionCapability) {
|
|
80
|
-
_context.next = 3;
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
84
|
-
window.location.assign(legacyDuplicateUrl);
|
|
85
|
-
return _context.abrupt("return");
|
|
86
|
-
case 3:
|
|
87
|
-
_context.next = 4;
|
|
88
|
-
return fetchActivationId(cloudId);
|
|
89
|
-
case 4:
|
|
90
|
-
activationId = _context.sent;
|
|
91
|
-
if (activationId) {
|
|
92
|
-
_context.next = 5;
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
96
|
-
window.location.assign(legacyDuplicateUrl);
|
|
97
|
-
return _context.abrupt("return");
|
|
98
|
-
case 5:
|
|
99
|
-
agentAri = "ari:cloud:rovo::agent/activation/".concat(activationId, "/").concat(agentId); // Call BE mutation to duplicate the agent
|
|
100
|
-
_context.next = 6;
|
|
101
|
-
return fetchDuplicateAgentMutation(agentAri);
|
|
102
|
-
case 6:
|
|
103
|
-
result = _context.sent;
|
|
104
|
-
if (result.success && result.newAgentAri) {
|
|
105
|
-
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
106
|
-
window.location.assign(getStudioPath("/s/".concat(cloudId, "/agents/").concat(encodeURIComponent(result.newAgentAri), "/v/draft/details")));
|
|
107
|
-
} else {
|
|
108
|
-
// Fallback to legacy on error
|
|
109
|
-
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
110
|
-
window.location.assign(legacyDuplicateUrl);
|
|
111
|
-
}
|
|
112
|
-
case 7:
|
|
113
|
-
case "end":
|
|
114
|
-
return _context.stop();
|
|
115
|
-
}
|
|
116
|
-
}, _callee);
|
|
117
|
-
}));
|
|
118
|
-
return function (_x) {
|
|
119
|
-
return _ref4.apply(this, arguments);
|
|
120
|
-
};
|
|
121
|
-
}(), [cloudId, email, fireEvent, source]);
|
|
122
|
-
var onConversationStarter = function onConversationStarter(_ref5) {
|
|
123
|
-
var agentId = _ref5.agentId,
|
|
124
|
-
prompt = _ref5.prompt;
|
|
125
|
-
var startConversationInNewTab = function startConversationInNewTab() {
|
|
126
|
-
var baseUrl = "".concat(getATLContextUrl('home'), "/chat");
|
|
127
|
-
var urlWithParams = encodeParamsToUrl(baseUrl, _objectSpread({
|
|
128
|
-
cloudId: cloudId
|
|
129
|
-
}, createRovoParams({
|
|
130
|
-
cloudId: cloudId,
|
|
131
|
-
agentId: agentId,
|
|
132
|
-
prompt: prompt,
|
|
133
|
-
pathway: 'chat'
|
|
134
|
-
})));
|
|
135
|
-
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
136
|
-
};
|
|
137
|
-
publishWithPostMessage({
|
|
138
|
-
targetWindow: window,
|
|
139
|
-
payload: {
|
|
140
|
-
type: 'chat-new',
|
|
141
|
-
source: 'AgentProfileCard',
|
|
142
|
-
data: {
|
|
143
|
-
name: prompt.slice(0, 50),
|
|
144
|
-
prompt: prompt,
|
|
145
|
-
agentId: agentId,
|
|
146
|
-
dialogues: []
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
onAcknowledgeTimeout: function onAcknowledgeTimeout() {
|
|
150
|
-
startConversationInNewTab();
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
};
|
|
154
|
-
var onOpenChat = function onOpenChat(agentId, agentName) {
|
|
155
|
-
var openChatInNewTab = function openChatInNewTab() {
|
|
156
|
-
var baseUrl = "".concat(getATLContextUrl('home'), "/chat");
|
|
157
|
-
var urlWithParams = encodeParamsToUrl(baseUrl, _objectSpread({
|
|
158
|
-
cloudId: cloudId
|
|
159
|
-
}, createRovoParams({
|
|
160
|
-
cloudId: cloudId,
|
|
161
|
-
agentId: agentId,
|
|
162
|
-
pathway: 'chat'
|
|
163
|
-
})));
|
|
164
|
-
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
165
|
-
};
|
|
166
|
-
publishWithPostMessage({
|
|
167
|
-
targetWindow: window,
|
|
168
|
-
payload: {
|
|
169
|
-
type: 'chat-new',
|
|
170
|
-
source: 'AgentProfileCard',
|
|
171
|
-
data: {
|
|
172
|
-
agentId: agentId,
|
|
173
|
-
dialogues: [],
|
|
174
|
-
name: "Chat with ".concat(agentName)
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
onAcknowledgeTimeout: function onAcknowledgeTimeout() {
|
|
178
|
-
openChatInNewTab();
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
};
|
|
182
|
-
var onViewFullProfile = function onViewFullProfile(agentId) {
|
|
183
|
-
var _navigateToTeamsApp = navigateToTeamsApp({
|
|
184
|
-
type: 'AGENT',
|
|
185
|
-
payload: {
|
|
186
|
-
agentId: agentId
|
|
187
|
-
},
|
|
188
|
-
cloudId: cloudId,
|
|
189
|
-
shouldOpenInSameTab: false
|
|
190
|
-
}),
|
|
191
|
-
onNavigate = _navigateToTeamsApp.onNavigate;
|
|
192
|
-
if (fg('platform-adopt-teams-nav-config')) {
|
|
193
|
-
onNavigate();
|
|
194
|
-
} else {
|
|
195
|
-
window.open("".concat(window.location.origin, "/people/agent/").concat(agentId), '_blank', 'noopener, noreferrer');
|
|
196
|
-
}
|
|
197
|
-
fireEvent('ui.button.clicked.viewAgentFullProfileButton', {
|
|
198
|
-
agentId: agentId,
|
|
199
|
-
source: source
|
|
200
|
-
});
|
|
201
|
-
};
|
|
202
|
-
return {
|
|
203
|
-
onEditAgent: onEditAgent,
|
|
204
|
-
onCopyAgent: onCopyAgent,
|
|
205
|
-
onDuplicateAgent: onDuplicateAgent,
|
|
206
|
-
onOpenChat: onOpenChat,
|
|
207
|
-
onConversationStarter: onConversationStarter,
|
|
208
|
-
onViewFullProfile: onViewFullProfile
|
|
209
|
-
};
|
|
210
|
-
};
|
|
1
|
+
export var ROVO_PARAM_PREFIX = 'rovoChat';
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
+
import { useCallback } from 'react';
|
|
8
|
+
import { getATLContextUrl } from '@atlaskit/atlassian-context/get-atl-context-url';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
|
+
import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers/post-message-to-pubsub';
|
|
11
|
+
import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
|
|
12
|
+
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics/use-analytics-events';
|
|
13
|
+
import { encodeParamsToUrl } from '../../../util/url';
|
|
14
|
+
import { getAtlassianStudioAgentDuplicateUrl } from '../utils/getAtlassianStudioAgentDuplicateUrl';
|
|
15
|
+
import { getAtlassianStudioAgentEditUrl } from '../utils/getAtlassianStudioAgentEditUrl';
|
|
16
|
+
import { getStudioPath } from '../utils/getStudioPath';
|
|
17
|
+
import { fetchActivationId } from './fetchActivationId';
|
|
18
|
+
import { fetchDuplicateAgentMutation } from './fetchDuplicateAgentMutation';
|
|
19
|
+
import { fetchHasVersionCapability } from './fetchHasVersionCapability';
|
|
20
|
+
import { firstCharUpper } from './firstCharUpper';
|
|
21
|
+
import { ROVO_PARAM_PREFIX } from './useAgentActions';
|
|
22
|
+
var createRovoParams = function createRovoParams(params) {
|
|
23
|
+
var rovoParams = {};
|
|
24
|
+
Object.entries(params).forEach(function (_ref) {
|
|
25
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
26
|
+
key = _ref2[0],
|
|
27
|
+
value = _ref2[1];
|
|
28
|
+
rovoParams["".concat(ROVO_PARAM_PREFIX).concat(firstCharUpper(key))] = encodeURIComponent(value);
|
|
29
|
+
});
|
|
30
|
+
return rovoParams;
|
|
31
|
+
};
|
|
32
|
+
export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
|
|
33
|
+
var cloudId = _ref3.cloudId,
|
|
34
|
+
email = _ref3.email,
|
|
35
|
+
source = _ref3.source;
|
|
36
|
+
var _useRovoPostMessageTo = useRovoPostMessageToPubsub(),
|
|
37
|
+
publishWithPostMessage = _useRovoPostMessageTo.publishWithPostMessage;
|
|
38
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
39
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
40
|
+
var onEditAgent = useCallback(function (agentId) {
|
|
41
|
+
var url = getAtlassianStudioAgentEditUrl(cloudId, agentId, email);
|
|
42
|
+
window.open(url, '_blank', 'noopener, noreferrer');
|
|
43
|
+
fireEvent('ui.button.clicked.editAgentButton', {
|
|
44
|
+
agentId: agentId,
|
|
45
|
+
source: source
|
|
46
|
+
});
|
|
47
|
+
}, [cloudId, email, fireEvent, source]);
|
|
48
|
+
var onCopyAgent = function onCopyAgent(agentId) {
|
|
49
|
+
var url = "".concat(window.location.origin, "/people/agent/").concat(agentId);
|
|
50
|
+
var urlWithParams = encodeParamsToUrl(url, {
|
|
51
|
+
cloudId: cloudId
|
|
52
|
+
});
|
|
53
|
+
navigator.clipboard.writeText(urlWithParams);
|
|
54
|
+
fireEvent('ui.button.clicked.copyAgentLinkButton', {
|
|
55
|
+
agentId: agentId,
|
|
56
|
+
source: source
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
var onDuplicateAgent = useCallback( /*#__PURE__*/function () {
|
|
60
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(agentId) {
|
|
61
|
+
var legacyDuplicateUrl, hasVersionCapability, activationId, agentAri, result;
|
|
62
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
63
|
+
while (1) switch (_context.prev = _context.next) {
|
|
64
|
+
case 0:
|
|
65
|
+
fireEvent('ui.button.clicked.duplicateAgentButton', {
|
|
66
|
+
agentId: agentId,
|
|
67
|
+
source: source
|
|
68
|
+
});
|
|
69
|
+
legacyDuplicateUrl = getAtlassianStudioAgentDuplicateUrl(cloudId, agentId, email); // When versioning FG is off, use legacy duplicate flow
|
|
70
|
+
if (fg('rovo_agent_versioning_enabled')) {
|
|
71
|
+
_context.next = 1;
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
window.open(legacyDuplicateUrl, '_blank', 'noopener, noreferrer');
|
|
75
|
+
return _context.abrupt("return");
|
|
76
|
+
case 1:
|
|
77
|
+
_context.next = 2;
|
|
78
|
+
return fetchHasVersionCapability(cloudId);
|
|
79
|
+
case 2:
|
|
80
|
+
hasVersionCapability = _context.sent;
|
|
81
|
+
if (hasVersionCapability) {
|
|
82
|
+
_context.next = 3;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
86
|
+
window.location.assign(legacyDuplicateUrl);
|
|
87
|
+
return _context.abrupt("return");
|
|
88
|
+
case 3:
|
|
89
|
+
_context.next = 4;
|
|
90
|
+
return fetchActivationId(cloudId);
|
|
91
|
+
case 4:
|
|
92
|
+
activationId = _context.sent;
|
|
93
|
+
if (activationId) {
|
|
94
|
+
_context.next = 5;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
98
|
+
window.location.assign(legacyDuplicateUrl);
|
|
99
|
+
return _context.abrupt("return");
|
|
100
|
+
case 5:
|
|
101
|
+
agentAri = "ari:cloud:rovo::agent/activation/".concat(activationId, "/").concat(agentId); // Call BE mutation to duplicate the agent
|
|
102
|
+
_context.next = 6;
|
|
103
|
+
return fetchDuplicateAgentMutation(agentAri);
|
|
104
|
+
case 6:
|
|
105
|
+
result = _context.sent;
|
|
106
|
+
if (result.success && result.newAgentAri) {
|
|
107
|
+
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
108
|
+
window.location.assign(getStudioPath("/s/".concat(cloudId, "/agents/").concat(encodeURIComponent(result.newAgentAri), "/v/draft/details")));
|
|
109
|
+
} else {
|
|
110
|
+
// Fallback to legacy on error
|
|
111
|
+
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
112
|
+
window.location.assign(legacyDuplicateUrl);
|
|
113
|
+
}
|
|
114
|
+
case 7:
|
|
115
|
+
case "end":
|
|
116
|
+
return _context.stop();
|
|
117
|
+
}
|
|
118
|
+
}, _callee);
|
|
119
|
+
}));
|
|
120
|
+
return function (_x) {
|
|
121
|
+
return _ref4.apply(this, arguments);
|
|
122
|
+
};
|
|
123
|
+
}(), [cloudId, email, fireEvent, source]);
|
|
124
|
+
var onConversationStarter = function onConversationStarter(_ref5) {
|
|
125
|
+
var agentId = _ref5.agentId,
|
|
126
|
+
prompt = _ref5.prompt;
|
|
127
|
+
var startConversationInNewTab = function startConversationInNewTab() {
|
|
128
|
+
var baseUrl = "".concat(getATLContextUrl('home'), "/chat");
|
|
129
|
+
var urlWithParams = encodeParamsToUrl(baseUrl, _objectSpread({
|
|
130
|
+
cloudId: cloudId
|
|
131
|
+
}, createRovoParams({
|
|
132
|
+
cloudId: cloudId,
|
|
133
|
+
agentId: agentId,
|
|
134
|
+
prompt: prompt,
|
|
135
|
+
pathway: 'chat'
|
|
136
|
+
})));
|
|
137
|
+
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
138
|
+
};
|
|
139
|
+
publishWithPostMessage({
|
|
140
|
+
targetWindow: window,
|
|
141
|
+
payload: {
|
|
142
|
+
type: 'chat-new',
|
|
143
|
+
source: 'AgentProfileCard',
|
|
144
|
+
data: {
|
|
145
|
+
name: prompt.slice(0, 50),
|
|
146
|
+
prompt: prompt,
|
|
147
|
+
agentId: agentId,
|
|
148
|
+
dialogues: []
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
onAcknowledgeTimeout: function onAcknowledgeTimeout() {
|
|
152
|
+
startConversationInNewTab();
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
var onOpenChat = function onOpenChat(agentId, agentName) {
|
|
157
|
+
var openChatInNewTab = function openChatInNewTab() {
|
|
158
|
+
var baseUrl = "".concat(getATLContextUrl('home'), "/chat");
|
|
159
|
+
var urlWithParams = encodeParamsToUrl(baseUrl, _objectSpread({
|
|
160
|
+
cloudId: cloudId
|
|
161
|
+
}, createRovoParams({
|
|
162
|
+
cloudId: cloudId,
|
|
163
|
+
agentId: agentId,
|
|
164
|
+
pathway: 'chat'
|
|
165
|
+
})));
|
|
166
|
+
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
167
|
+
};
|
|
168
|
+
publishWithPostMessage({
|
|
169
|
+
targetWindow: window,
|
|
170
|
+
payload: {
|
|
171
|
+
type: 'chat-new',
|
|
172
|
+
source: 'AgentProfileCard',
|
|
173
|
+
data: {
|
|
174
|
+
agentId: agentId,
|
|
175
|
+
dialogues: [],
|
|
176
|
+
name: "Chat with ".concat(agentName)
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
onAcknowledgeTimeout: function onAcknowledgeTimeout() {
|
|
180
|
+
openChatInNewTab();
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
var onViewFullProfile = function onViewFullProfile(agentId) {
|
|
185
|
+
var _navigateToTeamsApp = navigateToTeamsApp({
|
|
186
|
+
type: 'AGENT',
|
|
187
|
+
payload: {
|
|
188
|
+
agentId: agentId
|
|
189
|
+
},
|
|
190
|
+
cloudId: cloudId,
|
|
191
|
+
shouldOpenInSameTab: false
|
|
192
|
+
}),
|
|
193
|
+
onNavigate = _navigateToTeamsApp.onNavigate;
|
|
194
|
+
if (fg('platform-adopt-teams-nav-config')) {
|
|
195
|
+
onNavigate();
|
|
196
|
+
} else {
|
|
197
|
+
window.open("".concat(window.location.origin, "/people/agent/").concat(agentId), '_blank', 'noopener, noreferrer');
|
|
198
|
+
}
|
|
199
|
+
fireEvent('ui.button.clicked.viewAgentFullProfileButton', {
|
|
200
|
+
agentId: agentId,
|
|
201
|
+
source: source
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
return {
|
|
205
|
+
onEditAgent: onEditAgent,
|
|
206
|
+
onCopyAgent: onCopyAgent,
|
|
207
|
+
onDuplicateAgent: onDuplicateAgent,
|
|
208
|
+
onOpenChat: onOpenChat,
|
|
209
|
+
onConversationStarter: onConversationStarter,
|
|
210
|
+
onViewFullProfile: onViewFullProfile
|
|
211
|
+
};
|
|
212
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { getStudioPath } from './getStudioPath';
|
|
2
|
+
export var getAtlassianStudioAgentDuplicateUrl = function getAtlassianStudioAgentDuplicateUrl(siteId, agentId, email) {
|
|
3
|
+
return getStudioPath("/s/".concat(siteId, "/agents/enrich/rovo/agents/").concat(agentId, "?redirect=").concat(encodeURIComponent('/create')), email);
|
|
4
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { getStudioPath } from './getStudioPath';
|
|
2
|
+
export var getAtlassianStudioAgentEditUrl = function getAtlassianStudioAgentEditUrl(siteId, agentId, email) {
|
|
3
|
+
return getStudioPath("/s/".concat(siteId, "/agents/enrich/rovo/agents/").concat(agentId, "?redirect=").concat(encodeURIComponent('/:agentId/overview')), email);
|
|
4
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { STUDIO_PROD_URL, STUDIO_STAGING_URL } from './index';
|
|
2
|
+
var isStaging = function isStaging() {
|
|
3
|
+
var host = window.location.host;
|
|
4
|
+
return host.includes('localhost') || host.includes('.stg.atlassian') || host.includes('.stg-east.frontend.public.atl-paas.net') || host.includes('jira-dev.com');
|
|
5
|
+
};
|
|
6
|
+
export var getStudioHost = function getStudioHost() {
|
|
7
|
+
return isStaging() ? STUDIO_STAGING_URL : STUDIO_PROD_URL;
|
|
8
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
2
|
+
import { getStudioHost } from './getStudioHost';
|
|
3
|
+
var getStudioSessionSyncUrl = function getStudioSessionSyncUrl(path, email) {
|
|
4
|
+
var url = new URL("".concat(getStudioHost()).concat(path));
|
|
5
|
+
url.searchParams.set('login_hint', email);
|
|
6
|
+
return url.toString();
|
|
7
|
+
};
|
|
8
|
+
export var getStudioPath = function getStudioPath(path, email) {
|
|
9
|
+
if (email && fg('manual-studio-entry-link')) {
|
|
10
|
+
return getStudioSessionSyncUrl(path, email);
|
|
11
|
+
}
|
|
12
|
+
return "".concat(getStudioHost()).concat(path);
|
|
13
|
+
};
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
var STUDIO_STAGING_URL = 'https://atlassian-studio.stg-east.frontend.public.atl-paas.net';
|
|
4
|
-
var isStaging = function isStaging() {
|
|
5
|
-
var host = window.location.host;
|
|
6
|
-
return host.includes('localhost') || host.includes('.stg.atlassian') || host.includes('.stg-east.frontend.public.atl-paas.net') || host.includes('jira-dev.com');
|
|
7
|
-
};
|
|
8
|
-
export var getStudioHost = function getStudioHost() {
|
|
9
|
-
return isStaging() ? STUDIO_STAGING_URL : STUDIO_PROD_URL;
|
|
10
|
-
};
|
|
11
|
-
var getStudioSessionSyncUrl = function getStudioSessionSyncUrl(path, email) {
|
|
12
|
-
var url = new URL("".concat(getStudioHost()).concat(path));
|
|
13
|
-
url.searchParams.set('login_hint', email);
|
|
14
|
-
return url.toString();
|
|
15
|
-
};
|
|
16
|
-
export var getStudioPath = function getStudioPath(path, email) {
|
|
17
|
-
if (email && fg('manual-studio-entry-link')) {
|
|
18
|
-
return getStudioSessionSyncUrl(path, email);
|
|
19
|
-
}
|
|
20
|
-
return "".concat(getStudioHost()).concat(path);
|
|
21
|
-
};
|
|
22
|
-
export var getAtlassianStudioAgentEditUrl = function getAtlassianStudioAgentEditUrl(siteId, agentId, email) {
|
|
23
|
-
return getStudioPath("/s/".concat(siteId, "/agents/enrich/rovo/agents/").concat(agentId, "?redirect=").concat(encodeURIComponent('/:agentId/overview')), email);
|
|
24
|
-
};
|
|
25
|
-
export var getAtlassianStudioAgentDuplicateUrl = function getAtlassianStudioAgentDuplicateUrl(siteId, agentId, email) {
|
|
26
|
-
return getStudioPath("/s/".concat(siteId, "/agents/enrich/rovo/agents/").concat(agentId, "?redirect=").concat(encodeURIComponent('/create')), email);
|
|
27
|
-
};
|
|
1
|
+
export var STUDIO_PROD_URL = 'https://studio.atlassian.com';
|
|
2
|
+
export var STUDIO_STAGING_URL = 'https://atlassian-studio.stg-east.frontend.public.atl-paas.net';
|
|
@@ -28,7 +28,7 @@ import { CardContent, CardHeader, CardWrapper } from '../../styled/TeamTrigger';
|
|
|
28
28
|
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
29
29
|
import { isBasicClick } from '../../util/click';
|
|
30
30
|
import { getPageTime } from '../../util/performance';
|
|
31
|
-
import { ErrorIllustration } from '../Error';
|
|
31
|
+
import { ErrorIllustration } from '../Error/ErrorIllustration';
|
|
32
32
|
import TeamForbiddenErrorState from './TeamForbiddenErrorState';
|
|
33
33
|
import TeamLoadingState from './TeamLoadingState';
|
|
34
34
|
var LARGE_MEMBER_COUNT = 50;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
1
2
|
// Do not export TeamProfileCard here as it will break lazy-loading for the team trigger.
|
|
2
3
|
import { DELAY_MS_HIDE, DELAY_MS_SHOW } from '../../util/config';
|
|
3
4
|
import TeamProfileCardTrigger from './TeamProfileCardTrigger';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use `import { DELAY_MS_HIDE, DELAY_MS_SHOW } from '@atlaskit/profilecard/config'` instead.
|
|
7
|
+
*/
|
|
4
8
|
export { DELAY_MS_HIDE, DELAY_MS_SHOW };
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-re-exports
|
|
5
11
|
export default TeamProfileCardTrigger;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
6
|
+
import { SpinnerContainer } from '../../styled/UserTrigger';
|
|
7
|
+
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
8
|
+
import { getPageTime } from '../../util/performance';
|
|
9
|
+
export var LoadingView = function LoadingView(_ref) {
|
|
10
|
+
var fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration;
|
|
11
|
+
useEffect(function () {
|
|
12
|
+
fireAnalyticsWithDuration('ui.profilecard.rendered.spinner', function (duration) {
|
|
13
|
+
return _objectSpread({
|
|
14
|
+
firedAt: Math.round(getPageTime()),
|
|
15
|
+
duration: duration
|
|
16
|
+
}, PACKAGE_META_DATA);
|
|
17
|
+
});
|
|
18
|
+
}, [fireAnalyticsWithDuration]);
|
|
19
|
+
return /*#__PURE__*/React.createElement(SpinnerContainer, {
|
|
20
|
+
testId: "profilecard-spinner-container"
|
|
21
|
+
}, /*#__PURE__*/React.createElement(Spinner, null));
|
|
22
|
+
};
|