Skip to content

Ports tgui ticket panel from yogs #5906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 12, 2025

Conversation

adamsong
Copy link
Contributor

@adamsong adamsong commented Mar 12, 2025

About The Pull Request

Ports yogs tgui ticket panel, plus a little bit of the rest of yog's ticket system that the panel relies on.

Why It's Good For The Game

Having to constantly click refresh is annoying
image
image
image
image

Changelog

🆑
add: Added tgui ticket panel
/:cl:

@michaelyoungin
Copy link
Contributor

PELASE POOBERT I BEG OF YOU

@LikeLakers2
Copy link
Collaborator

LikeLakers2 commented Mar 12, 2025

Marking as awaiting admin review, as I assume they'd want to review it first.

@LikeLakers2 LikeLakers2 added Feature: enhancement New feature or request Approval: awaiting admin review PR is awaiting admin approval Code: TGUI Involves TGUI in some way, shape or form labels Mar 12, 2025
@@ -94,15 +94,15 @@
VALUES (:type, :target_ckey, :admin_ckey, :text, [timestamp? ":timestamp" : "Now()"], :server, INET_ATON(:internet_address), :port, :round_id, :secret, :expiry, :note_severity, (SELECT `minutes` FROM [format_table_name("role_time")] WHERE `ckey` = :target_ckey AND `job` = 'Living'))
"}, parameters)
var/pm = "[key_name(usr)] has created a [type][(type == "note" || type == "message" || type == "watchlist entry") ? " for [target_key]" : ""]: [text]"
var/header = "[key_name_admin(usr)] has created a [type][(type == "note" || type == "message" || type == "watchlist entry") ? " for [target_key]" : ""]"
var/header = "[usr.key] has created a [type][(type == "note" || type == "message" || type == "watchlist entry") ? " for [target_key]" : ""]"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't do this, as the use of key_name_admin gives more info (or inserts *no key* if there's no key attached, rather than simply leaving a blank space).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key_name_admin also adds html tags, which are then sanitized by tgui and displayed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use dangerouslySetInnerHTML or decodeHtmlEntities

Copy link
Collaborator

@LikeLakers2 LikeLakers2 Mar 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key_name_admin also adds html tags, which are then sanitized by tgui and displayed

Still, the way you have it leaves a blank space if there's no key attached - which can lead to confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can just do key_name, it does the same thing without the html tags

exportable_text += "[special_role_description]<br>"
exportable_text += ADMIN_FULLMONTY_NONAME(subject)

