File tree Expand file tree Collapse file tree 8 files changed +38
-68
lines changed
components/confirm-delete-dialog Expand file tree Collapse file tree 8 files changed +38
-68
lines changed Original file line number Diff line number Diff line change 1111 - ' main'
1212
1313concurrency :
14- group : registry-push-${{ github.ref }}
14+ group : registry-push
1515 cancel-in-progress : true
1616
1717jobs :
Original file line number Diff line number Diff line change @@ -17,11 +17,10 @@ import { http } from '@/lib/request';
1717
1818interface IProps {
1919 open : boolean ;
20- title : string ;
2120 titleKey ?: string ;
22- resourceName ?: string ;
23- description : string ;
24- itemTitle ? : string ;
21+ descriptionKey ?: string ;
22+ targetName : string ;
23+ itemTitle : string ;
2524 deleteUrl : string ;
2625 restoreUrl ?: string ;
2726 successMessage ?: string ;
@@ -35,10 +34,9 @@ interface IProps {
3534export default function ConfirmDeleteDialog ( props : IProps ) {
3635 const {
3736 open,
38- title,
3937 titleKey,
40- resourceName ,
41- description ,
38+ targetName ,
39+ descriptionKey ,
4240 itemTitle,
4341 deleteUrl,
4442 restoreUrl,
@@ -103,27 +101,19 @@ export default function ConfirmDeleteDialog(props: IProps) {
103101 < AlertDialogContent >
104102 < AlertDialogHeader >
105103 < AlertDialogTitle >
106- { titleKey && itemTitle && resourceName ? (
107- < Trans
108- i18nKey = { titleKey }
109- values = { { title : itemTitle , resource_name : resourceName } }
110- />
111- ) : (
112- title
113- ) }
104+ < Trans
105+ i18nKey = { titleKey || 'common.dialog.delete.title' }
106+ values = { { target_name : targetName } }
107+ />
114108 </ AlertDialogTitle >
115109 < AlertDialogDescription >
116- { itemTitle ? (
117- < Trans
118- i18nKey = { description }
119- values = { { title : itemTitle } }
120- components = { {
121- strong : < strong className = "font-bold" /> ,
122- } }
123- />
124- ) : (
125- description
126- ) }
110+ < Trans
111+ i18nKey = { descriptionKey || 'common.dialog.delete.description' }
112+ values = { { title : itemTitle } }
113+ components = { {
114+ strong : < strong className = "font-bold" /> ,
115+ } }
116+ />
127117 </ AlertDialogDescription >
128118 </ AlertDialogHeader >
129119 < AlertDialogFooter >
Original file line number Diff line number Diff line change 3030 "deleted_description" : " This resource has been deleted" ,
3131 "no_content" : " Resource has no content to download" ,
3232 "untitled" : " Untitled" ,
33- "delete" : {
34- "dialog" : {
35- "title" : " Delete {{ resource_name }} {{ title }}?" ,
36- "description" : " You are going to delete <strong>{{ title }}</strong>"
37- }
38- },
3933 "attrs" : {
4034 "tag" : " Tag" ,
4135 "add_tag" : " Add tag" ,
387381 "deleted" : " Deleted Conversations" ,
388382 "deleted_description" : " This conversation has been deleted" ,
389383 "delete" : {
390- "option" : " Delete" ,
391- "dialog" : {
392- "title" : " Delete {{ resource_name }} {{ title }}?" ,
393- "description" : " You are going to delete <strong>{{ title }}</strong>"
394- }
384+ "option" : " Delete"
395385 },
396386 "rename" : {
397387 "option" : " Rename" ,
544534 "refresh" : " Refresh" ,
545535 "retry" : " Retry" ,
546536 "previous" : " Previous" ,
547- "next" : " Next"
537+ "next" : " Next" ,
538+ "dialog" : {
539+ "delete" : {
540+ "title" : " Delete {{target_name}}?" ,
541+ "description" : " You are going to delete <strong>{{title}}</strong>"
542+ }
543+ }
548544 },
549545 "loading" : " Loading..." ,
550546 "creating" : " Creating..." ,
Original file line number Diff line number Diff line change 2222 "invalid_ext" : " 当前文件格式不支持"
2323 },
2424 "resource" : {
25- "name" : " 资源 " ,
25+ "name" : " 文件 " ,
2626 "folder" : {
2727 "children_count" : " {{ count }} 个文件"
2828 },
2929 "deleted" : " 已删除" ,
3030 "deleted_description" : " 此资源已被删除" ,
3131 "no_content" : " 资源没有内容可下载" ,
3232 "untitled" : " 未命名" ,
33- "delete" : {
34- "dialog" : {
35- "title" : " 删除{{ resource_name }}{{ title }}?" ,
36- "description" : " 您将要删除 <strong>{{ title }}</strong>"
37- }
38- },
3933 "attrs" : {
4034 "tag" : " 标签" ,
4135 "add_tag" : " 点击添加标签" ,
387381 "deleted" : " 已删除对话" ,
388382 "deleted_description" : " 此对话已被删除" ,
389383 "delete" : {
390- "option" : " 删除对话" ,
391- "dialog" : {
392- "title" : " 删除{{ resource_name }}{{ title }}?" ,
393- "description" : " 您将要删除 <strong>{{ title }}</strong>。"
394- }
384+ "option" : " 删除对话"
395385 },
396386 "rename" : {
397387 "option" : " 重命名" ,
544534 "refresh" : " 刷新" ,
545535 "retry" : " 重试" ,
546536 "previous" : " 上一页" ,
547- "next" : " 下一页"
537+ "next" : " 下一页" ,
538+ "dialog" : {
539+ "delete" : {
540+ "title" : " 删除{{target_name}}?" ,
541+ "description" : " 您将要删除 <strong>{{title}}</strong>"
542+ }
543+ }
548544 },
549545 "loading" : " 加载中..." ,
550546 "creating" : " 创建中..." ,
Original file line number Diff line number Diff line change @@ -20,10 +20,7 @@ export default function RemoveHistory(props: IProps) {
2020 return (
2121 < ConfirmDeleteDialog
2222 open = { data . open }
23- title = { t ( 'chat.conversations.delete.dialog.title' ) }
24- titleKey = "chat.conversations.delete.dialog.title"
25- resourceName = { t ( 'chat.conversations.name' ) }
26- description = "chat.conversations.delete.dialog.description"
23+ targetName = { t ( 'chat.conversations.name' ) }
2724 itemTitle = { data . title }
2825 deleteUrl = { `namespaces/${ namespaceId } /conversations/${ data . id } ` }
2926 restoreUrl = { `/namespaces/${ namespaceId } /conversations/${ data . id } /restore` }
Original file line number Diff line number Diff line change @@ -164,10 +164,7 @@ export default function Actions(props: IProps) {
164164 ) }
165165 < ConfirmDeleteDialog
166166 open = { remove }
167- title = { t ( 'chat.conversations.delete.dialog.title' ) }
168- titleKey = "chat.conversations.delete.dialog.title"
169- resourceName = { t ( 'chat.conversations.name' ) }
170- description = "chat.conversations.delete.dialog.description"
167+ targetName = { t ( 'chat.conversations.name' ) }
171168 itemTitle = { chatTitle }
172169 deleteUrl = { `/namespaces/${ namespaceId } /conversations/${ conversationId } ` }
173170 restoreUrl = { `/namespaces/${ namespaceId } /conversations/${ conversationId } /restore` }
Original file line number Diff line number Diff line change @@ -550,10 +550,7 @@ export default function Actions(props: IActionProps) {
550550 { resource && (
551551 < ConfirmDeleteDialog
552552 open = { showDeleteDialog }
553- title = { t ( 'resource.delete.dialog.title' ) }
554- titleKey = "resource.delete.dialog.title"
555- resourceName = { t ( 'resource.name' ) }
556- description = "resource.delete.dialog.description"
553+ targetName = { t ( 'resource.name' ) }
557554 itemTitle = { resource . name || t ( 'resource.untitled' ) }
558555 deleteUrl = { `/namespaces/${ namespaceId } /resources/${ resource . id } ` }
559556 restoreUrl = { `/namespaces/${ namespaceId } /resources/${ resource . id } /restore` }
Original file line number Diff line number Diff line change @@ -61,10 +61,7 @@ export default function MainSidebar() {
6161 < Setting />
6262 < ConfirmDeleteDialog
6363 open = { deleteDialog . open }
64- title = { t ( 'resource.delete.dialog.title' ) }
65- titleKey = "resource.delete.dialog.title"
66- resourceName = { t ( 'resource.name' ) }
67- description = "resource.delete.dialog.description"
64+ targetName = { t ( 'resource.name' ) }
6865 itemTitle = { deleteDialog . title }
6966 deleteUrl = { `/namespaces/${ namespaceId } /resources/${ deleteDialog . id } ` }
7067 restoreUrl = { `/namespaces/${ namespaceId } /resources/${ deleteDialog . id } /restore` }
You can’t perform that action at this time.
0 commit comments