mirror of
https://codeberg.org/vlw/freshdesk-filters.git
synced 2025-11-04 23:22:42 +01:00
Compare commits
No commits in common. "bc577168a99209cbe4e4de37e0e4bed7bd89d99c" and "d0563e1edb12ff5f6acd90da91652145db124067" have entirely different histories.
bc577168a9
...
d0563e1edb
6 changed files with 8 additions and 43 deletions
|
|
@ -13,17 +13,14 @@ This extension provides the following functionality:
|
|||
### Open ticket by clicking the whole table column
|
||||
Tickets can be opened by clicking anywhere inside the subject column, not just on the link itself.
|
||||
|
||||
### (Optional) Agent name(s)
|
||||
Current agent name or names can be defined explicitly or with a regular expression.
|
||||
|
||||
### (Optional) Open ticket in a new tab
|
||||
Open tickets in a new tab instead of navigating to the ticket directly.
|
||||
|
||||
### (Optional) Dim tickets not assigned to current agent(s)
|
||||
Tickets not assigned to the current agent(s) will be dimmed.
|
||||
### (Optional) Dim tickets not assigned to current agent
|
||||
Tickets not assigned to the current agent will be dimmed.
|
||||
|
||||
### (Optional) Move tickets assigned to current agent to the top
|
||||
> [!WARNING]
|
||||
> This feature is kind of broken at the moment.
|
||||
|
||||
Tickets assigned to the current agent(s) will be placed at the top of the tickets table.
|
||||
Tickets assigned to the current agent will be placed at the top of the tickets table.
|
||||
|
|
@ -9,10 +9,4 @@ body {
|
|||
label {
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
form {
|
||||
hr {
|
||||
opacity: .1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -19,10 +19,6 @@ document.querySelectorAll("input").forEach(async inputElement => {
|
|||
// Fetch setting value from browser storage by input field name
|
||||
const value = (await chrome.storage.sync.get([inputElement.name]))[inputElement.name];
|
||||
|
||||
if (!value) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (inputElement.type) {
|
||||
case "checkbox":
|
||||
return inputElement.checked = value === "true";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ const CONFIG = {
|
|||
AGENT_NAME : "agent_name",
|
||||
DIM_NOT_ASSIGNED : "is_dim_not_assigned",
|
||||
OPEN_TICKET_NEW_TAB : "is_open_ticket_new_tab",
|
||||
AGENT_NAME_REGEX : "is_agent_name_regex",
|
||||
MOVE_ASSIGNED_TO_TOP : "is_move_assigned_to_top",
|
||||
|
||||
// Resolve config value
|
||||
|
|
@ -132,16 +131,9 @@ class FreshdeskFilters {
|
|||
// Dim tickets not assigned to this agent is enabled
|
||||
if (await CONFIG.get(CONFIG.DIM_NOT_ASSIGNED) === "true") {
|
||||
tableRowElement.classList.remove(CLASSNAME.DIM_NOT_ASSIGNED);
|
||||
|
||||
// Check if this ticket is assigned to this agent
|
||||
const isCurrentAgent = await CONFIG.get(CONFIG.AGENT_NAME_REGEX) !== "true"
|
||||
// An agent name is explicitly defined
|
||||
? ticketAgentName === agentName
|
||||
// Agent name(s) are defined with RegEx
|
||||
: new RegExp(agentName).test(ticketAgentName);
|
||||
|
||||
// This ticket is not assigned to this agent
|
||||
if (!isCurrentAgent && ticketAgentName !== AGENT_UNASSIGNED) {
|
||||
if (ticketAgentName !== AGENT_UNASSIGNED && ticketAgentName !== agentName) {
|
||||
tableRowElement.classList.add(CLASSNAME.DIM_NOT_ASSIGNED);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"action": {
|
||||
"default_popup": "popup.html"
|
||||
},
|
||||
"version": "0.2.0",
|
||||
"version": "0.1.0",
|
||||
"description": "Adds additional filtering and display options to Freshdesk tickets",
|
||||
"homepage_url": "https://codeberg.org/vlw/freshdesk-filters",
|
||||
"permissions": ["storage"],
|
||||
|
|
|
|||
|
|
@ -20,27 +20,13 @@
|
|||
<h5>My name</h5>
|
||||
<input type="text" name="agent_name" placeholder="Nisse Hult">
|
||||
</label>
|
||||
<label class="my-1">
|
||||
<input type="checkbox" name="is_agent_name_regex">
|
||||
Use Regular Expression
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row my-2 g-3">
|
||||
<div>
|
||||
<label class="my-1">
|
||||
<input type="checkbox" name="is_open_ticket_new_tab">
|
||||
Open tickets in a new tab
|
||||
</label>
|
||||
<label class="my-1">
|
||||
<input type="checkbox" name="is_dim_not_assigned">
|
||||
Dim tickets that are not assigned to me
|
||||
</label>
|
||||
<label class="my-1">
|
||||
<input type="checkbox" name="is_move_assigned_to_top">
|
||||
Move tickets assigned to me to the top
|
||||
</label>
|
||||
<label class="my-1"><input type="checkbox" name="is_open_ticket_new_tab">Open tickets in a new tab</label>
|
||||
<label class="my-1"><input type="checkbox" name="is_dim_not_assigned">Dim tickets that are not assigned to me</label>
|
||||
<label class="my-1"><input type="checkbox" name="is_move_assigned_to_top">Move tickets assigned to me to the top</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue