silverwind
5791a73e75
Convert frontend code to typescript ( #31559 )
...
None of the frontend js/ts files was touched besides these two commands
(edit: no longer true, I touched one file in
61105d0618
because of a deprecation that was not showing before the rename).
`tsc` currently reports 778 errors, so I have disabled it in CI as
planned.
Everything appears to work fine.
5 months ago
silverwind
507fbf4c3c
Use `querySelector` over alternative DOM methods ( #31280 )
...
As per
https://github.com/go-gitea/gitea/pull/30115#discussion_r1626060164 ,
prefer `querySelector` by enabling
[`unicorn/prefer-query-selector`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-query-selector.md )
and autofixing all except 10 issues.
According to
[this](https://old.reddit.com/r/learnjavascript/comments/i0f5o8/performance_of_getelementbyid_vs_queryselector/ ),
querySelector may be faster as well, so it's a win-win.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Giteabot <teabot@gitea.io>
6 months ago
wxiaoguang
eb8bb82e58
Fix activity heat map padding & locale ( #30823 )
...
Fix #30808
---------
Co-authored-by: silverwind <me@silverwind.io>
7 months ago
silverwind
8b5c081d76
Remove fomantic loader module ( #26670 )
...
Replace Fomantic `loader` CSS module with our existing `is-loading`
spinner. Only three places in the UI used this module, which are
pictured here:
imagediff:
<img width="1237" alt="Screenshot 2023-08-22 at 22 18 01"
src="https://github.com/go-gitea/gitea/assets/115237/b0d82531-f05e-43c6-9e5b-1bfc268c056d ">
webauthn:
<img width="894" alt="Screenshot 2023-08-22 at 22 05 05"
src="https://github.com/go-gitea/gitea/assets/115237/7b583425-d944-474a-a57a-22a65bbd8b29 ">
heatmap (I removed the previous loading text, it was unreadable because
it was tiny and on fast machines only visible for a fraction of a
second):
<img width="764" alt="Screenshot 2023-08-22 at 22 18 44"
src="https://github.com/go-gitea/gitea/assets/115237/1c7472d6-3e17-4224-a992-d8c0b380cc73 ">
Also, heatmap container does not resize any more after loading now and
previous duplicate id `user-heatmap` is gone.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
1 year ago
Yarden Shoham
f045e58cc7
Localize activity heatmap (except tooltip) ( #24131 )
...
The calculation of the total sum is moved to the backend so a full HTML
string could be sent.
![image](https://user-images.githubusercontent.com/20454870/232112381-c11d896b-ba47-40f8-b2a3-71cf4b3208de.png )
- Closes #10669
- 2nd attempt (the first was in #21570 )
---------
Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2 years ago
silverwind
2cf0cf0de1
JS refactors ( #22227 )
...
- Replace all default exports with named exports, except for Vue SFCs
- Remove names from Vue SFCs, they are automatically inferred from the
filename
- Misc whitespace-related tweaks
2 years ago
Yarden Shoham
125e3e3d66
Localize time units on activity heatmap ( #21570 )
...
Previously, the months and days were hardcoded into English
* Closes #15541
## Screenshots
### English
![image](https://user-images.githubusercontent.com/20454870/197410352-1b28a637-ce19-41ae-b4e5-27955555b082.png )
### German
![image](https://user-images.githubusercontent.com/20454870/197410455-f243ca84-807f-476e-b8ed-c24e827bfc2d.png )
### Spanish
![image](https://user-images.githubusercontent.com/20454870/197410366-55202ca5-08f9-4152-8f9d-d5eeebd532ef.png )
### Italian
![image](https://user-images.githubusercontent.com/20454870/197410385-75f754dd-e845-4444-8a04-472a8f45b617.png )
### Portuguese
This one has a bit of overflow
![image](https://user-images.githubusercontent.com/20454870/197410414-b91f962e-77e9-4cc7-990b-01c0fc0cbd0b.png )
Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years ago
André Jaenisch
04e97b8311
Refactor from Vue2 to Vue3 ( #20044 )
...
Close #19902
2 years ago
silverwind
19b017f398
Use explicit jQuery import, remove unused eslint globals ( #18435 )
...
- Don't rely on globals (window.$) for jQuery import
- Remove eslint globals no longer in use
3 years ago
silverwind
a159c3175f
Add new JS linter rules ( #17699 )
...
* Add new JS linter rules
Adds a few useful rules from eslint-plugin-github. Notable changes:
- Forbid dataset usage, its camel-casing behaviour makes it hard to
grep for attributes.
- Forbid .then() and .catch(), we should generally prefer await for new
code. For rare cases where they are useful, a eslint-disable-line
directive can be set.
- Add docs js to linting
* also enable github/array-foreach
* small tweak
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
3 years ago
wxiaoguang
bb71ceeeb2
Improve async/await usage, and sort init calls in `index.js` ( #17386 )
...
* clean up async/await, and sort init calls in `index.js
* use `const _promise` to indicate that we do not need await an async function
3 years ago
siddweiker
f573e93ed4
Fix heatmap activity ( #15252 )
...
* Group heatmap actions by 15 minute intervals
Signed-off-by: Sidd Weiker <siddweiker@gmail.com>
* Add multi-contribution test for user heatmap
Signed-off-by: Sidd Weiker <siddweiker@gmail.com>
* Add timezone aware summation for activity heatmap
Signed-off-by: Sidd Weiker <siddweiker@gmail.com>
* Fix api user heatmap test
Signed-off-by: Sidd Weiker <siddweiker@gmail.com>
* Update variable declaration style
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago
silverwind
12c2efb45c
Remove fetch request from heatmap ( #13623 )
...
* Remove fetch request from heatmap
Render heatmap data directly to HTML, eliminating one HTTP request on
frontpage and user profile. Also added min-height to the container so
the page content will no longer move after loading.
* rename and error display
* also log the js error
* add error handler
* remove useless inline style and hide divider on small screens
* Update routers/user/home.go
* Update routers/user/profile.go
4 years ago