-
Notifications
You must be signed in to change notification settings - Fork 0
Add reference document link to JSON model view #115
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
421b1d2
Add reference document link to JSON model view
vkarpov15 f1fdc4a
bump mongoose
vkarpov15 6cda3a2
Refine JSON reference link styling
vkarpov15 d1caa89
Merge branch 'codex/add-view-document-link-on-json-view' of github.co…
vkarpov15 b61a8f5
layout cleanup
vkarpov15 b3498d9
bump extrovert
vkarpov15 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| <div> | ||
| <div class="flex items-baseline whitespace-pre" :style="indentStyle"> | ||
| <button | ||
| v-if="showToggle" | ||
| type="button" | ||
| class="w-4 h-4 mr-1 inline-flex items-center justify-center leading-none text-gray-500 hover:text-gray-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-slate-400 cursor-pointer" | ||
| @click.stop="handleToggle" | ||
| > | ||
| {{ isCollapsedNode ? '+' : '-' }} | ||
| </button> | ||
| <span v-else class="w-4 h-4 mr-1 inline-flex items-center justify-center invisible flex-shrink-0"></span> | ||
| <template v-if="hasKey"> | ||
| <span class="text-blue-600">"{{ nodeKey }}"</span><span>: </span> | ||
| </template> | ||
| <template v-if="isComplex"> | ||
| <template v-if="hasChildren"> | ||
| <span>{{ openingBracket }}</span> | ||
| <span v-if="isCollapsedNode" class="mx-1">…</span> | ||
| <span v-if="isCollapsedNode">{{ closingBracket }}{{ comma }}</span> | ||
| </template> | ||
| <template v-else> | ||
| <span>{{ openingBracket }}{{ closingBracket }}{{ comma }}</span> | ||
| </template> | ||
| </template> | ||
| <template v-else> | ||
| <!-- | ||
| If value is a string and overflows its container (i.e. goes over one line), show an ellipsis. | ||
| This is done via CSS ellipsis strategy. | ||
| --> | ||
| <span | ||
| v-if="shouldShowReferenceLink" | ||
| class="inline-flex items-baseline group" | ||
| > | ||
| <span | ||
| :class="[...valueClasses, 'underline', 'decoration-dotted', 'underline-offset-2']" | ||
| :style="typeof value === 'string' | ||
| ? { | ||
| display: 'inline-block', | ||
| maxWidth: '100%', | ||
| overflow: 'hidden', | ||
| textOverflow: 'ellipsis', | ||
| whiteSpace: 'nowrap', | ||
| verticalAlign: 'bottom' | ||
| } | ||
| : {}" | ||
| :title="typeof value === 'string' && $el && $el.scrollWidth > $el.clientWidth ? value : undefined" | ||
| > | ||
| {{ formattedValue }} | ||
| </span> | ||
| <span> | ||
| {{ comma }} | ||
| </span> | ||
| <a | ||
| href="#" | ||
| class="ml-1 text-sm text-sky-700 opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity" | ||
| @click.stop.prevent="goToReference(value)" | ||
| > | ||
| View Document | ||
| </a> | ||
| </span> | ||
| <span | ||
| v-else | ||
| :class="valueClasses" | ||
| :style="typeof value === 'string' | ||
| ? { | ||
| display: 'inline-block', | ||
| maxWidth: '100%', | ||
| overflow: 'hidden', | ||
| textOverflow: 'ellipsis', | ||
| whiteSpace: 'nowrap', | ||
| verticalAlign: 'bottom' | ||
| } | ||
| : {}" | ||
| :title="typeof value === 'string' && $el && $el.scrollWidth > $el.clientWidth ? value : undefined" | ||
| > | ||
| {{ formattedValue }}{{ comma }} | ||
| </span> | ||
| </template> | ||
| </div> | ||
| <template v-if="isComplex && hasChildren && !isCollapsedNode"> | ||
| <json-node | ||
| v-for="child in children" | ||
| :key="child.path" | ||
| :node-key="child.displayKey" | ||
| :value="child.value" | ||
| :level="level + 1" | ||
| :is-last="child.isLast" | ||
| :path="child.path" | ||
| :toggle-collapse="toggleCollapse" | ||
| :is-collapsed="isCollapsed" | ||
| :create-child-path="createChildPath" | ||
| :indent-size="indentSize" | ||
| :max-top-level-fields="maxTopLevelFields" | ||
| :top-level-expanded="topLevelExpanded" | ||
| :expand-top-level="expandTopLevel" | ||
| :references="references" | ||
| ></json-node> | ||
| <div | ||
| v-if="hasHiddenRootChildren" | ||
| class="flex items-baseline whitespace-pre" | ||
| :style="indentStyle" | ||
| > | ||
| <span class="w-4 h-4 mr-1 inline-flex items-center justify-center invisible"></span> | ||
| <button | ||
| type="button" | ||
| class="text-xs inline-flex items-center gap-1 ml-4 text-slate-500 hover:text-slate-700 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-slate-400" | ||
| :title="hiddenChildrenTooltip" | ||
| @click.stop="handleExpandTopLevel" | ||
| > | ||
| <span aria-hidden="true">{{hiddenChildrenLabel}}…</span> | ||
| </button> | ||
| </div> | ||
| <div class="flex items-baseline whitespace-pre" :style="indentStyle"> | ||
| <span class="w-4 h-4 mr-1 inline-flex items-center justify-center invisible"></span> | ||
| <span>{{ closingBracket }}{{ comma }}</span> | ||
| </div> | ||
| </template> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.