Skip to content

Commit

Permalink
[Improvement][Resource Center] Display brief file name in file-detail…
Browse files Browse the repository at this point in the history
…s page (apache#15137)
  • Loading branch information
arlendp committed Nov 16, 2023
1 parent 65a7c7f commit be9595d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default defineComponent({
// fullname is now the id of resources
const fullName = String(router.currentRoute.value.query.prefix || '')
const tenantCode = String(router.currentRoute.value.query.tenantCode || '')
const alias = String(router.currentRoute.value.query.alias || '')

const { state } = useForm()
const { getResourceView, handleUpdateContent } = useEdit(state)
Expand All @@ -61,6 +62,7 @@ export default defineComponent({
return {
componentName,
resourceViewRef,
alias,
handleReturn,
handleFileContent,
...toRefs(state)
Expand All @@ -73,7 +75,7 @@ export default defineComponent({
{this.resourceViewRef.isReady.value ? (
<div class={styles['file-edit-content']}>
<h2>
<span>{this.resourceViewRef.state.value.alias}</span>
<span>{this.alias}</span>
</h2>
<NForm
rules={this.rules}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,18 @@ export default defineComponent({
return !(flag && size < 1000000)
}

const handleEditFile = (item: { fullName: string; user_name: string }) => {
const handleEditFile = (item: {
fullName: string
user_name: string
alias: string
}) => {
router.push({
name: 'resource-file-edit',
query: { prefix: item.fullName, tenantCode: item.user_name }
query: {
prefix: item.fullName,
tenantCode: item.user_name,
alias: item.alias
}
})
}

Expand Down Expand Up @@ -126,7 +134,8 @@ export default defineComponent({
onClick={() => {
this.handleEditFile({
fullName: this.row.fullName,
user_name: this.row.user_name
user_name: this.row.user_name,
alias: this.row.alias
})
}}
style={{ marginRight: '-5px' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface ResourceFileTableData {
user_name: string
directory: string
file_name: string
alias: string
description: string
size: number
type: ResourceType
Expand Down

0 comments on commit be9595d

Please sign in to comment.