@atlaskit/profilecard 26.19.9 → 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 +66 -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
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { getATLContextUrl } from '@atlaskit/atlassian-context/get-atl-context-url';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
4
|
+
import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers/post-message-to-pubsub';
|
|
5
|
+
import { navigateToTeamsApp } from '@atlaskit/teams-app-config/navigation';
|
|
6
|
+
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics/use-analytics-events';
|
|
7
|
+
import { encodeParamsToUrl } from '../../../util/url';
|
|
8
|
+
import { getAtlassianStudioAgentDuplicateUrl } from '../utils/getAtlassianStudioAgentDuplicateUrl';
|
|
9
|
+
import { getAtlassianStudioAgentEditUrl } from '../utils/getAtlassianStudioAgentEditUrl';
|
|
10
|
+
import { getStudioPath } from '../utils/getStudioPath';
|
|
11
|
+
import { fetchActivationId } from './fetchActivationId';
|
|
12
|
+
import { fetchDuplicateAgentMutation } from './fetchDuplicateAgentMutation';
|
|
13
|
+
import { fetchHasVersionCapability } from './fetchHasVersionCapability';
|
|
14
|
+
import { firstCharUpper } from './firstCharUpper';
|
|
15
|
+
import { ROVO_PARAM_PREFIX } from './useAgentActions';
|
|
16
|
+
const createRovoParams = params => {
|
|
17
|
+
const rovoParams = {};
|
|
18
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
19
|
+
rovoParams[`${ROVO_PARAM_PREFIX}${firstCharUpper(key)}`] = encodeURIComponent(value);
|
|
20
|
+
});
|
|
21
|
+
return rovoParams;
|
|
22
|
+
};
|
|
23
|
+
export const useAgentUrlActions = ({
|
|
24
|
+
cloudId,
|
|
25
|
+
email,
|
|
26
|
+
source
|
|
27
|
+
}) => {
|
|
28
|
+
const {
|
|
29
|
+
publishWithPostMessage
|
|
30
|
+
} = useRovoPostMessageToPubsub();
|
|
31
|
+
const {
|
|
32
|
+
fireEvent
|
|
33
|
+
} = useAnalyticsEvents();
|
|
34
|
+
const onEditAgent = useCallback(agentId => {
|
|
35
|
+
const url = getAtlassianStudioAgentEditUrl(cloudId, agentId, email);
|
|
36
|
+
window.open(url, '_blank', 'noopener, noreferrer');
|
|
37
|
+
fireEvent('ui.button.clicked.editAgentButton', {
|
|
38
|
+
agentId,
|
|
39
|
+
source
|
|
40
|
+
});
|
|
41
|
+
}, [cloudId, email, fireEvent, source]);
|
|
42
|
+
const onCopyAgent = agentId => {
|
|
43
|
+
const url = `${window.location.origin}/people/agent/${agentId}`;
|
|
44
|
+
const urlWithParams = encodeParamsToUrl(url, {
|
|
45
|
+
cloudId
|
|
46
|
+
});
|
|
47
|
+
navigator.clipboard.writeText(urlWithParams);
|
|
48
|
+
fireEvent('ui.button.clicked.copyAgentLinkButton', {
|
|
49
|
+
agentId,
|
|
50
|
+
source
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
const onDuplicateAgent = useCallback(async agentId => {
|
|
54
|
+
fireEvent('ui.button.clicked.duplicateAgentButton', {
|
|
55
|
+
agentId,
|
|
56
|
+
source
|
|
57
|
+
});
|
|
58
|
+
const legacyDuplicateUrl = getAtlassianStudioAgentDuplicateUrl(cloudId, agentId, email);
|
|
59
|
+
|
|
60
|
+
// When versioning FG is off, use legacy duplicate flow
|
|
61
|
+
if (!fg('rovo_agent_versioning_enabled')) {
|
|
62
|
+
window.open(legacyDuplicateUrl, '_blank', 'noopener, noreferrer');
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Check if versioning migration has completed for this site
|
|
67
|
+
const hasVersionCapability = await fetchHasVersionCapability(cloudId);
|
|
68
|
+
if (!hasVersionCapability) {
|
|
69
|
+
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
70
|
+
window.location.assign(legacyDuplicateUrl);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Resolve agent ARI (profilecard doesn't have agentAri, so fetch activationId)
|
|
75
|
+
const activationId = await fetchActivationId(cloudId);
|
|
76
|
+
if (!activationId) {
|
|
77
|
+
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
78
|
+
window.location.assign(legacyDuplicateUrl);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const agentAri = `ari:cloud:rovo::agent/activation/${activationId}/${agentId}`;
|
|
82
|
+
|
|
83
|
+
// Call BE mutation to duplicate the agent
|
|
84
|
+
const result = await fetchDuplicateAgentMutation(agentAri);
|
|
85
|
+
if (result.success && result.newAgentAri) {
|
|
86
|
+
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
87
|
+
window.location.assign(getStudioPath(`/s/${cloudId}/agents/${encodeURIComponent(result.newAgentAri)}/v/draft/details`));
|
|
88
|
+
} else {
|
|
89
|
+
// Fallback to legacy on error
|
|
90
|
+
// Opening in same tab because, we cannot open in new tab after async operation, because browsers prevent `.open` after certain duration
|
|
91
|
+
window.location.assign(legacyDuplicateUrl);
|
|
92
|
+
}
|
|
93
|
+
}, [cloudId, email, fireEvent, source]);
|
|
94
|
+
const onConversationStarter = ({
|
|
95
|
+
agentId,
|
|
96
|
+
prompt
|
|
97
|
+
}) => {
|
|
98
|
+
const startConversationInNewTab = () => {
|
|
99
|
+
const baseUrl = `${getATLContextUrl('home')}/chat`;
|
|
100
|
+
const urlWithParams = encodeParamsToUrl(baseUrl, {
|
|
101
|
+
cloudId,
|
|
102
|
+
...createRovoParams({
|
|
103
|
+
cloudId,
|
|
104
|
+
agentId,
|
|
105
|
+
prompt,
|
|
106
|
+
pathway: 'chat'
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
110
|
+
};
|
|
111
|
+
publishWithPostMessage({
|
|
112
|
+
targetWindow: window,
|
|
113
|
+
payload: {
|
|
114
|
+
type: 'chat-new',
|
|
115
|
+
source: 'AgentProfileCard',
|
|
116
|
+
data: {
|
|
117
|
+
name: prompt.slice(0, 50),
|
|
118
|
+
prompt,
|
|
119
|
+
agentId,
|
|
120
|
+
dialogues: []
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
onAcknowledgeTimeout: () => {
|
|
124
|
+
startConversationInNewTab();
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
const onOpenChat = (agentId, agentName) => {
|
|
129
|
+
const openChatInNewTab = () => {
|
|
130
|
+
const baseUrl = `${getATLContextUrl('home')}/chat`;
|
|
131
|
+
const urlWithParams = encodeParamsToUrl(baseUrl, {
|
|
132
|
+
cloudId,
|
|
133
|
+
...createRovoParams({
|
|
134
|
+
cloudId,
|
|
135
|
+
agentId,
|
|
136
|
+
pathway: 'chat'
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
140
|
+
};
|
|
141
|
+
publishWithPostMessage({
|
|
142
|
+
targetWindow: window,
|
|
143
|
+
payload: {
|
|
144
|
+
type: 'chat-new',
|
|
145
|
+
source: 'AgentProfileCard',
|
|
146
|
+
data: {
|
|
147
|
+
agentId,
|
|
148
|
+
dialogues: [],
|
|
149
|
+
name: `Chat with ${agentName}`
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
onAcknowledgeTimeout: () => {
|
|
153
|
+
openChatInNewTab();
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
const onViewFullProfile = agentId => {
|
|
158
|
+
const {
|
|
159
|
+
onNavigate
|
|
160
|
+
} = navigateToTeamsApp({
|
|
161
|
+
type: 'AGENT',
|
|
162
|
+
payload: {
|
|
163
|
+
agentId
|
|
164
|
+
},
|
|
165
|
+
cloudId,
|
|
166
|
+
shouldOpenInSameTab: false
|
|
167
|
+
});
|
|
168
|
+
if (fg('platform-adopt-teams-nav-config')) {
|
|
169
|
+
onNavigate();
|
|
170
|
+
} else {
|
|
171
|
+
window.open(`${window.location.origin}/people/agent/${agentId}`, '_blank', 'noopener, noreferrer');
|
|
172
|
+
}
|
|
173
|
+
fireEvent('ui.button.clicked.viewAgentFullProfileButton', {
|
|
174
|
+
agentId,
|
|
175
|
+
source
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
return {
|
|
179
|
+
onEditAgent,
|
|
180
|
+
onCopyAgent,
|
|
181
|
+
onDuplicateAgent,
|
|
182
|
+
onOpenChat,
|
|
183
|
+
onConversationStarter,
|
|
184
|
+
onViewFullProfile
|
|
185
|
+
};
|
|
186
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { STUDIO_PROD_URL, STUDIO_STAGING_URL } from './index';
|
|
2
|
+
const isStaging = () => {
|
|
3
|
+
const 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 const 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
|
+
const getStudioSessionSyncUrl = (path, email) => {
|
|
4
|
+
const url = new URL(`${getStudioHost()}${path}`);
|
|
5
|
+
url.searchParams.set('login_hint', email);
|
|
6
|
+
return url.toString();
|
|
7
|
+
};
|
|
8
|
+
export const getStudioPath = (path, email) => {
|
|
9
|
+
if (email && fg('manual-studio-entry-link')) {
|
|
10
|
+
return getStudioSessionSyncUrl(path, email);
|
|
11
|
+
}
|
|
12
|
+
return `${getStudioHost()}${path}`;
|
|
13
|
+
};
|
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
const STUDIO_STAGING_URL = 'https://atlassian-studio.stg-east.frontend.public.atl-paas.net';
|
|
4
|
-
const isStaging = () => {
|
|
5
|
-
const 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 const getStudioHost = () => {
|
|
9
|
-
return isStaging() ? STUDIO_STAGING_URL : STUDIO_PROD_URL;
|
|
10
|
-
};
|
|
11
|
-
const getStudioSessionSyncUrl = (path, email) => {
|
|
12
|
-
const url = new URL(`${getStudioHost()}${path}`);
|
|
13
|
-
url.searchParams.set('login_hint', email);
|
|
14
|
-
return url.toString();
|
|
15
|
-
};
|
|
16
|
-
export const getStudioPath = (path, email) => {
|
|
17
|
-
if (email && fg('manual-studio-entry-link')) {
|
|
18
|
-
return getStudioSessionSyncUrl(path, email);
|
|
19
|
-
}
|
|
20
|
-
return `${getStudioHost()}${path}`;
|
|
21
|
-
};
|
|
22
|
-
export const getAtlassianStudioAgentEditUrl = (siteId, agentId, email) => getStudioPath(`/s/${siteId}/agents/enrich/rovo/agents/${agentId}?redirect=${encodeURIComponent('/:agentId/overview')}`, email);
|
|
23
|
-
export const getAtlassianStudioAgentDuplicateUrl = (siteId, agentId, email) => getStudioPath(`/s/${siteId}/agents/enrich/rovo/agents/${agentId}?redirect=${encodeURIComponent('/create')}`, email);
|
|
1
|
+
export const STUDIO_PROD_URL = 'https://studio.atlassian.com';
|
|
2
|
+
export const STUDIO_STAGING_URL = 'https://atlassian-studio.stg-east.frontend.public.atl-paas.net';
|
|
@@ -23,7 +23,7 @@ import { CardContent, CardHeader, CardWrapper } from '../../styled/TeamTrigger';
|
|
|
23
23
|
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
24
24
|
import { isBasicClick } from '../../util/click';
|
|
25
25
|
import { getPageTime } from '../../util/performance';
|
|
26
|
-
import { ErrorIllustration } from '../Error';
|
|
26
|
+
import { ErrorIllustration } from '../Error/ErrorIllustration';
|
|
27
27
|
import TeamForbiddenErrorState from './TeamForbiddenErrorState';
|
|
28
28
|
import TeamLoadingState from './TeamLoadingState';
|
|
29
29
|
const 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,19 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
3
|
+
import { SpinnerContainer } from '../../styled/UserTrigger';
|
|
4
|
+
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
5
|
+
import { getPageTime } from '../../util/performance';
|
|
6
|
+
export const LoadingView = ({
|
|
7
|
+
fireAnalyticsWithDuration
|
|
8
|
+
}) => {
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
fireAnalyticsWithDuration('ui.profilecard.rendered.spinner', duration => ({
|
|
11
|
+
firedAt: Math.round(getPageTime()),
|
|
12
|
+
duration,
|
|
13
|
+
...PACKAGE_META_DATA
|
|
14
|
+
}));
|
|
15
|
+
}, [fireAnalyticsWithDuration]);
|
|
16
|
+
return /*#__PURE__*/React.createElement(SpinnerContainer, {
|
|
17
|
+
testId: "profilecard-spinner-container"
|
|
18
|
+
}, /*#__PURE__*/React.createElement(Spinner, null));
|
|
19
|
+
};
|
|
@@ -1,222 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { FormattedMessage, useIntl } from 'react-intl';
|
|
4
|
-
import Avatar from '@atlaskit/avatar/avatar';
|
|
5
|
-
import Button from '@atlaskit/button/default/button';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
|
-
import Spinner from '@atlaskit/spinner/spinner';
|
|
8
|
-
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics/use-analytics-events';
|
|
9
|
-
import { TeamsLinkButton } from '@atlaskit/teams-app-internal-navigation/teams-link-button';
|
|
10
|
-
import messages from '../../messages';
|
|
11
|
-
import { ActionButtonGroup, ActionsFlexSpacer, AnimatedKudosButton, AnimationWrapper, CardContainer, CardContent, KudosBlobAnimation, ProfileImage } from '../../styled/Card';
|
|
12
|
-
import { CardWrapper, SpinnerContainer } from '../../styled/UserTrigger';
|
|
13
|
-
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
14
|
-
import { isBasicClick } from '../../util/click';
|
|
15
|
-
import { getPageTime } from '../../util/performance';
|
|
16
|
-
import { ErrorMessage } from '../Error';
|
|
17
|
-
import { ACTION_OVERFLOW_THRESHOLD, OverflowProfileCardButtons } from './OverflowProfileCardButtons';
|
|
18
|
-
import { ProfileCardDetails } from './ProfileCardDetails';
|
|
19
|
-
const GIVE_KUDOS_ACTION_ID = 'give-kudos';
|
|
20
|
-
const useKudos = (cloudId, userId, teamCentralBaseUrl, openKudosDrawer) => {
|
|
21
|
-
const kudosUrl = useMemo(() => {
|
|
22
|
-
const recipientId = userId ? `&recipientId=${userId}` : '';
|
|
23
|
-
const cloudIdParam = cloudId ? `&cloudId=${cloudId}` : '';
|
|
24
|
-
return `${teamCentralBaseUrl || ''}/kudos/give?type=individual${recipientId}${cloudIdParam}`;
|
|
25
|
-
}, [cloudId, teamCentralBaseUrl, userId]);
|
|
26
|
-
const kudosButtonCallback = useCallback(() => {
|
|
27
|
-
if (openKudosDrawer) {
|
|
28
|
-
openKudosDrawer();
|
|
29
|
-
} else {
|
|
30
|
-
window.open(kudosUrl);
|
|
31
|
-
}
|
|
32
|
-
}, [kudosUrl, openKudosDrawer]);
|
|
33
|
-
const kudosAction = useMemo(() => {
|
|
34
|
-
return {
|
|
35
|
-
label: /*#__PURE__*/React.createElement(FormattedMessage, messages.giveKudosButton),
|
|
36
|
-
id: GIVE_KUDOS_ACTION_ID,
|
|
37
|
-
callback: kudosButtonCallback,
|
|
38
|
-
link: kudosUrl
|
|
39
|
-
};
|
|
40
|
-
}, [kudosButtonCallback, kudosUrl]);
|
|
41
|
-
return {
|
|
42
|
-
kudosAction,
|
|
43
|
-
kudosButtonCallback,
|
|
44
|
-
kudosUrl
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
const Wrapper = props => /*#__PURE__*/React.createElement(CardWrapper, {
|
|
48
|
-
testId: "profilecard",
|
|
49
|
-
role: "dialog",
|
|
50
|
-
labelledBy: props.labelledBy,
|
|
51
|
-
ariaLabel: props.ariaLabel
|
|
52
|
-
}, props.children);
|
|
53
|
-
export const ProfilecardInternal = props => {
|
|
54
|
-
const [openTime] = useState(getPageTime());
|
|
55
|
-
const intl = useIntl();
|
|
56
|
-
const {
|
|
57
|
-
fireEvent
|
|
58
|
-
} = useAnalyticsEvents();
|
|
59
|
-
const fireAnalyticsWithDuration = useCallback((eventKey, generator) => {
|
|
60
|
-
const duration = getPageTime() - openTime;
|
|
61
|
-
const attributes = generator(duration);
|
|
62
|
-
fireEvent(eventKey, attributes);
|
|
63
|
-
}, [openTime, fireEvent]);
|
|
64
|
-
const {
|
|
65
|
-
kudosAction
|
|
66
|
-
} = useKudos(props.cloudId, props.userId, props.teamCentralBaseUrl, props.openKudosDrawer);
|
|
67
|
-
const {
|
|
68
|
-
actions = [],
|
|
69
|
-
isCurrentUser,
|
|
70
|
-
isKudosEnabled,
|
|
71
|
-
status = 'active'
|
|
72
|
-
} = props;
|
|
73
|
-
const realActions = useMemo(() => {
|
|
74
|
-
if (isCurrentUser || !isKudosEnabled || status !== 'active') {
|
|
75
|
-
return actions;
|
|
76
|
-
}
|
|
77
|
-
return actions.concat([kudosAction]);
|
|
78
|
-
}, [actions, isCurrentUser, isKudosEnabled, kudosAction, status]);
|
|
79
|
-
const {
|
|
80
|
-
isLoading,
|
|
81
|
-
fullName,
|
|
82
|
-
hasError
|
|
83
|
-
} = props;
|
|
84
|
-
const canRender = !hasError && !isLoading && !!(fullName || status === 'closed');
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
if (canRender) {
|
|
87
|
-
fireAnalyticsWithDuration('ui.profilecard.rendered.content', duration => ({
|
|
88
|
-
duration,
|
|
89
|
-
numActions: realActions.length,
|
|
90
|
-
firedAt: Math.round(getPageTime()),
|
|
91
|
-
...PACKAGE_META_DATA
|
|
92
|
-
}));
|
|
93
|
-
}
|
|
94
|
-
}, [canRender, fireAnalyticsWithDuration, realActions]);
|
|
95
|
-
if (hasError) {
|
|
96
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
97
|
-
ariaLabel: intl.formatMessage(messages.errorDialogLabel)
|
|
98
|
-
}, /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
99
|
-
reload: props.clientFetchProfile,
|
|
100
|
-
errorType: props.errorType || null,
|
|
101
|
-
fireAnalytics: fireEvent
|
|
102
|
-
}));
|
|
103
|
-
}
|
|
104
|
-
if (isLoading) {
|
|
105
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
106
|
-
ariaLabel: intl.formatMessage(messages.loadingDialogLabel)
|
|
107
|
-
}, /*#__PURE__*/React.createElement(LoadingView, {
|
|
108
|
-
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
109
|
-
}));
|
|
110
|
-
}
|
|
111
|
-
if (!canRender) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
const isDisabledUser = status === 'inactive' || status === 'closed';
|
|
115
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
116
|
-
labelledBy: "profilecard-name-label"
|
|
117
|
-
}, /*#__PURE__*/React.createElement(CardContainer, {
|
|
118
|
-
isDisabledUser: isDisabledUser,
|
|
119
|
-
withoutElevation: props.withoutElevation
|
|
120
|
-
}, /*#__PURE__*/React.createElement(ProfileImage, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
121
|
-
size: "xlarge",
|
|
122
|
-
src: status !== 'closed' ? props.avatarUrl : undefined,
|
|
123
|
-
borderColor: "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)"
|
|
124
|
-
})), /*#__PURE__*/React.createElement(CardContent, null, /*#__PURE__*/React.createElement(ProfileCardDetails, _extends({}, props, {
|
|
125
|
-
status: status,
|
|
126
|
-
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
127
|
-
})), realActions && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ActionsFlexSpacer, null), /*#__PURE__*/React.createElement(Actions, _extends({}, fg('jfp_a11y_team_profile_card_actions_label') && {
|
|
128
|
-
fullName
|
|
129
|
-
}, {
|
|
130
|
-
fullName: fullName,
|
|
131
|
-
actions: realActions,
|
|
132
|
-
fireAnalyticsWithDuration: fireAnalyticsWithDuration,
|
|
133
|
-
isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard,
|
|
134
|
-
isRenderedInPortal: props.isRenderedInPortal
|
|
135
|
-
}))))));
|
|
136
|
-
};
|
|
137
|
-
const Actions = ({
|
|
138
|
-
actions,
|
|
139
|
-
fireAnalyticsWithDuration,
|
|
140
|
-
isTriggeredUsingKeyboard,
|
|
141
|
-
isRenderedInPortal,
|
|
142
|
-
fullName
|
|
143
|
-
}) => {
|
|
144
|
-
const onActionClick = useCallback((action, args, event, index) => {
|
|
145
|
-
fireAnalyticsWithDuration('ui.profilecard.clicked.action', duration => ({
|
|
146
|
-
method: 'click',
|
|
147
|
-
firedAt: Math.round(getPageTime()),
|
|
148
|
-
duration,
|
|
149
|
-
hasHref: !!action.link,
|
|
150
|
-
hasOnClick: !!action.callback,
|
|
151
|
-
index,
|
|
152
|
-
actionId: action.id || 'no-id-specified',
|
|
153
|
-
...PACKAGE_META_DATA
|
|
154
|
-
}));
|
|
155
|
-
if (action.callback && isBasicClick(event)) {
|
|
156
|
-
event.preventDefault();
|
|
157
|
-
action.callback(event, ...args);
|
|
158
|
-
}
|
|
159
|
-
}, [fireAnalyticsWithDuration]);
|
|
160
|
-
if (!actions || actions.length === 0) {
|
|
161
|
-
return null;
|
|
162
|
-
}
|
|
163
|
-
const regularActions = actions.slice(0, ACTION_OVERFLOW_THRESHOLD);
|
|
164
|
-
const overflowActions = actions.length > ACTION_OVERFLOW_THRESHOLD ? actions.slice(ACTION_OVERFLOW_THRESHOLD) : undefined;
|
|
165
|
-
return /*#__PURE__*/React.createElement(ActionButtonGroup, {
|
|
166
|
-
testId: "profilecard-actions"
|
|
167
|
-
}, regularActions.map((action, index) => {
|
|
168
|
-
const isKudos = action.id === GIVE_KUDOS_ACTION_ID;
|
|
169
|
-
if (isKudos && fg('fix_give_kudos_btn_incorrect_role')) {
|
|
170
|
-
const kudosButton = /*#__PURE__*/React.createElement(Button, {
|
|
171
|
-
appearance: "default",
|
|
172
|
-
key: action.id || index,
|
|
173
|
-
onClick: (event, ...args) => onActionClick(action, args, event, index),
|
|
174
|
-
autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
|
|
175
|
-
id: `action-button-${action.id}`,
|
|
176
|
-
"aria-labelledby": `action-button-${action.id} profilecard-name-label`
|
|
177
|
-
}, action.label, /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
|
|
178
|
-
return /*#__PURE__*/React.createElement(AnimatedKudosButton, {
|
|
179
|
-
key: `profile-card-action-kudos_${action.id || index}`
|
|
180
|
-
}, kudosButton);
|
|
181
|
-
}
|
|
182
|
-
const button = /*#__PURE__*/React.createElement(TeamsLinkButton, {
|
|
183
|
-
appearance: "default",
|
|
184
|
-
key: action.id || index,
|
|
185
|
-
onClick: (event, ...args) => onActionClick(action, args, event, index),
|
|
186
|
-
href: action.link || '',
|
|
187
|
-
intent: "action",
|
|
188
|
-
autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
|
|
189
|
-
id: `action-button-${action.id}`,
|
|
190
|
-
"aria-labelledby": `action-button-${action.id} profilecard-name-label`
|
|
191
|
-
}, action.label, isKudos && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
192
2
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}, fg('jfp_a11y_team_profile_card_actions_label') && {
|
|
205
|
-
fullName
|
|
206
|
-
})));
|
|
207
|
-
};
|
|
208
|
-
export const LoadingView = ({
|
|
209
|
-
fireAnalyticsWithDuration
|
|
210
|
-
}) => {
|
|
211
|
-
useEffect(() => {
|
|
212
|
-
fireAnalyticsWithDuration('ui.profilecard.rendered.spinner', duration => ({
|
|
213
|
-
firedAt: Math.round(getPageTime()),
|
|
214
|
-
duration,
|
|
215
|
-
...PACKAGE_META_DATA
|
|
216
|
-
}));
|
|
217
|
-
}, [fireAnalyticsWithDuration]);
|
|
218
|
-
return /*#__PURE__*/React.createElement(SpinnerContainer, {
|
|
219
|
-
testId: "profilecard-spinner-container"
|
|
220
|
-
}, /*#__PURE__*/React.createElement(Spinner, null));
|
|
221
|
-
};
|
|
222
|
-
export default ProfilecardInternal;
|
|
3
|
+
import { ProfilecardInternal } from './ProfilecardInternal';
|
|
4
|
+
export default ProfilecardInternal;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use `import { ProfilecardInternal } from '@atlaskit/profilecard/profilecard-internal'` instead.
|
|
8
|
+
*/
|
|
9
|
+
export { ProfilecardInternal } from './ProfilecardInternal';
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use `import { LoadingView } from '@atlaskit/profilecard/loading-view'` instead.
|
|
12
|
+
*/
|
|
13
|
+
export { LoadingView } from './LoadingView';
|
|
@@ -13,7 +13,7 @@ import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
|
13
13
|
import relativeDate from '../../internal/relative-date';
|
|
14
14
|
import messages from '../../messages';
|
|
15
15
|
import { AppTitleLabel, CustomLozengeContainer, DetailsGroup, DisabledInfo, JobTitleLabel, LozengeWrapper } from '../../styled/Card';
|
|
16
|
-
import { IconLabel } from '../Icon';
|
|
16
|
+
import { default as IconLabel } from '../Icon/IconLabel';
|
|
17
17
|
import ReportingLinesDetails from './ReportingLinesDetails';
|
|
18
18
|
const styles = {
|
|
19
19
|
detailedListWrapperNext: "_19pkxy5q _2hwxze3t _otyrze3t _18u0ze3t _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t",
|
|
@@ -5,7 +5,7 @@ import { GiveKudosLauncherLazy, KudosType } from '@atlaskit/give-kudos';
|
|
|
5
5
|
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics/use-analytics-events';
|
|
6
6
|
import filterActions from '../../internal/filterActions';
|
|
7
7
|
import { CardWrapper } from '../../styled/UserTrigger';
|
|
8
|
-
import { ErrorMessage } from '../Error';
|
|
8
|
+
import { default as ErrorMessage } from '../Error/ErrorMessage';
|
|
9
9
|
import ProfileCard from './ProfileCard';
|
|
10
10
|
import UserLoadingState from './UserLoadingState';
|
|
11
11
|
class ProfileCardResourced extends React.PureComponent {
|