No Sign Out option for user in Help Center

답변함

19 댓글

  • Ifra Saqlain
    Community Moderator
    Zendesk Luminary
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Hey Donna,

    Follow the below steps -

    1). Go to the header.hbs file.

     

    2). Find the code, see the given screenshot , your code would be written like this -

     

    For copy and paste - if something missing then you can copy the below code and replace it with your code.

    {{#if signed_in}}
    <div class="user-info dropdown">
    <button class="dropdown-toggle" aria-haspopup="true">
    {{user_avatar class="user-avatar"}}
    <span class="hide-on-mobile">
    {{user_name}}
    <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" focusable="false" viewBox="0 0 12 12" class="dropdown-chevron-icon" aria-hidden="true">
    <path fill="none" stroke="currentColor" stroke-linecap="round" d="M3 4.5l2.6 2.6c.2.2.5.2.7 0L9 4.5"/>
    </svg>
    </span>
    </button>
    <div class="dropdown-menu" role="menu">
    {{link "my_activities" role="menuitem"}}
    {{my_profile role="menuitem"}}
    {{change_password role="menuitem"}}
    {{link "sign_out" role="menuitem"}}
    </div>
    </div>
    {{else}}
    {{#link "sign_in" class="sign-in"}}
    {{t 'sign_in'}}
    {{/link}}
    {{/if}}

     

    3). That code is for User Info

     

    4). Close preview mode of your theme showing like this on preview mode at the header area.

     

    Click on your name and see the output-

     

     

    Still not showing then you can share the public URL of your Help Centre I'll figure out what's the issue :), but your buggy theme set as live, so I can see here.

     

     

    Thanks

    Team Diziana

     

     

     

    0
  • Ifra Saqlain
    Community Moderator
    Zendesk Luminary
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Or maybe the dropdown is hiding due to any CSS code.

    0
  • Donna Fairhurst

    Thank you. Copied what you shared.

    Portal Theme is currently live and this is where I am having issues: https://gradecam.zendesk.com/hc/en-us

    Allows me to sign in but not out:

     

    Also - in the preview you will see 4 categories on the preview but when it is live it only shows 3 categories like above

     

    thank you for your help in this.

    ~Donna

    0
  • Ifra Saqlain
    Community Moderator
    Zendesk Luminary
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Hi Donna, that's because your jQuery is bugging your dropdown. I think you didn't add jQuery CDN in head tag that's why the error is 'en-us:141 Uncaught ReferenceError: $ is not defined'.

     

     

    First of all, add the CDN of jQuery. Go to the document_head.hbs file and add the given CDN.

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

     

    Screenshot for the same:

    If you have already multiple files added in the document_head.hbs file then add the CDN at the end of <link .....> stylesheet CDN like in the given screenshot because the JS loads after the CSS.

    See, you have all options in the dropdown but due to jQuery bug that's not showing.

     

     

     

     

    Your second question's answer is, your fourth category have articles those are not set view permission as Everyone that's why the category is hiding on end user.

     

    Go to your articles of that buggy category and set all articles as  Everyone.

     

    Otherwise, create a demo category, and then demo section under that category and then create a demo article under that section and set that view permission Everyone.

    Test that on homepage if that's showing on end user then figure out what's the reason.

    https://support.zendesk.com/hc/en-us/articles/226941067-Why-aren-t-categories-and-sections-visible-to-customers-

     

    Thanks

     

     

    0
  • Donna Fairhurst

    This is what I am seeing in the console - I can't get the dropdown to show to log out.

    Thanks,

    ~Donna

    0
  • Ifra Saqlain
    Community Moderator
    Zendesk Luminary
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Hi Donna,

    Your script code needs closing DOM function. You have missed a closing bracket in your script file.

     

    Add the closing bracket at the end of all code  -  });

    See in the screenshot, I have added - line no. 405

    0
  • Donna Fairhurst

    Thank you - I can sign out now but as you can see - what in the world is going on when a user signs out?  And when I sign out as an end user, I still only see 3 categories.  I have checked all articles and made demo articles for the GradeCam Admin Support Tutorials but not finding the error.

    See video of what happens when I sign out - which now doesn't allow me to sign back in - I do have the sign in redirecting right to the activities so that may be messing things up:

    https://drive.google.com/file/d/1W2wxv99sADORo3LNt4D16y_F73WzoHZ8/view

    ~Donna

    0
  • Ifra Saqlain
    Community Moderator
    Zendesk Luminary
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Donna, I tried it to figure out but can't sign in and having problem. Can you share he credential of your Help centre on my gmail id (ifrasaqlain@gmail.com) so I can figure out what's going wrong and share the solution here.

    I have seen your script code via page source and your script code is fine now. 

    I am damn sure something is going wrong in the theme because when I open the HC theme previously , I haven't seeing this loading bug.

     

    0
  • Donna Fairhurst

    Oh I am sure I have messed something up haha

    How do I share the credential to you?  

    ~Donna

    0
  • Ifra Saqlain
    Community Moderator
    Zendesk Luminary
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Username and password, which you use to sign in your help centre workbench, share to ifrasaqlain@gmail.com

     

    workbench screenshot which you login:

    0
  • Ifra Saqlain
    Community Moderator
    Zendesk Luminary
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    See, you have write the custom code in wrong function.

    Your current code is (at the end):

     

     

    It should be like this:

    0
  • Joshua

    Thank you for the thorough assistance on this problem, Ifra! It was very helpful to see your debugging process.

    I found this ticket while encountering the same problem. Turns out the root of my issue was slightly different though. According to the official documentation, the sign out link is hidden in preview mode. Consequently, I never saw it while testing my code. I'm not sure why it is this way, but have made a Community Feedback post to understand/see if it can be changed!

    Link to Community post

    0
  • Ifra Saqlain
    Community Moderator
    Zendesk Luminary
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Thank you for the thorough assistance on this problem, Ifra! It was very helpful to see your debugging process.

    Thanks :)

    0
  • David Jetter

    Ifra Saqlain you have been very helpful in the past! i'm seeing something similar where users cannot even get a drop down when they click on their name in the top right and cannot see options to view their requests or to sign out, yet I think I have everything enabled to allow them to see it. Can you help? mcasupport.kw.com

    0
  • Ifra Saqlain
    Community Moderator
    Zendesk Luminary
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Hi David,

    You missed the closing brackets, I'm attaching the screenshot you can see there and fix in your code.

    Line no. 82, where I added closing brackets but you missed that --

     

     

    Try and let me know it works or not :)

     

    0
  • David Jetter

    Ifra Saqlain I was able to add it, but the drop down still does not appear. I can sign in no problem, but then nothing appears when clicking on my name when I would expect to see sign out, my requests, etc.

    Thank you for checking into this and helping!

    0
  • Ifra Saqlain
    Community Moderator
    Zendesk Luminary
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Okay I checked out the code of script.js file, you need to open Copenhagen theme and copy paste the default code and then add your custom js code at the end of script.js file, your issue will be solve automatically.

    OR

    You can replace your code with the given code which I have fixed for you.

    (function () {
      'use strict';

      // Key map
      const ENTER = 13;
      const ESCAPE = 27;

      function toggleNavigation(toggle, menu) {
        const isExpanded = menu.getAttribute("aria-expanded") === "true";
        menu.setAttribute("aria-expanded", !isExpanded);
        toggle.setAttribute("aria-expanded", !isExpanded);
      }

      function closeNavigation(toggle, menu) {
        menu.setAttribute("aria-expanded", false);
        toggle.setAttribute("aria-expanded", false);
        toggle.focus();
      }

      // Navigation

      window.addEventListener("DOMContentLoaded", () => {
        const menuButton = document.querySelector(".header .menu-button-mobile");
        const menuList = document.querySelector("#user-nav-mobile");

        menuButton.addEventListener("click", (event) => {
          event.stopPropagation();
          toggleNavigation(menuButton, menuList);
        });

        menuList.addEventListener("keyup", (event) => {
          if (event.keyCode === ESCAPE) {
            event.stopPropagation();
            closeNavigation(menuButton, menuList);
          }
        });

        // Toggles expanded aria to collapsible elements
        const collapsible = document.querySelectorAll(
          ".collapsible-nav, .collapsible-sidebar"
        );

        collapsible.forEach((element) => {
          const toggle = element.querySelector(
            ".collapsible-nav-toggle, .collapsible-sidebar-toggle"
          );

          element.addEventListener("click", () => {
            toggleNavigation(toggle, element);
          });

          element.addEventListener("keyup", (event) => {
            console.log("escape");
            if (event.keyCode === ESCAPE) {
              closeNavigation(toggle, element);
            }
          });
        });

        // If multibrand search has more than 5 help centers or categories collapse the list
        const multibrandFilterLists = document.querySelectorAll(
          ".multibrand-filter-list"
        );
        multibrandFilterLists.forEach((filter) => {
          if (filter.children.length > 6) {
            // Display the show more button
            const trigger = filter.querySelector(".see-all-filters");
            trigger.setAttribute("aria-hidden", false);

            // Add event handler for click
            trigger.addEventListener("click", (event) => {
              event.stopPropagation();
              trigger.parentNode.removeChild(trigger);
              filter.classList.remove("multibrand-filter-list--collapsed");
            });
          }
        });
      });

      const isPrintableChar = (str) => {
        return str.length === 1 && str.match(/^\S$/);
      };

      function Dropdown(toggle, menu) {
        this.toggle = toggle;
        this.menu = menu;

        this.menuPlacement = {
          top: menu.classList.contains("dropdown-menu-top"),
          end: menu.classList.contains("dropdown-menu-end"),
        };

        this.toggle.addEventListener("click", this.clickHandler.bind(this));
        this.toggle.addEventListener("keydown", this.toggleKeyHandler.bind(this));
        this.menu.addEventListener("keydown", this.menuKeyHandler.bind(this));
        document.body.addEventListener("click", this.outsideClickHandler.bind(this));

        const toggleId = this.toggle.getAttribute("id") || crypto.randomUUID();
        const menuId = this.menu.getAttribute("id") || crypto.randomUUID();

        this.toggle.setAttribute("id", toggleId);
        this.menu.setAttribute("id", menuId);

        this.toggle.setAttribute("aria-controls", menuId);
        this.menu.setAttribute("aria-labelledby", toggleId);

        this.menu.setAttribute("tabindex", -1);
        this.menuItems.forEach((menuItem) => {
          menuItem.tabIndex = -1;
        });

        this.focusedIndex = -1;
      }

      Dropdown.prototype = {
        get isExpanded() {
          return this.toggle.getAttribute("aria-expanded") === "true";
        },

        get menuItems() {
          return Array.prototype.slice.call(
            this.menu.querySelectorAll("[role='menuitem'], [role='menuitemradio']")
          );
        },

        dismiss: function () {
          if (!this.isExpanded) return;

          this.toggle.removeAttribute("aria-expanded");
          this.menu.classList.remove("dropdown-menu-end", "dropdown-menu-top");
          this.focusedIndex = -1;
        },

        open: function () {
          if (this.isExpanded) return;

          this.toggle.setAttribute("aria-expanded", true);
          this.handleOverflow();
        },

        handleOverflow: function () {
          var rect = this.menu.getBoundingClientRect();

          var overflow = {
            right: rect.left < 0 || rect.left + rect.width > window.innerWidth,
            bottom: rect.top < 0 || rect.top + rect.height > window.innerHeight,
          };

          if (overflow.right || this.menuPlacement.end) {
            this.menu.classList.add("dropdown-menu-end");
          }

          if (overflow.bottom || this.menuPlacement.top) {
            this.menu.classList.add("dropdown-menu-top");
          }

          if (this.menu.getBoundingClientRect().top < 0) {
            this.menu.classList.remove("dropdown-menu-top");
          }
        },

        focusByIndex: function (index) {
          if (!this.menuItems.length) return;

          this.menuItems.forEach((item, itemIndex) => {
            if (itemIndex === index) {
              item.tabIndex = 0;
              item.focus();
            } else {
              item.tabIndex = -1;
            }
          });

          this.focusedIndex = index;
        },

        focusFirstMenuItem: function () {
          this.focusByIndex(0);
        },

        focusLastMenuItem: function () {
          this.focusByIndex(this.menuItems.length - 1);
        },

        focusNextMenuItem: function (currentItem) {
          if (!this.menuItems.length) return;

          const currentIndex = this.menuItems.indexOf(currentItem);
          const nextIndex = (currentIndex + 1) % this.menuItems.length;

          this.focusByIndex(nextIndex);
        },

        focusPreviousMenuItem: function (currentItem) {
          if (!this.menuItems.length) return;

          const currentIndex = this.menuItems.indexOf(currentItem);
          const previousIndex =
            currentIndex <= 0 ? this.menuItems.length - 1 : currentIndex - 1;

          this.focusByIndex(previousIndex);
        },

        focusByChar: function (currentItem, char) {
          char = char.toLowerCase();

          const itemChars = this.menuItems.map((menuItem) =>
            menuItem.textContent.trim()[0].toLowerCase()
          );

          const startIndex =
            (this.menuItems.indexOf(currentItem) + 1) % this.menuItems.length;

          // look up starting from current index
          let index = itemChars.indexOf(char, startIndex);

          // if not found, start from start
          if (index === -1) {
            index = itemChars.indexOf(char, 0);
          }

          if (index > -1) {
            this.focusByIndex(index);
          }
        },

        outsideClickHandler: function (e) {
          if (
            this.isExpanded &&
            !this.toggle.contains(e.target) &&
            !e.composedPath().includes(this.menu)
          ) {
            this.dismiss();
            this.toggle.focus();
          }
        },

        clickHandler: function (event) {
          event.stopPropagation();
          event.preventDefault();

          if (this.isExpanded) {
            this.dismiss();
            this.toggle.focus();
          } else {
            this.open();
            this.focusFirstMenuItem();
          }
        },

        toggleKeyHandler: function (e) {
          const key = e.key;

          switch (key) {
            case "Enter":
            case " ":
            case "ArrowDown":
            case "Down": {
              e.stopPropagation();
              e.preventDefault();

              this.open();
              this.focusFirstMenuItem();
              break;
            }
            case "ArrowUp":
            case "Up": {
              e.stopPropagation();
              e.preventDefault();

              this.open();
              this.focusLastMenuItem();
              break;
            }
            case "Esc":
            case "Escape": {
              e.stopPropagation();
              e.preventDefault();

              this.dismiss();
              this.toggle.focus();
              break;
            }
          }
        },

        menuKeyHandler: function (e) {
          const key = e.key;
          const currentElement = this.menuItems[this.focusedIndex];

          if (e.ctrlKey || e.altKey || e.metaKey) {
            return;
          }

          switch (key) {
            case "Esc":
            case "Escape": {
              e.stopPropagation();
              e.preventDefault();

              this.dismiss();
              this.toggle.focus();
              break;
            }
            case "ArrowDown":
            case "Down": {
              e.stopPropagation();
              e.preventDefault();

              this.focusNextMenuItem(currentElement);
              break;
            }
            case "ArrowUp":
            case "Up": {
              e.stopPropagation();
              e.preventDefault();
              this.focusPreviousMenuItem(currentElement);
              break;
            }
            case "Home":
            case "PageUp": {
              e.stopPropagation();
              e.preventDefault();
              this.focusFirstMenuItem();
              break;
            }
            case "End":
            case "PageDown": {
              e.stopPropagation();
              e.preventDefault();
              this.focusLastMenuItem();
              break;
            }
            case "Tab": {
              if (e.shiftKey) {
                e.stopPropagation();
                e.preventDefault();
                this.dismiss();
                this.toggle.focus();
              } else {
                this.dismiss();
              }
              break;
            }
            default: {
              if (isPrintableChar(key)) {
                e.stopPropagation();
                e.preventDefault();
                this.focusByChar(currentElement, key);
              }
            }
          }
        },
      };

      // Drodowns

      window.addEventListener("DOMContentLoaded", () => {
        const dropdowns = [];
        const dropdownToggles = document.querySelectorAll(".dropdown-toggle");

        dropdownToggles.forEach((toggle) => {
          const menu = toggle.nextElementSibling;
          if (menu && menu.classList.contains("dropdown-menu")) {
            dropdowns.push(new Dropdown(toggle, menu));
          }
        });
      });

      // Share

      window.addEventListener("DOMContentLoaded", () => {
        const links = document.querySelectorAll(".share a");
        links.forEach((anchor) => {
          anchor.addEventListener("click", (event) => {
            event.preventDefault();
            window.open(anchor.href, "", "height = 500, width = 500");
          });
        });
      });

      // Vanilla JS debounce function, by Josh W. Comeau:
      // https://www.joshwcomeau.com/snippets/javascript/debounce/
      function debounce(callback, wait) {
        let timeoutId = null;
        return (...args) => {
          window.clearTimeout(timeoutId);
          timeoutId = window.setTimeout(() => {
            callback.apply(null, args);
          }, wait);
        };
      }

      // Define variables for search field
      let searchFormFilledClassName = "search-has-value";
      let searchFormSelector = "form[role='search']";

      // Clear the search input, and then return focus to it
      function clearSearchInput(event) {
        event.target
          .closest(searchFormSelector)
          .classList.remove(searchFormFilledClassName);

        let input;
        if (event.target.tagName === "INPUT") {
          input = event.target;
        } else if (event.target.tagName === "BUTTON") {
          input = event.target.previousElementSibling;
        } else {
          input = event.target.closest("button").previousElementSibling;
        }
        input.value = "";
        input.focus();
      }

      // Have the search input and clear button respond
      // when someone presses the escape key, per:
      // https://twitter.com/adambsilver/status/1152452833234554880
      function clearSearchInputOnKeypress(event) {
        const searchInputDeleteKeys = ["Delete", "Escape"];
        if (searchInputDeleteKeys.includes(event.key)) {
          clearSearchInput(event);
        }
      }

      // Create an HTML button that all users -- especially keyboard users --
      // can interact with, to clear the search input.
      // To learn more about this, see:
      // https://adrianroselli.com/2019/07/ignore-typesearch.html#Delete
      // https://www.scottohara.me/blog/2022/02/19/custom-clear-buttons.html
      function buildClearSearchButton(inputId) {
        const button = document.createElement("button");
        button.setAttribute("type", "button");
        button.setAttribute("aria-controls", inputId);
        button.classList.add("clear-button");
        const buttonLabel = window.searchClearButtonLabelLocalized;
        const icon = `<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' focusable='false' role='img' viewBox='0 0 12 12' aria-label='${buttonLabel}'><path stroke='currentColor' stroke-linecap='round' stroke-width='2' d='M3 9l6-6m0 6L3 3'/></svg>`;
        button.innerHTML = icon;
        button.addEventListener("click", clearSearchInput);
        button.addEventListener("keyup", clearSearchInputOnKeypress);
        return button;
      }

      // Append the clear button to the search form
      function appendClearSearchButton(input, form) {
        const searchClearButton = buildClearSearchButton(input.id);
        form.append(searchClearButton);
        if (input.value.length > 0) {
          form.classList.add(searchFormFilledClassName);
        }
      }

      // Add a class to the search form when the input has a value;
      // Remove that class from the search form when the input doesn't have a value.
      // Do this on a delay, rather than on every keystroke.
      const toggleClearSearchButtonAvailability = debounce((event) => {
        const form = event.target.closest(searchFormSelector);
        form.classList.toggle(
          searchFormFilledClassName,
          event.target.value.length > 0
        );
      }, 200);

      // Search

      window.addEventListener("DOMContentLoaded", () => {
        // Set up clear functionality for the search field
        const searchForms = [...document.querySelectorAll(searchFormSelector)];
        const searchInputs = searchForms.map((form) =>
          form.querySelector("input[type='search']")
        );
        searchInputs.forEach((input) => {
          appendClearSearchButton(input, input.closest(searchFormSelector));
          input.addEventListener("keyup", clearSearchInputOnKeypress);
          input.addEventListener("keyup", toggleClearSearchButtonAvailability);
        });
      });

      const key = "returnFocusTo";

      function saveFocus() {
        const activeElementId = document.activeElement.getAttribute("id");
        sessionStorage.setItem(key, "#" + activeElementId);
      }

      function returnFocus() {
        const returnFocusTo = sessionStorage.getItem(key);
        if (returnFocusTo) {
          sessionStorage.removeItem("returnFocusTo");
          const returnFocusToEl = document.querySelector(returnFocusTo);
          returnFocusToEl && returnFocusToEl.focus && returnFocusToEl.focus();
        }
      }

      // Forms

      window.addEventListener("DOMContentLoaded", () => {
        // In some cases we should preserve focus after page reload
        returnFocus();

        // show form controls when the textarea receives focus or back button is used and value exists
        const commentContainerTextarea = document.querySelector(
          ".comment-container textarea"
        );
        const commentContainerFormControls = document.querySelector(
          ".comment-form-controls, .comment-ccs"
        );

        if (commentContainerTextarea) {
          commentContainerTextarea.addEventListener(
            "focus",
            function focusCommentContainerTextarea() {
              commentContainerFormControls.style.display = "block";
              commentContainerTextarea.removeEventListener(
                "focus",
                focusCommentContainerTextarea
              );
            }
          );

          if (commentContainerTextarea.value !== "") {
            commentContainerFormControls.style.display = "block";
          }
        }

        // Expand Request comment form when Add to conversation is clicked
        const showRequestCommentContainerTrigger = document.querySelector(
          ".request-container .comment-container .comment-show-container"
        );
        const requestCommentFields = document.querySelectorAll(
          ".request-container .comment-container .comment-fields"
        );
        const requestCommentSubmit = document.querySelector(
          ".request-container .comment-container .request-submit-comment"
        );

        if (showRequestCommentContainerTrigger) {
          showRequestCommentContainerTrigger.addEventListener("click", () => {
            showRequestCommentContainerTrigger.style.display = "none";
            Array.prototype.forEach.call(requestCommentFields, (element) => {
              element.style.display = "block";
            });
            requestCommentSubmit.style.display = "inline-block";

            if (commentContainerTextarea) {
              commentContainerTextarea.focus();
            }
          });
        }

        // Mark as solved button
        const requestMarkAsSolvedButton = document.querySelector(
          ".request-container .mark-as-solved:not([data-disabled])"
        );
        const requestMarkAsSolvedCheckbox = document.querySelector(
          ".request-container .comment-container input[type=checkbox]"
        );
        const requestCommentSubmitButton = document.querySelector(
          ".request-container .comment-container input[type=submit]"
        );

        if (requestMarkAsSolvedButton) {
          requestMarkAsSolvedButton.addEventListener("click", () => {
            requestMarkAsSolvedCheckbox.setAttribute("checked", true);
            requestCommentSubmitButton.disabled = true;
            requestMarkAsSolvedButton.setAttribute("data-disabled", true);
            requestMarkAsSolvedButton.form.submit();
          });
        }

        // Change Mark as solved text according to whether comment is filled
        const requestCommentTextarea = document.querySelector(
          ".request-container .comment-container textarea"
        );

        const usesWysiwyg =
          requestCommentTextarea &&
          requestCommentTextarea.dataset.helper === "wysiwyg";

        function isEmptyPlaintext(s) {
          return s.trim() === "";
        }

        function isEmptyHtml(xml) {
          const doc = new DOMParser().parseFromString(`<_>${xml}</_>`, "text/xml");
          const img = doc.querySelector("img");
          return img === null && isEmptyPlaintext(doc.children[0].textContent);
        }

        const isEmpty = usesWysiwyg ? isEmptyHtml : isEmptyPlaintext;

        if (requestCommentTextarea) {
          requestCommentTextarea.addEventListener("input", () => {
            if (isEmpty(requestCommentTextarea.value)) {
              if (requestMarkAsSolvedButton) {
                requestMarkAsSolvedButton.innerText =
                  requestMarkAsSolvedButton.getAttribute("data-solve-translation");
              }
            } else {
              if (requestMarkAsSolvedButton) {
                requestMarkAsSolvedButton.innerText =
                  requestMarkAsSolvedButton.getAttribute(
                    "data-solve-and-submit-translation"
                  );
              }
            }
          });
        }

        const selects = document.querySelectorAll(
          "#request-status-select, #request-organization-select"
        );

        selects.forEach((element) => {
          element.addEventListener("change", (event) => {
            event.stopPropagation();
            saveFocus();
            element.form.submit();
          });
        });

        // Submit requests filter form on search in the request list page
        const quickSearch = document.querySelector("#quick-search");
        if (quickSearch) {
          quickSearch.addEventListener("keyup", (event) => {
            if (event.keyCode === ENTER) {
              event.stopPropagation();
              saveFocus();
              quickSearch.form.submit();
            }
          });
        }

        // Submit organization form in the request page
        const requestOrganisationSelect = document.querySelector(
          "#request-organization select"
        );

        if (requestOrganisationSelect) {
          requestOrganisationSelect.addEventListener("change", () => {
            requestOrganisationSelect.form.submit();
          });

          requestOrganisationSelect.addEventListener("click", (e) => {
            // Prevents Ticket details collapsible-sidebar to close on mobile
            e.stopPropagation();
          });
        }

        // If there are any error notifications below an input field, focus that field
        const notificationElm = document.querySelector(".notification-error");
        if (
          notificationElm &&
          notificationElm.previousElementSibling &&
          typeof notificationElm.previousElementSibling.focus === "function"
        ) {
          notificationElm.previousElementSibling.focus();
        }
      });

    })();

    $(document).ready(function() {
      if ($('.blocks-item > a > span:contains("Agent Answers")')) {
         $(".blocks-item > a").attr("href", "https:answers.kw.com");
      }
    });

    window.hcm = {};
    function hcmanager(account_key, dataset_id, domain, script_url) {
      window.hcm._accountKey = account_key;
      window.hcm._datasetId = dataset_id;
      window.hcm._domain = domain;
      var script = document.createElement("script");
      script.type = "application/javascript";
      script.src = script_url;
      var first = document.getElementsByTagName('script')[0];
      first.parentNode.insertBefore(script, first);
    }
    hcmanager('885d56d73cd8e827177bd6e47426ac6e', '64c3e0d501fa999e5f1f9086', 'https://hcmanager.swifteq.com', 'https://scripts.swifteq.com/hc_events.js');

    0
  • David Jetter

    Ifra Saqlain Thank you for this. I'm still not seeing the drop down option appearing after signing in. When I download a new version of the theme, I see the drop down appearing there. My thought at this point is to just download the newest version of the theme and add the custom code we have everywhere bit by bit to see if that may be blocking things. I do thank you for the assist here, you've helped me with a couple of scenarios like this!

    0
  • Ifra Saqlain
    Community Moderator
    Zendesk Luminary
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Hey David Jetter, see your previous error has been change yet and new error is showing after updating the code. Now you can fix the error of hcmanager file.

    {"message":"Not Found","error":404}


    Console:



     

    You have dropdownlist but due to hcmanager error the event isn't working.

    0

댓글을 남기려면 로그인하세요.

Zendesk 제공