Share Externally: Texts modification (#89640)

This commit is contained in:
Juan Cabanas 2024-06-25 17:52:41 -03:00 committed by GitHub
parent 2fb7b18ead
commit 0d276fe7b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 39 additions and 49 deletions

View File

@ -127,7 +127,7 @@ func TestAPIViewPublicDashboard(t *testing.T) {
var errResp errutil.PublicError
err := json.Unmarshal(response.Body.Bytes(), &errResp)
require.NoError(t, err)
assert.Equal(t, "Public dashboard not found", errResp.Message)
assert.Equal(t, "Dashboard not found", errResp.Message)
assert.Equal(t, "publicdashboards.notFound", errResp.MessageID)
}
})

View File

@ -5,24 +5,24 @@ import "github.com/grafana/grafana/pkg/apimachinery/errutil"
var (
ErrInternalServerError = errutil.Internal("publicdashboards.internalServerError", errutil.WithPublicMessage("Internal server error"))
ErrPublicDashboardNotFound = errutil.NotFound("publicdashboards.notFound", errutil.WithPublicMessage("Public dashboard not found"))
ErrPublicDashboardNotFound = errutil.NotFound("publicdashboards.notFound", errutil.WithPublicMessage("Dashboard not found"))
ErrDashboardNotFound = errutil.NotFound("publicdashboards.dashboardNotFound", errutil.WithPublicMessage("Dashboard not found"))
ErrPanelNotFound = errutil.NotFound("publicdashboards.panelNotFound", errutil.WithPublicMessage("Public dashboard panel not found"))
ErrPanelNotFound = errutil.NotFound("publicdashboards.panelNotFound", errutil.WithPublicMessage("Dashboard panel not found"))
ErrBadRequest = errutil.BadRequest("publicdashboards.badRequest")
ErrPanelQueriesNotFound = errutil.BadRequest("publicdashboards.panelQueriesNotFound", errutil.WithPublicMessage("Failed to extract queries from panel"))
ErrInvalidAccessToken = errutil.BadRequest("publicdashboards.invalidAccessToken", errutil.WithPublicMessage("Invalid access token"))
ErrInvalidPanelId = errutil.BadRequest("publicdashboards.invalidPanelId", errutil.WithPublicMessage("Invalid panel id"))
ErrInvalidUid = errutil.BadRequest("publicdashboards.invalidUid", errutil.WithPublicMessage("Invalid Uid"))
ErrPublicDashboardIdentifierNotSet = errutil.BadRequest("publicdashboards.identifierNotSet", errutil.WithPublicMessage("No Uid for public dashboard specified"))
ErrPublicDashboardHasTemplateVariables = errutil.BadRequest("publicdashboards.hasTemplateVariables", errutil.WithPublicMessage("Public dashboard has template variables"))
ErrPublicDashboardIdentifierNotSet = errutil.BadRequest("publicdashboards.identifierNotSet", errutil.WithPublicMessage("No Uid for dashboard specified"))
ErrPublicDashboardHasTemplateVariables = errutil.BadRequest("publicdashboards.hasTemplateVariables", errutil.WithPublicMessage("Dashboard has template variables"))
ErrInvalidInterval = errutil.BadRequest("publicdashboards.invalidInterval", errutil.WithPublicMessage("intervalMS should be greater than 0"))
ErrInvalidMaxDataPoints = errutil.BadRequest("publicdashboards.maxDataPoints", errutil.WithPublicMessage("maxDataPoints should be greater than 0"))
ErrInvalidTimeRange = errutil.BadRequest("publicdashboards.invalidTimeRange", errutil.WithPublicMessage("Invalid time range"))
ErrInvalidShareType = errutil.BadRequest("publicdashboards.invalidShareType", errutil.WithPublicMessage("Invalid share type"))
ErrDashboardIsPublic = errutil.BadRequest("publicdashboards.dashboardIsPublic", errutil.WithPublicMessage("Dashboard is already public"))
ErrPublicDashboardUidExists = errutil.BadRequest("publicdashboards.uidExists", errutil.WithPublicMessage("Public Dashboard Uid already exists"))
ErrPublicDashboardAccessTokenExists = errutil.BadRequest("publicdashboards.accessTokenExists", errutil.WithPublicMessage("Public Dashboard Access Token already exists"))
ErrPublicDashboardUidExists = errutil.BadRequest("publicdashboards.uidExists", errutil.WithPublicMessage("Dashboard Uid already exists"))
ErrPublicDashboardAccessTokenExists = errutil.BadRequest("publicdashboards.accessTokenExists", errutil.WithPublicMessage("Dashboard Access Token already exists"))
ErrPublicDashboardNotEnabled = errutil.Forbidden("publicdashboards.notEnabled", errutil.WithPublicMessage("Public dashboard paused"))
ErrPublicDashboardNotEnabled = errutil.Forbidden("publicdashboards.notEnabled", errutil.WithPublicMessage("Dashboard paused"))
)

