Skip to content

Commit dc2444c

Browse files
Merge branch 'main' of github.com:CenterForOpenScience/angular-osf into feat/502-add-community-metadata
2 parents dabeb9f + 26fbc6f commit dc2444c

163 files changed

Lines changed: 2644 additions & 1225 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"id": 7359757,
3+
"name": "All Branch Rules",
4+
"target": "branch",
5+
"source_type": "Repository",
6+
"source": "CenterForOpenScience/angular-osf",
7+
"enforcement": "disabled",
8+
"conditions": {
9+
"ref_name": {
10+
"exclude": ["refs/heads/main", "refs/heads/develop"],
11+
"include": ["~ALL"]
12+
}
13+
},
14+
"rules": [
15+
{
16+
"type": "deletion"
17+
},
18+
{
19+
"type": "required_review_thread_resolution",
20+
"parameters": {
21+
"enabled": true
22+
}
23+
},
24+
{
25+
"type": "pull_request",
26+
"parameters": {
27+
"required_approving_review_count": 1,
28+
"dismiss_stale_reviews_on_push": true,
29+
"require_code_owner_review": false,
30+
"require_last_push_approval": true,
31+
"automatic_copilot_code_review_enabled": false,
32+
"allowed_merge_methods": ["squash"]
33+
}
34+
}
35+
],
36+
"bypass_actors": []
37+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"id": 7359601,
3+
"name": "Main/Develop Branch Rules",
4+
"target": "branch",
5+
"source_type": "Repository",
6+
"source": "CenterForOpenScience/angular-osf",
7+
"enforcement": "active",
8+
"conditions": {
9+
"ref_name": {
10+
"exclude": [],
11+
"include": ["~DEFAULT_BRANCH", "refs/heads/develop"]
12+
}
13+
},
14+
"rules": [
15+
{
16+
"type": "deletion"
17+
},
18+
{
19+
"type": "non_fast_forward"
20+
},
21+
{
22+
"type": "merge_queue",
23+
"parameters": {
24+
"merge_method": "SQUASH",
25+
"max_entries_to_build": 8,
26+
"min_entries_to_merge": 1,
27+
"max_entries_to_merge": 5,
28+
"min_entries_to_merge_wait_minutes": 5,
29+
"grouping_strategy": "ALLGREEN",
30+
"check_response_timeout_minutes": 90
31+
}
32+
},
33+
{
34+
"type": "required_review_thread_resolution",
35+
"parameters": {
36+
"enabled": true
37+
}
38+
},
39+
{
40+
"type": "pull_request",
41+
"parameters": {
42+
"required_approving_review_count": 1,
43+
"dismiss_stale_reviews_on_push": true,
44+
"require_code_owner_review": false,
45+
"require_last_push_approval": true,
46+
"automatic_copilot_code_review_enabled": false,
47+
"allowed_merge_methods": ["squash"]
48+
}
49+
}
50+
],
51+
"bypass_actors": []
52+
}

.github/workflows/review.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: actions/github-script@v7
1919
with:
2020
script: |
21-
const {owner, repo} = context.repo;
21+
const { owner, repo } = context.repo;
2222
2323
// Determine PR number for both pull_request and pull_request_review events
2424
let number;
@@ -41,11 +41,13 @@ jobs:
4141
const latestByUser = new Map();
4242
for (const r of reviews) latestByUser.set(r.user.id, r.state);
4343
44-
// Count approvals
4544
const approvals = [...latestByUser.values()].filter(s => s === 'APPROVED').length;
45+
const hasRequestChanges = [...latestByUser.values()].includes('CHANGES_REQUESTED');
4646
4747
if (approvals < 1) {
4848
core.setFailed(`PR #${number} requires at least one approving review before merging.`);
49+
} else if (hasRequestChanges) {
50+
core.setFailed(`PR #${number} cannot be merged because at least one reviewer has requested changes.`);
4951
} else {
5052
core.info(`Approvals found: ${approvals}. Check passed.`);
5153
}

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ module.exports = tseslint.config(
9090
files: ['**/*.spec.ts'],
9191
rules: {
9292
'@typescript-eslint/no-explicit-any': 'off',
93+
'@typescript-eslint/no-empty-function': 'off',
9394
},
9495
}
9596
);

package-lock.json

Lines changed: 19 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@
6767
"@commitlint/cli": "^19.7.1",
6868
"@commitlint/config-conventional": "^19.7.1",
6969
"@compodoc/compodoc": "^1.1.26",
70+
"@types/gapi": "^0.0.47",
71+
"@types/gapi.auth2": "^0.0.61",
7072
"@types/jest": "^29.5.14",
7173
"@types/markdown-it": "^14.1.2",
7274
"angular-eslint": "19.1.0",

