@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,240 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
|
-
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; }
|
|
6
|
-
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; }
|
|
7
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
8
|
-
import { FormattedMessage, useIntl } from 'react-intl';
|
|
9
|
-
import Avatar from '@atlaskit/avatar/avatar';
|
|
10
|
-
import Button from '@atlaskit/button/default/button';
|
|
11
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
|
-
import Spinner from '@atlaskit/spinner/spinner';
|
|
13
|
-
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics/use-analytics-events';
|
|
14
|
-
import { TeamsLinkButton } from '@atlaskit/teams-app-internal-navigation/teams-link-button';
|
|
15
|
-
import messages from '../../messages';
|
|
16
|
-
import { ActionButtonGroup, ActionsFlexSpacer, AnimatedKudosButton, AnimationWrapper, CardContainer, CardContent, KudosBlobAnimation, ProfileImage } from '../../styled/Card';
|
|
17
|
-
import { CardWrapper, SpinnerContainer } from '../../styled/UserTrigger';
|
|
18
|
-
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
19
|
-
import { isBasicClick } from '../../util/click';
|
|
20
|
-
import { getPageTime } from '../../util/performance';
|
|
21
|
-
import { ErrorMessage } from '../Error';
|
|
22
|
-
import { ACTION_OVERFLOW_THRESHOLD, OverflowProfileCardButtons } from './OverflowProfileCardButtons';
|
|
23
|
-
import { ProfileCardDetails } from './ProfileCardDetails';
|
|
24
|
-
var GIVE_KUDOS_ACTION_ID = 'give-kudos';
|
|
25
|
-
var useKudos = function useKudos(cloudId, userId, teamCentralBaseUrl, openKudosDrawer) {
|
|
26
|
-
var kudosUrl = useMemo(function () {
|
|
27
|
-
var recipientId = userId ? "&recipientId=".concat(userId) : '';
|
|
28
|
-
var cloudIdParam = cloudId ? "&cloudId=".concat(cloudId) : '';
|
|
29
|
-
return "".concat(teamCentralBaseUrl || '', "/kudos/give?type=individual").concat(recipientId).concat(cloudIdParam);
|
|
30
|
-
}, [cloudId, teamCentralBaseUrl, userId]);
|
|
31
|
-
var kudosButtonCallback = useCallback(function () {
|
|
32
|
-
if (openKudosDrawer) {
|
|
33
|
-
openKudosDrawer();
|
|
34
|
-
} else {
|
|
35
|
-
window.open(kudosUrl);
|
|
36
|
-
}
|
|
37
|
-
}, [kudosUrl, openKudosDrawer]);
|
|
38
|
-
var kudosAction = useMemo(function () {
|
|
39
|
-
return {
|
|
40
|
-
label: /*#__PURE__*/React.createElement(FormattedMessage, messages.giveKudosButton),
|
|
41
|
-
id: GIVE_KUDOS_ACTION_ID,
|
|
42
|
-
callback: kudosButtonCallback,
|
|
43
|
-
link: kudosUrl
|
|
44
|
-
};
|
|
45
|
-
}, [kudosButtonCallback, kudosUrl]);
|
|
46
|
-
return {
|
|
47
|
-
kudosAction: kudosAction,
|
|
48
|
-
kudosButtonCallback: kudosButtonCallback,
|
|
49
|
-
kudosUrl: kudosUrl
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
var Wrapper = function Wrapper(props) {
|
|
53
|
-
return /*#__PURE__*/React.createElement(CardWrapper, {
|
|
54
|
-
testId: "profilecard",
|
|
55
|
-
role: "dialog",
|
|
56
|
-
labelledBy: props.labelledBy,
|
|
57
|
-
ariaLabel: props.ariaLabel
|
|
58
|
-
}, props.children);
|
|
59
|
-
};
|
|
60
|
-
export var ProfilecardInternal = function ProfilecardInternal(props) {
|
|
61
|
-
var _useState = useState(getPageTime()),
|
|
62
|
-
_useState2 = _slicedToArray(_useState, 1),
|
|
63
|
-
openTime = _useState2[0];
|
|
64
|
-
var intl = useIntl();
|
|
65
|
-
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
66
|
-
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
67
|
-
var fireAnalyticsWithDuration = useCallback(function (eventKey, generator) {
|
|
68
|
-
var duration = getPageTime() - openTime;
|
|
69
|
-
var attributes = generator(duration);
|
|
70
|
-
fireEvent(eventKey, attributes);
|
|
71
|
-
}, [openTime, fireEvent]);
|
|
72
|
-
var _useKudos = useKudos(props.cloudId, props.userId, props.teamCentralBaseUrl, props.openKudosDrawer),
|
|
73
|
-
kudosAction = _useKudos.kudosAction;
|
|
74
|
-
var _props$actions = props.actions,
|
|
75
|
-
actions = _props$actions === void 0 ? [] : _props$actions,
|
|
76
|
-
isCurrentUser = props.isCurrentUser,
|
|
77
|
-
isKudosEnabled = props.isKudosEnabled,
|
|
78
|
-
_props$status = props.status,
|
|
79
|
-
status = _props$status === void 0 ? 'active' : _props$status;
|
|
80
|
-
var realActions = useMemo(function () {
|
|
81
|
-
if (isCurrentUser || !isKudosEnabled || status !== 'active') {
|
|
82
|
-
return actions;
|
|
83
|
-
}
|
|
84
|
-
return actions.concat([kudosAction]);
|
|
85
|
-
}, [actions, isCurrentUser, isKudosEnabled, kudosAction, status]);
|
|
86
|
-
var isLoading = props.isLoading,
|
|
87
|
-
fullName = props.fullName,
|
|
88
|
-
hasError = props.hasError;
|
|
89
|
-
var canRender = !hasError && !isLoading && !!(fullName || status === 'closed');
|
|
90
|
-
useEffect(function () {
|
|
91
|
-
if (canRender) {
|
|
92
|
-
fireAnalyticsWithDuration('ui.profilecard.rendered.content', function (duration) {
|
|
93
|
-
return _objectSpread({
|
|
94
|
-
duration: duration,
|
|
95
|
-
numActions: realActions.length,
|
|
96
|
-
firedAt: Math.round(getPageTime())
|
|
97
|
-
}, PACKAGE_META_DATA);
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}, [canRender, fireAnalyticsWithDuration, realActions]);
|
|
101
|
-
if (hasError) {
|
|
102
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
103
|
-
ariaLabel: intl.formatMessage(messages.errorDialogLabel)
|
|
104
|
-
}, /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
105
|
-
reload: props.clientFetchProfile,
|
|
106
|
-
errorType: props.errorType || null,
|
|
107
|
-
fireAnalytics: fireEvent
|
|
108
|
-
}));
|
|
109
|
-
}
|
|
110
|
-
if (isLoading) {
|
|
111
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
112
|
-
ariaLabel: intl.formatMessage(messages.loadingDialogLabel)
|
|
113
|
-
}, /*#__PURE__*/React.createElement(LoadingView, {
|
|
114
|
-
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
115
|
-
}));
|
|
116
|
-
}
|
|
117
|
-
if (!canRender) {
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
var isDisabledUser = status === 'inactive' || status === 'closed';
|
|
121
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
122
|
-
labelledBy: "profilecard-name-label"
|
|
123
|
-
}, /*#__PURE__*/React.createElement(CardContainer, {
|
|
124
|
-
isDisabledUser: isDisabledUser,
|
|
125
|
-
withoutElevation: props.withoutElevation
|
|
126
|
-
}, /*#__PURE__*/React.createElement(ProfileImage, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
127
|
-
size: "xlarge",
|
|
128
|
-
src: status !== 'closed' ? props.avatarUrl : undefined,
|
|
129
|
-
borderColor: "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)"
|
|
130
|
-
})), /*#__PURE__*/React.createElement(CardContent, null, /*#__PURE__*/React.createElement(ProfileCardDetails, _extends({}, props, {
|
|
131
|
-
status: status,
|
|
132
|
-
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
133
|
-
})), 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') && {
|
|
134
|
-
fullName: fullName
|
|
135
|
-
}, {
|
|
136
|
-
fullName: fullName,
|
|
137
|
-
actions: realActions,
|
|
138
|
-
fireAnalyticsWithDuration: fireAnalyticsWithDuration,
|
|
139
|
-
isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard,
|
|
140
|
-
isRenderedInPortal: props.isRenderedInPortal
|
|
141
|
-
}))))));
|
|
142
|
-
};
|
|
143
|
-
var Actions = function Actions(_ref) {
|
|
144
|
-
var actions = _ref.actions,
|
|
145
|
-
fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration,
|
|
146
|
-
isTriggeredUsingKeyboard = _ref.isTriggeredUsingKeyboard,
|
|
147
|
-
isRenderedInPortal = _ref.isRenderedInPortal,
|
|
148
|
-
fullName = _ref.fullName;
|
|
149
|
-
var onActionClick = useCallback(function (action, args, event, index) {
|
|
150
|
-
fireAnalyticsWithDuration('ui.profilecard.clicked.action', function (duration) {
|
|
151
|
-
return _objectSpread({
|
|
152
|
-
method: 'click',
|
|
153
|
-
firedAt: Math.round(getPageTime()),
|
|
154
|
-
duration: duration,
|
|
155
|
-
hasHref: !!action.link,
|
|
156
|
-
hasOnClick: !!action.callback,
|
|
157
|
-
index: index,
|
|
158
|
-
actionId: action.id || 'no-id-specified'
|
|
159
|
-
}, PACKAGE_META_DATA);
|
|
160
|
-
});
|
|
161
|
-
if (action.callback && isBasicClick(event)) {
|
|
162
|
-
event.preventDefault();
|
|
163
|
-
action.callback.apply(action, [event].concat(_toConsumableArray(args)));
|
|
164
|
-
}
|
|
165
|
-
}, [fireAnalyticsWithDuration]);
|
|
166
|
-
if (!actions || actions.length === 0) {
|
|
167
|
-
return null;
|
|
168
|
-
}
|
|
169
|
-
var regularActions = actions.slice(0, ACTION_OVERFLOW_THRESHOLD);
|
|
170
|
-
var overflowActions = actions.length > ACTION_OVERFLOW_THRESHOLD ? actions.slice(ACTION_OVERFLOW_THRESHOLD) : undefined;
|
|
171
|
-
return /*#__PURE__*/React.createElement(ActionButtonGroup, {
|
|
172
|
-
testId: "profilecard-actions"
|
|
173
|
-
}, regularActions.map(function (action, index) {
|
|
174
|
-
var isKudos = action.id === GIVE_KUDOS_ACTION_ID;
|
|
175
|
-
if (isKudos && fg('fix_give_kudos_btn_incorrect_role')) {
|
|
176
|
-
var kudosButton = /*#__PURE__*/React.createElement(Button, {
|
|
177
|
-
appearance: "default",
|
|
178
|
-
key: action.id || index,
|
|
179
|
-
onClick: function onClick(event) {
|
|
180
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
181
|
-
args[_key - 1] = arguments[_key];
|
|
182
|
-
}
|
|
183
|
-
return onActionClick(action, args, event, index);
|
|
184
|
-
},
|
|
185
|
-
autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
|
|
186
|
-
id: "action-button-".concat(action.id),
|
|
187
|
-
"aria-labelledby": "action-button-".concat(action.id, " profilecard-name-label")
|
|
188
|
-
}, action.label, /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
|
|
189
|
-
return /*#__PURE__*/React.createElement(AnimatedKudosButton, {
|
|
190
|
-
key: "profile-card-action-kudos_".concat(action.id || index)
|
|
191
|
-
}, kudosButton);
|
|
192
|
-
}
|
|
193
|
-
var button = /*#__PURE__*/React.createElement(TeamsLinkButton, {
|
|
194
|
-
appearance: "default",
|
|
195
|
-
key: action.id || index,
|
|
196
|
-
onClick: function onClick(event) {
|
|
197
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
198
|
-
args[_key2 - 1] = arguments[_key2];
|
|
199
|
-
}
|
|
200
|
-
return onActionClick(action, args, event, index);
|
|
201
|
-
},
|
|
202
|
-
href: action.link || '',
|
|
203
|
-
intent: "action",
|
|
204
|
-
autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
|
|
205
|
-
id: "action-button-".concat(action.id),
|
|
206
|
-
"aria-labelledby": "action-button-".concat(action.id, " profilecard-name-label")
|
|
207
|
-
}, 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. */
|
|
208
2
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
return onActionClick(action, args, event, index + ACTION_OVERFLOW_THRESHOLD);
|
|
221
|
-
}
|
|
222
|
-
}, fg('jfp_a11y_team_profile_card_actions_label') && {
|
|
223
|
-
fullName: fullName
|
|
224
|
-
})));
|
|
225
|
-
};
|
|
226
|
-
export var LoadingView = function LoadingView(_ref2) {
|
|
227
|
-
var fireAnalyticsWithDuration = _ref2.fireAnalyticsWithDuration;
|
|
228
|
-
useEffect(function () {
|
|
229
|
-
fireAnalyticsWithDuration('ui.profilecard.rendered.spinner', function (duration) {
|
|
230
|
-
return _objectSpread({
|
|
231
|
-
firedAt: Math.round(getPageTime()),
|
|
232
|
-
duration: duration
|
|
233
|
-
}, PACKAGE_META_DATA);
|
|
234
|
-
});
|
|
235
|
-
}, [fireAnalyticsWithDuration]);
|
|
236
|
-
return /*#__PURE__*/React.createElement(SpinnerContainer, {
|
|
237
|
-
testId: "profilecard-spinner-container"
|
|
238
|
-
}, /*#__PURE__*/React.createElement(Spinner, null));
|
|
239
|
-
};
|
|
240
|
-
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';
|
|
@@ -15,7 +15,7 @@ import Tooltip from '@atlaskit/tooltip/Tooltip';
|
|
|
15
15
|
import relativeDate from '../../internal/relative-date';
|
|
16
16
|
import messages from '../../messages';
|
|
17
17
|
import { AppTitleLabel, CustomLozengeContainer, DetailsGroup, DisabledInfo, JobTitleLabel, LozengeWrapper } from '../../styled/Card';
|
|
18
|
-
import { IconLabel } from '../Icon';
|
|
18
|
+
import { default as IconLabel } from '../Icon/IconLabel';
|
|
19
19
|
import ReportingLinesDetails from './ReportingLinesDetails';
|
|
20
20
|
var styles = {
|
|
21
21
|
detailedListWrapperNext: "_19pkxy5q _2hwxze3t _otyrze3t _18u0ze3t _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t",
|
|
@@ -15,7 +15,7 @@ import { GiveKudosLauncherLazy, KudosType } from '@atlaskit/give-kudos';
|
|
|
15
15
|
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics/use-analytics-events';
|
|
16
16
|
import filterActions from '../../internal/filterActions';
|
|
17
17
|
import { CardWrapper } from '../../styled/UserTrigger';
|
|
18
|
-
import { ErrorMessage } from '../Error';
|
|
18
|
+
import { default as ErrorMessage } from '../Error/ErrorMessage';
|
|
19
19
|
import ProfileCard from './ProfileCard';
|
|
20
20
|
import UserLoadingState from './UserLoadingState';
|
|
21
21
|
var ProfileCardResourced = /*#__PURE__*/function (_React$PureComponent) {
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
8
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
9
|
+
import Avatar from '@atlaskit/avatar/avatar';
|
|
10
|
+
import Button from '@atlaskit/button/default/button';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
12
|
+
import { useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics/use-analytics-events';
|
|
13
|
+
import { TeamsLinkButton } from '@atlaskit/teams-app-internal-navigation/teams-link-button';
|
|
14
|
+
import messages from '../../messages';
|
|
15
|
+
import { ActionButtonGroup, ActionsFlexSpacer, AnimatedKudosButton, AnimationWrapper, CardContainer, CardContent, KudosBlobAnimation, ProfileImage } from '../../styled/Card';
|
|
16
|
+
import { CardWrapper } from '../../styled/UserTrigger';
|
|
17
|
+
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
18
|
+
import { isBasicClick } from '../../util/click';
|
|
19
|
+
import { getPageTime } from '../../util/performance';
|
|
20
|
+
import { default as ErrorMessage } from '../Error/ErrorMessage';
|
|
21
|
+
import { LoadingView } from './LoadingView';
|
|
22
|
+
import { ACTION_OVERFLOW_THRESHOLD, OverflowProfileCardButtons } from './OverflowProfileCardButtons';
|
|
23
|
+
import { ProfileCardDetails } from './ProfileCardDetails';
|
|
24
|
+
var GIVE_KUDOS_ACTION_ID = 'give-kudos';
|
|
25
|
+
var useKudos = function useKudos(cloudId, userId, teamCentralBaseUrl, openKudosDrawer) {
|
|
26
|
+
var kudosUrl = useMemo(function () {
|
|
27
|
+
var recipientId = userId ? "&recipientId=".concat(userId) : '';
|
|
28
|
+
var cloudIdParam = cloudId ? "&cloudId=".concat(cloudId) : '';
|
|
29
|
+
return "".concat(teamCentralBaseUrl || '', "/kudos/give?type=individual").concat(recipientId).concat(cloudIdParam);
|
|
30
|
+
}, [cloudId, teamCentralBaseUrl, userId]);
|
|
31
|
+
var kudosButtonCallback = useCallback(function () {
|
|
32
|
+
if (openKudosDrawer) {
|
|
33
|
+
openKudosDrawer();
|
|
34
|
+
} else {
|
|
35
|
+
window.open(kudosUrl);
|
|
36
|
+
}
|
|
37
|
+
}, [kudosUrl, openKudosDrawer]);
|
|
38
|
+
var kudosAction = useMemo(function () {
|
|
39
|
+
return {
|
|
40
|
+
label: /*#__PURE__*/React.createElement(FormattedMessage, messages.giveKudosButton),
|
|
41
|
+
id: GIVE_KUDOS_ACTION_ID,
|
|
42
|
+
callback: kudosButtonCallback,
|
|
43
|
+
link: kudosUrl
|
|
44
|
+
};
|
|
45
|
+
}, [kudosButtonCallback, kudosUrl]);
|
|
46
|
+
return {
|
|
47
|
+
kudosAction: kudosAction,
|
|
48
|
+
kudosButtonCallback: kudosButtonCallback,
|
|
49
|
+
kudosUrl: kudosUrl
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
var Wrapper = function Wrapper(props) {
|
|
53
|
+
return /*#__PURE__*/React.createElement(CardWrapper, {
|
|
54
|
+
testId: "profilecard",
|
|
55
|
+
role: "dialog",
|
|
56
|
+
labelledBy: props.labelledBy,
|
|
57
|
+
ariaLabel: props.ariaLabel
|
|
58
|
+
}, props.children);
|
|
59
|
+
};
|
|
60
|
+
var Actions = function Actions(_ref) {
|
|
61
|
+
var actions = _ref.actions,
|
|
62
|
+
fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration,
|
|
63
|
+
isTriggeredUsingKeyboard = _ref.isTriggeredUsingKeyboard,
|
|
64
|
+
isRenderedInPortal = _ref.isRenderedInPortal,
|
|
65
|
+
fullName = _ref.fullName;
|
|
66
|
+
var onActionClick = useCallback(function (action, args, event, index) {
|
|
67
|
+
fireAnalyticsWithDuration('ui.profilecard.clicked.action', function (duration) {
|
|
68
|
+
return _objectSpread({
|
|
69
|
+
method: 'click',
|
|
70
|
+
firedAt: Math.round(getPageTime()),
|
|
71
|
+
duration: duration,
|
|
72
|
+
hasHref: !!action.link,
|
|
73
|
+
hasOnClick: !!action.callback,
|
|
74
|
+
index: index,
|
|
75
|
+
actionId: action.id || 'no-id-specified'
|
|
76
|
+
}, PACKAGE_META_DATA);
|
|
77
|
+
});
|
|
78
|
+
if (action.callback && isBasicClick(event)) {
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
action.callback.apply(action, [event].concat(_toConsumableArray(args)));
|
|
81
|
+
}
|
|
82
|
+
}, [fireAnalyticsWithDuration]);
|
|
83
|
+
if (!actions || actions.length === 0) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
var regularActions = actions.slice(0, ACTION_OVERFLOW_THRESHOLD);
|
|
87
|
+
var overflowActions = actions.length > ACTION_OVERFLOW_THRESHOLD ? actions.slice(ACTION_OVERFLOW_THRESHOLD) : undefined;
|
|
88
|
+
return /*#__PURE__*/React.createElement(ActionButtonGroup, {
|
|
89
|
+
testId: "profilecard-actions"
|
|
90
|
+
}, regularActions.map(function (action, index) {
|
|
91
|
+
var isKudos = action.id === GIVE_KUDOS_ACTION_ID;
|
|
92
|
+
if (isKudos && fg('fix_give_kudos_btn_incorrect_role')) {
|
|
93
|
+
var kudosButton = /*#__PURE__*/React.createElement(Button, {
|
|
94
|
+
appearance: "default",
|
|
95
|
+
key: action.id || index,
|
|
96
|
+
onClick: function onClick(event) {
|
|
97
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
98
|
+
args[_key - 1] = arguments[_key];
|
|
99
|
+
}
|
|
100
|
+
return onActionClick(action, args, event, index);
|
|
101
|
+
},
|
|
102
|
+
autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
|
|
103
|
+
id: "action-button-".concat(action.id),
|
|
104
|
+
"aria-labelledby": "action-button-".concat(action.id, " profilecard-name-label")
|
|
105
|
+
}, action.label, /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
|
|
106
|
+
return /*#__PURE__*/React.createElement(AnimatedKudosButton, {
|
|
107
|
+
key: "profile-card-action-kudos_".concat(action.id || index)
|
|
108
|
+
}, kudosButton);
|
|
109
|
+
}
|
|
110
|
+
var button = /*#__PURE__*/React.createElement(TeamsLinkButton, {
|
|
111
|
+
appearance: "default",
|
|
112
|
+
key: action.id || index,
|
|
113
|
+
onClick: function onClick(event) {
|
|
114
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
115
|
+
args[_key2 - 1] = arguments[_key2];
|
|
116
|
+
}
|
|
117
|
+
return onActionClick(action, args, event, index);
|
|
118
|
+
},
|
|
119
|
+
href: action.link || '',
|
|
120
|
+
intent: "action",
|
|
121
|
+
autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
|
|
122
|
+
id: "action-button-".concat(action.id),
|
|
123
|
+
"aria-labelledby": "action-button-".concat(action.id, " profilecard-name-label")
|
|
124
|
+
}, action.label, isKudos && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
|
|
125
|
+
|
|
126
|
+
// TODO: Remove this once fix_give_kudos_btn_incorrect_role is fully rolled out
|
|
127
|
+
if (isKudos) {
|
|
128
|
+
return /*#__PURE__*/React.createElement(AnimatedKudosButton, {
|
|
129
|
+
key: "profile-card-action-kudos_".concat(action.id || index)
|
|
130
|
+
}, button);
|
|
131
|
+
}
|
|
132
|
+
return button;
|
|
133
|
+
}), overflowActions && /*#__PURE__*/React.createElement(OverflowProfileCardButtons, _extends({
|
|
134
|
+
actions: overflowActions,
|
|
135
|
+
fireAnalyticsWithDuration: fireAnalyticsWithDuration,
|
|
136
|
+
onItemClick: function onItemClick(action, args, event, index) {
|
|
137
|
+
return onActionClick(action, args, event, index + ACTION_OVERFLOW_THRESHOLD);
|
|
138
|
+
}
|
|
139
|
+
}, fg('jfp_a11y_team_profile_card_actions_label') && {
|
|
140
|
+
fullName: fullName
|
|
141
|
+
})));
|
|
142
|
+
};
|
|
143
|
+
export var ProfilecardInternal = function ProfilecardInternal(props) {
|
|
144
|
+
var _useState = useState(getPageTime()),
|
|
145
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
146
|
+
openTime = _useState2[0];
|
|
147
|
+
var intl = useIntl();
|
|
148
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
149
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
150
|
+
var fireAnalyticsWithDuration = useCallback(function (eventKey, generator) {
|
|
151
|
+
var duration = getPageTime() - openTime;
|
|
152
|
+
var attributes = generator(duration);
|
|
153
|
+
fireEvent(eventKey, attributes);
|
|
154
|
+
}, [openTime, fireEvent]);
|
|
155
|
+
var _useKudos = useKudos(props.cloudId, props.userId, props.teamCentralBaseUrl, props.openKudosDrawer),
|
|
156
|
+
kudosAction = _useKudos.kudosAction;
|
|
157
|
+
var _props$actions = props.actions,
|
|
158
|
+
actions = _props$actions === void 0 ? [] : _props$actions,
|
|
159
|
+
isCurrentUser = props.isCurrentUser,
|
|
160
|
+
isKudosEnabled = props.isKudosEnabled,
|
|
161
|
+
_props$status = props.status,
|
|
162
|
+
status = _props$status === void 0 ? 'active' : _props$status;
|
|
163
|
+
var realActions = useMemo(function () {
|
|
164
|
+
if (isCurrentUser || !isKudosEnabled || status !== 'active') {
|
|
165
|
+
return actions;
|
|
166
|
+
}
|
|
167
|
+
return actions.concat([kudosAction]);
|
|
168
|
+
}, [actions, isCurrentUser, isKudosEnabled, kudosAction, status]);
|
|
169
|
+
var isLoading = props.isLoading,
|
|
170
|
+
fullName = props.fullName,
|
|
171
|
+
hasError = props.hasError;
|
|
172
|
+
var canRender = !hasError && !isLoading && !!(fullName || status === 'closed');
|
|
173
|
+
useEffect(function () {
|
|
174
|
+
if (canRender) {
|
|
175
|
+
fireAnalyticsWithDuration('ui.profilecard.rendered.content', function (duration) {
|
|
176
|
+
return _objectSpread({
|
|
177
|
+
duration: duration,
|
|
178
|
+
numActions: realActions.length,
|
|
179
|
+
firedAt: Math.round(getPageTime())
|
|
180
|
+
}, PACKAGE_META_DATA);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}, [canRender, fireAnalyticsWithDuration, realActions]);
|
|
184
|
+
if (hasError) {
|
|
185
|
+
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
186
|
+
ariaLabel: intl.formatMessage(messages.errorDialogLabel)
|
|
187
|
+
}, /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
188
|
+
reload: props.clientFetchProfile,
|
|
189
|
+
errorType: props.errorType || null,
|
|
190
|
+
fireAnalytics: fireEvent
|
|
191
|
+
}));
|
|
192
|
+
}
|
|
193
|
+
if (isLoading) {
|
|
194
|
+
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
195
|
+
ariaLabel: intl.formatMessage(messages.loadingDialogLabel)
|
|
196
|
+
}, /*#__PURE__*/React.createElement(LoadingView, {
|
|
197
|
+
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
if (!canRender) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
var isDisabledUser = status === 'inactive' || status === 'closed';
|
|
204
|
+
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
205
|
+
labelledBy: "profilecard-name-label"
|
|
206
|
+
}, /*#__PURE__*/React.createElement(CardContainer, {
|
|
207
|
+
isDisabledUser: isDisabledUser,
|
|
208
|
+
withoutElevation: props.withoutElevation
|
|
209
|
+
}, /*#__PURE__*/React.createElement(ProfileImage, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
210
|
+
size: "xlarge",
|
|
211
|
+
src: status !== 'closed' ? props.avatarUrl : undefined,
|
|
212
|
+
borderColor: "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)"
|
|
213
|
+
})), /*#__PURE__*/React.createElement(CardContent, null, /*#__PURE__*/React.createElement(ProfileCardDetails, _extends({}, props, {
|
|
214
|
+
status: status,
|
|
215
|
+
fireAnalyticsWithDuration: fireAnalyticsWithDuration
|
|
216
|
+
})), 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') && {
|
|
217
|
+
fullName: fullName
|
|
218
|
+
}, {
|
|
219
|
+
fullName: fullName,
|
|
220
|
+
actions: realActions,
|
|
221
|
+
fireAnalyticsWithDuration: fireAnalyticsWithDuration,
|
|
222
|
+
isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard,
|
|
223
|
+
isRenderedInPortal: props.isRenderedInPortal
|
|
224
|
+
}))))));
|
|
225
|
+
};
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `import { DELAY_MS_HIDE, DELAY_MS_SHOW } from '@atlaskit/profilecard/config'` instead.
|
|
4
|
+
*/
|
|
1
5
|
export { DELAY_MS_HIDE, DELAY_MS_SHOW } from '../../util/config';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use `import { ProfileCardLazy } from '@atlaskit/profilecard/lazy-profile-card'` instead.
|
|
9
|
+
*/
|
|
2
10
|
export { ProfileCardLazy } from './lazyProfileCard';
|
|
3
11
|
import ProfileCardTrigger from './ProfileCardTrigger';
|
|
4
12
|
export default ProfileCardTrigger;
|
|
@@ -4,7 +4,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import React, { useEffect } from 'react';
|
|
5
5
|
import AkSpinner from '@atlaskit/spinner/spinner';
|
|
6
6
|
import { SpinnerContainer } from '../../styled/UserTrigger';
|
|
7
|
-
import {
|
|
7
|
+
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
8
|
+
import { getActionSubject } from '../../util/getActionSubject';
|
|
8
9
|
import { getPageTime } from '../../util/performance';
|
|
9
10
|
export var LoadingState = function LoadingState(_ref) {
|
|
10
11
|
var fireAnalytics = _ref.fireAnalytics,
|
|
@@ -11,7 +11,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
12
12
|
import { Popup } from '@atlaskit/popup/popup';
|
|
13
13
|
import { layers } from '@atlaskit/theme/constants';
|
|
14
|
-
import {
|
|
14
|
+
import { PACKAGE_META_DATA } from '../../util/analytics';
|
|
15
|
+
import { getActionSubject } from '../../util/getActionSubject';
|
|
15
16
|
import { getPageTime } from '../../util/performance';
|
|
16
17
|
import { useProfileInfo } from '../../util/useProfileInfo';
|
|
17
18
|
import { LoadingState } from './LoadingState';
|
|
@@ -162,4 +162,11 @@ export var TeamProfileCard = function TeamProfileCard(_ref) {
|
|
|
162
162
|
isDisplayedOnProfileCard: true,
|
|
163
163
|
maxNumberOfContainersToShow: loading ? 0 : 9
|
|
164
164
|
})))));
|
|
165
|
-
};
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// Public API aliases preserved from an eliminated entry-point (volt-migrate-package).
|
|
168
|
+
/**
|
|
169
|
+
* @deprecated Use the `TeamProfileCard` export from
|
|
170
|
+
* `@atlaskit/profilecard/team-profile-card/main` instead.
|
|
171
|
+
*/
|
|
172
|
+
export { TeamProfileCard as TeamProfileCardWithContainer };
|
|
@@ -6,7 +6,7 @@ import React, { Suspense, useCallback, useState } from 'react';
|
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
7
|
import { GiveKudosLauncherLazy, KudosType } from '@atlaskit/give-kudos';
|
|
8
8
|
import ButtonItem from '@atlaskit/menu/button-item';
|
|
9
|
-
import { extractIdFromAri } from '../../../client/
|
|
9
|
+
import { extractIdFromAri } from '../../../client/extractIdFromAri';
|
|
10
10
|
import { messages } from './messages';
|
|
11
11
|
import { MoreActions } from './more-actions';
|
|
12
12
|
var GIVE_KUDOS_ACTION_ID = 'give-kudos';
|