Skip to content

Commit

Permalink
remove claim
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Oct 11, 2023
1 parent c94e3fc commit 64e7756
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions tgui/packages/tgui/interfaces/WorkingJoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,24 +870,20 @@ const AccessTickets = (props, context) => {
can_claim = 'No';
}
let can_update = 'Yes';
if (ticket.assignee !== logged_in) {
can_update = 'No';
} else if (ticket.lock_status === 'CLOSED') {
if (ticket.lock_status === 'CLOSED') {
can_update = 'No';
}
let view_status = 'Ticket is pending assignment.';
let view_icon = 'circle-question';
let update_tooltip = 'Update Access';
if (ticket.status === 'assigned') {
view_status = 'Ticket is assigned.';
view_icon = 'circle-plus';
update_tooltip = 'Grant Access';
} else if (ticket.status === 'rejected') {
let update_tooltip = 'Grant Access';
if (ticket.status === 'rejected') {
view_status = 'Ticket has been rejected.';
view_icon = 'circle-xmark';
update_tooltip = 'Ticket rejected. No further changes possible.';
} else if (ticket.status === 'cancelled') {
view_status = 'Ticket was cancelled by reporter.';
view_icon = 'circle-stop';
update_tooltip = 'Ticket cancelled. No further changes possible.';
} else if (ticket.status === 'granted') {
view_status = 'Access ticket has been granted.';
view_icon = 'circle-check';
Expand All @@ -906,10 +902,7 @@ const AccessTickets = (props, context) => {
if (can_update === 'No') {
can_reject = 'No';
}
if (ticket.status !== 'assigned') {
can_reject = 'No';
}
if (ticket.assignee !== logged_in) {
if (ticket.status !== 'pending') {
can_reject = 'No';
}

Expand All @@ -932,12 +925,6 @@ const AccessTickets = (props, context) => {
</Flex.Item>
<Flex.Item ml="1rem">
<Button icon={view_icon} tooltip={view_status} />
<Button.Confirm
icon="user-lock"
tooltip="Claim Ticket"
disabled={can_claim === 'No'}
onClick={() => act('claim_ticket', { ticket: ticket.ref })}
/>
<Button.Confirm
icon="user-gear"
tooltip={update_tooltip}
Expand Down

0 comments on commit 64e7756

Please sign in to comment.