MCPcopy Create free account
hub / github.com/pydio/cells / loadEdges

Method loadEdges

cmd/ctl.go:250–274  ·  view source on GitHub ↗
(source registry.Item, oo ...registry.Option)

Source from the content-addressed store, hash-verified

248}
249
250func (m *model) loadEdges(source registry.Item, oo ...registry.Option) {
251 if m.reg == nil {
252 return
253 }
254 m.edges = []item{}
255 if source == nil {
256 m.updateList(m.edgesList, m.edges, m.currentEdge)
257 return
258 }
259 for n, t := range pb.ItemType_value {
260 if n != "EDGE" && n != "ALL" {
261 oo = append(oo, registry.WithType(pb.ItemType(t)))
262 }
263 }
264 // m.currentEdge = 0
265 for _, i := range m.reg.ListAdjacentItems(
266 registry.WithAdjacentSourceItems([]registry.Item{source}),
267 registry.WithAdjacentTargetOptions(oo...),
268 ) {
269 eType := util.DetectType(i)
270 m.edges = append(m.edges, item{ri: i, main: i.Name(), secondary: eType.String() + " - " + i.ID(), it: eType})
271 sort.Sort(itemsByType(m.edges))
272 }
273 m.updateList(m.edgesList, m.edges, m.currentEdge)
274}
275
276func (m *model) itemsChanged(index int) {
277 // sel := m.items[index]

Callers 1

itemsChangedMethod · 0.95

Calls 10

updateListMethod · 0.95
WithTypeFunction · 0.92
WithAdjacentSourceItemsFunction · 0.92
DetectTypeFunction · 0.92
itemsByTypeTypeAlias · 0.85
ListAdjacentItemsMethod · 0.65
NameMethod · 0.65
StringMethod · 0.65
IDMethod · 0.65

Tested by

no test coverage detected