Skip to content

Commit 117bccc

Browse files
robot-ci-heartexfern-api[bot]hakan458
authored
feat: FIT-582: Members Page performance improvement to display only users with contributions (#536)
Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: hakan458 <[email protected]>
1 parent a5a6844 commit 117bccc

File tree

10 files changed

+402
-26
lines changed

10 files changed

+402
-26
lines changed

.mock/definition/projects.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -969,25 +969,6 @@ service:
969969
task_count: 1
970970
audiences:
971971
- public
972-
api_projects_members_retrieve:
973-
path: /api/projects/{id}/members/
974-
method: GET
975-
auth: true
976-
docs: Retrieve the members for a specific project.
977-
source:
978-
openapi: openapi/openapi.yaml
979-
path-parameters:
980-
id: integer
981-
display-name: Get project members
982-
response:
983-
docs: ''
984-
type: root.ProjectMember
985-
examples:
986-
- path-parameters:
987-
id: 1
988-
response:
989-
body:
990-
user: 1
991972
api_projects_members_create:
992973
path: /api/projects/{id}/members/
993974
method: POST
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
imports:
2+
root: ../__package__.yml
3+
service:
4+
auth: false
5+
base-path: ''
6+
endpoints:
7+
get:
8+
path: /api/projects/{id}/members/
9+
method: GET
10+
auth: true
11+
docs: >-
12+
Retrieve the members for a specific project. Optionally filter by user
13+
IDs (comma-separated).
14+
source:
15+
openapi: openapi/openapi.yaml
16+
path-parameters:
17+
id: integer
18+
display-name: Get project members
19+
request:
20+
name: MembersGetRequest
21+
query-parameters:
22+
user_ids:
23+
type: optional<string>
24+
docs: >-
25+
Comma-separated list of user IDs to include. Example:
26+
user_ids=1,2,3
27+
response:
28+
docs: List of users with membership information
29+
type: list<root.LseUser>
30+
examples:
31+
- path-parameters:
32+
id: 1
33+
response:
34+
body:
35+
- active_organization: 1
36+
active_organization_meta: active_organization_meta
37+
allow_newsletters: true
38+
avatar: avatar
39+
custom_hotkeys:
40+
key: value
41+
date_joined: '2024-01-15T09:30:00Z'
42+
email: email
43+
first_name: first_name
44+
id: 1
45+
initials: initials
46+
last_activity: '2024-01-15T09:30:00Z'
47+
last_name: last_name
48+
lse_fields:
49+
email_notification_settings: email_notification_settings
50+
invite_activated: true
51+
invite_expired: invite_expired
52+
invite_expired_at: invite_expired_at
53+
invited_at: '2024-01-15T09:30:00Z'
54+
invited_by: 1
55+
onboarding_state: not_started
56+
social_auth_finished: true
57+
trial_company: trial_company
58+
trial_experience_labeling: trial_experience_labeling
59+
trial_license_enterprise: true
60+
trial_models_in_production: trial_models_in_production
61+
trial_role: annotator
62+
org_membership:
63+
- active: active
64+
organization_id: 1
65+
role: role
66+
pause: pause
67+
phone: phone
68+
username: username
69+
audiences:
70+
- public
71+
source:
72+
openapi: openapi/openapi.yaml

.mock/openapi/openapi.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7106,26 +7106,39 @@ paths:
71067106
tags:
71077107
- Projects
71087108
get:
7109-
description: Retrieve the members for a specific project.
7109+
description: Retrieve the members for a specific project. Optionally filter by user IDs (comma-separated).
71107110
operationId: api_projects_members_retrieve
71117111
parameters:
71127112
- in: path
71137113
name: id
71147114
required: true
71157115
schema:
71167116
type: integer
7117+
- description: 'Comma-separated list of user IDs to include. Example: user_ids=1,2,3'
7118+
in: query
7119+
name: user_ids
7120+
schema:
7121+
type: string
71177122
responses:
71187123
'200':
71197124
content:
71207125
application/json:
71217126
schema:
7122-
$ref: '#/components/schemas/ProjectMember'
7123-
description: ''
7127+
items:
7128+
$ref: '#/components/schemas/LseUser'
7129+
type: array
7130+
description: List of users with membership information
71247131
security:
71257132
- Token: []
71267133
summary: Get project members
71277134
tags:
71287135
- Projects
7136+
x-fern-audiences:
7137+
- public
7138+
x-fern-sdk-group-name:
7139+
- projects
7140+
- members
7141+
x-fern-sdk-method-name: get
71297142
post:
71307143
description: Add a member to a specific project.
71317144
operationId: api_projects_members_create

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reference.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20265,6 +20265,85 @@ client.projects.exports.convert(
2026520265
</dl>
2026620266

2026720267

20268+
</dd>
20269+
</dl>
20270+
</details>
20271+
20272+
## Projects Members
20273+
<details><summary><code>client.projects.members.<a href="src/label_studio_sdk/projects/members/client.py">get</a>(...)</code></summary>
20274+
<dl>
20275+
<dd>
20276+
20277+
#### 📝 Description
20278+
20279+
<dl>
20280+
<dd>
20281+
20282+
<dl>
20283+
<dd>
20284+
20285+
Retrieve the members for a specific project. Optionally filter by user IDs (comma-separated).
20286+
</dd>
20287+
</dl>
20288+
</dd>
20289+
</dl>
20290+
20291+
#### 🔌 Usage
20292+
20293+
<dl>
20294+
<dd>
20295+
20296+
<dl>
20297+
<dd>
20298+
20299+
```python
20300+
from label_studio_sdk import LabelStudio
20301+
20302+
client = LabelStudio(
20303+
api_key="YOUR_API_KEY",
20304+
)
20305+
client.projects.members.get(
20306+
id=1,
20307+
)
20308+
20309+
```
20310+
</dd>
20311+
</dl>
20312+
</dd>
20313+
</dl>
20314+
20315+
#### ⚙️ Parameters
20316+
20317+
<dl>
20318+
<dd>
20319+
20320+
<dl>
20321+
<dd>
20322+
20323+
**id:** `int`
20324+
20325+
</dd>
20326+
</dl>
20327+
20328+
<dl>
20329+
<dd>
20330+
20331+
**user_ids:** `typing.Optional[str]` — Comma-separated list of user IDs to include. Example: user_ids=1,2,3
20332+
20333+
</dd>
20334+
</dl>
20335+
20336+
<dl>
20337+
<dd>
20338+
20339+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
20340+
20341+
</dd>
20342+
</dl>
20343+
</dd>
20344+
</dl>
20345+
20346+
2026820347
</dd>
2026920348
</dl>
2027020349
</details>

src/label_studio_sdk/projects/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
ProjectsImportTasksResponse,
1010
ProjectsListRequestFilter,
1111
)
12-
from . import assignments, exports, pauses, stats
12+
from . import assignments, exports, members, pauses, stats
1313
from .assignments import (
1414
AssignmentsAssignRequestType,
1515
AssignmentsBulkAssignRequestFilters,
@@ -58,6 +58,7 @@
5858
"StatsIaaResponseStd",
5959
"assignments",
6060
"exports",
61+
"members",
6162
"pauses",
6263
"stats",
6364
]

src/label_studio_sdk/projects/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import typing
44
from ..core.client_wrapper import SyncClientWrapper
55
from .exports.client import ExportsClient
6+
from .members.client import MembersClient
67
from .stats.client import StatsClient
78
from .assignments.client import AssignmentsClient
89
from .pauses.client import PausesClient
@@ -35,6 +36,7 @@
3536
from ..types.project_label_config import ProjectLabelConfig
3637
from ..core.client_wrapper import AsyncClientWrapper
3738
from .exports.client import AsyncExportsClient
39+
from .members.client import AsyncMembersClient
3840
from .stats.client import AsyncStatsClient
3941
from .assignments.client import AsyncAssignmentsClient
4042
from .pauses.client import AsyncPausesClient
@@ -48,6 +50,7 @@ class ProjectsClient:
4850
def __init__(self, *, client_wrapper: SyncClientWrapper):
4951
self._client_wrapper = client_wrapper
5052
self.exports = ExportsClient(client_wrapper=self._client_wrapper)
53+
self.members = MembersClient(client_wrapper=self._client_wrapper)
5154
self.stats = StatsClient(client_wrapper=self._client_wrapper)
5255
self.assignments = AssignmentsClient(client_wrapper=self._client_wrapper)
5356
self.pauses = PausesClient(client_wrapper=self._client_wrapper)
@@ -976,6 +979,7 @@ class AsyncProjectsClient:
976979
def __init__(self, *, client_wrapper: AsyncClientWrapper):
977980
self._client_wrapper = client_wrapper
978981
self.exports = AsyncExportsClient(client_wrapper=self._client_wrapper)
982+
self.members = AsyncMembersClient(client_wrapper=self._client_wrapper)
979983
self.stats = AsyncStatsClient(client_wrapper=self._client_wrapper)
980984
self.assignments = AsyncAssignmentsClient(client_wrapper=self._client_wrapper)
981985
self.pauses = AsyncPausesClient(client_wrapper=self._client_wrapper)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+

0 commit comments

Comments
 (0)