refactor: Fix Enteprise type errors (#9442)
This commit is contained in:
@@ -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);
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user