-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add version, edition and similar badges. (#1961)
* Add version, edition and similar badges. * Add version, edition and similar badges. --------- Co-authored-by: Taron Chatoyan <chatoyan48@gmailc.com>
- Loading branch information
1 parent
bafe0e2
commit c6a56c8
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |