Skip to content

Commit 8c4930f

Browse files
authored
Merge branch 'master' into archival-service
2 parents e303a5b + 7c47e24 commit 8c4930f

File tree

10 files changed

+310
-247
lines changed

10 files changed

+310
-247
lines changed

.eslintrc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ parserOptions:
1111
plugins:
1212
- eslint-plugin-unicorn
1313
- eslint-plugin-import
14+
- eslint-plugin-vue
15+
16+
extends:
17+
- plugin:vue/recommended
1418

1519
env:
1620
es2021: true
@@ -24,7 +28,7 @@ globals:
2428
u2fApi: false
2529

2630
overrides:
27-
- files: ["web_src/**/*.js"]
31+
- files: ["web_src/**/*.js", "web_src/**/*.vue"]
2832
env:
2933
browser: true
3034
jquery: true
@@ -387,6 +391,11 @@ rules:
387391
use-isnan: [2]
388392
valid-typeof: [2, {requireStringLiterals: true}]
389393
vars-on-top: [0]
394+
vue/attributes-order: [0]
395+
vue/component-definition-name-casing: [0]
396+
vue/html-closing-bracket-spacing: [0]
397+
vue/max-attributes-per-line: [0]
398+
vue/one-component-per-file: [0]
390399
wrap-iife: [2, inside]
391400
wrap-regex: [0]
392401
yield-star-spacing: [2, after]

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ lint: lint-frontend lint-backend
312312

313313
.PHONY: lint-frontend
314314
lint-frontend: node_modules
315-
npx eslint web_src/js build webpack.config.js
316-
npx stylelint web_src/less
315+
npx eslint --max-warnings=0 web_src/js build webpack.config.js
316+
npx stylelint --max-warnings=0 web_src/less
317317

318318
.PHONY: lint-backend
319319
lint-backend: golangci-lint revive vet

models/repo.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,6 +1501,10 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e
15011501
return fmt.Errorf("update: %v", err)
15021502
}
15031503

1504+
if err = repo.updateSize(e); err != nil {
1505+
log.Error("Failed to update size for repository: %v", err)
1506+
}
1507+
15041508
if visibilityChanged {
15051509
if err = repo.getOwner(e); err != nil {
15061510
return fmt.Errorf("getOwner: %v", err)
@@ -1546,10 +1550,6 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e
15461550
return fmt.Errorf("updateRepository[%d]: %v", forkRepos[i].ID, err)
15471551
}
15481552
}
1549-
1550-
if err = repo.updateSize(e); err != nil {
1551-
log.Error("Failed to update size for repository: %v", err)
1552-
}
15531553
}
15541554

15551555
return nil

