mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
refactor(editor): Fix typescript issues in components (no-changelog) (#9580)
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { type StyleValue, defineComponent, type PropType } from 'vue';
|
||||
|
||||
import type { ITemplatesNode } from '@/Interface';
|
||||
import type { INodeTypeDescription } from 'n8n-workflow';
|
||||
@@ -50,6 +50,7 @@ import { useRootStore } from '@/stores/n8nRoot.store';
|
||||
interface NodeIconData {
|
||||
type: string;
|
||||
path?: string;
|
||||
icon?: string;
|
||||
fileExtension?: string;
|
||||
fileBuffer?: string;
|
||||
}
|
||||
@@ -69,7 +70,8 @@ export default defineComponent({
|
||||
default: false,
|
||||
},
|
||||
nodeType: {
|
||||
type: Object,
|
||||
type: Object as PropType<INodeTypeDescription>,
|
||||
required: true,
|
||||
},
|
||||
size: {
|
||||
type: Number,
|
||||
@@ -82,9 +84,11 @@ export default defineComponent({
|
||||
'max-width': this.size + 'px',
|
||||
};
|
||||
},
|
||||
iconStyleData(): object {
|
||||
const nodeType = this.nodeType as ITemplatesNode | null;
|
||||
const color = nodeType ? nodeType.defaults && nodeType.defaults.color : '';
|
||||
iconStyleData(): StyleValue {
|
||||
const nodeType = this.nodeType;
|
||||
const nodeTypeColor = nodeType?.defaults?.color;
|
||||
const color = typeof nodeTypeColor === 'string' ? nodeTypeColor : '';
|
||||
|
||||
if (!this.size) {
|
||||
return { color };
|
||||
}
|
||||
@@ -103,7 +107,7 @@ export default defineComponent({
|
||||
}),
|
||||
};
|
||||
},
|
||||
imageStyleData(): object {
|
||||
imageStyleData(): StyleValue {
|
||||
return {
|
||||
width: '100%',
|
||||
'max-width': '100%',
|
||||
|
||||
Reference in New Issue
Block a user