Skip to content

Commit

Permalink
Merge pull request #8229 from lockiechen/issue_8220
Browse files Browse the repository at this point in the history
fix: 【sg】进入项目管理列表页面,title 为 undefined 问题 fix issue #8220
  • Loading branch information
lockiechen authored Jan 10, 2023
2 parents 9fe5e35 + d4816aa commit 086a22e
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 94 deletions.
1 change: 0 additions & 1 deletion src/frontend/bk-pipeline/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ export function getDependOnDesc (job) {
}
return val
} catch (e) {
console.log(job, e)
return ''
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@
parent = parent.$parent
roadMap = `${~~parent.roadMap},${roadMap}`
}
// console.log(roadMap.slice(2))
return roadMap.slice(2)
},
isActive (index) {
Expand Down
1 change: 0 additions & 1 deletion src/frontend/devops-atomstore/src/views/market/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
this.getUserApprovalInfo(atomCode),
this.getQualityData(atomCode)
]).then(([atomDetail, atomStatic, userAppInfo, quality]) => {
console.log(quality, 'quality')
const detail = atomDetail || {}
detail.detailId = atomDetail.atomId
detail.recentExecuteNum = atomStatic.recentExecuteNum || 0
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/devops-codelib/src/views/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
return this.$route.meta.logo
},
title () {
return this.$route.meta.title
return this.$t(`codelib.${this.$route.meta.title}`)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/devops-codelib/src/views/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<code-lib-table v-bind="codelibs" :switch-page="switchPage" @handleSortChange="handleSortChange"></code-lib-table>
</template>
<empty-tips v-else-if="codelibs && codelibs.hasCreatePermission" :title="$t('codelib.codelib')" :desc="$t('codelib.codelibDesc')">
<bk-button v-for="typeLabel in codelibTypes" theme="primary" :key="typeLabel" @click="createCodelib(typeLabel)">
{{ `${$t('codelib.link')}${typeLabel}${$t('codelib.codelib')}` }}
<bk-button v-for="typeLabel in codelibTypes" :key="typeLabel" @click="createCodelib(typeLabel)">
{{ `${$t('codelib.link')} ${typeLabel} ${$t('codelib.codelib')}` }}
</bk-button>
</empty-tips>
<empty-tips v-else :title="$t('codelib.noCodelibPermission')" :desc="$t('codelib.noPermissionDesc')">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
data () {
return {
defaultMachineCover: require('../../../scss/logo/machine.svg'),
installDocsLink: `${DOCS_URL_PREFIX}/services/pools/self-hosted-agents`
installDocsLink: `${DOCS_URL_PREFIX}/Services/Resource/bkci-hosted-windows-agent.md`
}
},
methods: {
Expand Down
2 changes: 0 additions & 2 deletions src/frontend/devops-environment/src/views/env_detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
},
activeTabComp () {
const activeTab = this.tabs.find(tab => tab.tabName === this.curItemTab)
console.log(activeTab)
return activeTab && activeTab.comp ? activeTab.comp : null
},
projectId () {
Expand Down Expand Up @@ -150,7 +149,6 @@
theme
})
} finally {
console.log('121221')
this.loading.isLoading = false
}
},
Expand Down
32 changes: 5 additions & 27 deletions src/frontend/devops-nav/src/components/Header/NavMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
import Logo from '../Logo/index.vue'
import NavBox from '../NavBox/index.vue'
import eventBus from '../../utils/eventBus'
import { mapDocumnetTitle } from '@/utils/constants'
@Component({
name: 'nav-menu',
Expand Down Expand Up @@ -165,34 +166,10 @@
getDocumentTitle (linkNew) {
const title = linkNew.split('/')[1]
const titlesMap = {
pipeline: this.$t('documentTitlePipeline'),
codelib: this.$t('documentTitleCodelib'),
artifactory: this.$t('documentTitleArtifactory'),
codecc: this.$t('documentTitleCodecc'),
experience: this.$t('documentTitleExperience'),
turbo: this.$t('documentTitleTurbo'),
repo: this.$t('documentTitleRepo'),
preci: this.$t('documentTitlePreci'),
stream: this.$t('documentTitleStream'),
wetest: this.$t('documentTitleWetest'),
quality: this.$t('documentTitleQuality'),
xinghai: this.$t('documentTitleXinghai'),
bcs: this.$t('documentTitleBcs'),
job: this.$t('documentTitleJob'),
environment: this.$t('documentTitleEnvironment'),
vs: this.$t('documentTitleVs'),
apk: this.$t('documentTitleApk'),
monitor: this.$t('documentTitleMonitor'),
perm: this.$t('documentTitlePerm'),
ticket: this.$t('documentTitleTicket'),
store: this.$t('documentTitleStore'),
metrics: this.$t('documentTitleMetrics')
}
return titlesMap[title]
return this.$t(mapDocumnetTitle(title)) as string
}
gotoPage ({ link_new: linkNew }) {
gotoPage ({ link_new: linkNew, newWindow = false, newWindowUrl = '' }) {
const cAlias = this.currentPage && getServiceAliasByPath(this.currentPage.link_new)
const nAlias = getServiceAliasByPath(linkNew)
const destUrl = this.addConsole(linkNew)
Expand All @@ -201,7 +178,8 @@
eventBus.$emit('goHome')
return
}
this.$router.push(destUrl)
(newWindow && newWindowUrl) ? window.open(newWindowUrl, '_blank') : this.$router.push(destUrl)
document.title = this.getDocumentTitle(linkNew)
}
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/devops-nav/src/components/NavBox/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
isAbsoluteUrl = isAbsoluteUrl
gotoPage ({ link_new: linkNew }) {
gotoPage ({ link_new: linkNew, newWindow = false, newWindowUrl = '' }) {
const cAlias = this.currentPage && getServiceAliasByPath(this.currentPage.link_new)
const nAlias = getServiceAliasByPath(linkNew)
const destUrl = this.addConsole(linkNew)
Expand All @@ -103,7 +103,7 @@
eventBus.$emit('goHome')
return
}
this.$router.push(destUrl)
(newWindow && newWindowUrl) ? window.open(newWindowUrl, '_blank') : this.$router.push(destUrl)
document.title = this.getDocumentTitle(linkNew)
}
Expand Down
1 change: 0 additions & 1 deletion src/frontend/devops-nav/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ Vue.mixin({
resourceId,
instanceId
}])
console.log('redirectUrl', redirectUrl)
window.open(redirectUrl, '_blank')
this.$bkInfo({
title: this.$t('permissionRefreshtitle'),
Expand Down
27 changes: 27 additions & 0 deletions src/frontend/devops-nav/src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export const titlesMap = {
pipeline: 'documentTitlePipeline',
codelib: 'documentTitleCodelib',
artifactory: 'documentTitleArtifactory',
codecc: 'documentTitleCodecc',
experience: 'documentTitleExperience',
turbo: 'documentTitleTurbo',
repo: 'documentTitleRepo',
preci: 'documentTitlePreci',
stream: 'documentTitleStream',
wetest: 'documentTitleWetest',
quality: 'documentTitleQuality',
xinghai: 'documentTitleXinghai',
bcs: 'documentTitleBcs',
job: 'documentTitleJob',
environment: 'documentTitleEnvironment',
vs: 'documentTitleVs',
apk: 'documentTitleApk',
monitor: 'documentTitleMonitor',
perm: 'documentTitlePerm',
ticket: 'documentTitleTicket',
store: 'documentTitleStore',
metrics: 'documentTitleMetrics'
}
export function mapDocumnetTitle (service) {
return titlesMap[service] || 'documentTitleHome'
}
28 changes: 2 additions & 26 deletions src/frontend/devops-nav/src/views/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import { Component, Watch } from 'vue-property-decorator'
import { State, Action } from 'vuex-class'
import AnnouncementDialog from '../components/AnnouncementDialog/index.vue'
import { mapDocumnetTitle } from '@/utils/constants'
@Component({
components: {
Expand All @@ -46,32 +47,7 @@
}
getDocumentTitle (model) {
const titlesMap = {
'': this.$t('documentTitleHome'),
pipeline: this.$t('documentTitlePipeline'),
codelib: this.$t('documentTitleCodelib'),
artifactory: this.$t('documentTitleArtifactory'),
codecc: this.$t('documentTitleCodecc'),
experience: this.$t('documentTitleExperience'),
turbo: this.$t('documentTitleTurbo'),
repo: this.$t('documentTitleRepo'),
preci: this.$t('documentTitlePreci'),
stream: this.$t('documentTitleStream'),
wetest: this.$t('documentTitleWetest'),
quality: this.$t('documentTitleQuality'),
xinghai: this.$t('documentTitleXinghai'),
bcs: this.$t('documentTitleBcs'),
job: this.$t('documentTitleJob'),
environment: this.$t('documentTitleEnvironment'),
vs: this.$t('documentTitleVs'),
apk: this.$t('documentTitleApk'),
monitor: this.$t('documentTitleMonitor'),
perm: this.$t('documentTitlePerm'),
ticket: this.$t('documentTitleTicket'),
store: this.$t('documentTitleStore'),
metrics: this.$t('documentTitleMetrics')
}
return titlesMap[model]
return this.$t(mapDocumnetTitle(model)) as string
}
async created () {
Expand Down
36 changes: 9 additions & 27 deletions src/frontend/devops-nav/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
v-for="service in recentVisitService"
:key="service.key"
:to="addConsole(service.link_new)"
@click.native="getDocumentTitle(service.link_new)"
@click.native="updateDocumnetTitle(service.link_new)"
>
<img v-if="isAbsoluteUrl(service.logoUrl)" :src="service.logoUrl" class="recent-logo-icon" />
<Logo
Expand Down Expand Up @@ -53,6 +53,7 @@
slot="content"
class="all-service-list"
column-width="190px"
:get-document-title="getDocumentTitle"
:with-hover="false"
:services="services"
/>
Expand Down Expand Up @@ -166,7 +167,8 @@
import Logo from '../components/Logo/index.vue'
import { Accordion, AccordionItem } from '../components/Accordion/index'
import { urlJoin, isAbsoluteUrl } from '../utils/util'
import { urlJoin, isAbsoluteUrl } from '@/utils/util'
import { mapDocumnetTitle } from '@/utils/constants'
@Component({
components: {
Expand Down Expand Up @@ -223,31 +225,11 @@
getDocumentTitle (linkNew) {
const title = linkNew.split('/')[1]
const titlesMap = {
pipeline: this.$t('documentTitlePipeline'),
codelib: this.$t('documentTitleCodelib'),
artifactory: this.$t('documentTitleArtifactory'),
codecc: this.$t('documentTitleCodecc'),
experience: this.$t('documentTitleExperience'),
turbo: this.$t('documentTitleTurbo'),
repo: this.$t('documentTitleRepo'),
preci: this.$t('documentTitlePreci'),
stream: this.$t('documentTitleStream'),
wetest: this.$t('documentTitleWetest'),
quality: this.$t('documentTitleQuality'),
xinghai: this.$t('documentTitleXinghai'),
bcs: this.$t('documentTitleBcs'),
job: this.$t('documentTitleJob'),
environment: this.$t('documentTitleEnvironment'),
vs: this.$t('documentTitleVs'),
apk: this.$t('documentTitleApk'),
monitor: this.$t('documentTitleMonitor'),
perm: this.$t('documentTitlePerm'),
ticket: this.$t('documentTitleTicket'),
store: this.$t('documentTitleStore'),
metrics: this.$t('documentTitleMetrics')
}
document.title = titlesMap[title]
return this.$t(mapDocumnetTitle(title)) as string
}
updateDocumnetTitle (linkNew) {
document.title = this.getDocumentTitle(linkNew)
}
serviceName (name = ''): string {
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/devops-quality/src/views/overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
showContent: false,
isEmptyRule: false,
totalInterceptRecor: 0,
docsUrl: `${DOCS_URL_PREFIX.replace('持续集成平台', '质量红线')}/Inro/README.md`,
docsUrl: `${DOCS_URL_PREFIX.replace('持续集成平台', '质量红线')}/Intro/README.md`,
pipelineListLabel: [],
pipelineListValue: [],
trendList: [],
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/locale/codelib/en-US.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"codelib": "Code Repositories",
"codelib": "Repo",
"linkCodelib": "Link Repo",
"repo": "Code Repositories",
"link": "link",
Expand Down

0 comments on commit 086a22e

Please sign in to comment.