options/locale/locale_nl-NL.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,7 @@ milestones=Mijlpalen
807807
commits=Commits
808808
commit=Commit
809809
releases=Publicaties
810+
tag=Label
810811
file_raw=Ruw
811812
file_history=Geschiedenis
812813
file_view_raw=Weergave ruw bestand
@@ -868,7 +869,10 @@ editor.file_already_exists=Een bestand met de naam '%s' bestaat al in deze repos
868869
editor.commit_empty_file_header=Commit een leeg bestand
869870
editor.commit_empty_file_text=Het bestand dat u wilt committen is leeg. Doorgaan?
870871
editor.no_changes_to_show=Er zijn geen wijzigingen om weer te geven.
872+
editor.fail_to_update_file=Bijwerken/aanmaken van bestand '%s ' mislukt.
873+
editor.fail_to_update_file_summary=Foutmelding:
871874
editor.push_rejected_no_message=De wijziging is afgewezen door de server zonder bericht. Controleer githooks.
875+
editor.push_rejected_summary=Volledig afwijzingsbericht:
872876
editor.add_subdir=Een map toevoegen…
873877
editor.unable_to_upload_files=Uploaden van bestand '%s' is mislukt: %v
874878
editor.upload_file_is_locked=Bestand '%s' is vergrendeld door %s.
@@ -1250,9 +1254,12 @@ pulls.rebase_merge_commit_pull_request=Rebase en voeg samen (--no-ff)
12501254
pulls.squash_merge_pull_request=Squash en Merge
12511255
pulls.require_signed_wont_sign=De branch heeft ondertekende commits nodig, maar deze merge zal niet worden ondertekend
12521256
pulls.invalid_merge_option=Je kan de samenvoegingsoptie niet gebruiken voor deze pull-aanvraag.
1257+
pulls.merge_conflict_summary=Foutmelding
1258+
pulls.rebase_conflict_summary=Foutmelding
12531259
; </summary><code>%[2]s<br>%[3]s</code></details>
12541260
pulls.unrelated_histories=Samenvoegen mislukt: de HEAD en base delen geen gemeenschappelijke geschiedenis. Tip: Probeer een andere strategie
12551261
pulls.merge_out_of_date=Samenvoegen mislukt: Tijdens het samenvoegen is de basis bijgewerkt. Tip: Probeer het opnieuw.
1262+
pulls.push_rejected_summary=Volledig afwijzingsbericht
12561263
pulls.push_rejected_no_message=Samenvoegen mislukt: De push is afgewezen maar er was geen extern bericht.<br>Controleer de githooks voor deze repository
12571264
pulls.open_unmerged_pull_exists=`Je kan deze pull-aanvraag niet opnieuw openen omdat er een andere (#%d) met identieke eigenschappen open staat.`
12581265
pulls.status_checking=Sommige controles zijn in behandeling
@@ -2210,6 +2217,7 @@ config.ssh_minimum_key_sizes=Minimale key-lengtes
22102217
config.lfs_config=LFS Configuratie
22112218
config.lfs_enabled=Ingeschakeld
22122219
config.lfs_content_path=LFS inhoudspad
2220+
config.lfs_http_auth_expiry=LFS HTTP Auth Vervaltijd
22132221
22142222
config.db_config=Databaseconfiguratie
22152223
config.db_type=Type
@@ -2232,10 +2240,12 @@ config.mail_notify=Activeer e-mailnotificaties
22322240
config.disable_key_size_check=Controle op key-lengte uitschakelen
22332241
config.enable_captcha=CAPTCHA inschakelen
22342242
config.active_code_lives=Actieve Code leven
2243+
config.reset_password_code_lives=Herstel accountcode vervaltijd
22352244
config.default_keep_email_private=Verberg standaard alle e-mailadressen
22362245
config.default_allow_create_organization=Standaard toestaan om organisaties aan te maken
22372246
config.enable_timetracking=Tijdregistratie inschakelen
22382247
config.default_enable_timetracking=Tijdregistratie standaard inschakelen
2248+
config.default_allow_only_contributors_to_track_time=Sta alleen bijdragers toe tijdregistratie te gebruiken
22392249
config.no_reply_address=Verborgen e-maildomein
22402250
config.default_visibility_organization=Standaard zichtbaarheid voor nieuwe organisaties
22412251
config.default_enable_dependencies=Issue afhankelijkheden standaard inschakelen
@@ -2290,6 +2300,7 @@ config.git_max_diff_files=Max Diff bestanden (om weer te geven)
22902300
config.git_gc_args=GC Parameters
22912301
config.git_migrate_timeout=Migratie time-out
22922302
config.git_mirror_timeout=Kopie Update Timeout
2303+
config.git_clone_timeout=Kloon operatie timeout
22932304
config.git_pull_timeout=Pull operatie timeout
22942305
config.git_gc_timeout=GC operatie timeout
22952306

package-lock.json

