Skip to content

Commit aa5cce3

Browse files
authored
Merge branch 'master' into responsive
2 parents e4a7a5e + 67925df commit aa5cce3

File tree

6 files changed

+106
-25
lines changed

6 files changed

+106
-25
lines changed

README.md

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,37 @@
11
# SCRUM Helper
22

3-
This chrome extension helps you to write scrums in google groups for FOSSASIA related projects. You need to add your github username, dates, and other options. It fetches your PRs, Issues, and the PRs you reviewed from Github API, and prefills the SCRUM. You can edit the scrum further to meet your needs.
3+
**SCRUM Helper** is a Chrome extension designed to simplify writing scrums in Google Groups for FOSSASIA projects. By adding your GitHub username, date range, and other options, it automatically fetches your PRs, Issues, and reviewed PRs via the GitHub API and pre-fills the scrum. You can then edit the scrum to fit your needs.
4+
45

56
![SCRUMLOGO](docs/images/scrumhelper-png.png)
67

8+
## Features
9+
10+
- Fetches your GitHub PRs, Issues, and reviewed PRs
11+
- Auto-generates scrum updates
12+
- Supports Google Groups, Gmail, Yahoo, and Outlook compose windows
13+
714
## How to install
8-
```
9-
1. Clone this repository.
10-
2. Goto `chrome://extensions` on your chrome browser.
11-
3. Turn on developer mode if not already on.
12-
4. Load unpacked extension from `src` folder.
13-
5. Click on the Scrum Helper icon you see on your browser toolbar.
14-
6. Fill in the settings in the popup.
15-
7. Open https://groups.google.com/forum/#!newtopic/<groupname>.
16-
8. Refresh the page for new settings to reflect.
17-
```
15+
16+
1. Clone this repository to your local machine.
17+
2. Go to `chrome://extensions` on your chrome browser.
18+
3. Enable Developer Mode (toggle in the top-right) if not already.
19+
4. Click Load unpacked and select the `src` folder inside the cloned repo
20+
5. Click the Scrum Helper icon on your browser toolbar
21+
6. Fill in your settings in the popup (GitHub username, date range, etc.)
22+
23+
## Usage
24+
### For Google Groups:
25+
- Open Google Groups New Topic
26+
- Start a New Conversation
27+
- Refresh the page to apply the Scrum Helper settings
28+
- Use the pre-filled scrum and edit as needed
29+
30+
### For Gmail, Yahoo, and Outlook:
31+
- Open the Compose window.
32+
- Ensure the Scrum Helper settings are applied (follow step 6 above)
33+
- The extension will prefill scrum content for you to edit
34+
1835
## Setting up the code locally
1936

