Skip to content

Commit 0540c43

Browse files
committed
feat: Update toolbar title in MainComponent.vue for better readability; and keep the 'API Response' view always as the end tab
1 parent c258cfb commit 0540c43

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/components/MainComponent.vue

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<v-icon>mdi-github</v-icon>
66
</v-btn>
77

8-
<v-toolbar-title>Copilot Metrics Viewer | {{ capitalizedItemName }} : {{ gitHubOrgName }}</v-toolbar-title>
8+
<v-toolbar-title class="toolbar-title">Copilot Metrics Viewer | {{ capitalizedItemName }} : {{ dispalyedViewName }}</v-toolbar-title>
99
<h2 class="error-message"> {{ mockedDataMessage }} </h2>
1010
<v-spacer></v-spacer>
1111

@@ -79,9 +79,12 @@ export default defineComponent({
7979
return 'invalid';
8080
}
8181
},
82-
capitalizedItemName() {
82+
capitalizedItemName():string {
8383
return this.itemName.charAt(0).toUpperCase() + this.itemName.slice(1);
8484
},
85+
dispalyedViewName(): string {
86+
return this.capitalizedItemName === 'Enterprise' ? process.env.VUE_APP_GITHUB_ENT: process.env.VUE_APP_GITHUB_ORG;
87+
},
8588
isScopeOrganization() {
8689
return process.env.VUE_APP_SCOPE === 'organization';
8790
},
@@ -100,7 +103,13 @@ export default defineComponent({
100103
this.tabItems.unshift(this.itemName);
101104
}
102105
if (process.env.VUE_APP_SCOPE === 'organization') {
106+
// get the last item in the array,which is 'api response'
107+
//and add 'seat analysis' before it
108+
let lastItem = this.tabItems.pop();
103109
this.tabItems.push('seat analysis');
110+
if (lastItem) {
111+
this.tabItems.push(lastItem);
112+
}
104113
}
105114
},
106115
setup() {
@@ -177,6 +186,12 @@ export default defineComponent({
177186
</script>
178187

179188
<style scoped>
189+
.toolbar-title {
190+
white-space: nowrap;
191+
overflow: visible;
192+
text-overflow: clip;
193+
194+
}
180195
.error-message {
181196
color: red;
182197
}

0 commit comments

Comments
 (0)