Skip to content

Commit

Permalink
Add version, edition and similar badges. (#1961)
Browse files Browse the repository at this point in the history
* Add version, edition and similar badges.

* Add version, edition and similar badges.

---------

Co-authored-by: Taron Chatoyan <chatoyan48@gmailc.com>
  • Loading branch information
t-chatoyan and Taron Chatoyan authored Nov 19, 2024
1 parent bafe0e2 commit c6a56c8
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions components/content/Badge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<template>
<div class="fw-bold d-flex gap-2 flex-wrap mb-3">
<p class="mb-0">Available on:</p>
<span class="badge d-flex align-items-center bg-body-tertiary">{{version}}</span>
<span v-bind:v-if="edition" v-for="edition in editions" class="badge d-flex align-items-center" :class="`bg-${editionInfo(edition).color}`">{{ editionInfo(edition).label }}</span>
</div>

</template>

<script>
export default {
components: {},
props: {
version: {
type: String,
default: ''
},
editions: {
type: Object,
default: []
}
},
data() {
return {
color: 'secondary',
editionLabelAndColorByPrefix: {
OSS: {label: "Open Source Edition", color: "primary"},
EE: {label: "Enterprise Edition", color: "secondary"},
CLOUD_TEAM: {label: "Cloud Team plan", color: "success"},
CLOUD_PRO: {label: "Cloud Pro plan", color: "info"},
}
}
},
mounted() {
console.log('All props:', this.$props);
console.log('All props:', this.$props.text);
},
methods: {
editionInfo(edition) {
return this.editionLabelAndColorByPrefix?.[edition] ?? {
label: edition,
color: "dark-3"
}
}
},
computed: {
title() {
if (this.type === 'editions') {
return this.editionLabelAndColorByPrefix.EE.label
}
return this.$props.type
}
},
}
</script>

0 comments on commit c6a56c8

Please sign in to comment.