2037
```
@@ -30,4 +47,17 @@ $ npm install
3047
## About contributing
3148
- Follow the Issues and PRs templates as far as possible.
3249
- If you want to make a PR, please mention in the corresponding issue that you are working on it.
33-
- Please run `npm run test` locally to check for syntax errors before making a PR.
50+
- Before making a PR, ensure your code is properly formatted and linted:
51+
- Format your code: This command automatically formats your code based on the project's style guidelines.
52+
```sh
53+
npm run format
54+
```
55+
- Check for issues: This command runs the formatter, linter, and import sorting on the requested files to enforce coding standards.
56+
```sh
57+
npm run check
58+
```
59+
- Fix linting errors: If the linter detects fixable issues, this command will automatically apply the necessary corrections.
60+
```sh
61+
npm run fix
62+
```
63+
- If you encounter any bugs, please report them at the [Issues page](https://github.com/fossasia/scrum_helper/issues).

docs/images/popup.png

-11.1 KB
Loading

docs/images/scrum.png

-23.3 KB
Loading

src/index.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,17 @@ li {
5050
list-style-type: disc !important;
5151
margin-left: 1rem;
5252
}
53+
.selectedLabel {
54+
font-weight: 400;
55+
color: #333333;
56+
}
57+
58+
.unselectedLabel {
59+
font-weight: 300;
60+
color: #666666;
61+
}
62+
63+
.selectedLabel, .unselectedLabel {
64+
transition: color 0.3s ease-in-out, font-weight 0.3s ease-in-out;
65+
}
66+

src/scripts/emailClientAdapter.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,24 @@ class EmailClientAdapter {
4040
body: [
4141
// Desktop selectors
4242
'#editor-container [contenteditable="true"][role="textbox"]',
43+
'[aria-multiline="true"][aria-label="Message body"][contenteditable="true"][role="textbox"]',
44+
'[aria-label="Message body"][contenteditable="true"]',
45+
'[role="textbox"][contenteditable="true"]',
46+
'[data-test-id*="compose"][contenteditable="true"]',
47+
'.compose-editor [contenteditable="true"]'
4348
// Mobile selectors
4449
'#editor-container-mobile [contenteditable="true"][role="textbox"]',
45-
],
50+
].join(', '),
4651
subject: [
4752
// Desktop selectors
4853
'#compose-subject-input, input[placeholder="Subject"][id="compose-subject-input"]',
54+
'#compose-subject-input',
55+
'input[placeholder="Subject"]',
56+
'input[aria-label*="subject" i]',
57+
'input[data-test-id*="subject" i]'
4958
// Mobile selectors
5059
'#compose-subject-input-mobile, input[placeholder="Subject"][id="compose-subject-input-mobile"]'
51-
],
60+
].join(', '),
5261
},
5362
eventTypes: {
5463
contentChange: 'input',

src/scripts/main.js

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function handleBodyOnLoad() {
2222
'userReason',
2323
'lastWeekContribution',
2424
'gsoc',
25+
'selectedTab',
2526
],
2627
(items) => {
2728
if (items.githubUsername) {
@@ -65,6 +66,15 @@ function handleBodyOnLoad() {
6566
} else {
6667
handleCodeheatClick();
6768
}
69+
if (items.selectedTab === 'gsoc') {
70+
handleGsocClick();
71+
}
72+
else {
73+
handleCodeheatClick();
74+
}
75+
76+
// initialize materialize tabs
77+
$('.tabs').tabs('select_tab', items.selectedTab === 'gsoc' ? 'gsocBox' : 'codeheatBox' );
6878
},
6979
);
7080
}
@@ -82,19 +92,27 @@ function handleEndingDateChange() {
8292
}
8393
function handleLastWeekContributionChange() {
8494
var value = lastWeekContributionElement.checked;
95+
var labelElement = document.querySelector("label[for='lastWeekContribution']");
96+
8597
if (value) {
86-
startingDateElement.disabled = true;
87-
endingDateElement.disabled = true;
88-
endingDateElement.value = getToday();
89-
startingDateElement.value = getLastWeek();
90-
handleEndingDateChange();
91-
handleStartingDateChange();
98+
startingDateElement.disabled = true;
99+
endingDateElement.disabled = true;
100+
endingDateElement.value = getToday();
101+
startingDateElement.value = getLastWeek();
102+
handleEndingDateChange();
103+
handleStartingDateChange();
104+
labelElement.classList.add("selectedLabel");
105+
labelElement.classList.remove("unselectedLabel");
92106
} else {
93-
startingDateElement.disabled = false;
94-
endingDateElement.disabled = false;
107+
startingDateElement.disabled = false;
108+
endingDateElement.disabled = false;
109+
labelElement.classList.add("unselectedLabel");
110+
labelElement.classList.remove("selectedLabel");
95111
}
112+
96113
chrome.storage.local.set({ lastWeekContribution: value });
97114
}
115+
98116
function getLastWeek() {
99117
var today = new Date();
100118
var noDays_to_goback = gsoc == 0 ? 7 : 1;
@@ -135,9 +153,19 @@ function handleProjectNameChange() {
135153
}
136154
function handleOpenLabelChange() {
137155
var value = showOpenLabelElement.checked;
156+
var labelElement = document.querySelector("label[for='showOpenLabel']");
157+
158+
if (value) {
159+
labelElement.classList.add("selectedLabel");
160+
labelElement.classList.remove("unselectedLabel");
161+
} else {
162+
labelElement.classList.add("unselectedLabel");
163+
labelElement.classList.remove("selectedLabel");
164+
}
165+
138166
chrome.storage.local.set({ showOpenLabel: value });
139-
chrome.storage.local.set({ showClosedLabel: value });
140167
}
168+
141169
function handleUserReasonChange() {
142170
var value = userReasonElement.value;
143171
chrome.storage.local.set({ userReason: value });
@@ -147,15 +175,15 @@ function handleCodeheatClick() {
147175
$('#codeheatTab').addClass('active');
148176
$('.tabs').tabs();
149177
$('#noDays').text('7 days');
150-
chrome.storage.local.set({ gsoc: 0 });
178+
chrome.storage.local.set({ gsoc: 0, selectedTab: 'codeheat' });
151179
handleLastWeekContributionChange();
152180
}
153181
function handleGsocClick() {
154182
gsoc = 1;
155183
$('#gsocTab').addClass('active');
156184
$('.tabs').tabs();
157185
$('#noDays').text('1 day');
158-
chrome.storage.local.set({ gsoc: 1 });
186+
chrome.storage.local.set({ gsoc: 1, selectedTab: 'gsoc' });
159187
handleLastWeekContributionChange();
160188
}
161189
enableToggleElement.addEventListener('change', handleEnableChange);

0 commit comments

Comments
 (0)