forked from zendesk/url_builder_app
-
Notifications
You must be signed in to change notification settings - Fork 8
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
maintenance updates #35
Merged
Merged
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
bed1dc6
got something rendering at least
physik932 3613fe1
get some testing working
physik932 c7fe20f
got ticket and custom field integration
physik932 13b9a03
add client and factory mocks
physik932 aca4149
add client mock in setup tests for jest
physik932 39cdcb5
move client out to a separate lib, import as needed
physik932 3ad9845
hide the console error
physik932 72d9414
yay tests
physik932 1e6b635
reconfiguring this repo
physik932 079c007
updaet ignore
physik932 d54ec51
untracking files
physik932 daf9029
update package json notes, add faker
physik932 8273136
update json docs
physik932 e35f6fe
move wiki notes to a doc
physik932 a603388
remove travis badge
physik932 fe9cc81
faker
physik932 c89caee
remove nvmrc
physik932 4e0688a
use updated faker
physik932 86605af
update imports
physik932 31948c7
linting, import changes
physik932 3acc4c6
fix invoke call for test
physik932 08537db
remove code climate and travis integration
physik932 ccd359c
updates to docs
physik932 17e9cd3
ran npm install
physik932 0451ba8
testing a workflow
physik932 7278c2d
just use npm
physik932 c33bc62
use esm
physik932 3a50ae2
use esm modules
physik932 eb3dc9e
more webpack fixes
physik932 64d2869
move images around
physik932 0addf25
node versions
physik932 c822588
change app name
physik932 50eb47e
export default module
physik932 6cc868c
use updated webpack cli version, use corejs instead of prefill
physik932 9307360
use babel preset env settings instead of polyfill
physik932 f623762
fix local js references because ecmascript or something
physik932 4612255
attempting to fix css
physik932 71abef3
fix list items and font bolding
physik932 646c1ad
use zendesk css bedrock
physik932 54fcf74
bump twitter bootstrap to 3
physik932 afe79b2
update some styles
physik932 0e74626
fix images
physik932 ca61855
add some zcli commands
physik932 8f426f9
remove unused dependencies
physik932 5f7c499
update docs, remove images
physik932 5eabb42
remove unused data-main
physik932 c856553
docs updates
physik932 f3e7206
use just node 18 not specific patch version
physik932 680286d
add npm cache
physik932 fe3ee95
dont need both nvmrc and node version
physik932 f28199e
use finally instead
physik932 b7a5a3d
try zcli validate as a final build step
physik932 0cde1ec
found a neat ref
physik932 cac9a86
comment out validate, as it requires auth
physik932 5611aa4
one more attempt at zcli validate
physik932 e3bf399
remove validate step
physik932 e734357
fix readme badges
physik932 83bb57c
unfix build status
physik932 d7e49b6
wrong uri for badge
physik932 e32a81b
once ore
physik932 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
{ | ||
"presets": ["@babel/preset-env"], | ||
"plugins": ["@babel/plugin-transform-runtime"] | ||
} | ||
"presets": [ | ||
["@babel/preset-env", { | ||
"useBuiltIns": "usage", | ||
"corejs": 3 | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# Browsers that we support | ||
last 2 version | ||
IE 11 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Changes from V2 to V3 (2023) | ||
This version of the app used the Zendesk app scaffolds to generate a Node 18 project. We updated the app from the scaffold and updated, deprecated, or added dependencies as needed to recreate functionality. | ||
|
||
## Changes from V1 to V2 (2019) | ||
Zendesk moved to a new API version in 2019, and deprecated the original version of this app. Ibotta uses Zendesk and heavily used the original app, and so it was forked and updated. | ||
|
||
The original notes from our Wiki can be found in [this document](./V1_TO_V2_NOTES.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,133 @@ | ||
|
||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as | ||
contributors and maintainers pledge to make participation in our project and | ||
our community a harassment-free experience for everyone, regardless of age, body | ||
size, disability, ethnicity, sex characteristics, gender identity and expression, | ||
level of experience, education, socio-economic status, nationality, personal | ||
appearance, race, religion, or sexual identity and orientation. | ||
We as members, contributors, and leaders pledge to make participation in our | ||
community a harassment-free experience for everyone, regardless of age, body | ||
size, visible or invisible disability, ethnicity, sex characteristics, gender | ||
identity and expression, level of experience, education, socio-economic status, | ||
nationality, personal appearance, race, caste, color, religion, or sexual | ||
identity and orientation. | ||
|
||
We pledge to act and interact in ways that contribute to an open, welcoming, | ||
diverse, inclusive, and healthy community. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment | ||
include: | ||
Examples of behavior that contributes to a positive environment for our | ||
community include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
* Demonstrating empathy and kindness toward other people | ||
* Being respectful of differing opinions, viewpoints, and experiences | ||
* Giving and gracefully accepting constructive feedback | ||
* Accepting responsibility and apologizing to those affected by our mistakes, | ||
and learning from the experience | ||
* Focusing on what is best not just for us as individuals, but for the overall | ||
community | ||
|
||
Examples of unacceptable behavior by participants include: | ||
Examples of unacceptable behavior include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or | ||
advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* The use of sexualized language or imagery, and sexual attention or advances of | ||
any kind | ||
* Trolling, insulting or derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic | ||
address, without explicit permission | ||
* Publishing others' private information, such as a physical or email address, | ||
without their explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Our Responsibilities | ||
## Enforcement Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable | ||
behavior and are expected to take appropriate and fair corrective action in | ||
response to any instances of unacceptable behavior. | ||
Community leaders are responsible for clarifying and enforcing our standards of | ||
acceptable behavior and will take appropriate and fair corrective action in | ||
response to any behavior that they deem inappropriate, threatening, offensive, | ||
or harmful. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or | ||
reject comments, commits, code, wiki edits, issues, and other contributions | ||
that are not aligned to this Code of Conduct, or to ban temporarily or | ||
permanently any contributor for other behaviors that they deem inappropriate, | ||
threatening, offensive, or harmful. | ||
Community leaders have the right and responsibility to remove, edit, or reject | ||
comments, commits, code, wiki edits, issues, and other contributions that are | ||
not aligned to this Code of Conduct, and will communicate reasons for moderation | ||
decisions when appropriate. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all project spaces, and it also applies when | ||
an individual is representing the project or its community in public spaces. | ||
Examples of representing a project or community include using an official | ||
project e-mail address, posting via an official social media account, or acting | ||
as an appointed representative at an online or offline event. Representation of | ||
a project may be further defined and clarified by project maintainers. | ||
This Code of Conduct applies within all community spaces, and also applies when | ||
an individual is officially representing the community in public spaces. | ||
Examples of representing our community include using an official e-mail address, | ||
posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by contacting the project team at [osscompliance@ibotta.com]. All | ||
complaints will be reviewed and investigated and will result in a response that | ||
is deemed necessary and appropriate to the circumstances. The project team is | ||
obligated to maintain confidentiality with regard to the reporter of an incident. | ||
Further details of specific enforcement policies may be posted separately. | ||
reported to the community leaders responsible for enforcement at | ||
[INSERT CONTACT METHOD]. | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the | ||
reporter of any incident. | ||
|
||
## Enforcement Guidelines | ||
|
||
Community leaders will follow these Community Impact Guidelines in determining | ||
the consequences for any action they deem in violation of this Code of Conduct: | ||
|
||
### 1. Correction | ||
|
||
**Community Impact**: Use of inappropriate language or other behavior deemed | ||
unprofessional or unwelcome in the community. | ||
|
||
**Consequence**: A private, written warning from community leaders, providing | ||
clarity around the nature of the violation and an explanation of why the | ||
behavior was inappropriate. A public apology may be requested. | ||
|
||
### 2. Warning | ||
|
||
**Community Impact**: A violation through a single incident or series of | ||
actions. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good | ||
faith may face temporary or permanent repercussions as determined by other | ||
members of the project's leadership. | ||
**Consequence**: A warning with consequences for continued behavior. No | ||
interaction with the people involved, including unsolicited interaction with | ||
those enforcing the Code of Conduct, for a specified period of time. This | ||
includes avoiding interactions in community spaces as well as external channels | ||
like social media. Violating these terms may lead to a temporary or permanent | ||
ban. | ||
|
||
### 3. Temporary Ban | ||
|
||
**Community Impact**: A serious violation of community standards, including | ||
sustained inappropriate behavior. | ||
|
||
**Consequence**: A temporary ban from any sort of interaction or public | ||
communication with the community for a specified period of time. No public or | ||
private interaction with the people involved, including unsolicited interaction | ||
with those enforcing the Code of Conduct, is allowed during this period. | ||
Violating these terms may lead to a permanent ban. | ||
|
||
### 4. Permanent Ban | ||
|
||
**Community Impact**: Demonstrating a pattern of violation of community | ||
standards, including sustained inappropriate behavior, harassment of an | ||
individual, or aggression toward or disparagement of classes of individuals. | ||
|
||
**Consequence**: A permanent ban from any sort of public interaction within the | ||
community. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, | ||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html | ||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], | ||
version 2.1, available at | ||
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
Community Impact Guidelines were inspired by | ||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. | ||
|
||
For answers to common questions about this code of conduct, see | ||
https://www.contributor-covenant.org/faq | ||
For answers to common questions about this code of conduct, see the FAQ at | ||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at | ||
[https://www.contributor-covenant.org/translations][translations]. | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html | ||
[Mozilla CoC]: https://github.com/mozilla/diversity | ||
[FAQ]: https://www.contributor-covenant.org/faq | ||
[translations]: https://www.contributor-covenant.org/translations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Note: Run commands in the root app directory. | ||
|
||
Compile the app for DEV | ||
=============== | ||
1) `npm install` | ||
2) `npm run watch` | ||
3) Open a new command line window in the root app directory | ||
4) `zcli apps:server dist` will serve the app to your Zendesk instance. When prompted, enter in a JSON formatted string with URLS (See README for more instructions on format). | ||
5) Navigate to a ticket in your Zendesk instance and append the URL with `?zcli_apps=true` | ||
|
||
Compile the app for PROD | ||
=============== | ||
1) `npm install` | ||
2) `npm run build` | ||
|
||
To run the tests | ||
=============== | ||
1) `npm install` | ||
2) `npm run test` | ||
|
||
Uploading the app | ||
============== | ||
1) `npm install` | ||
2) `npm run build` | ||
3) `npm validate` -- this uses `zcli` to validate any misconfigurations in the `manifest.json` or missing files in `dist`. | ||
4) If you have not created the app in your instance yet, use `zcli apps:create dist` to do so. If you have already uploaded the app, you can use `zcli apps:update dist` to update it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,33 @@ | ||
# Prerequisites | ||
# Issue or Feature Request | ||
|
||
Please answer the following questions for yourself before submitting an issue. | ||
## Prerequisites for Issues | ||
|
||
Please answer the following questions before submitting an issue. | ||
|
||
- [ ] I am running the latest version | ||
- [ ] I checked the documentation and found no answer | ||
- [ ] I checked to make sure that this issue has not already been filed | ||
|
||
# Expected Behavior | ||
# Current Behavior | ||
|
||
Please describe the behavior you are expecting. | ||
Please describe the behavior you are experiencing. | ||
|
||
# Current Behavior | ||
# Expected Behavior | ||
|
||
What is the current behavior? | ||
What is the desired behavior? | ||
|
||
# Failure Information (for bugs) | ||
|
||
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template. | ||
Please provide any info around the issue you are seeing. | ||
|
||
## Steps to Reproduce | ||
|
||
Please provide detailed steps for reproducing the issue. | ||
|
||
1. step 1 | ||
2. step 2 | ||
3. you get it... | ||
|
||
## Context | ||
|
||
Please provide any relevant information about your setup. | ||
|
||
* Browser Version: | ||
* Operating System: | ||
|
||
## Failure Logs (Follow steps to reproduce with Developer Tools open - Usually F12) | ||
|
||
Please include any relevant log snippets or files here. | ||
* If it is not sensitive, please add the JSON array of URLs you are using. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Overview | ||
The V2 version of this app seeks to offer the same functionality as the [V1 version](https://github.com/zendesklabs/url_builder_app). During the development process, we used the [Zendesk App Scaffold](https://github.com/zendesk/app_scaffold) as a template and made improvements to the maintainability of the code base. We reviewed the [existing issues outlined](https://github.com/zendesklabs/url_builder_app/issues) for areas we can address, as well as identified some small issues we fixed. These are outlined below. | ||
|
||
## Changed Keys | ||
ticket.requester.firstname -> ticket.requester.firstName | ||
ticket.requester.lastname -> ticket.requester.lastName | ||
ticket.assignee.firstname -> ticket.assignee.firstName | ||
ticket.assignee.lastname -> ticket.assignee.lastName | ||
current_user.firstname -> currentUser.firstName | ||
current_user.lastname -> currentUser.lastName | ||
|
||
### Note about `externalId` vs `external_id` keys | ||
We noticed the README mentioned using `ticket.requester.externalId`, but this appeared to be replaced with `external_id`. This is due to the User object called via Zendesk API using snake_case keys while the ZAFClient's ticket object uses camelCase keys. We no longer use the API call, and now the `externalId` is the usage of this key. | ||
|
||
### Note about `firstName` and `lastName` keys | ||
The Zendesk API and ZAFClient provide two different depths of information on User type objects. The API call returns [a detailed object](https://developer.zendesk.com/rest_api/docs/support/users#json-format-for-agent-or-admin-requests) while the ZAFClient's `ticket.[requester, assignee]` and `currentUser` objects are [less detailed](https://developer.zendesk.com/apps/docs/support-api/all_locations#user-object). In addition, we noticed the object keys from the ZAFClient come back as camelCase while the Zendesk API returns snake_case keys. | ||
|
||
The detailed User object was used to get the full name and then split them into the `firstname` and `lastname` keys. However, with the ZAFClient `ticket` object, we were able to replicate the same functionality without the extra API call and logic to map this. The keys are still present but now follow camelCase naming. | ||
|
||
## Error Handling | ||
The V2 version of this app will now display an error message and link to the V2 app's GitHub Issues page when an error occurs. There are steps outlined to file an issue there and what we will need to help you troubleshoot the issues. | ||
|
||
# Upcoming App Improvements | ||
We're always interested in ways to improve this app for agents and developers! Please create an issue or PR detailing your ideas! Below, you will find a few ideas we have to make this app an even better experience. | ||
|
||
## URL Sanitization | ||
We noticed that if a ticket did not have an assignee or was requested via email, and a Zendesk User was not matched to the email, then the `ticket.requester` fields became null. This caused some URLs to have issues. | ||
|
||
An example of this issue that we observed: | ||
```javascript | ||
[ | ||
{ | ||
"title": "Example URL", | ||
"url": "http://example.com/?name={{ticket.requester.name}}" | ||
}, | ||
{ | ||
"title": "User Profile", | ||
"url": "http://example.com/user/{{ticket.requester.id}}/profile" | ||
} | ||
] | ||
``` | ||
|
||
Would generate: | ||
```html | ||
<ul> | ||
<li> | ||
<a href="http://example.com/?name=">Example URL</a> | ||
</li> | ||
<li> | ||
<a href="http://example.com/user//profile">User Profile</a> | ||
</li> | ||
</ul> | ||
``` | ||
physik932 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
To resolve this, we want to sanitize URLs to provide an error message when a field referenced does not have a value. | ||
|
||
## Specific Error Messages | ||
Currently, our error handling creates a warning image and reference to our GitHub Issues page. We would like to expand on this to provide specific error handling cases, like Zendesk's API returning an error, or a field referenced in the JSON URL that is not supported. | ||
|
||
## TODOS | ||
|
||
### Custom Field Naming | ||
Should `ticket.requester.user_fields.YYY`, `ticket.custom_field_XXXXXX`, `ticket.organization.organization_fields.XXXXXX` be renamed to be consistent? I noticed that these fields used to be referenced via the `containerContext` object, and are now retrieved via Zendesk API calls. I'd like to have these fields available, but use consistent naming across them. |
File renamed without changes
File renamed without changes
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From babel: