@chisquare-tech/origine-ngx-apps-code 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -210,6 +210,11 @@ class CodeApi {
|
|
|
210
210
|
comment(project, name, n, c) {
|
|
211
211
|
return this.api.post(`${this.repoPath(project, name)}/pulls/${n}/comments`, c).pipe(map((r) => data(r)));
|
|
212
212
|
}
|
|
213
|
+
/** Arms (method) or disarms (null) auto-merge on a pull request (DEV-25). */
|
|
214
|
+
autoMerge(project, name, n, method) {
|
|
215
|
+
const url = `${this.repoPath(project, name)}/pulls/${n}/auto-merge`;
|
|
216
|
+
return (method === null ? this.api.delete(url) : this.api.post(url, { method })).pipe(map((r) => data(r)));
|
|
217
|
+
}
|
|
213
218
|
/** Commits suggested changes of line comments onto the pull request's branch (DEV-20). */
|
|
214
219
|
applySuggestions(project, name, n, comments, message = '') {
|
|
215
220
|
return this.api.post(`${this.repoPath(project, name)}/pulls/${n}/suggestions`, { comments, message }).pipe(map((r) => data(r)));
|
|
@@ -344,6 +349,10 @@ const TOKEN_CSS = `
|
|
|
344
349
|
:host ::ng-deep .tk-nb, :host ::ng-deep .tk-nt, :host ::ng-deep .tk-bp{color:var(--o-tk-p)}
|
|
345
350
|
:host ::ng-deep .tk-gi{color:var(--o-add)} :host ::ng-deep .tk-gd{color:var(--o-bad-tx)}
|
|
346
351
|
`;
|
|
352
|
+
/** Why a signed commit is not verified (DEV-31). */
|
|
353
|
+
function verifyWhy(reason) {
|
|
354
|
+
return { unknown_key: 'Signed with a key that is not the committer’s signing key', bad_signature: 'The signature does not match the commit' }[reason] ?? 'Not verified';
|
|
355
|
+
}
|
|
347
356
|
|
|
348
357
|
/**
|
|
349
358
|
* What every page under /code/:repo shares: the project, the repository named in the URL (loaded
|
|
@@ -361,6 +370,7 @@ class RepoPage {
|
|
|
361
370
|
this.error = signal('', ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
362
371
|
this.note = signal('', ...(ngDevMode ? [{ debugName: "note" }] : /* istanbul ignore next */ []));
|
|
363
372
|
this.people = computed(() => new People(this.host.people()), ...(ngDevMode ? [{ debugName: "people" }] : /* istanbul ignore next */ []));
|
|
373
|
+
this.verifyWhy = verifyWhy;
|
|
364
374
|
this.canWrite = computed(() => !this.repo()?.archivedAt && (this.repo()?.capabilities ?? []).includes('code.write'), ...(ngDevMode ? [{ debugName: "canWrite" }] : /* istanbul ignore next */ []));
|
|
365
375
|
this.canAdmin = computed(() => (this.repo()?.capabilities ?? []).includes('resources.manage'), ...(ngDevMode ? [{ debugName: "canAdmin" }] : /* istanbul ignore next */ []));
|
|
366
376
|
/** Repository settings short of a rename, the visibility and deletion: Maintainers, and maintain collaborators. */
|
|
@@ -1682,7 +1692,8 @@ class CommitBox {
|
|
|
1682
1692
|
this.toNew = signal(false, ...(ngDevMode ? [{ debugName: "toNew" }] : /* istanbul ignore next */ []));
|
|
1683
1693
|
this.newBranch = signal('', ...(ngDevMode ? [{ debugName: "newBranch" }] : /* istanbul ignore next */ []));
|
|
1684
1694
|
this.rules = signal([], ...(ngDevMode ? [{ debugName: "rules" }] : /* istanbul ignore next */ []));
|
|
1685
|
-
|
|
1695
|
+
/** Direct commits are refused: the rules block direct pushes, or require signed commits (a browser commit is unsigned). */
|
|
1696
|
+
this.blocked = computed(() => this.rules().some((r) => (r.blockDirectPush || r.requireSignedCommits) && matchesPattern(r.pattern, this.branch())), ...(ngDevMode ? [{ debugName: "blocked" }] : /* istanbul ignore next */ []));
|
|
1686
1697
|
effect(() => {
|
|
1687
1698
|
const m = this.defaultMessage();
|
|
1688
1699
|
untracked(() => this.message.set(m));
|
|
@@ -2134,6 +2145,7 @@ class CommitsPage extends RepoPage {
|
|
|
2134
2145
|
@for (k of c.keys; track k) {<a class="o-chip o-blu" [routerLink]="host.link('issues/' + k)">{{ k }}</a>}
|
|
2135
2146
|
</span>
|
|
2136
2147
|
</div>
|
|
2148
|
+
@if (c.verification; as v) {<span class="o-chip" [class.o-grn]="v.verified" [attr.title]="v.verified ? 'Signed with a key of ' + people().name(v.signer) : verifyWhy(v.reason)" [attr.data-testid]="'verify-' + c.short">{{ v.verified ? 'Verified' : 'Unverified' }}</span>}
|
|
2137
2149
|
<a class="o-btn o-sm o-mono" [routerLink]="link('commit/' + c.oid)">{{ c.short }}</a>
|
|
2138
2150
|
<a class="o-btn o-sm" [routerLink]="link()" [queryParams]="{ ref: c.oid }" title="Browse files at this commit" [attr.aria-label]="'Browse files at ' + c.short">‹›</a>
|
|
2139
2151
|
</div>
|
|
@@ -2174,6 +2186,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
2174
2186
|
@for (k of c.keys; track k) {<a class="o-chip o-blu" [routerLink]="host.link('issues/' + k)">{{ k }}</a>}
|
|
2175
2187
|
</span>
|
|
2176
2188
|
</div>
|
|
2189
|
+
@if (c.verification; as v) {<span class="o-chip" [class.o-grn]="v.verified" [attr.title]="v.verified ? 'Signed with a key of ' + people().name(v.signer) : verifyWhy(v.reason)" [attr.data-testid]="'verify-' + c.short">{{ v.verified ? 'Verified' : 'Unverified' }}</span>}
|
|
2177
2190
|
<a class="o-btn o-sm o-mono" [routerLink]="link('commit/' + c.oid)">{{ c.short }}</a>
|
|
2178
2191
|
<a class="o-btn o-sm" [routerLink]="link()" [queryParams]="{ ref: c.oid }" title="Browse files at this commit" [attr.aria-label]="'Browse files at ' + c.short">‹›</a>
|
|
2179
2192
|
</div>
|
|
@@ -2223,6 +2236,7 @@ class CommitPage extends RepoPage {
|
|
|
2223
2236
|
@if (c.body) {<span class="o-mut o-lh" style="white-space:pre-wrap">{{ c.body }}</span>}
|
|
2224
2237
|
<div class="o-flex o-wrap o-sm">
|
|
2225
2238
|
<span class="o-av" aria-hidden="true">{{ initials(c.author.name) }}</span><b class="o-b5">{{ c.author.name }}</b><span class="o-faint">committed {{ ago(c.committer.when) }}</span>
|
|
2239
|
+
@if (c.verification; as v) {<span class="o-chip" [class.o-grn]="v.verified" [attr.title]="v.verified ? 'Signed with a key of ' + people().name(v.signer) : verifyWhy(v.reason)" data-testid="commit-verified">{{ v.verified ? 'Verified' : 'Unverified' }}</span>}
|
|
2226
2240
|
@for (k of c.keys; track k) {<a class="o-chip o-blu" [routerLink]="host.link('issues/' + k)">{{ k }}</a>}
|
|
2227
2241
|
<span class="o-r o-mono o-faint">commit {{ c.oid.slice(0, 10) }}@for (p of c.parents; track p) { · parent <a [routerLink]="link('commit/' + p)">{{ p.slice(0, 7) }}</a>}</span>
|
|
2228
2242
|
</div>
|
|
@@ -2254,6 +2268,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
2254
2268
|
@if (c.body) {<span class="o-mut o-lh" style="white-space:pre-wrap">{{ c.body }}</span>}
|
|
2255
2269
|
<div class="o-flex o-wrap o-sm">
|
|
2256
2270
|
<span class="o-av" aria-hidden="true">{{ initials(c.author.name) }}</span><b class="o-b5">{{ c.author.name }}</b><span class="o-faint">committed {{ ago(c.committer.when) }}</span>
|
|
2271
|
+
@if (c.verification; as v) {<span class="o-chip" [class.o-grn]="v.verified" [attr.title]="v.verified ? 'Signed with a key of ' + people().name(v.signer) : verifyWhy(v.reason)" data-testid="commit-verified">{{ v.verified ? 'Verified' : 'Unverified' }}</span>}
|
|
2257
2272
|
@for (k of c.keys; track k) {<a class="o-chip o-blu" [routerLink]="host.link('issues/' + k)">{{ k }}</a>}
|
|
2258
2273
|
<span class="o-r o-mono o-faint">commit {{ c.oid.slice(0, 10) }}@for (p of c.parents; track p) { · parent <a [routerLink]="link('commit/' + p)">{{ p.slice(0, 7) }}</a>}</span>
|
|
2259
2274
|
</div>
|
|
@@ -2840,6 +2855,10 @@ class PullPage extends RepoPage {
|
|
|
2840
2855
|
this.run(this.api.comment(this.projectId(), this.name(), this.number, { body: c.body, path: c.path, side: c.side, line: c.line, pending: c.pending }), 'Could not add the comment.', () => { if (c.pending)
|
|
2841
2856
|
this.note.set('Added to your review. Submit it from Review changes to post your comments.'); });
|
|
2842
2857
|
}
|
|
2858
|
+
/** Arms auto-merge with a method, or disarms it (null). */
|
|
2859
|
+
setAutoMerge(method) {
|
|
2860
|
+
this.run(this.api.autoMerge(this.projectId(), this.name(), this.number, method), method === null ? 'Could not turn auto-merge off.' : 'Could not turn auto-merge on.', () => this.note.set(method === null ? 'Auto-merge is off.' : 'Auto-merge is on: this pull request merges as you once every requirement passes.'));
|
|
2861
|
+
}
|
|
2843
2862
|
toggleBatch(id) {
|
|
2844
2863
|
const b = this.batch();
|
|
2845
2864
|
this.batch.set(b.includes(id) ? b.filter((x) => x !== id) : [...b, id]);
|
|
@@ -3013,6 +3032,12 @@ class PullPage extends RepoPage {
|
|
|
3013
3032
|
<div class="o-flex o-wrap" style="padding:12px 14px;background:var(--o-well)">
|
|
3014
3033
|
@if (p.canReview && !approvedByMe()) {<button type="button" class="o-btn" (click)="approve()" [disabled]="busy()" data-testid="approve">Approve</button>}
|
|
3015
3034
|
@if (p.canEdit) {<button type="button" class="o-btn o-ghost" (click)="close(false)" [disabled]="busy()">Close</button>}
|
|
3035
|
+
@if (p.autoMergeBy) {
|
|
3036
|
+
<span class="o-chip o-blu" data-testid="auto-merge-on">Auto-merge on · {{ methodLabel(p.autoMergeMethod || 'merge') }} · by {{ people().name(p.autoMergeBy) }}</span>
|
|
3037
|
+
@if (canWrite()) {<button type="button" class="o-btn o-sm o-ghost" (click)="setAutoMerge(null)" [disabled]="busy()" data-testid="auto-merge-off">Disable auto-merge</button>}
|
|
3038
|
+
} @else if (repo()?.allowAutoMerge && canWrite() && !p.gate.mergeable) {
|
|
3039
|
+
<button type="button" class="o-btn o-sm" (click)="setAutoMerge(method())" [disabled]="busy()" data-testid="auto-merge-enable" title="Merges as you once every requirement passes">Enable auto-merge</button>
|
|
3040
|
+
}
|
|
3016
3041
|
@if (p.canMerge) {
|
|
3017
3042
|
<span class="o-faint o-sm">Delete branch after merge</span><button type="button" class="o-tog" role="switch" aria-label="Delete branch after merge" [class.o-on]="delBranch()" [attr.aria-checked]="delBranch()" (click)="delBranch.set(!delBranch())"></button>
|
|
3018
3043
|
<div class="merge o-r">
|
|
@@ -3042,7 +3067,7 @@ class PullPage extends RepoPage {
|
|
|
3042
3067
|
@case ('commits') {
|
|
3043
3068
|
<div class="o-card">
|
|
3044
3069
|
@for (c of cmp()?.commits ?? []; track c.oid) {
|
|
3045
|
-
<div class="o-row"><span class="o-av" aria-hidden="true">{{ initials(c.author.name) }}</span><a class="o-ell" style="flex:1;color:var(--o-tx)" [routerLink]="link('commit/' + c.oid)">{{ c.subject }}</a
|
|
3070
|
+
<div class="o-row"><span class="o-av" aria-hidden="true">{{ initials(c.author.name) }}</span><a class="o-ell" style="flex:1;color:var(--o-tx)" [routerLink]="link('commit/' + c.oid)">{{ c.subject }}</a>@if (c.verification; as v) {<span class="o-chip" [class.o-grn]="v.verified" [attr.title]="v.verified ? 'Signed with a key of ' + people().name(v.signer) : verifyWhy(v.reason)" [attr.data-testid]="'verify-' + c.short">{{ v.verified ? 'Verified' : 'Unverified' }}</span>}<a class="o-mono o-sm o-faint" [routerLink]="link('commit/' + c.oid)">{{ c.short }}</a></div>
|
|
3046
3071
|
} @empty {<div class="o-empty">{{ cmp() ? 'No commits.' : 'Loading…' }}</div>}
|
|
3047
3072
|
</div>
|
|
3048
3073
|
}
|
|
@@ -3190,6 +3215,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
3190
3215
|
<div class="o-flex o-wrap" style="padding:12px 14px;background:var(--o-well)">
|
|
3191
3216
|
@if (p.canReview && !approvedByMe()) {<button type="button" class="o-btn" (click)="approve()" [disabled]="busy()" data-testid="approve">Approve</button>}
|
|
3192
3217
|
@if (p.canEdit) {<button type="button" class="o-btn o-ghost" (click)="close(false)" [disabled]="busy()">Close</button>}
|
|
3218
|
+
@if (p.autoMergeBy) {
|
|
3219
|
+
<span class="o-chip o-blu" data-testid="auto-merge-on">Auto-merge on · {{ methodLabel(p.autoMergeMethod || 'merge') }} · by {{ people().name(p.autoMergeBy) }}</span>
|
|
3220
|
+
@if (canWrite()) {<button type="button" class="o-btn o-sm o-ghost" (click)="setAutoMerge(null)" [disabled]="busy()" data-testid="auto-merge-off">Disable auto-merge</button>}
|
|
3221
|
+
} @else if (repo()?.allowAutoMerge && canWrite() && !p.gate.mergeable) {
|
|
3222
|
+
<button type="button" class="o-btn o-sm" (click)="setAutoMerge(method())" [disabled]="busy()" data-testid="auto-merge-enable" title="Merges as you once every requirement passes">Enable auto-merge</button>
|
|
3223
|
+
}
|
|
3193
3224
|
@if (p.canMerge) {
|
|
3194
3225
|
<span class="o-faint o-sm">Delete branch after merge</span><button type="button" class="o-tog" role="switch" aria-label="Delete branch after merge" [class.o-on]="delBranch()" [attr.aria-checked]="delBranch()" (click)="delBranch.set(!delBranch())"></button>
|
|
3195
3226
|
<div class="merge o-r">
|
|
@@ -3219,7 +3250,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
3219
3250
|
@case ('commits') {
|
|
3220
3251
|
<div class="o-card">
|
|
3221
3252
|
@for (c of cmp()?.commits ?? []; track c.oid) {
|
|
3222
|
-
<div class="o-row"><span class="o-av" aria-hidden="true">{{ initials(c.author.name) }}</span><a class="o-ell" style="flex:1;color:var(--o-tx)" [routerLink]="link('commit/' + c.oid)">{{ c.subject }}</a
|
|
3253
|
+
<div class="o-row"><span class="o-av" aria-hidden="true">{{ initials(c.author.name) }}</span><a class="o-ell" style="flex:1;color:var(--o-tx)" [routerLink]="link('commit/' + c.oid)">{{ c.subject }}</a>@if (c.verification; as v) {<span class="o-chip" [class.o-grn]="v.verified" [attr.title]="v.verified ? 'Signed with a key of ' + people().name(v.signer) : verifyWhy(v.reason)" [attr.data-testid]="'verify-' + c.short">{{ v.verified ? 'Verified' : 'Unverified' }}</span>}<a class="o-mono o-sm o-faint" [routerLink]="link('commit/' + c.oid)">{{ c.short }}</a></div>
|
|
3223
3254
|
} @empty {<div class="o-empty">{{ cmp() ? 'No commits.' : 'Loading…' }}</div>}
|
|
3224
3255
|
</div>
|
|
3225
3256
|
}
|
|
@@ -3308,7 +3339,7 @@ function writePref(key, value) {
|
|
|
3308
3339
|
}
|
|
3309
3340
|
}
|
|
3310
3341
|
|
|
3311
|
-
const BLANK = { id: '', pattern: '', blockDirectPush: true, blockForcePush: true, blockDeletion: true, requiredApprovals: 1, dismissStaleApprovals: true, requireUpToDate: false, requireCodeOwnerReview: false, requiredChecks: [] };
|
|
3342
|
+
const BLANK = { id: '', pattern: '', blockDirectPush: true, blockForcePush: true, blockDeletion: true, requiredApprovals: 1, dismissStaleApprovals: true, requireUpToDate: false, requireCodeOwnerReview: false, requireSignedCommits: false, requireLinearHistory: false, bypass: [], requiredChecks: [] };
|
|
3312
3343
|
// /{org}/{project}/code/{repo}/settings?section= (prototype "code_settings"): general settings and
|
|
3313
3344
|
// merge methods, branch protection rules, and the danger zone (archive, delete).
|
|
3314
3345
|
class RepoSettingsPage extends RepoPage {
|
|
@@ -3322,7 +3353,7 @@ class RepoSettingsPage extends RepoPage {
|
|
|
3322
3353
|
this.check = signal('', ...(ngDevMode ? [{ debugName: "check" }] : /* istanbul ignore next */ []));
|
|
3323
3354
|
this.confirm = signal('', ...(ngDevMode ? [{ debugName: "confirm" }] : /* istanbul ignore next */ []));
|
|
3324
3355
|
this.busy = signal(false, ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
|
|
3325
|
-
this.g = { name: '', description: '', visibility: 'private', defaultBranch: '', mergeMethods: [], deleteBranchOnMerge: false };
|
|
3356
|
+
this.g = { name: '', description: '', visibility: 'private', defaultBranch: '', mergeMethods: [], deleteBranchOnMerge: false, allowAutoMerge: false };
|
|
3326
3357
|
this.methods = [{ id: 'merge', label: 'Merge commit' }, { id: 'squash', label: 'Squash' }, { id: 'rebase', label: 'Rebase' }];
|
|
3327
3358
|
this.toggles = [
|
|
3328
3359
|
{ key: 'blockDirectPush', label: 'Require a pull request before merging', hint: 'Direct pushes are blocked; changes arrive through pull requests.' },
|
|
@@ -3331,7 +3362,10 @@ class RepoSettingsPage extends RepoPage {
|
|
|
3331
3362
|
{ key: 'dismissStaleApprovals', label: 'Dismiss stale approvals', hint: 'A new commit dismisses approvals given on an older one.' },
|
|
3332
3363
|
{ key: 'requireUpToDate', label: 'Require branches to be up to date', hint: 'The branch must contain the target’s latest commit before it merges.' },
|
|
3333
3364
|
{ key: 'requireCodeOwnerReview', label: 'Require review from CODEOWNERS', hint: 'Owners of changed paths are requested automatically; one of them approves each owned file.' },
|
|
3365
|
+
{ key: 'requireSignedCommits', label: 'Require signed commits', hint: 'Verified against members’ signing keys, on push and at merge.' },
|
|
3366
|
+
{ key: 'requireLinearHistory', label: 'Require linear history', hint: 'No merge commits: squash or rebase only.' },
|
|
3334
3367
|
];
|
|
3368
|
+
this.bypassRoles = [{ id: 'owner', label: 'Owners' }, { id: 'admin', label: 'Admins' }, { id: 'maintainer', label: 'Maintainers' }];
|
|
3335
3369
|
this.collabs = signal([], ...(ngDevMode ? [{ debugName: "collabs" }] : /* istanbul ignore next */ []));
|
|
3336
3370
|
this.perms = [{ id: 'read', label: 'Read' }, { id: 'write', label: 'Write' }, { id: 'maintain', label: 'Maintain' }];
|
|
3337
3371
|
this.addable = computed(() => this.host.people().filter((p) => !this.collabs().some((c) => c.userId === p.id)), ...(ngDevMode ? [{ debugName: "addable" }] : /* istanbul ignore next */ []));
|
|
@@ -3372,7 +3406,7 @@ class RepoSettingsPage extends RepoPage {
|
|
|
3372
3406
|
}
|
|
3373
3407
|
onRepo(r) {
|
|
3374
3408
|
this.loadCollabs(r);
|
|
3375
|
-
this.g = { name: r.name, description: r.description, visibility: r.visibility, defaultBranch: r.defaultBranch, mergeMethods: [...(r.mergeMethods ?? [])], deleteBranchOnMerge: r.deleteBranchOnMerge };
|
|
3409
|
+
this.g = { name: r.name, description: r.description, visibility: r.visibility, defaultBranch: r.defaultBranch, mergeMethods: [...(r.mergeMethods ?? [])], deleteBranchOnMerge: r.deleteBranchOnMerge, allowAutoMerge: !!r.allowAutoMerge };
|
|
3376
3410
|
if (!r.empty)
|
|
3377
3411
|
this.api.refs(this.projectId(), r.name, 'branch').subscribe({ next: (b) => this.branches.set(b), error: () => undefined });
|
|
3378
3412
|
this.api.protections(this.projectId(), r.name).subscribe({ next: (p) => this.rules.set(p), error: () => undefined });
|
|
@@ -3398,12 +3432,19 @@ class RepoSettingsPage extends RepoPage {
|
|
|
3398
3432
|
parts.push('up to date');
|
|
3399
3433
|
if (p.requireCodeOwnerReview)
|
|
3400
3434
|
parts.push('code owners');
|
|
3435
|
+
if (p.requireSignedCommits)
|
|
3436
|
+
parts.push('signed commits');
|
|
3437
|
+
if (p.requireLinearHistory)
|
|
3438
|
+
parts.push('linear');
|
|
3401
3439
|
if (p.blockDeletion)
|
|
3402
3440
|
parts.push('no deletion');
|
|
3403
3441
|
return parts.join(' · ') || 'no restrictions';
|
|
3404
3442
|
}
|
|
3405
3443
|
edit(p) {
|
|
3406
|
-
this.form.set(p ? { ...BLANK, ...p, requiredChecks: [...(p.requiredChecks ?? [])] } : { ...BLANK, pattern: this.rules().length ? '' : this.repo()?.defaultBranch ?? 'main', requiredChecks: [] });
|
|
3444
|
+
this.form.set(p ? { ...BLANK, ...p, requiredChecks: [...(p.requiredChecks ?? [])], bypass: [...(p.bypass ?? [])] } : { ...BLANK, pattern: this.rules().length ? '' : this.repo()?.defaultBranch ?? 'main', requiredChecks: [] });
|
|
3445
|
+
}
|
|
3446
|
+
flipBypass(f, role) {
|
|
3447
|
+
f.bypass = f.bypass.includes(role) ? f.bypass.filter((x) => x !== role) : [...f.bypass, role];
|
|
3407
3448
|
}
|
|
3408
3449
|
flip(f, k) {
|
|
3409
3450
|
f[k] = !f[k];
|
|
@@ -3428,8 +3469,8 @@ class RepoSettingsPage extends RepoPage {
|
|
|
3428
3469
|
const renamed = this.g.name.trim() !== r.name;
|
|
3429
3470
|
// a maintain collaborator sends what they may change; the name and visibility stay a Maintainer's
|
|
3430
3471
|
const body = this.canAdmin()
|
|
3431
|
-
? { name: this.g.name.trim(), description: this.g.description, visibility: this.g.visibility, defaultBranch: this.g.defaultBranch, mergeMethods: this.g.mergeMethods, deleteBranchOnMerge: this.g.deleteBranchOnMerge }
|
|
3432
|
-
: { description: this.g.description, defaultBranch: this.g.defaultBranch, mergeMethods: this.g.mergeMethods, deleteBranchOnMerge: this.g.deleteBranchOnMerge };
|
|
3472
|
+
? { name: this.g.name.trim(), description: this.g.description, visibility: this.g.visibility, defaultBranch: this.g.defaultBranch, mergeMethods: this.g.mergeMethods, deleteBranchOnMerge: this.g.deleteBranchOnMerge, allowAutoMerge: this.g.allowAutoMerge }
|
|
3473
|
+
: { description: this.g.description, defaultBranch: this.g.defaultBranch, mergeMethods: this.g.mergeMethods, deleteBranchOnMerge: this.g.deleteBranchOnMerge, allowAutoMerge: this.g.allowAutoMerge };
|
|
3433
3474
|
this.api.update(this.projectId(), r.name, body).subscribe({
|
|
3434
3475
|
next: (n) => {
|
|
3435
3476
|
this.busy.set(false);
|
|
@@ -3520,6 +3561,7 @@ class RepoSettingsPage extends RepoPage {
|
|
|
3520
3561
|
@for (m of methods; track m.id) {<label class="o-flex"><input type="checkbox" [checked]="g.mergeMethods.includes(m.id)" (change)="flipMethod(m.id)" [disabled]="!canMaintain()" />{{ m.label }}</label>}
|
|
3521
3562
|
</div>
|
|
3522
3563
|
<div class="o-flex"><button type="button" class="o-tog" role="switch" aria-labelledby="rs-del" [class.o-on]="g.deleteBranchOnMerge" [attr.aria-checked]="g.deleteBranchOnMerge" (click)="g.deleteBranchOnMerge = !g.deleteBranchOnMerge" [disabled]="!canMaintain()"></button><span id="rs-del">Delete head branches after merge</span></div>
|
|
3564
|
+
<div class="o-flex"><button type="button" class="o-tog" role="switch" aria-labelledby="rs-auto" [class.o-on]="g.allowAutoMerge" [attr.aria-checked]="g.allowAutoMerge" (click)="g.allowAutoMerge = !g.allowAutoMerge" [disabled]="!canMaintain()" data-testid="allow-auto-merge"></button><span id="rs-auto">Allow auto-merge when all requirements pass</span></div>
|
|
3523
3565
|
<div class="o-flex"><button type="button" class="o-tog o-dis" disabled aria-label="Allow auto-merge"></button>Allow auto-merge when all requirements pass<b class="o-ph-tag o-ga">GA</b></div>
|
|
3524
3566
|
@if (canMaintain()) {<div class="o-flex">@if (!canAdmin()) {<span class="o-faint o-sm">As a maintain collaborator you change these settings; a project Maintainer renames the repository or changes its visibility.</span>}<button type="submit" class="o-btn o-dark o-r" [disabled]="busy() || !g.mergeMethods.length" data-testid="settings-save">Save</button></div>}
|
|
3525
3567
|
</form>
|
|
@@ -3545,7 +3587,9 @@ class RepoSettingsPage extends RepoPage {
|
|
|
3545
3587
|
<input id="rule-check" class="o-in o-sm o-mono" style="width:160px" placeholder="+ check name, Enter" [ngModel]="check()" (ngModelChange)="check.set($event)" name="check" (keydown.enter)="$event.preventDefault(); addCheck(f)" />
|
|
3546
3588
|
</div>
|
|
3547
3589
|
</div>
|
|
3548
|
-
<div class="o-fld"><span class="o-lbl" style="padding:0">Allowed to bypass
|
|
3590
|
+
<div class="o-fld"><span class="o-lbl" style="padding:0">Allowed to bypass</span><div class="o-flex o-wrap">
|
|
3591
|
+
@for (b of bypassRoles; track b.id) {<button type="button" class="o-chip" style="cursor:pointer;border:none" [class.o-blu]="f.bypass.includes(b.id)" [attr.aria-pressed]="f.bypass.includes(b.id)" (click)="flipBypass(f, b.id)" [attr.data-testid]="'bypass-' + b.id">{{ b.label }}</button>}
|
|
3592
|
+
<span class="o-hint">Pushes by these roles go through this rule; every bypass is written to the audit log.</span></div></div>
|
|
3549
3593
|
<div class="o-fld"><span class="o-lbl" style="padding:0">What a blocked push sees</span><div class="o-term" style="font-size:11.5px"><div>$ git push origin {{ f.pattern || 'main' }}</div><div>remote: ✕ {{ f.pattern || 'main' }} is protected by rule “{{ f.pattern || 'main' }}”: direct pushes are blocked.</div><div>remote: Open a pull request instead.</div></div></div>
|
|
3550
3594
|
<div class="o-flex">
|
|
3551
3595
|
@if (f.id) {<button type="button" class="o-btn o-sm o-ghost" style="color:var(--o-bad-tx)" (click)="removeRule(f)">Delete rule</button>}
|
|
@@ -3645,6 +3689,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
3645
3689
|
@for (m of methods; track m.id) {<label class="o-flex"><input type="checkbox" [checked]="g.mergeMethods.includes(m.id)" (change)="flipMethod(m.id)" [disabled]="!canMaintain()" />{{ m.label }}</label>}
|
|
3646
3690
|
</div>
|
|
3647
3691
|
<div class="o-flex"><button type="button" class="o-tog" role="switch" aria-labelledby="rs-del" [class.o-on]="g.deleteBranchOnMerge" [attr.aria-checked]="g.deleteBranchOnMerge" (click)="g.deleteBranchOnMerge = !g.deleteBranchOnMerge" [disabled]="!canMaintain()"></button><span id="rs-del">Delete head branches after merge</span></div>
|
|
3692
|
+
<div class="o-flex"><button type="button" class="o-tog" role="switch" aria-labelledby="rs-auto" [class.o-on]="g.allowAutoMerge" [attr.aria-checked]="g.allowAutoMerge" (click)="g.allowAutoMerge = !g.allowAutoMerge" [disabled]="!canMaintain()" data-testid="allow-auto-merge"></button><span id="rs-auto">Allow auto-merge when all requirements pass</span></div>
|
|
3648
3693
|
<div class="o-flex"><button type="button" class="o-tog o-dis" disabled aria-label="Allow auto-merge"></button>Allow auto-merge when all requirements pass<b class="o-ph-tag o-ga">GA</b></div>
|
|
3649
3694
|
@if (canMaintain()) {<div class="o-flex">@if (!canAdmin()) {<span class="o-faint o-sm">As a maintain collaborator you change these settings; a project Maintainer renames the repository or changes its visibility.</span>}<button type="submit" class="o-btn o-dark o-r" [disabled]="busy() || !g.mergeMethods.length" data-testid="settings-save">Save</button></div>}
|
|
3650
3695
|
</form>
|
|
@@ -3670,7 +3715,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
3670
3715
|
<input id="rule-check" class="o-in o-sm o-mono" style="width:160px" placeholder="+ check name, Enter" [ngModel]="check()" (ngModelChange)="check.set($event)" name="check" (keydown.enter)="$event.preventDefault(); addCheck(f)" />
|
|
3671
3716
|
</div>
|
|
3672
3717
|
</div>
|
|
3673
|
-
<div class="o-fld"><span class="o-lbl" style="padding:0">Allowed to bypass
|
|
3718
|
+
<div class="o-fld"><span class="o-lbl" style="padding:0">Allowed to bypass</span><div class="o-flex o-wrap">
|
|
3719
|
+
@for (b of bypassRoles; track b.id) {<button type="button" class="o-chip" style="cursor:pointer;border:none" [class.o-blu]="f.bypass.includes(b.id)" [attr.aria-pressed]="f.bypass.includes(b.id)" (click)="flipBypass(f, b.id)" [attr.data-testid]="'bypass-' + b.id">{{ b.label }}</button>}
|
|
3720
|
+
<span class="o-hint">Pushes by these roles go through this rule; every bypass is written to the audit log.</span></div></div>
|
|
3674
3721
|
<div class="o-fld"><span class="o-lbl" style="padding:0">What a blocked push sees</span><div class="o-term" style="font-size:11.5px"><div>$ git push origin {{ f.pattern || 'main' }}</div><div>remote: ✕ {{ f.pattern || 'main' }} is protected by rule “{{ f.pattern || 'main' }}”: direct pushes are blocked.</div><div>remote: Open a pull request instead.</div></div></div>
|
|
3675
3722
|
<div class="o-flex">
|
|
3676
3723
|
@if (f.id) {<button type="button" class="o-btn o-sm o-ghost" style="color:var(--o-bad-tx)" (click)="removeRule(f)">Delete rule</button>}
|
|
@@ -4286,5 +4333,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
4286
4333
|
* Generated bundle index. Do not edit.
|
|
4287
4334
|
*/
|
|
4288
4335
|
|
|
4289
|
-
export { BranchesPage, CodeApi, CodeHost, CommitBox, CommitPage, CommitsPage, CurrentRepo, CurrentRepoPage, DiffView, FilePage, NewFilePage, NewRepoPage, People, PullPage, PullsPage, RefPicker, ReleasesPage, RepoHomePage, RepoPage, RepoSettingsPage, ReposPage, TOKEN_CSS, ago, apiMessage, checkDot, copy, dayLabel, initials, langColour, matchesPattern, pair, shortDate, size };
|
|
4336
|
+
export { BranchesPage, CodeApi, CodeHost, CommitBox, CommitPage, CommitsPage, CurrentRepo, CurrentRepoPage, DiffView, FilePage, NewFilePage, NewRepoPage, People, PullPage, PullsPage, RefPicker, ReleasesPage, RepoHomePage, RepoPage, RepoSettingsPage, ReposPage, TOKEN_CSS, ago, apiMessage, checkDot, copy, dayLabel, initials, langColour, matchesPattern, pair, shortDate, size, verifyWhy };
|
|
4290
4337
|
//# sourceMappingURL=chisquare-tech-origine-ngx-apps-code.mjs.map
|