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

Release 1.1.0 #222

Merged
merged 96 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
18b2324
Merge pull request #140 from NIAEFEUP/main
ttoino Sep 20, 2023
1024619
Show the user's notifications in a popup
ttoino Sep 26, 2023
311e86a
Add button to mark notifications as read
ttoino Sep 26, 2023
d9132be
Wrong class name in notifications
ttoino Sep 26, 2023
c404e1d
Merge pull request #148 from NIAEFEUP/main
ttoino Oct 3, 2023
fab3a97
Merge pull request #152 from NIAEFEUP/main
ttoino Nov 15, 2023
761e622
show class size
filipesolha Nov 28, 2023
08de2e4
Merge pull request #154 from NIAEFEUP/feature/class-size
filipesolha Dec 2, 2023
b0a2e04
Merge pull request #147 from NIAEFEUP/feature/notifications-popup
ttoino Dec 2, 2023
daa35d4
Add course enrollment id for each card
LuisDuarte1 Jan 9, 2024
16ad7ad
Add favorte course to redirect to it's details
LuisDuarte1 Jan 9, 2024
cffba7b
Merge branch 'develop' into feature/favorite-course
LuisDuarte1 Jan 9, 2024
857d5ee
Merge pull request #159 from NIAEFEUP/feature/favorite-course
LuisDuarte1 Jan 21, 2024
b6a01f1
Start configuring webpack, migrate to yarn modern
ttoino Mar 19, 2024
1b90406
Add popup and other missing modules to webpack config
ttoino Apr 2, 2024
a24eeae
It's running :party:
ttoino Apr 8, 2024
88d0dbb
Fix recursive copy
ttoino Apr 8, 2024
4e40466
Add scripts to package.json
ttoino Apr 8, 2024
5769556
Merge pull request #168 from NIAEFEUP/main
ttoino Apr 11, 2024
e202783
Merge pull request #170 from NIAEFEUP/main
ttoino Apr 11, 2024
9b5b756
ignore dist folder from watch
thePeras Jul 5, 2024
0582d0b
Fix popup and watch changes now works
thePeras Jul 16, 2024
3db7f94
Merge branch 'develop' into refactor/webpack
thePeras Jul 16, 2024
ba34c42
Merge pull request #165 from NIAEFEUP/refactor/webpack
thePeras Jul 19, 2024
152c42c
enabled typescript support on webpack and added TSX
toni-santos Jul 26, 2024
855e996
remove unused files and file structure tweaks
toni-santos Aug 1, 2024
c988f7f
re add override-functions.js
toni-santos Aug 2, 2024
5d435e1
Merge pull request #175 from NIAEFEUP/feature/jsx
toni-santos Aug 5, 2024
5157a66
Create layout components
thePeras Aug 10, 2024
5276724
add table component and some basic css for it
toni-santos Aug 21, 2024
6ace68e
Toogle popovers and Button component
thePeras Aug 22, 2024
4a74b3d
add styling to table components
toni-santos Sep 2, 2024
8074588
Icon component and remove decraped code
thePeras Aug 23, 2024
72f72b3
Merge pull request #178 from NIAEFEUP/refactor/layout-to-tsx
thePeras Sep 5, 2024
b2f5152
allow anchor tags to be clickable on table header
toni-santos Sep 8, 2024
cb3a782
Merge branch 'develop' into refactor/tables-to-tsx
toni-santos Sep 8, 2024
f5cb06c
fix folder structure
toni-santos Sep 8, 2024
b4e1499
Merge pull request #179 from NIAEFEUP/refactor/tables-to-tsx
thePeras Sep 9, 2024
247d4e5
added and ran linter and formatter
toni-santos Sep 11, 2024
bdb2b8a
Components Page
thePeras Sep 9, 2024
bce67b5
update README.md, run prettier and clean up popup folder
toni-santos Sep 13, 2024
5c0af44
Merge pull request #187 from NIAEFEUP/feature/components-docs
thePeras Sep 15, 2024
deca226
Merge branch 'develop' into feat/linter-formatter
toni-santos Sep 16, 2024
b00b98f
Started Accordion Component
SimaoNery Sep 16, 2024
24ebe74
Merge pull request #189 from NIAEFEUP/feat/linter-formatter
toni-santos Sep 25, 2024
3d12d7a
add CI yaml file
toni-santos Sep 25, 2024
71d5c19
fix CI and components paeg
toni-santos Sep 25, 2024
5921500
Merge pull request #193 from NIAEFEUP/feature/actions
toni-santos Sep 28, 2024
d9fd8f4
add schedule link to header
toni-santos Oct 13, 2024
4cced69
Merge pull request #197 from NIAEFEUP/feature/header-schedule
toni-santos Oct 18, 2024
9219fa5
Merge remote-tracking branch 'origin/develop' into feature/accordion-…
SimaoNery Oct 24, 2024
20b5288
Button reference and initial ui
thePeras Oct 29, 2024
eec3139
Button style and variations
thePeras Nov 1, 2024
cdf283c
Fix bugs and apply the Button to navbar
thePeras Nov 1, 2024
30db459
Refactor popup and created two different categories
thePeras Nov 2, 2024
4c6a667
Refactor .js files to .ts and extract code
thePeras Nov 2, 2024
5ced57c
changed klaw file filter
JaimeFRF Nov 5, 2024
64525cc
resolved format issues
JaimeFRF Nov 6, 2024
713ad1d
Merge pull request #201 from NIAEFEUP/bug/popup-reload
thePeras Nov 6, 2024
5caa9a7
More tsx and components
thePeras Nov 7, 2024
9d0e03d
Merge branch 'develop' into refactor/ts-and-popup
thePeras Nov 7, 2024
84f4d1e
Merge pull request #199 from NIAEFEUP/refactor/ts-and-popup
thePeras Nov 7, 2024
426c0b7
Merge remote-tracking branch 'origin/develop' into component/button
thePeras Nov 7, 2024
b44fdfa
Merge pull request #198 from NIAEFEUP/component/button
thePeras Nov 7, 2024
a48b1c2
migrate index to typescript and add regex
toni-santos Oct 7, 2024
ed06209
fix yarn.lock
toni-santos Oct 8, 2024
bea36ba
change functionsToExeceute dictionary
toni-santos Oct 28, 2024
e03d154
document duplicated page checks
toni-santos Oct 28, 2024
12ab75d
fix regex expressions
toni-santos Nov 6, 2024
2e969df
simplify components page expression
toni-santos Nov 7, 2024
36aa316
fix build issues and small tweaks
toni-santos Nov 10, 2024
9313040
Merge pull request #194 from NIAEFEUP/feature/better-script-running
toni-santos Nov 11, 2024
72c4f27
Merge remote-tracking branch 'origin/develop' into feature/accordion-…
SimaoNery Nov 14, 2024
b90f890
Accordion.tsx && Accordion in ComponentsPage
SimaoNery Nov 14, 2024
b434cfa
resolved page flickering - wait for page to fully load
JaimeFRF Nov 15, 2024
baa5493
help buttons
Leonor2004 Nov 18, 2024
db9b38d
Merge pull request #206 from NIAEFEUP/bug/page-flickering
JaimeFRF Nov 19, 2024
1f74747
better UX and small styling fixes
toni-santos Nov 20, 2024
b4e7bf8
changes tooltip messages
Leonor2004 Nov 26, 2024
7145b1b
code reuse improvement
Leonor2004 Nov 27, 2024
68c2fd4
forgotten space
Leonor2004 Nov 27, 2024
ed637da
tooltip contect as strings
Leonor2004 Nov 27, 2024
48e1933
Text and correction changes
Leonor2004 Nov 27, 2024
3b6e49f
readability issues...again
Leonor2004 Nov 27, 2024
b76f8b8
Changed accordion data and header sintax
SimaoNery Nov 28, 2024
b85f305
Changed accordion css location
SimaoNery Nov 28, 2024
e9ed77e
Merge branch 'develop' into feature/popup-option-details
thePeras Nov 28, 2024
5dbd6cc
Merge pull request #218 from NIAEFEUP/feature/popup-option-details
Leonor2004 Nov 28, 2024
c80f71d
fix: notifications load
thePeras Nov 28, 2024
ac5235e
Linter and formatter
SimaoNery Nov 28, 2024
67a19f6
Merge pull request #205 from NIAEFEUP/feature/accordion-component
SimaoNery Nov 28, 2024
d630f6b
fix expand and start on class page
toni-santos Nov 28, 2024
c545143
fix class page error
toni-santos Nov 28, 2024
d45dffc
Merge pull request #220 from NIAEFEUP/fix/notifications-load
thePeras Nov 29, 2024
7e67690
Merge branch 'develop' into fix/expand-and-class-page
thePeras Nov 29, 2024
ebd79d9
Merge pull request #221 from NIAEFEUP/fix/expand-and-class-page
toni-santos Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