View File

@ -75,10 +75,7 @@ export const ConfigEmailSharing = () => {
>
<Stack direction="row">
<Input
placeholder={t(
'public-dashboard.email-sharing.recipient-email-placeholder',
'Type in the recipient email address and press Enter'
)}
placeholder={t('public-dashboard.email-sharing.recipient-email-placeholder', 'Email')}
autoCapitalize="none"
loading={isAddEmailLoading}
{...register('email', {

View File

@ -38,7 +38,7 @@ export const getAnyOneWithTheLinkShareOption = () => {
label: t('public-dashboard.share-externally.public-share-type-option-label', 'Anyone with the link'),
description: t(
'public-dashboard.share-externally.public-share-type-option-description',
'Anyone with the link can access'
'Anyone with the link can access dashboard'
),
value: PublicDashboardShareType.PUBLIC,
icon: 'globe',
@ -49,7 +49,7 @@ const getOnlySpecificPeopleShareOption = () => ({
label: t('public-dashboard.share-externally.email-share-type-option-label', 'Only specific people'),
description: t(
'public-dashboard.share-externally.email-share-type-option-description',
'Only people with access can open with the link'
'Only people with the link can access dashboard'
),
value: PublicDashboardShareType.EMAIL,
icon: 'users-alt',

View File

@ -69,29 +69,24 @@ export default function ShareTypeSelect({
</Label>
{isLoading && <Spinner />}
</Stack>
<Stack direction="row" gap={1} alignItems="center">
{isEmailSharingEnabled() ? (
<Select
data-testid={selectors.shareTypeSelect}
options={options}
value={value}
disabled={!hasWritePermissions}
onChange={(v) => {
setShareType(v);
onUpdateShareType(v.value!);
}}
className={styles.select}
/>
) : (
<>
{toIconName(anyOneWithTheLinkOpt.icon) && <Icon name={toIconName(anyOneWithTheLinkOpt.icon)!} />}
<Text>{anyOneWithTheLinkOpt.label}</Text>
</>
)}
<Text element="p" variant="bodySmall" color="disabled">
<Trans i18nKey="public-dashboard.share-configuration.access-label">can access</Trans>
</Text>
</Stack>
{isEmailSharingEnabled() ? (
<Select
data-testid={selectors.shareTypeSelect}
options={options}
value={value}
disabled={!hasWritePermissions}
onChange={(v) => {
setShareType(v);
onUpdateShareType(v.value!);
}}
className={styles.select}
/>
) : (
<>
{toIconName(anyOneWithTheLinkOpt.icon) && <Icon name={toIconName(anyOneWithTheLinkOpt.icon)!} />}
<Text>{anyOneWithTheLinkOpt.label}</Text>
</>
)}
</div>
);
}

View File

@ -8,8 +8,8 @@ export function EmailSharingPricingAlert() {
<Alert title="" severity="info" bottomSpacing={0}>
<Stack justifyContent="space-between" gap={2} alignItems="center">
<Trans i18nKey="public-dashboard.email-sharing.alert-text">
Effective immediately, sharing public dashboards by email incurs a cost per active user. Going forward, youll
be prompted for payment whenever you add new users to your dashboard.
Sharing dashboards by email is billed per user for the duration of the 30-day token, regardless of how many
dashboards are shared. Billing stops after 30 days unless you renew the token.
</Trans>
<Button variant="secondary" onClick={() => window.open(EMAIL_SHARING_URL, '_blank')} type="button">
<Trans i18nKey="public-dashboard.email-sharing.learn-more-button">Learn more</Trans>

View File

@ -1443,7 +1443,7 @@
},
"email-sharing": {
"accept-button": "Accept",
"alert-text": "Effective immediately, sharing public dashboards by email incurs a cost per active user. Going forward, youll be prompted for payment whenever you add new users to your dashboard.",
"alert-text": "Sharing dashboards by email is billed per user for the duration of the 30-day token, regardless of how many dashboards are shared. Billing stops after 30 days unless you renew the token.",
"bill-ack": "I understand that adding users requires payment.*",
"cancel-button": "Cancel",
"input-invalid-email-text": "Invalid email",
@ -1452,7 +1452,7 @@
"invite-field-desc": "Invite people by email",
"invite-field-label": "Invite",
"learn-more-button": "Learn more",
"recipient-email-placeholder": "Type in the recipient email address and press Enter",
"recipient-email-placeholder": "Email",
"recipient-invalid-email-text": "Invalid email",
"recipient-invitation-button": "Invite",
"recipient-invitation-description": "Invite someone by email",
@ -1512,16 +1512,15 @@
"success-delete-old": "Public dashboard deleted!"
},
"share-configuration": {
"access-label": "can access",
"share-type-label": "Link access"
},
"share-externally": {
"copy-link-button": "Copy external link",
"email-share-type-option-description": "Only people with access can open with the link",
"email-share-type-option-description": "Only people with the link can access dashboard",
"email-share-type-option-label": "Only specific people",
"pause-access-button": "Pause access",
"pause-access-tooltip": "Pausing will temporarily disable access to this dashboard for all users",
"public-share-type-option-description": "Anyone with the link can access",
"public-share-type-option-description": "Anyone with the link can access dashboard",
"public-share-type-option-label": "Anyone with the link",
"resume-access-button": "Resume access",
"revoke-access-button": "Revoke access",

View File

@ -1443,7 +1443,7 @@
},
"email-sharing": {
"accept-button": "Åččępŧ",
"alert-text": "Ēƒƒęčŧįvę įmmęđįäŧęľy, şĥäřįʼnģ pūþľįč đäşĥþőäřđş þy ęmäįľ įʼnčūřş ä čőşŧ pęř äčŧįvę ūşęř. Ğőįʼnģ ƒőřŵäřđ, yőūľľ þę přőmpŧęđ ƒőř päymęʼnŧ ŵĥęʼnęvęř yőū äđđ ʼnęŵ ūşęřş ŧő yőūř đäşĥþőäřđ.",
"alert-text": "Ŝĥäřįʼnģ đäşĥþőäřđş þy ęmäįľ įş þįľľęđ pęř ūşęř ƒőř ŧĥę đūřäŧįőʼn őƒ ŧĥę 30-đäy ŧőĸęʼn, řęģäřđľęşş őƒ ĥőŵ mäʼny đäşĥþőäřđş äřę şĥäřęđ. ßįľľįʼnģ şŧőpş äƒŧęř 30 đäyş ūʼnľęşş yőū řęʼnęŵ ŧĥę ŧőĸęʼn.",
"bill-ack": "Ĩ ūʼnđęřşŧäʼnđ ŧĥäŧ äđđįʼnģ ūşęřş řęqūįřęş päymęʼnŧ.*",
"cancel-button": "Cäʼnčęľ",
"input-invalid-email-text": "Ĩʼnväľįđ ęmäįľ",
@ -1452,7 +1452,7 @@
"invite-field-desc": "Ĩʼnvįŧę pęőpľę þy ęmäįľ",
"invite-field-label": "Ĩʼnvįŧę",
"learn-more-button": "Ŀęäřʼn mőřę",
"recipient-email-placeholder": "Ŧypę įʼn ŧĥę řęčįpįęʼnŧ ęmäįľ äđđřęşş äʼnđ přęşş Ēʼnŧęř",
"recipient-email-placeholder": "Ēmäįľ",
"recipient-invalid-email-text": "Ĩʼnväľįđ ęmäįľ",
"recipient-invitation-button": "Ĩʼnvįŧę",
"recipient-invitation-description": "Ĩʼnvįŧę şőmęőʼnę þy ęmäįľ",
@ -1512,16 +1512,15 @@
"success-delete-old": "Pūþľįč đäşĥþőäřđ đęľęŧęđ!"
},
"share-configuration": {
"access-label": "čäʼn äččęşş",
"share-type-label": "Ŀįʼnĸ äččęşş"
},
"share-externally": {
"copy-link-button": "Cőpy ęχŧęřʼnäľ ľįʼnĸ",
"email-share-type-option-description": "Øʼnľy pęőpľę ŵįŧĥ äččęşş čäʼn őpęʼn ŵįŧĥ ŧĥę ľįʼnĸ",
"email-share-type-option-description": "Øʼnľy pęőpľę ŵįŧĥ ŧĥę ľįʼnĸ čäʼn äččęşş đäşĥþőäřđ",
"email-share-type-option-label": "Øʼnľy şpęčįƒįč pęőpľę",
"pause-access-button": "Päūşę äččęşş",
"pause-access-tooltip": "Päūşįʼnģ ŵįľľ ŧęmpőřäřįľy đįşäþľę äččęşş ŧő ŧĥįş đäşĥþőäřđ ƒőř äľľ ūşęřş",
"public-share-type-option-description": "Åʼnyőʼnę ŵįŧĥ ŧĥę ľįʼnĸ čäʼn äččęşş",
"public-share-type-option-description": "Åʼnyőʼnę ŵįŧĥ ŧĥę ľįʼnĸ čäʼn äččęşş đäşĥþőäřđ",
"public-share-type-option-label": "Åʼnyőʼnę ŵįŧĥ ŧĥę ľįʼnĸ",
"resume-access-button": "Ŗęşūmę äččęşş",
"revoke-access-button": "Ŗęvőĸę äččęşş",