Created XSLT Tooltips (#243)
Co-authored-by: widlam <mikolaj.widla@gmail.com> Reviewed-on: #243
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import xpathDiffs from '@/assets/tooltips/xpath/xpathdiffs.json';
|
||||
import { ref } from 'vue';
|
||||
import xsltDiffs from '@/assets/tooltips/xslt/xsltdiffs.json';
|
||||
import TooltipCategoryComponent from './TooltipCategoryComponent.vue';
|
||||
|
||||
const isEntryHidden = ref(true)
|
||||
|
||||
const props = defineProps({
|
||||
toolName: {type: String, required: true},
|
||||
toolVersion: {type: String, required: true}
|
||||
})
|
||||
|
||||
function getDiffEntry(toolVersion : String) : string[] {
|
||||
switch(toolVersion){
|
||||
if ( props.toolName == "xpath" ){
|
||||
switch(toolVersion){
|
||||
case "2.0" : {
|
||||
return xpathDiffs.VersionDiffs[0].diffs
|
||||
}
|
||||
@@ -17,32 +22,49 @@ function getDiffEntry(toolVersion : String) : string[] {
|
||||
return xpathDiffs.VersionDiffs[2].diffs
|
||||
}
|
||||
default: {
|
||||
return xpathDiffs.VersionDiffs[0].diffs
|
||||
return xpathDiffs.VersionDiffs[2].diffs
|
||||
}
|
||||
}
|
||||
} else if (props.toolName == "xslt") {
|
||||
return ["XSLT 2.0"].concat(xsltDiffs.VersionDiffs[0].diffs).concat(["XSLT 3.0"]).concat(xsltDiffs.VersionDiffs[1].diffs) ;
|
||||
} else{
|
||||
return ["foo"]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getInfo(num : number ){
|
||||
if(props.toolName == "xslt"){
|
||||
return xsltDiffs.universalInfo[num]
|
||||
} else{
|
||||
return xpathDiffs.universalInfo[num]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
toolName: {type: String, required: true},
|
||||
toolVersion: {type: String, required: true}
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
<TooltipCategoryComponent :name="xpathDiffs.universalInfo[0].category">
|
||||
<TooltipCategoryComponent :name="getInfo(0).category">
|
||||
<span class="text-center">
|
||||
{{ xpathDiffs.universalInfo[0].description }}
|
||||
{{ getInfo(0).description }}
|
||||
</span>
|
||||
</TooltipCategoryComponent>
|
||||
|
||||
<TooltipCategoryComponent v-if="toolVersion !== '1.0'" :name="'What\'s new in ' + toolName + ' ' + toolVersion ">
|
||||
<TooltipCategoryComponent v-if="toolVersion !== '1.0'" :name="getInfo(1).category">
|
||||
<span v-for=" diff in getDiffEntry(toolVersion)" v-bind:key="diff" class=" text-justify" >
|
||||
* {{ diff }}
|
||||
<div class="w-full h-4 text-center" v-if="diff.includes('XSLT')">
|
||||
------------ {{ diff }} ------------
|
||||
</div>
|
||||
<span v-else>
|
||||
* {{ diff }}
|
||||
</span>
|
||||
|
||||
</span>
|
||||
</TooltipCategoryComponent>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user