Skip to content

Commit 1395368

Browse files
committed
Enhance AgentsListRow component by adding prop type documentation for accountID, displayName, login, and avatar. Update comment regarding action buttons to align with phased rollout plan.
1 parent 4dbae3d commit 1395368

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/pages/settings/Agents/AgentsListRow.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,16 @@ import type {AvatarSource} from '@libs/UserAvatarUtils';
77
import CONST from '@src/CONST';
88

99
type AgentsListRowProps = {
10+
/** Account ID of the agent */
1011
accountID: number;
12+
13+
/** Display name of the agent */
1114
displayName: string;
15+
16+
/** Login email of the agent */
1217
login: string;
18+
19+
/** Avatar source of the agent */
1320
avatar: AvatarSource;
1421
};
1522

@@ -42,7 +49,7 @@ function AgentsListRow({accountID, displayName, login, avatar}: AgentsListRowPro
4249
{login}
4350
</Text>
4451
</View>
45-
{/* Chat, Co-pilot and Edit buttons will be added in R1.3 */}
52+
{/* Action buttons are deferred to R1.3 per phased rollout plan */}
4653
</View>
4754
);
4855
}

tests/unit/pages/settings/AgentsPageTest.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,16 @@ describe('AgentsPage', () => {
150150
});
151151

152152
it('shows agent list when agents exist in Onyx', () => {
153+
const TEST_ACCOUNT_ID = 12345;
153154
mockUseOnyx.mockImplementation((key) => {
154155
if (key === ONYXKEYS.COLLECTION.SHARED_NVP_AGENT_PROMPT) {
155-
return [{[`${ONYXKEYS.COLLECTION.SHARED_NVP_AGENT_PROMPT}12345`]: {prompt: 'Test prompt'}}, {status: 'loaded'}];
156+
return [{[`${ONYXKEYS.COLLECTION.SHARED_NVP_AGENT_PROMPT}${TEST_ACCOUNT_ID}`]: {prompt: 'Test prompt'}}, {status: 'loaded'}];
156157
}
157158
if (key === ONYXKEYS.PERSONAL_DETAILS_LIST) {
158159
return [
159160
{
160-
12345: {
161-
accountID: 12345,
161+
[TEST_ACCOUNT_ID]: {
162+
accountID: TEST_ACCOUNT_ID,
162163
displayName: 'Test Agent',
163164
login: 'agent@example.com',
164165
avatar: undefined,

0 commit comments

Comments
 (0)