-
Notifications
You must be signed in to change notification settings - Fork 12
feat(entities-config-editor): migrate from PoC #2078
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
base: main
Are you sure you want to change the base?
Conversation
packages/core/entities-config-editor/src/components/EntitiesConfigEditor.vue
Show resolved
Hide resolved
1a8a64e
to
2588ed8
Compare
Preview components from this PR in consuming applicationIn consuming application project install preview versions of shared packages generated by this PR:
|
rootSchema.properties = { | ||
...rootSchema.properties, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q: why are we copying this property here?
return monaco.editor.createModel(_language === 'json' ? '{}' : '', _language, uri.value) | ||
}) | ||
|
||
const textDocument = computed(() =>{ | ||
const _language = unref(language) | ||
return TextDocument.create(uri.value.toString(), _language, 0, _language === 'json' ? '{}' : '') | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT about isolating the ternary expression into computed like:
const langTemplate = computed(() => language.value === 'json' ? '{}' : '')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the suggestion. I'm marking this pull request as Draft for now as I plan to refactor the code a little bit. Let me come back with more improvements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, let me know when it's ready ✉️
export interface FieldEmits<V = any> { | ||
(e: 'update-value', value: V): void | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking maybe we should use the same definition for Emitter
export interface FieldEmits<V = any> { | |
(e: 'update-value', value: V): void | |
} | |
export interface FieldEmits<V = any> { | |
'updateValue': [value: V], | |
} |
} | ||
|
||
export const isNumberLikeField = (schema: FieldSchema): schema is NumberLikeFieldSchema => | ||
schema.type === FIELD_TYPES.NUMBER || schema.type === FIELD_TYPES.INTEGER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I'd prefer
schema.type === FIELD_TYPES.NUMBER || schema.type === FIELD_TYPES.INTEGER | |
[FIELD_TYPES.NUMBER, FIELD_TYPES].includes(schema.type) |
Summary
This pull request migrates the MVP from the previous PoC. The current implementation is not perfect and will be improved by future pull requests.
KM-1107