on:
push: # Run on pushes to "develop"
branches:
- develop
pull_request: # Run on PRs to "develop"
branches:
- develop
types: [opened, reopened, synchronize, ready_for_review]

jobs:
prettier:
if: ${{ github.event.pull_request.draft == false }}

name: Check Javascript code style
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Enable Corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 21
cache: yarn

- name: Install dependencies
run: yarn install

- name: Run Prettier
run: yarn format

eslint:
if: ${{ github.event.pull_request.draft == false }}

name: Lint Javascript code
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Enable Corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 21
cache: yarn

- name: Install dependencies
run: yarn install

- name: Run Eslint
run: yarn lint
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,13 @@ bundle/safari
.vscode

# Xcode project
xcuserdata/
xcuserdata/

# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
# !.yarn/sdks
!.yarn/versions
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
/node_modules
/dist
/.yarn
/.github
/popup/.next
/popup/.yarn
/popup/.node_modules
/popup/out

.changes.json
package-lock.json
yarn.lock
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"useTabs": false,
"tabWidth": 4,
"printWidth": 80,
"singleQuote": false,
"endOfLine": "auto",
"trailingComma": "all"
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
14 changes: 7 additions & 7 deletions Develop for Safari.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
From [developer.apple.com](https://developer.apple.com/documentation/safariservices/safari_app_extensions/building_a_safari_app_extension#2957927):

>To develop without a certificate, each time you launch Safari, you need to tell it to load unsigned extensions using the Develop menu:
> To develop without a certificate, each time you launch Safari, you need to tell it to load unsigned extensions using the Develop menu:
>
> Open Safari and choose Safari > Preferences.
> Open Safari and choose Safari > Preferences.
>
> Select the Advanced tab, then select the “Show Develop menu in menu bar” checkbox.
> Select the Advanced tab, then select the “Show Develop menu in menu bar” checkbox.
>
> Choose Develop > Allow Unsigned Extensions, enter your password, and click OK. The Allow Unsigned Extensions setting resets when a user quits Safari, so you need to set it again the next time you launch Safari.
> Choose Develop > Allow Unsigned Extensions, enter your password, and click OK. The Allow Unsigned Extensions setting resets when a user quits Safari, so you need to set it again the next time you launch Safari.
>
> Choose Safari > Preferences and click the Extensions tab. This tab shows the localized description, display name, and version number for the selected Safari app extension. It also provides a more nuanced message about the permissions for the extension.
> Choose Safari > Preferences and click the Extensions tab. This tab shows the localized description, display name, and version number for the selected Safari app extension. It also provides a more nuanced message about the permissions for the extension.
>
> Find your new extension in the list on the left, and enable it by selecting its checkbox.
> Find your new extension in the list on the left, and enable it by selecting its checkbox.
>
> Close Safari Preferences.
> Close Safari Preferences.
1 change: 1 addition & 0 deletions PRIVACY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
TODO:

# Privacy Policy

NitSig does not store or collect any personal information. All user prefences are stored on the user's device in local storage.
Expand Down
70 changes: 53 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,68 @@
## Development / Building / Bundling the Extension
## Developing

First, you must have [yarn](https://classic.yarnpkg.com/lang/en/docs/install) installed.

Run
Install dependencies:

```sh
yarn install
```

Build for the first time:

```sh
yarn build
```

Choose your favorite browser and start developing:

```sh
yarn run dev:firefox
```

or

```sh
yarn run dev:chrome
```

This command will initialize a browser window and load the extension, watching for changes and reloading the window automatically.

## Building a bundle

```sh
yarn && yarn bundle [all | firefox | chrome | safari]
yarn build
```
at the root directory and you'll get a bundle directory that looks like this:

## Linting and formatting

In order to maintain our codebase we are using [Prettier](https://prettier.io/) for formatting and [ESLint](https://eslint.org/) for linting.

If you only want to check for formatting issues run:

```sh
yarn format
```
📂 bundle
└ 📁 chrome
└ 📁 firefox
└ 📁 safari
└ 🗄️ chrome.zip
└ 🗄️ firefox.zip
└ 🗄️ safari.zip

Or if you want to have Prettier fix them:

```sh
yarn format:fix
```

## Watch for changes
Similarly, to check for linting issues run:

```sh
sudo yarn watch [firefox | chrome | safari]
yarn lint
```

The extension polls the watch webserver for changes, if the page doesn't reload automatically, reload the extension and if that doesn't work, see the service worker/background script console for errors.
And, if you wish to fix the warnings that ESLint picks up, run:

## Load Extension
```sh
yarn lint:fix
```

You can bundle the extension for `Chrome`, `Firefox`, and `Safari`:
## Loading a bundle

<table>
<tr>
Expand Down Expand Up @@ -62,4 +96,6 @@ You can bundle the extension for `Chrome`, `Firefox`, and `Safari`:
</tr>
</table>

#### This respository was based on the [typefully/minimal-twitter](https://github.com/typefully/minimal-twitter) extension repository
## Components Page

Checkout the components page by adding `/components` to the end of any Sigarra URL.
2 changes: 1 addition & 1 deletion assets/mac-icon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ convert mac-icon.png -resize 64x64 -gravity center -background transparent -exte
convert mac-icon.png -resize 256x256 -gravity center -background transparent -extent 256x256 [email protected]
convert mac-icon.png -resize 512x512 -gravity center -background transparent -extent 512x512 [email protected]
convert mac-icon.png -resize 1024x1024 -gravity center -background transparent -extent 1024x1024 [email protected]
```
```
94 changes: 51 additions & 43 deletions background.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,69 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const sigarraRegex = /.*:\/\/sigarra\.up\.pt\/feup\/.*/;

// Add default values for each option here
const popupOptions = {
navbar: "on",
shortcuts: "on",
autoLogin: "off",
font: "on",
navbar: "on",
shortcuts: "on",
autoLogin: "off",
font: "on",
};

chrome.runtime.onInstalled.addListener((object) => {
if (object.reason === "install") {
const reloadFEUPSigarraPages = () => {
chrome.tabs.query({ url: "*://sigarra.up.pt/feup/*" }, (tabs) => {
tabs.forEach((tab) => {
chrome.tabs.reload(tab.id);
});
tabs.forEach((tab) => {
chrome.tabs.reload(tab.id);
});
});
};

if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
chrome.tabs.create({
url: chrome.runtime.getURL("html/autorize.html")
});
}else{
chrome.tabs.create({
url: chrome.runtime.getURL("html/installed.html")
});
}
chrome.runtime.onInstalled.addListener((object) => {
if (object.reason === "install") {
reloadFEUPSigarraPages();

chrome.storage.local.set(popupOptions);
}
if (navigator.userAgent.toLowerCase().indexOf("firefox") > -1) {
chrome.tabs.create({
url: chrome.runtime.getURL("html/autorize.html"),
});
} else {
chrome.tabs.create({
url: chrome.runtime.getURL("html/installed.html"),
});
}

if (object.reason === "update") {
for (const opt in popupOptions) {
if (chrome.storage.local.get(opt) == null)
chrome.storage.local.set({[opt]: popupOptions[opt]});
chrome.storage.local.set(popupOptions);
}
}
});

if (object.reason === "update") {
reloadFEUPSigarraPages();
for (const opt in popupOptions) {
if (chrome.storage.local.get(opt) == null)
chrome.storage.local.set({ [opt]: popupOptions[opt] });
}
}
});

chrome.runtime.onMessage.addListener(async (message, sender, sendResponse) => {
if(!sender.tab.active){
console.log("tab not active skipping message...")
return;
}
if (message.type == "login") {
const cookie = await chrome.cookies.get({ name: "SI_SESSION", url: sender.tab.url })
console.log(cookie)
if(cookie == null || cookie.value === "0"){
sendResponse(false);
return;
if (!sender.tab.active) {
console.log("tab not active skipping message...");
return;
}
if (message.type == "login") {
const cookie = await chrome.cookies.get({
name: "SI_SESSION",
url: sender.tab.url,
});
console.log(cookie);
if (cookie == null || cookie.value === "0") {
sendResponse(false);
return;
}
message.auto_login.verifed = true;
await chrome.storage.local.set({ auto_login: message.auto_login });
sendResponse(true);
}
message.auto_login.verifed = true;
await chrome.storage.local.set({ auto_login: message.auto_login });
sendResponse(true);
}
});

chrome.permissions.onRemoved.addListener((permissions) => {
//TODO:
});
chrome.permissions.onRemoved.addListener(() => {
//TODO:
});
Loading