Skip to content
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

Change comment type not working in new "Agent Workspace" #141

Open
romeroadrian opened this issue Jun 10, 2021 · 0 comments
Open

Change comment type not working in new "Agent Workspace" #141

romeroadrian opened this issue Jun 10, 2021 · 0 comments

Comments

@romeroadrian
Copy link

Looks like the change comment type feat is broken in the new "Zendesk Agent Workspace" (the new ticket UI).

The property is client.set('comment.type', value)

Here's a basic app that reproduces the issue:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <!--   See Using Zendesk Garden:
    https://developer.zendesk.com/apps/docs/developer-guide/setup#using-zendesk-garden
    https://garden.zendesk.com/css-components/bedrock/
    https://garden.zendesk.com/css-components/utilities/typography/
   -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/combine/npm/@zendeskgarden/[email protected],npm/@zendeskgarden/[email protected]">
</head>
<body>
  <h2 class="u-semibold u-fs-xl">Hello, World!</h2>
  <button id="public" type="button">Change to Public</button>
  <button id="internal" type="button">Change to Internal</button>
  <p>Current type: <span id="current"></span></p>
  <script src="https://static.zdassets.com/zendesk_app_framework_sdk/2.0/zaf_sdk.min.js"></script>
  <script>
    // Initialise Apps framework client. See also:
    // https://developer.zendesk.com/apps/docs/developer-guide/getting_started
    var client = ZAFClient.init();
    client.invoke('resize', { width: '100%', height: '200px' });

    var publicBtn = document.getElementById('public');
    var internalBtn = document.getElementById('internal');
    var current = document.getElementById('current');

    client.on('comment.type.changed', function(e) {
      console.log('Type has been changed to:', e);
      current.textContent = e;
    });

    publicBtn.onclick = function() {
      client.set('comment.type', 'publicReply')
    };

    internalBtn.onclick = function() {
      client.set('comment.type', 'internalNote')
    };

    client.get('comment.type').then(function(data) {
      current.textContent = data['comment.type'];
    });
  </script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant