Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOUR-16942 | Update Inbound Configuration Accordion Icon in Node Inspector Panel #429

Merged
merged 2 commits into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 26 additions & 13 deletions src/components/FormAccordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
v-b-toggle="`collapse-${config.name || config.label}`"
class="accordion-button text-left card-header d-flex align-items-center w-100 pl-3"
:id="`accordion-button-${config.name || config.label}`"
>
<i
v-if="config.icon"
class="fas mr-1 fa-fw"
:class="`fa-${config.icon}`"
/>

<span class="ml-1 mr-auto">{{ config.label }}</span>

<i class="when-opened fas fa-chevron-down accordion-arrow ml-auto" />
<i class="when-closed fas fa-chevron-right accordion-arrow ml-auto" />
>
<div v-if="config.icon">
<i v-if="fontAwesomeIcon" class="fas mr-1 fa-fw" :class="`fa-${config.icon}`" />
<img v-if="svgIcon" :src="config.icon" :alt="config.name + ' icon'" width="18px" class="mr-1" />
</div>
<span class="ml-1 mr-auto">{{ config.label }}</span>
<i class="when-opened fas fa-chevron-down accordion-arrow ml-auto" />
<i class="when-closed fas fa-chevron-right accordion-arrow ml-auto" />
</button>

<b-collapse
Expand All @@ -41,7 +38,9 @@ export default {
return {
initiallyOpen: Boolean(this.config.initiallyOpen),
items: [],
}
fontAwesomeIcon: false,
svgIcon: false,
};
},
watch: {
value: {
Expand All @@ -54,7 +53,21 @@ export default {
this.$emit('input', this.items);
},
},
}
mounted() {
this.getAccordionIcon();
},
methods: {
getAccordionIcon() {
if (this.config.icon.includes("svg")) {
this.fontAwesomeIcon = false;
this.svgIcon = true;
} else {
this.fontAwesomeIcon = true;
this.svgIcon = false;
}
}
}
};
</script>

<style scoped lang="scss">
Expand Down
Loading