add category hints from methodlist
This commit is contained in:
parent
78eaef1c61
commit
0b0915a457
|
@ -763,8 +763,9 @@ class CCPMethodEditorController extends HTMLElement{
|
|||
}
|
||||
|
||||
renderCategoryHints(){
|
||||
const cats1 = ["Uncategorized", this.getCurrentCategory()]
|
||||
const cats = [...new Set(cats1)]
|
||||
const s = new Set(["Uncategorized", this.getCurrentCategory()])
|
||||
const ml = document.querySelector("d4s-ccp-methodlist")
|
||||
const cats = ml ? [...s].concat(ml.getCategoryHints()) : [...s]
|
||||
return `
|
||||
<datalist id="categoryhints">
|
||||
${cats.map(c=>`<option value="${c}">${c}</option>`)}
|
||||
|
|
|
@ -195,6 +195,15 @@ class CCPMethodList extends HTMLElement{
|
|||
}, {})
|
||||
}
|
||||
|
||||
getCategoryHints(){
|
||||
const s = new Set()
|
||||
for(let i=0; i < this.#data.length; i++){
|
||||
const cat = m.metadata.filter(md=>md.role === "category").map(md=>md.title)
|
||||
s.add(cat)
|
||||
}
|
||||
return [...s]
|
||||
}
|
||||
|
||||
exportCategory(category){
|
||||
Promise.all(
|
||||
this.#filtered[category].map(m=>this.exportMethod(m.id))
|
||||
|
|
Loading…
Reference in New Issue