Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/superannotate/lib/app/interface/sdk_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
33 changes: 27 additions & 6 deletions src/superannotate/lib/app/mixp/utils/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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

},
}


Expand Down Expand Up @@ -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},
}