Skip to content
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

Mkarimi/tooltip enum values #121

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions quasar_site/src/pages/MemberDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
{{ parameter.type }}
</router-link>
<a v-else :href="typeUrl(parameter.type)" target="_blank" class="routerlink text-weight-regular">{{ parameter.type }}</a>
<q-tooltip v-if="typeFromToken(parameter.type) && typeFromToken(parameter.type)['dataType']=='enum'">{{ typeFromToken(parameter.type).values.map(v => v.signature) }}</q-tooltip>
</template
>
<template v-else
Expand Down Expand Up @@ -161,6 +162,7 @@
Type:
<router-link v-if="!returnType.link.toLowerCase().startsWith('http')" :to="returnType.link" class="routerlink">{{returnType.name}}</router-link>
<a v-else :href="returnType.link" target="_blank" class="routerlink">{{ returnType.name }}</a>
<q-tooltip v-if="returnType.enumValues">{{returnType.enumValues}}</q-tooltip>
</template>
<template v-else>
Type: {{returnType.name}}
Expand Down Expand Up @@ -487,6 +489,13 @@ export default {
return this.memberName;
},
tokenPath(token) {
const type = this.typeFromToken(token);
if (!type){
return null;
}
return ViewModel.itemPath(type);
},
typeFromToken(token) {
// skip tokens that start with a lower case letter
if (token.length < 1 || token[0] === token[0].toLowerCase()) return null;
if (token.endsWith("[]")) token = token.substring(0, token.length - 2);
Expand All @@ -500,7 +509,7 @@ export default {
return null;
}
}
return ViewModel.itemPath(type);
return type
},
typeUrl(typeToken){
const tokenPath = this.tokenPath(typeToken)
Expand Down Expand Up @@ -532,12 +541,14 @@ export default {
// const tokenPath = this.tokenPath(tokens[0])
// const link = tokenPath ? this.baseUrl + tokenPath : null
const link = this.typeUrl(tokens[0]);
const returnType = this.typeFromToken(tokens[0]);
const name = tokens[0].split(".").slice(-1)[0];
if (link) {
chunks.push({
link: link,
name: name,
isReturn: true
isReturn: true,
enumValues: returnType["dataType"] == "enum" ? returnType.values.map(v => v.signature) : null
})
chunks.push({ name: ' ' })
} else {
Expand Down Expand Up @@ -578,7 +589,7 @@ export default {
}
chunks.push({
link: link,
name: typeToken + ' '
name: typeToken + ' ',
})
chunks.push({ name: paramName, role:"name" })
}
Expand Down