Skip to content

Conversation

@mkovalua
Copy link
Contributor

@mkovalua mkovalua commented Oct 16, 2025

Purpose

Contributor page of components should offer option to import contributors from parent project.

Summary of Changes

Updating front end and back end code for such a purpose, allow only project with parent to do the stuff

Back End updates for the PR

CenterForOpenScience/osf.io#11376

Screenshot(s)

Screen.Recording.2025-10-17.at.23.37.54.online-video-cutter.com.mp4
image

Side Effects

QA Notes

@nsemets nsemets marked this pull request as ready for review October 17, 2025 15:02
class="w-full"
styleClass="w-full"
(click)="addSourceProjectContributors()"
[label]="'add Source Project Contributors' | translate"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add translation.

styleClass="w-full"
(click)="addSourceProjectContributors()"
[label]="'add Source Project Contributors' | translate"
data-test-add-contributor-button
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not correct data-test attribute. It must be data-test-add-contributors-from-parent or something similar..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it is redundant at all, have copied it from another button of same file

alert(this.allowAddingContributorsFromParentProject());
if (this.allowAddingContributorsFromParentProject()) {
const currentProject = this.currentProject();
alert(JSON.stringify(currentProject));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this.

clearUsers: ClearUsers,
getParentProject: GetParentProject,
getComponentsTree: GetResourceWithChildren,
getSubjects: FetchSelectedSubjects,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need subjects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, thanks

Comment on lines 68 to 69
getParentProject: GetParentProject,
getComponentsTree: GetResourceWithChildren,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also why do you need parent and components tree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for now, have found a workaround to get parent in the component where we called the component

readonly hasComponents = computed(() => this.components().length > 0);
readonly buttonLabel = computed(() => (this.isComponentsState() ? 'common.buttons.done' : 'common.buttons.next'));

currentProject = select(ProjectOverviewSelectors.getProject);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this.

header: 'project.contributors.addDialog.addRegisteredContributor',
width: '448px',
data: addedContributorIds,
data: { addedContributorIds, allowAddingContributorsFromParentProject: true },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preprints don't need this option. Remove it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix this comment.

@mkovalua mkovalua requested a review from nsemets October 20, 2025 09:05
header: 'project.contributors.addDialog.addRegisteredContributor',
width: '448px',
data: addedContributorIds,
data: { addedContributorIds, allowAddingContributorsFromParentProject: true },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix this comment.

class="w-full"
styleClass="w-full"
severity="secondary"
(click)="addSourceProjectContributors()"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(click)="addSourceProjectContributors()"
(onClick)="addSourceProjectContributors()"

}

addContributorsFromProject(resourceType: ResourceType, resourceId: string): Observable<void> {
const baseUrl = `${this.getBaseUrl(resourceType, resourceId)}/?copy_contributors_from_parent_project=${true}`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const baseUrl = `${this.getBaseUrl(resourceType, resourceId)}/?copy_contributors_from_parent_project=${true}`;
const baseUrl = `${this.getBaseUrl(resourceType, resourceId)}/?copy_contributors_from_parent_project=true`;

@nsemets
Copy link
Collaborator

nsemets commented Oct 20, 2025

Change base branch to feature/pbs-25.01.

@mkovalua mkovalua changed the base branch from main to feature/pbs-25.01 October 20, 2025 13:46
@mkovalua mkovalua changed the base branch from feature/pbs-25.01 to main October 20, 2025 15:16
@mkovalua
Copy link
Contributor Author

Fixing merge conflicts for the following PR by creating a new branch from target branch (there were so much conflicts to fix it in this PR)

https://github.com/CenterForOpenScience/angular-osf/pull/685/files

@mkovalua mkovalua closed this Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants