mirror of
https://github.com/harness/drone.git
synced 2025-05-19 10:29:55 +08:00
fix: [code-796]: fix encode text issue in toaster (#383)
This commit is contained in:
parent
d15aa03dfd
commit
ac8f1932ba
@ -13,7 +13,8 @@ import {
|
|||||||
useToaster,
|
useToaster,
|
||||||
FormInput,
|
FormInput,
|
||||||
Label,
|
Label,
|
||||||
ButtonVariation
|
ButtonVariation,
|
||||||
|
StringSubstitute
|
||||||
} from '@harnessio/uicore'
|
} from '@harnessio/uicore'
|
||||||
import { Icon } from '@harnessio/icons'
|
import { Icon } from '@harnessio/icons'
|
||||||
import { FontVariation } from '@harnessio/design-system'
|
import { FontVariation } from '@harnessio/design-system'
|
||||||
@ -77,7 +78,15 @@ export function useCreateBranchModal({
|
|||||||
hideModal()
|
hideModal()
|
||||||
onSuccess(response)
|
onSuccess(response)
|
||||||
if (showSuccessMessage) {
|
if (showSuccessMessage) {
|
||||||
showSuccess(getString('branchCreated', { branch: name }), 5000)
|
showSuccess(
|
||||||
|
<StringSubstitute
|
||||||
|
str={getString('branchCreated')}
|
||||||
|
vars={{
|
||||||
|
branch: name
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
5000
|
||||||
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(_error => {
|
.catch(_error => {
|
||||||
|
@ -13,7 +13,8 @@ import {
|
|||||||
useToaster,
|
useToaster,
|
||||||
FormInput,
|
FormInput,
|
||||||
Label,
|
Label,
|
||||||
ButtonVariation
|
ButtonVariation,
|
||||||
|
StringSubstitute
|
||||||
} from '@harnessio/uicore'
|
} from '@harnessio/uicore'
|
||||||
import { Icon } from '@harnessio/icons'
|
import { Icon } from '@harnessio/icons'
|
||||||
import { FontVariation } from '@harnessio/design-system'
|
import { FontVariation } from '@harnessio/design-system'
|
||||||
@ -77,7 +78,15 @@ export function useCreateTagModal({
|
|||||||
hideModal()
|
hideModal()
|
||||||
onSuccess(response)
|
onSuccess(response)
|
||||||
if (showSuccessMessage) {
|
if (showSuccessMessage) {
|
||||||
showSuccess(getString('tagCreated', { tag: name }), 5000)
|
showSuccess(
|
||||||
|
<StringSubstitute
|
||||||
|
str={getString('tagCreated')}
|
||||||
|
vars={{
|
||||||
|
tag: name
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
5000
|
||||||
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(_error => {
|
.catch(_error => {
|
||||||
|
@ -146,7 +146,7 @@ branchSource: Branch source
|
|||||||
branchSourceDesc: Choose a source branch
|
branchSourceDesc: Choose a source branch
|
||||||
basedOn: Based on
|
basedOn: Based on
|
||||||
failedToCreateBranch: Failed to create Branch. Please try again.
|
failedToCreateBranch: Failed to create Branch. Please try again.
|
||||||
branchCreated: Branch {{branch}} created.
|
branchCreated: Branch {branch} created.
|
||||||
tagCreated: Tag {{tag}} created.
|
tagCreated: Tag {{tag}} created.
|
||||||
confirmation: Confirmation
|
confirmation: Confirmation
|
||||||
deleteBranch: Delete Branches
|
deleteBranch: Delete Branches
|
||||||
@ -158,8 +158,8 @@ browseFiles: Browse Files
|
|||||||
compare: Compare
|
compare: Compare
|
||||||
commitString: 'Commit {commit}'
|
commitString: 'Commit {commit}'
|
||||||
repoDeleted: Repository {{repo}} deleted.
|
repoDeleted: Repository {{repo}} deleted.
|
||||||
branchDeleted: Branch {{branch}} deleted.
|
branchDeleted: Branch {branch} deleted.
|
||||||
tagDeleted: Tag {{tag}} deleted.
|
tagDeleted: Tag {tag} deleted.
|
||||||
failedToDeleteBranch: Failed to delete Branch. Please try again.
|
failedToDeleteBranch: Failed to delete Branch. Please try again.
|
||||||
createFile: Create __path__
|
createFile: Create __path__
|
||||||
updateFile: Update __path__
|
updateFile: Update __path__
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useMemo, useState } from 'react'
|
import React, { useEffect, useMemo, useState } from 'react'
|
||||||
import { Container, TableV2 as Table, Text, Avatar, Tag, useToaster } from '@harnessio/uicore'
|
import { Container, TableV2 as Table, Text, Avatar, Tag, useToaster, StringSubstitute } from '@harnessio/uicore'
|
||||||
import { Color, Intent } from '@harnessio/design-system'
|
import { Color, Intent } from '@harnessio/design-system'
|
||||||
import type { CellProps, Column } from 'react-table'
|
import type { CellProps, Column } from 'react-table'
|
||||||
import { Link, useHistory } from 'react-router-dom'
|
import { Link, useHistory } from 'react-router-dom'
|
||||||
@ -128,7 +128,15 @@ export function BranchesContent({ repoMetadata, searchTerm = '', branches, onDel
|
|||||||
action: async () => {
|
action: async () => {
|
||||||
deleteBranch({})
|
deleteBranch({})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
showSuccess(getString('branchDeleted', { branch: row.original.name }), 5000)
|
showSuccess(
|
||||||
|
<StringSubstitute
|
||||||
|
str={getString('branchDeleted')}
|
||||||
|
vars={{
|
||||||
|
branch: row.original.name
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
5000
|
||||||
|
)
|
||||||
onDeleteSuccess()
|
onDeleteSuccess()
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useMemo } from 'react'
|
import React, { useMemo } from 'react'
|
||||||
import { Container, TableV2 as Table, Text, Avatar, useToaster } from '@harnessio/uicore'
|
import { Container, TableV2 as Table, Text, Avatar, useToaster, StringSubstitute } from '@harnessio/uicore'
|
||||||
import { Color, Intent } from '@harnessio/design-system'
|
import { Color, Intent } from '@harnessio/design-system'
|
||||||
import type { CellProps, Column } from 'react-table'
|
import type { CellProps, Column } from 'react-table'
|
||||||
import { Link, useHistory } from 'react-router-dom'
|
import { Link, useHistory } from 'react-router-dom'
|
||||||
@ -137,7 +137,15 @@ export function TagsContent({ repoMetadata, searchTerm = '', branches, onDeleteS
|
|||||||
action: async () => {
|
action: async () => {
|
||||||
deleteBranch({})
|
deleteBranch({})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
showSuccess(getString('tagDeleted', { branch: row.original.name }), 5000)
|
showSuccess(
|
||||||
|
<StringSubstitute
|
||||||
|
str={getString('tagDeleted')}
|
||||||
|
vars={{
|
||||||
|
tag: row.original.name
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
5000
|
||||||
|
)
|
||||||
onDeleteSuccess()
|
onDeleteSuccess()
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
Loading…
Reference in New Issue
Block a user