You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@flagon.apache.org by "Jyyjy (via GitHub)" <gi...@apache.org> on 2024/07/18 16:49:50 UTC
[PR] Add report an issue (flagon-useralejs)
Jyyjy opened a new pull request, #480:
URL: https://github.com/apache/flagon-useralejs/pull/480
This resolves https://github.com/apache/flagon-useralejs/issues/478 with the following changes
1. Allows users to access user ale options via browser action with an icon.
2. Adds a simple issue form to the options page.
3. Routes the issue information to the top level frame of the currently active tab.
4. Adds an e2e test case that verifies the points 2 and 3 above.
Example issue log:
{
"pageUrl": "https://www.openstreetmap.org/#map=19/40.46362/-79.93668&layers=D",
"pageTitle": "OpenStreetMap",
"pageReferrer": "",
"browser": {
"browser": "chrome",
"version": "126.0.0"
},
"clientTime": 1721321016597,
"scrnRes": {
"width": 487,
"height": 857
},
"logType": "custom",
"userAction": true,
"details": {},
"userId": "pluginUser",
"toolVersion": "2.4.0",
"toolName": "useralePlugin",
"useraleVersion": "2.4.0",
"sessionId": "session_1721103156601",
"httpSessionId": "e9ef871810b812bbafdfc232b5fd13a9",
"browserSessionId": "9047683c125414150c97c20753fe97a5",
**"issueType": "Bug",
"issueDescription": "A detailed description of the issue.",
"type": "issue"**
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@flagon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@flagon.apache.org
For additional commands, e-mail: pr-help@flagon.apache.org
Re: [PR] Add report an issue (flagon-useralejs)
Posted by "Jyyjy (via GitHub)" <gi...@apache.org>.
Jyyjy commented on code in PR #480:
URL: https://github.com/apache/flagon-useralejs/pull/480#discussion_r1684864100
##########
src/UserALEWebExtension/options.ts:
##########
@@ -76,7 +75,46 @@ function getConfig() {
(document.getElementById("filter") as HTMLInputElement).value =
payload.pluginConfig.urlWhitelist;
});
+
+ (document.getElementById("optionsForm") as HTMLFormElement).addEventListener(
+ "submit",
+ setConfig,
+ );
+ (document.getElementById("issueForm") as HTMLFormElement).addEventListener(
+ "submit",
+ reportIssue,
+ );
+}
+
+function reportIssue() {
+ browser.runtime.sendMessage({
+ type: MessageTypes.ISSUE_REPORT,
+ payload: {
+ issueType: (
+ document.querySelector(
+ 'input[name="issueType"]:checked',
+ ) as HTMLButtonElement
+ ).value,
+ issueDescription: (
+ document.getElementById("issueDescription") as HTMLTextAreaElement
+ ).value,
+ type: "issue",
Review Comment:
I'll move to details.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For additional commands, e-mail: notifications-help@flagon.apache.org
Re: [PR] Add report an issue (flagon-useralejs)
Posted by "EandrewJones (via GitHub)" <gi...@apache.org>.
EandrewJones commented on code in PR #480:
URL: https://github.com/apache/flagon-useralejs/pull/480#discussion_r1686972100
##########
src/UserALEWebExtension/icons/UserALE Logo.png:
##########
Review Comment:
Cool.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For additional commands, e-mail: notifications-help@flagon.apache.org
Re: [PR] Add report an issue (flagon-useralejs)
Posted by "Jyyjy (via GitHub)" <gi...@apache.org>.
Jyyjy commented on code in PR #480:
URL: https://github.com/apache/flagon-useralejs/pull/480#discussion_r1684862714
##########
src/UserALEWebExtension/messageTypes.ts:
##########
@@ -20,3 +20,4 @@ const prefix = "USERALE_";
export const CONFIG_CHANGE = prefix + "CONFIG_CHANGE";
export const ADD_LOG = prefix + "ADD_LOG";
export const HTTP_SESSION = prefix + "HTTP_SESSION";
+export const ISSUE_REPORT = prefix + "ISSUE_REPORT";
Review Comment:
Agreed, will change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For additional commands, e-mail: notifications-help@flagon.apache.org
Re: [PR] Add report an issue (flagon-useralejs)
Posted by "Jyyjy (via GitHub)" <gi...@apache.org>.
Jyyjy commented on PR #480:
URL: https://github.com/apache/flagon-useralejs/pull/480#issuecomment-2239841710
Waiting for issue https://github.com/actions/setup-node/issues/1112 to rerun the CI rather than pinning the npm version lower.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For additional commands, e-mail: notifications-help@flagon.apache.org
Re: [PR] Add report an issue (flagon-useralejs)
Posted by "Jyyjy (via GitHub)" <gi...@apache.org>.
Jyyjy commented on code in PR #480:
URL: https://github.com/apache/flagon-useralejs/pull/480#discussion_r1684884172
##########
src/UserALEWebExtension/icons/UserALE Logo.png:
##########
Review Comment:
Looking at other projects, without any knowledge of the law, I'm pretty sure.
https://james.apache.org/index.html
https://commons.apache.org/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For additional commands, e-mail: notifications-help@flagon.apache.org
Re: [PR] Add report an issue (flagon-useralejs)
Posted by "EandrewJones (via GitHub)" <gi...@apache.org>.
EandrewJones commented on PR #480:
URL: https://github.com/apache/flagon-useralejs/pull/480#issuecomment-2243554059
@Jyyjy Tests now pass. Once you address issues, feel free to merge.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For additional commands, e-mail: notifications-help@flagon.apache.org
Re: [PR] Add report an issue (flagon-useralejs)
Posted by "Jyyjy (via GitHub)" <gi...@apache.org>.
Jyyjy commented on code in PR #480:
URL: https://github.com/apache/flagon-useralejs/pull/480#discussion_r1686997597
##########
package.json:
##########
@@ -16,6 +16,7 @@
"test": "npm run test:unit && npm run test:e2e",
"test:unit": "jest -c ./test/unit/jest.config.ts",
"test:e2e": "playwright test -c ./test/e2e/playwright.config.ts",
+ "pretest:e2e": "rm -rf ./test/e2e/chromeData/*",
"posttest:e2e": "rm -rf ./test/e2e/chromeData/*",
Review Comment:
Turns out, you can't run a script after a SIGINT because of how npm handles SIGINT. So I'm leaving in the pre script.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For additional commands, e-mail: notifications-help@flagon.apache.org
Re: [PR] Add report an issue (flagon-useralejs)
Posted by "Jyyjy (via GitHub)" <gi...@apache.org>.
Jyyjy merged PR #480:
URL: https://github.com/apache/flagon-useralejs/pull/480
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: pr-unsubscribe@flagon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@flagon.apache.org
For additional commands, e-mail: pr-help@flagon.apache.org
Re: [PR] Add report an issue (flagon-useralejs)
Posted by "EandrewJones (via GitHub)" <gi...@apache.org>.
EandrewJones commented on code in PR #480:
URL: https://github.com/apache/flagon-useralejs/pull/480#discussion_r1684802556
##########
src/UserALEWebExtension/optionsPage.html:
##########
@@ -50,7 +50,39 @@ <h1>Options</h1>
<br />
<div align="right">
- <button type="submit" id="submit">Save</button>
+ <button type="submit" id="submitOptions">Save Changes</button>
+ </div>
+ </form>
+ <h1>Report an Issue</h1>
+ <form name="issueForm" id="issueForm">
+ <label>Issue Type</label><br />
+ <label>
+ <input
+ type="radio"
+ id="bug"
+ name="issueType"
+ value="Bug"
+ checked="checked"
+ />
+ Bug </label
+ ><br />
+
+ <label>
+ <input type="radio" id="feat" name="issueType" value="Feature" />
+ Feature Request </label
+ ><br />
+ <br />
Review Comment:
The ol' `<br/>` to serve as padding instead of proper styles ;). Will let it slide for now.
##########
src/UserALEWebExtension/icons/UserALE Logo.png:
##########
Review Comment:
Are we legally allowed to use the Apache feather in this logo?
##########
src/UserALEWebExtension/options.ts:
##########
@@ -76,7 +75,46 @@ function getConfig() {
(document.getElementById("filter") as HTMLInputElement).value =
payload.pluginConfig.urlWhitelist;
});
+
+ (document.getElementById("optionsForm") as HTMLFormElement).addEventListener(
+ "submit",
+ setConfig,
+ );
+ (document.getElementById("issueForm") as HTMLFormElement).addEventListener(
+ "submit",
+ reportIssue,
+ );
+}
+
+function reportIssue() {
+ browser.runtime.sendMessage({
+ type: MessageTypes.ISSUE_REPORT,
+ payload: {
+ issueType: (
+ document.querySelector(
+ 'input[name="issueType"]:checked',
+ ) as HTMLButtonElement
+ ).value,
+ issueDescription: (
+ document.getElementById("issueDescription") as HTMLTextAreaElement
+ ).value,
+ type: "issue",
Review Comment:
Do we want to add these as additional fields or put them in the "details" field? If I recall, you added a discussion ticket for us to standardize our usage of details based on some conventions.
Right now it contains additional, action-specific contextual information for certain event types. Feels like a natural place to include these fields.
##########
src/UserALEWebExtension/messageTypes.ts:
##########
@@ -20,3 +20,4 @@ const prefix = "USERALE_";
export const CONFIG_CHANGE = prefix + "CONFIG_CHANGE";
export const ADD_LOG = prefix + "ADD_LOG";
export const HTTP_SESSION = prefix + "HTTP_SESSION";
+export const ISSUE_REPORT = prefix + "ISSUE_REPORT";
Review Comment:
I recommend we use an Enum here. That's essentially how you're using the import in other locations anyways.
##########
package.json:
##########
@@ -16,6 +16,7 @@
"test": "npm run test:unit && npm run test:e2e",
"test:unit": "jest -c ./test/unit/jest.config.ts",
"test:e2e": "playwright test -c ./test/e2e/playwright.config.ts",
+ "pretest:e2e": "rm -rf ./test/e2e/chromeData/*",
"posttest:e2e": "rm -rf ./test/e2e/chromeData/*",
Review Comment:
Why do we need to clean before and after?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For additional commands, e-mail: notifications-help@flagon.apache.org
Re: [PR] Add report an issue (flagon-useralejs)
Posted by "Jyyjy (via GitHub)" <gi...@apache.org>.
Jyyjy commented on code in PR #480:
URL: https://github.com/apache/flagon-useralejs/pull/480#discussion_r1684861797
##########
package.json:
##########
@@ -16,6 +16,7 @@
"test": "npm run test:unit && npm run test:e2e",
"test:unit": "jest -c ./test/unit/jest.config.ts",
"test:e2e": "playwright test -c ./test/e2e/playwright.config.ts",
+ "pretest:e2e": "rm -rf ./test/e2e/chromeData/*",
"posttest:e2e": "rm -rf ./test/e2e/chromeData/*",
Review Comment:
Added because when a test fails playwright starts a server for the results that needs an interrupt signal to stop. That interrupt signal prevents the post command from cleaning up.
But on second thought, I'll just create an explicit script to cleanup that runs regardless of the main scripts completion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@flagon.apache.org
For additional commands, e-mail: notifications-help@flagon.apache.org