to_chat(src.owner, boxed_message(exportable_text), confidential = TRUE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would highly recommend commenting out these lines of code, instead of removing them. It makes porting efforts easier.

message_admins(msg)
var/msg = "[key_name(usr)] made [key_name(M)] drop everything!"
log_admin(msg)
message_admins("[key_name_admin(usr)] made [ADMIN_LOOKUPFLW(M)] drop everything!")
Copy link
Collaborator

@LikeLakers2 LikeLakers2 Mar 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you reordering lines here, and in so many other places too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes the code a bit better, log_admin and admin_ticket_log getting the same message, w/o html tags, and then message_admins gets the tags, so I needed to move the definition of msg above the log_admin

// dat += "</html>"

// usr << browse(dat.Join(), "window=ahelp[id];size=750x480")
// MONKESTATION EDIT END
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little tip: DM supports /* */ for block comments. It's much easier to just use that, than to prepend // onto every line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not that much easier than telling vs code to block comment, but I can see how it would make porting stuff easier, so I'll convert it to a block

@@ -808,7 +808,7 @@
message_admins("[key_name_admin(usr)] [msg] in [ADMIN_VERBOSEJMP(specificTarget)].")
if (length(whoDyin))
for (var/mob/living/M in whoDyin)
admin_ticket_log(M, "[key_name_admin(usr)] [msg]")
admin_ticket_log(M, msg)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't do this, as this removes the user who launched the pod from the log.

Copy link
Contributor Author

@adamsong adamsong Mar 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not at my computer rn, but I'm pretty sure I'm grabbing usr in the New of the ticket log. I will check when I can

Copy link
Collaborator

@LikeLakers2 LikeLakers2 Mar 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't necessarily be the same usr who's launching the pod, though...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

admin_ticket_log doesn't pass a ckey, so /datum/ticket_log/New will set the user variable to get_fancy_key(usr) which is the same usr variable this call was passing to key_name_admin

@@ -1141,20 +1141,20 @@
if("remove")
if(BP)
BP.drop_limb()
admin_ticket_log("[key_name_admin(usr)] has removed [src]'s [parse_zone(BP.body_zone)]")
admin_ticket_log("[key_name(usr)] has removed [src]'s [parse_zone(BP.body_zone)]")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we switching this from key_name_admin to key_name...?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could I recommend not changing the interface skin, and instead adding the "Tickets" button under the "Admin" tab, like we already have with "View Latest Ticket"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interface button is convenient and works for players and admins, much easier than finding a verb every time

Copy link
Collaborator

@LikeLakers2 LikeLakers2 Mar 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we already have a tab where ticket stuff can be found - where players and admins alike would expect it to be. There is no reason to put the new stuff in a different place.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with discord verification, the tickets tab will become even more empty and obsolete because we're yoinking interviews. I think the tickets button is a nice addition.

@tired-wired
Copy link
Collaborator

Looks all good from an admin perspective.

@tired-wired tired-wired added Approval: admin approved PR is approved by admins and removed Approval: awaiting admin review PR is awaiting admin approval labels Mar 22, 2025
@Absolucy Absolucy added Process: do not merge don't merge this ffs Process: should testmerge PR should be testmerged first labels Mar 23, 2025
@Absolucy
Copy link
Member

Absolucy commented Mar 23, 2025

marking as do not merge until the code's thoroughly gone over and approved.

it's okay to testmerge, tho

@github-actions github-actions bot added the Merge Conflict DO NOT RENAME THIS LABEL label Mar 27, 2025
@adamsong adamsong force-pushed the tgui-ticket-panel branch from ca7c87b to f30c516 Compare March 27, 2025 02:02
@github-actions github-actions bot added Merge Conflict DO NOT RENAME THIS LABEL and removed Merge Conflict DO NOT RENAME THIS LABEL labels Mar 27, 2025
@adamsong adamsong force-pushed the tgui-ticket-panel branch from cad5070 to 2fdcd12 Compare March 27, 2025 17:57
@github-actions github-actions bot removed the Merge Conflict DO NOT RENAME THIS LABEL label Mar 27, 2025
Comment on lines +233 to +246
if("Notes")
browse_messages(target_ckey = ticket.initiator_ckey)
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a ui act for notes but no button on the ui for it?

@flleeppyy
Copy link
Member

flleeppyy commented Mar 28, 2025

Admins would like to be able to see how long ago a ticket was opened like on the old panel
image

Admins would also like further clarification on the "Administer", perhaps a tooltip or a rename to "Claim" would be good

@flleeppyy
Copy link
Member

flleeppyy commented Mar 28, 2025

A quick guide for admins would be nice! Something like a question mark button in the top right of the window that sends something like:

<div class="boxed_message"><b>TGUI Ticket Panel</b><br><span class="notice">
The new ticket interface takes a new approach to tickets; getting rid of the old tickets tab and giving it a new home as a button in the top right corner of the interface. You'll no longer have to refresh tickets to update them, since TGUI does that for you.<br><br></span>
<b>Rundown</b>
<br>
<span class="notice">
There are now 3 tabs at the top that act as a filter, each with 3 collapsible categories. "All", "My Tickets", "Unclaimed" and 3 categorys; namely Active, closed and resolved. All are self-explanatory.<br>
Tickets can now be claimed by an admin by pressing "Administer" on tickets, so less stepping on toes.<br>
Each ticket now has a chatbox that updates <i>live</i> as messages are sent.<br>
The ticket controls are pretty much the same compared to classic tickets.
</span>

</div>

Can be achieved with

chatRenderer.processBatch([{html: `blahblah`}])

@BanementI
Copy link
Contributor

can we also have the ticket reply box be bigger? sometimes responses are long as hell and its annoying not being able to see the entire paragraph we gotta send

@adamsong adamsong force-pushed the tgui-ticket-panel branch from fb511db to d101862 Compare April 12, 2025 15:27
@Absolucy Absolucy merged commit 8e53da3 into Monkestation:master Apr 12, 2025
25 checks passed
@Absolucy Absolucy removed the Process: do not merge don't merge this ffs label Apr 12, 2025
github-actions bot added a commit that referenced this pull request Apr 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approval: admin approved PR is approved by admins Code: TGUI Involves TGUI in some way, shape or form Feature: enhancement New feature or request Process: should testmerge PR should be testmerged first
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants