Commit a4eb85d 1 parent bf7727f commit a4eb85d Copy full SHA for a4eb85d
File tree 1 file changed +11
-2
lines changed
lua/telescope/_extensions/glpi
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,10 @@ local function get_tickets()
17
17
local function extract_ticket (t )
18
18
for _ , ticket in ipairs (t ) do
19
19
local id = ticket [" 2" ]
20
- local name = ticket [" 1" ] .. " (" .. ticket [" 4" ] .. " )"
20
+ local techs = ticket [" 5" ]
21
+ local techs_name = type (techs ) == " table" and table.concat (techs , " " ) or techs
22
+
23
+ local name = ticket [" 1" ] .. " (" .. ticket [" 4" ] .. " ) users: " .. techs_name
21
24
tickets [name ] = id
22
25
end
23
26
end
@@ -40,14 +43,20 @@ return function()
40
43
prompt_title = " Tickets en attente" ,
41
44
finder = finders .new_table ({
42
45
results = get_tickets (),
46
+ entry_maker = function (entry )
47
+ return {
48
+ ordinal = entry ,
49
+ display = entry :gsub (" users: .*$" , " " ),
50
+ }
51
+ end ,
43
52
}),
44
53
sorter = conf .generic_sorter (),
45
54
attach_mappings = function (prompt_bufnr , _ )
46
55
actions .select_default :replace (function ()
47
56
actions .close (prompt_bufnr )
48
57
49
58
local selection = state .get_selected_entry ()
50
- local ticket_id = tickets [selection [ 1 ] ]
59
+ local ticket_id = tickets [selection . ordinal ]
51
60
local ticket = api .get_ticket_id (ticket_id )
52
61
glpi .load_tickets ()
53
62
glpi .load_ticket (ticket )
You can’t perform that action at this time.
0 commit comments