src/@types/global.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type gapi from 'gapi-script'; // or just `import gapi from 'gapi-script';`
2+
3+
declare global {
4+
interface Window {
5+
gapi: typeof gapi;
6+
google: {
7+
picker: typeof google.picker;
8+
};
9+
}
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { InjectionToken } from '@angular/core';
2+
3+
import { environment } from 'src/environments/environment';
4+
5+
export const ENVIRONMENT = new InjectionToken<typeof environment>('App Environment', {
6+
providedIn: 'root',
7+
factory: () => environment,
8+
});

src/app/features/collections/components/add-to-collection/project-contributors-step/project-contributors-step.component.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
<p-step [value]="targetStepValue()" [disabled]="isDisabled()">
88
<ng-template #content>
99
<div class="flex flex-column gap-4 w-full">
10-
<h3>{{ 'collections.addToCollection.projectContributors' | translate }}</h3>
10+
<div class="flex align-items-baseline gap-1">
11+
<h3>{{ 'collections.addToCollection.projectContributors' | translate }}</h3>
12+
<osf-info-icon
13+
[tooltipText]="'collections.addToCollection.contributorsTooltip' | translate"
14+
tooltipPosition="bottom"
15+
></osf-info-icon>
16+
</div>
1117
@if (!isDisabled() && stepperActiveValue() !== targetStepValue()) {
1218
@if (projectContributors().length) {
1319
<div class="flex flex-column gap-2">

src/app/features/collections/components/add-to-collection/project-contributors-step/project-contributors-step.component.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,27 @@ import { filter } from 'rxjs/operators';
1313
import { ChangeDetectionStrategy, Component, DestroyRef, effect, inject, input, output, signal } from '@angular/core';
1414
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
1515

16-
import { findChangedItems } from '@osf/shared/helpers';
16+
import { InfoIconComponent } from '@osf/shared/components';
1717
import {
1818
AddContributorDialogComponent,
1919
AddUnregisteredContributorDialogComponent,
2020
ContributorsListComponent,
21-
} from '@shared/components/contributors';
22-
import { AddContributorType, ResourceType } from '@shared/enums';
23-
import { ContributorDialogAddModel, ContributorModel } from '@shared/models';
24-
import { CustomConfirmationService, ToastService } from '@shared/services';
25-
import { AddContributor, ContributorsSelectors, DeleteContributor, UpdateContributor } from '@shared/stores';
26-
import { ProjectsSelectors } from '@shared/stores/projects/projects.selectors';
21+
} from '@osf/shared/components/contributors';
22+
import { AddContributorType, ResourceType } from '@osf/shared/enums';
23+
import { findChangedItems } from '@osf/shared/helpers';
24+
import { ContributorDialogAddModel, ContributorModel } from '@osf/shared/models';
25+
import { CustomConfirmationService, ToastService } from '@osf/shared/services';
26+
import {
27+
AddContributor,
28+
ContributorsSelectors,
29+
DeleteContributor,
30+
ProjectsSelectors,
31+
UpdateContributor,
32+
} from '@osf/shared/stores';
2733

2834
@Component({
2935
selector: 'osf-project-contributors-step',
30-
imports: [Button, TranslatePipe, ContributorsListComponent, Step, StepItem, StepPanel, Tooltip],
36+
imports: [Button, Step, StepItem, StepPanel, Tooltip, TranslatePipe, ContributorsListComponent, InfoIconComponent],
3137
templateUrl: './project-contributors-step.component.html',
3238
styleUrl: './project-contributors-step.component.scss',
3339
providers: [DialogService],
@@ -40,9 +46,9 @@ export class ProjectContributorsStepComponent {
4046
private readonly toastService = inject(ToastService);
4147
private readonly customConfirmationService = inject(CustomConfirmationService);
4248

43-
protected readonly projectContributors = select(ContributorsSelectors.getContributors);
44-
protected readonly isContributorsLoading = select(ContributorsSelectors.isContributorsLoading);
45-
protected readonly selectedProject = select(ProjectsSelectors.getSelectedProject);
49+
readonly projectContributors = select(ContributorsSelectors.getContributors);
50+
readonly isContributorsLoading = select(ContributorsSelectors.isContributorsLoading);
51+
readonly selectedProject = select(ProjectsSelectors.getSelectedProject);
4652

4753
private initialContributors = signal<ContributorModel[]>([]);
4854

0 commit comments

Comments
 (0)