Skip to content

Commit 171aaba

Browse files
authored
Merge pull request #148 from simonredfern/develop
Json schema resource docs
2 parents 1c41a81 + 171ca01 commit 171aaba

File tree

11 files changed

+1256
-14
lines changed

11 files changed

+1256
-14
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,6 @@ test-results/
6262
playwright-report/
6363
playwright-coverage/
6464
shared-constants.js
65+
66+
# Documentation
67+
untracked_docs/

components.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ declare module 'vue' {
4444
ElTooltip: typeof import('element-plus/es')['ElTooltip']
4545
GlossarySearchNav: typeof import('./src/components/GlossarySearchNav.vue')['default']
4646
HeaderNav: typeof import('./src/components/HeaderNav.vue')['default']
47+
JsonSchemaViewer: typeof import('./src/components/JsonSchemaViewer.vue')['default']
4748
Menu: typeof import('./src/components/Menu.vue')['default']
49+
MessageDocsJsonSchemaSearchNav: typeof import('./src/components/MessageDocsJsonSchemaSearchNav.vue')['default']
4850
MessageDocsSearchNav: typeof import('./src/components/MessageDocsSearchNav.vue')['default']
4951
Preview: typeof import('./src/components/Preview.vue')['default']
5052
RouterLink: typeof import('vue-router')['RouterLink']

src/components/HeaderNav.vue

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {
3636
HEADER_LINKS_HOVER_COLOR as headerLinksHoverColorSetting,
3737
HEADER_LINKS_BACKGROUND_COLOR as headerLinksBackgroundColorSetting
3838
} from '../obp/style-setting'
39-
import { obpApiActiveVersionsKey, obpGroupedMessageDocsKey, obpMyCollectionsEndpointKey } from '@/obp/keys'
39+
import { obpApiActiveVersionsKey, obpGroupedMessageDocsKey, obpGroupedMessageDocsJsonSchemaKey, obpMyCollectionsEndpointKey } from '@/obp/keys'
4040
import SvelteDropdown from './SvelteDropdown.vue'
4141
4242
const route = useRoute()
@@ -51,6 +51,14 @@ const loginUsername = ref('')
5151
const logoffurl = ref('')
5252
const obpApiVersions = ref(inject(obpApiActiveVersionsKey) || [])
5353
const obpMessageDocs = ref(Object.keys(inject(obpGroupedMessageDocsKey) || {}))
54+
const obpMessageDocsJsonSchema = ref(Object.keys(inject(obpGroupedMessageDocsJsonSchemaKey) || {}))
55+
56+
// Combine message docs with JSON Schema items (with "J Schema" postfix)
57+
const combinedMessageDocs = computed(() => {
58+
const regularDocs = obpMessageDocs.value || []
59+
const jsonSchemaDocs = (obpMessageDocsJsonSchema.value || []).map(connector => `${connector} J Schema`)
60+
return [...regularDocs, ...jsonSchemaDocs]
61+
})
5462
5563
// Debug menu items
5664
const debugMenuItems = ref(['/debug/providers-status', '/debug/oidc'])
@@ -189,8 +197,8 @@ const setActive = (target: HTMLElement | null) => {
189197
}
190198
}
191199
192-
const handleMore = (command: string) => {
193-
console.log('handleMore called with command:', command)
200+
const handleMore = (command: string, source?: string) => {
201+
console.log('handleMore called with command:', command, 'source:', source)
194202
195203
// Ignore divider
196204
if (command === '---') {
@@ -201,11 +209,22 @@ const handleMore = (command: string) => {
201209
if (element !== null) {
202210
element.textContent = command;
203211
}
204-
if (command === '/message-docs') {
212+
213+
// Check if command ends with " J Schema" - if so, it's a JSON Schema message doc
214+
if (command.endsWith(' J Schema')) {
215+
const connector = command.replace(' J Schema', '')
216+
console.log('Navigating to message docs JSON schema:', connector)
217+
router.push({ name: 'message-docs-json-schema', params: { id: connector } })
218+
} else if (command === '/message-docs') {
205219
// Navigate to message docs list
206220
console.log('Navigating to message docs list')
207221
router.push({ name: 'message-docs-list' })
222+
} else if (command === '/message-docs-json-schema') {
223+
// Navigate to message docs JSON schema list
224+
console.log('Navigating to message docs JSON schema list')
225+
router.push({ name: 'message-docs-json-schema-list' })
208226
} else if (command.includes('_')) {
227+
// Regular message docs (connector names contain underscores)
209228
console.log('Navigating to message docs:', command)
210229
router.push({ name: 'message-docs', params: { id: command } })
211230
} else if (command.startsWith('/debug/')) {
@@ -292,7 +311,7 @@ const getCurrentPath = () => {
292311
class="menu-right"
293312
id="header-nav-message-docs"
294313
label="Message Docs"
295-
:items="obpMessageDocs"
314+
:items="combinedMessageDocs"
296315
:hover-color="headerLinksHoverColor"
297316
:background-color="headerLinksBackgroundColor"
298317
@select="handleMore"

0 commit comments

Comments
 (0)