diff --git a/src/superannotate/lib/app/interface/sdk_interface.py b/src/superannotate/lib/app/interface/sdk_interface.py index 867fe057f..15ad27198 100644 --- a/src/superannotate/lib/app/interface/sdk_interface.py +++ b/src/superannotate/lib/app/interface/sdk_interface.py @@ -2804,8 +2804,8 @@ def add_contributors_to_project( :param role: user role to apply, one of Admin , Annotator , QA :type role: str - return: lists of added, skipped contributors of the project - rtype: tuple (2 members) of lists of strs + :return: lists of added, skipped contributors of the project + :rtype: tuple (2 members) of lists of strs """ response = controller.add_contributors_to_project( project_name=project, emails=emails, role=role @@ -2828,8 +2828,8 @@ def invite_contributors_to_team( :param admin: enables admin privileges for the contributor :type admin: bool - return: lists of invited, skipped contributors of the team - rtype: tuple (2 members) of lists of strs + :return: lists of invited, skipped contributors of the team + :rtype: tuple (2 members) of lists of strs """ response = controller.invite_contributors_to_team(emails=emails, set_admin=admin) if response.errors: diff --git a/src/superannotate/lib/app/mixp/utils/parsers.py b/src/superannotate/lib/app/mixp/utils/parsers.py index 96b4bb17d..0a63b4a45 100644 --- a/src/superannotate/lib/app/mixp/utils/parsers.py +++ b/src/superannotate/lib/app/mixp/utils/parsers.py @@ -24,13 +24,15 @@ def get_team_metadata(*args, **kwargs): def invite_contributors_to_team(*args, **kwargs): admin = kwargs.get("admin", None) - if not admin: + if admin is None: admin = args[1:2] - if admin: - admin = "CUSTOM" + if not admin: + admin_value = False + if admin: + admin_value = admin[0] else: - admin = "DEFAULT" - return {"event_name": "invite_contributors_to_team", "properties": {"Admin": admin}} + admin_value = admin + return {"event_name": "invite_contributors_to_team", "properties": {"Admin": admin_value}} def search_team_contributors(*args, **kwargs): @@ -1071,9 +1073,17 @@ def aggregate_annotations_as_df(*args, **kwargs): if folder_names is None: folder_names = [] + project_type = kwargs.get("project_type", None) + if not project_type: + project_type = args[1] + return { "event_name": "aggregate_annotations_as_df", - "properties": {"Folder Count": len(folder_names)}, + "properties": { + "Folder Count": len(folder_names), + "Project Type": project_type + + }, } @@ -1185,3 +1195,14 @@ def validate_annotations(*args, **kwargs): "event_name": "validate_annotations", "properties": {"Project Type": project_type}, } + + +def add_contributors_to_project(*args, **kwargs): + user_role = kwargs.get("role", None) + if not user_role: + user_role = args[2:3] + + return { + "event_name": "add_contributors_to_project", + "properties": {"User Role": user_role}, + }