-
-
Notifications
You must be signed in to change notification settings - Fork 267
Thing and Item Details: Use core's file-format service to display code in YAML and DSL #3180
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?
Changes from 12 commits
3e8fbcc
34283c3
fb066a9
6ca0841
ed922e7
b8b8a91
b92c326
35cc398
765e3cd
55e7987
557fa60
ab4b15d
a7d7eff
3e20b0a
331d94e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,313 @@ | ||||||||
| <template> | ||||||||
| <f7-icon v-if="readOnly" | ||||||||
| f7="lock" | ||||||||
| class="float-right margin" | ||||||||
| style="opacity:0.5; z-index: 4000; user-select: none;" | ||||||||
| size="50" | ||||||||
| color="gray" | ||||||||
| :tooltip="readOnlyMsg" /> | ||||||||
|
|
||||||||
| <div class="code-editor"> | ||||||||
| <editor ref="editor" | ||||||||
| :mode="editorMode" | ||||||||
| :value="code" | ||||||||
| :hint-context="hintContext" | ||||||||
| :read-only="readOnly" | ||||||||
| @input="onEditorInput" /> | ||||||||
| </div> | ||||||||
|
|
||||||||
| <f7-toolbar bottom> | ||||||||
| <f7-segmented> | ||||||||
| <f7-button v-for="type in Object.keys(mediaTypes)" | ||||||||
| outline | ||||||||
| small | ||||||||
| :key="type" | ||||||||
| :active="uiOptionsStore.codeEditorType === type" | ||||||||
| @click="switchCodeType(type)"> | ||||||||
| {{ type }} | ||||||||
| </f7-button> | ||||||||
| </f7-segmented> | ||||||||
| <f7-button @click="copy" | ||||||||
| icon-ios="f7:square_on_square" | ||||||||
| icon-aurora="f7:square_on_square" | ||||||||
| color="blue" | ||||||||
| class="copy display-flex flex-direction-row"> | ||||||||
| Copy | ||||||||
| </f7-button> | ||||||||
| <f7-button v-if="!readOnly" | ||||||||
| @click="revertChanges" | ||||||||
| :disabled="!dirty" | ||||||||
| icon-ios="f7:arrow_2_circlepath" | ||||||||
| icon-aurora="f7:arrow_2_circlepath" | ||||||||
| color="red" | ||||||||
| class="reset display-flex flex-direction-row"> | ||||||||
| Revert | ||||||||
| </f7-button> | ||||||||
| </f7-toolbar> | ||||||||
|
|
||||||||
| <f7-popup ref="errors" | ||||||||
| id="code-errors" | ||||||||
| close-on-escape | ||||||||
| close-by-backdrop-click | ||||||||
| @popup:open="initializeMovablePopup($refs.errors, $refs.navbar)" | ||||||||
| @popup:closed="cleanupMovablePopup"> | ||||||||
| <f7-page> | ||||||||
| <f7-navbar title="Parse Errors" ref="navbar"> | ||||||||
| <f7-nav-right> | ||||||||
| <f7-link class="popup-close"> | ||||||||
| Close | ||||||||
| </f7-link> | ||||||||
| </f7-nav-right> | ||||||||
| </f7-navbar> | ||||||||
|
|
||||||||
| <f7-list class="col wide error-list"> | ||||||||
| <f7-list-item v-for="(error, idx) in errors" :key="idx" :title="error" /> | ||||||||
| </f7-list> | ||||||||
| </f7-page> | ||||||||
| </f7-popup> | ||||||||
| </template> | ||||||||
|
|
||||||||
| <style lang="stylus"> | ||||||||
| .code-editor | ||||||||
| position absolute | ||||||||
| top calc(var(--f7-navbar-height) + var(--f7-toolbar-height)) | ||||||||
| bottom calc(var(--f7-navbar-height)) | ||||||||
|
||||||||
| bottom calc(var(--f7-navbar-height)) | |
| bottom calc(var(--f7-toolbar-height)) |
Copilot
AI
Nov 10, 2025
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.
The documentation comment is incomplete. It mentions that the resulting object is emitted in an {update} event, but the actual event emitted is parsed (line 224). The comment should be updated to match the implementation.
| * The resulting object is emitted in an {update} event. | |
| * The resulting object is emitted in a {parsed} event. |
Copilot
AI
Nov 10, 2025
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.
Missing documentation for the onFailureCallback parameter. The JSDoc comment should include this parameter since it's used in the function signature.
| * @param {function} onSuccessCallback - Optional. A callback function to call when the code has been parsed | |
| * @param {function} onSuccessCallback - Optional. A callback function to call when the code has been parsed | |
| * @param {function} onFailureCallback - Optional. A callback function to call when parsing fails or no object is found |
Uh oh!
There was an error while loading. Please reload this page.