Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a curator to profile #1197

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add a curator to profile #1197

wants to merge 2 commits into from

Conversation

Katrin-kudryash
Copy link
Contributor

@Katrin-kudryash Katrin-kudryash commented Nov 13, 2024

PR includes

  • Feature

Related issues

Resolve #1193

@Katrin-kudryash Katrin-kudryash force-pushed the issues-1193 branch 2 times, most recently from 0f65236 to a6f4ac5 Compare November 18, 2024 06:44
@@ -11,5 +11,7 @@
"Retirement": "Увольнение",
"Transfer": "Перевод",
"Supplemental: ": "Дополнительно: ",
"Previous names": "Предыдущие ФИО"
"Previous names": "Предыдущие ФИО",
"Curator": "",
Copy link
Contributor

Choose a reason for hiding this comment

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

Translations

src/components/UserPage/UserPage.tsx Outdated Show resolved Hide resolved
src/components/UserUpdateForm/UserUpdateForm.tsx Outdated Show resolved Hide resolved
src/modules/userSchemas.ts Outdated Show resolved Hide resolved
src/modules/userMethods.ts Outdated Show resolved Hide resolved
src/trpc/router/restRouter.ts Outdated Show resolved Hide resolved
@Katrin-kudryash
Copy link
Contributor Author

s

@Katrin-kudryash
Copy link
Contributor Author

Screen.mov

@Katrin-kudryash
Copy link
Contributor Author

Scr.mov

"Save previous name:": "Сохранить предыдущее ФИО"
"Save previous name:": "Сохранить предыдущее ФИО",
"Curators:": "Кураторы",
"Curator": ""
Copy link
Contributor

Choose a reason for hiding this comment

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

Translation

onClose: () => void;
}

interface UserFormExternalTeamBlockType {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like unnecessary type

const savePreviousName = watch('savePreviousName') ?? false;

const updateUser = async (data: EditUser) => {
await editUser(data);
onClose();
};

const onCuratorsChange = (users: User[], type: keyof UserFormExternalTeamBlockType) => {
setValue(
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just setValue('curatorIds', ...)?

@@ -2,6 +2,7 @@ export interface ExternalUserUpdate {
email: string;
name?: string;
supervisorId?: string | null;
curators?: string[] | null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Curators cannot be saved in external update

},
{
name: result.name,
supervisorId: result.supervisorId,
organizationalUnitId: result.organizationUnitId ?? undefined,
email: result.email,
curatorIds: input.curatorIds,
Copy link
Contributor

Choose a reason for hiding this comment

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

Getting real list of curators would be more reliable than using input


if (curatorIds) {
updateUser.curators = {
connect: curatorIds.map((id) => ({ id })),
Copy link
Contributor

Choose a reason for hiding this comment

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

but where is disconnect?

@Katrin-kudryash Katrin-kudryash force-pushed the issues-1193 branch 3 times, most recently from f5c208d to 105db6e Compare November 22, 2024 07:47
@Katrin-kudryash
Copy link
Contributor Author

S.mov

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.

Add a curator to profile
4 participants