Skip to content

Commit

Permalink
Add derived classes to datatypes (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
karimi authored Jun 14, 2024
1 parent 4e36c58 commit 74359da
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
12 changes: 12 additions & 0 deletions quasar_site/src/ViewModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,18 @@ const ViewModel = {
rc.reverse();
return rc;
},
getDerivedClasses(item) {
const fullName = `${item.namespace}.${item.name}`.toLocaleLowerCase();
const children = Object.values(this.getTypeMap()).filter(
(c) => c.baseclass && c.baseclass.toLocaleLowerCase() == fullName
);
return children.map((c) => {
return {
...c,
link: `${c.namespace}.${c.name}`.toLocaleLowerCase(),
};
});
},
sinceIsGreater(test, existing) {
if (test === existing) return false;
const testVersion = test.split(".");
Expand Down
16 changes: 15 additions & 1 deletion quasar_site/src/pages/DataType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,23 @@
</span>
</p>
<i v-for="(item, index) in inheritence" :key="item.name">
<i v-if="index === 0">inheritence: </i>
<i v-if="index === 0">Inheritence: </i>
<router-link v-if="item.link" class="routerlink" :to="baseUrl + item.link.toLowerCase()">{{ item.name
}}</router-link>
<i v-else>{{ item.name }}</i>
<q-icon name="arrow_forward" />
<i v-if="index === (inheritence.length - 1)">{{ name }}</i>
</i>
<br/>

<i>Derived Classes: </i>
<i v-for="(item, index) in derivedClasses" :key="item.name">

<router-link v-if="item.link" class="routerlink" :to="baseUrl + item.link.toLowerCase()">{{ item.name
}}</router-link>
<i v-else>{{ item.name }}</i>
<i v-if="index < (inheritence.length)">, </i>
</i>
<p v-if="namespace && dataType !== 'namespace'">
<i>Namespace: <router-link class="routerlink" :to="baseUrl + namespace.toLowerCase()">{{ namespace
}}</router-link></i>
Expand Down Expand Up @@ -149,6 +159,10 @@ export default {
const node = ViewModel.findNodeByPath(this.$route.params.datatype)
return ViewModel.getinheritence(node)
},
derivedClasses: function () {
const node = ViewModel.findNodeByPath(this.$route.params.datatype)
return ViewModel.getDerivedClasses(node)
},
memberSections: function () {
const item = ViewModel.findNodeByPath(this.$route.params.datatype)
Expand Down

0 comments on commit 74359da

Please sign in to comment.