Lines changed: 63 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"eslint": "7.11.0",
5555
"eslint-plugin-import": "2.22.1",
5656
"eslint-plugin-unicorn": "23.0.0",
57+
"eslint-plugin-vue": "7.1.0",
5758
"stylelint": "13.7.2",
5859
"stylelint-config-standard": "20.0.0",
5960
"svgo": "1.3.2",
Lines changed: 60 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,71 @@
11
<template>
2-
<div>
3-
<div v-show="isLoading">
4-
<slot name="loading"></slot>
5-
</div>
6-
<h4 class="total-contributions" v-if="!isLoading">
7-
{{ totalContributions }} total contributions in the last 12 months
8-
</h4>
9-
<calendar-heatmap v-show="!isLoading" :locale="locale" :no-data-text="locale.no_contributions" :tooltip-unit="locale.contributions" :end-date="endDate" :values="values" :range-color="colorRange"/>
2+
<div>
3+
<div v-show="isLoading">
4+
<slot name="loading"/>
105
</div>
6+
<h4 v-if="!isLoading" class="total-contributions">
7+
{{ values.length }} total contributions in the last 12 months
8+
</h4>
9+
<calendar-heatmap
10+
v-show="!isLoading"
11+
:locale="locale"
12+
:no-data-text="locale.no_contributions"
13+
:tooltip-unit="locale.contributions"
14+
:end-date="endDate"
15+
:values="values"
16+
:range-color="colorRange"
17+
/>
18+
</div>
1119
</template>
12-
1320
<script>
1421
import {CalendarHeatmap} from 'vue-calendar-heatmap';
1522
const {AppSubUrl, heatmapUser} = window.config;
1623
1724
export default {
18-
name: "ActivityHeatmap",
19-
components: {
20-
CalendarHeatmap
21-
},
22-
data() {
23-
return {
24-
isLoading: true,
25-
colorRange: [],
26-
endDate: null,
27-
values: [],
28-
totalContributions: 0,
29-
suburl: AppSubUrl,
30-
user: heatmapUser,
31-
locale: {
32-
contributions: 'contributions',
33-
no_contributions: 'No contributions',
34-
},
35-
};
25+
name: 'ActivityHeatmap',
26+
components: {CalendarHeatmap},
27+
data: () => ({
28+
isLoading: true,
29+
colorRange: [],
30+
endDate: null,
31+
values: [],
32+
suburl: AppSubUrl,
33+
user: heatmapUser,
34+
locale: {
35+
contributions: 'contributions',
36+
no_contributions: 'No contributions',
3637
},
37-
mounted() {
38-
this.colorRange = [
39-
this.getColor(0),
40-
this.getColor(1),
41-
this.getColor(2),
42-
this.getColor(3),
43-
this.getColor(4),
44-
this.getColor(5)
45-
];
46-
this.endDate = new Date();
47-
this.loadHeatmap(this.user);
48-
},
49-
methods: {
50-
loadHeatmap(userName) {
51-
const self = this;
52-
$.get(`${this.suburl}/api/v1/users/${userName}/heatmap`, (chartRawData) => {
53-
const chartData = [];
54-
for (let i = 0; i < chartRawData.length; i++) {
55-
self.totalContributions += chartRawData[i].contributions;
56-
chartData[i] = {date: new Date(chartRawData[i].timestamp * 1000), count: chartRawData[i].contributions};
57-
}
58-
self.values = chartData;
59-
self.isLoading = false;
60-
});
61-
},
62-
getColor(idx) {
63-
const el = document.createElement('div');
64-
el.className = `heatmap-color-${idx}`;
65-
document.body.appendChild(el);
66-
67-
const color = getComputedStyle(el).backgroundColor;
68-
69-
document.body.removeChild(el);
70-
71-
return color;
72-
}
38+
}),
39+
mounted() {
40+
this.colorRange = [
41+
this.getColor(0),
42+
this.getColor(1),
43+
this.getColor(2),
44+
this.getColor(3),
45+
this.getColor(4),
46+
this.getColor(5)
47+
];
48+
this.endDate = new Date();
49+
this.loadHeatmap(this.user);
50+
},
51+
methods: {
52+
async loadHeatmap(userName) {
53+
const res = await fetch(`${this.suburl}/api/v1/users/${userName}/heatmap`);
54+
const data = await res.json();
55+
this.values = data.map(({contributions, timestamp}) => {
56+
return {date: new Date(timestamp * 1000), count: contributions};
57+
});
58+
this.isLoading = false;
7359
},
74-
}
60+
getColor(idx) {
61+
const el = document.createElement('div');
62+
el.className = `heatmap-color-${idx}`;
63+
document.body.appendChild(el);
64+
const color = getComputedStyle(el).backgroundColor;
65+
document.body.removeChild(el);
66+
return color;
67+
}
68+
},
69+
};
7570
</script>
76-
77-
<style scoped>
78-
79-
</style>
71+
<style scoped/>

0 commit comments

Comments
 (0)