Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#11028 from lockiechen/issue_10933
Browse files Browse the repository at this point in the history
fix: 非编辑页面切换Code方式时提示保存 TencentBlueKing#10933
  • Loading branch information
bkci-bot authored Sep 29, 2024
2 parents e1b68e6 + d6cf541 commit 5d97a3a
Show file tree
Hide file tree
Showing 14 changed files with 427 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@
'resetHistoryFilterCondition'
]),
updateTableHeight () {
this.tableHeight = this.$refs.tableBox.offsetHeight
this.tableHeight = this.$refs.tableBox?.offsetHeight
},
handleColumnChange (columns) {
this.tableColumnKeys = columns
Expand Down
5 changes: 1 addition & 4 deletions src/frontend/devops-pipeline/src/components/ModeSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@
id: mode,
cls: this.pipelineMode === mode ? 'is-selected' : ''
}))
},
canSwitch () {
return !(!this.readOnly && this.isEditing)
}
},
Expand Down Expand Up @@ -205,7 +202,7 @@
}
this.isSwitching = false
}
if (!this.draft && this.isEditing) {
if (!this.draft && this.isEditing && !this.readOnly) {
this.leaveConfirmVisisble = true
this.newMode = mode
return
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<template>
<span>
<span class="version-diff-entry-wrapper">
<bk-button
:text="text"
:outline="outline"
:theme="theme"
:disabled="disabled"
:size="size"
@click="initDiff"
>
<slot>
Expand All @@ -23,7 +25,10 @@
class="diff-version-dialog-content"
v-bkloading="{ isLoading: isLoadYaml, color: '#1d1d1d' }"
>
<header class="diff-version-header">
<header
class="diff-version-header"
v-if="showButton"
>
<VersionSelector
ext-cls="dark-theme-select-trigger"
ext-popover-cls="dark-theme-select-menu"
Expand Down Expand Up @@ -82,6 +87,10 @@
type: String,
default: 'primary'
},
size: {
type: String,
default: 'normal'
},
version: {
type: Number,
required: true
Expand All @@ -93,6 +102,14 @@
canSwitchVersion: {
type: Boolean,
default: true
},
showButton: {
type: Boolean,
default: true
},
disabled: {
type: Boolean,
default: false
}
},
data () {
Expand Down Expand Up @@ -167,6 +184,11 @@
<style lang="scss">
@import "@/scss/select-dark-theme.scss";
.version-diff-entry-wrapper {
.bk-button-text.bk-button-small {
padding: 0;
}
}
.diff-version-dialog.bk-dialog-wrapper {
transition: none;
.bk-dialog {
Expand Down
Loading

0 comments on commit 5d97a3a

Please sign in to comment.