refactor: Fix Enteprise type errors (#9442)

This commit is contained in:
Mutasem Aldmour
2024-05-17 13:58:26 +02:00
committed by GitHub
parent feba07ba8b
commit b2c17034c2
10 changed files with 75 additions and 39 deletions

View File

@@ -6,8 +6,8 @@
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import type { EnterpriseEditionFeature } from '@/constants';
import { type PropType, defineComponent } from 'vue';
import type { EnterpriseEditionFeatureValue } from '@/Interface';
import { mapStores } from 'pinia';
import { useSettingsStore } from '@/stores/settings.store';
@@ -15,18 +15,15 @@ export default defineComponent({
name: 'EnterpriseEdition',
props: {
features: {
type: Array,
default: () => [] as EnterpriseEditionFeature[],
type: Array as PropType<EnterpriseEditionFeatureValue[]>,
default: () => [],
},
},
computed: {
...mapStores(useSettingsStore),
canAccess(): boolean {
return this.features.reduce((acc: boolean, feature) => {
return (
acc &&
!!this.settingsStore.isEnterpriseFeatureEnabled(feature as EnterpriseEditionFeature)
);
return acc && !!this.settingsStore.isEnterpriseFeatureEnabled(feature);
}, true);
},
},