mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[ACS-8210] Agent basic details popup (#9956)
This commit is contained in:
committed by
Aleksander Sklorz
parent
16e851e6b5
commit
8abc6d495d
@@ -32,4 +32,15 @@ export class AgentsApi extends BaseApi {
|
||||
path: '/agents'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets agent avatar by id.
|
||||
*
|
||||
* @returns string with an image.
|
||||
*/
|
||||
getAgentAvatar(agentId: string): Promise<string> {
|
||||
return this.get({
|
||||
path: `/agents/${agentId}/avatars/-default-`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,9 @@
|
||||
# AgentsApi
|
||||
|
||||
| Method | HTTP request | Description |
|
||||
|-------------------------|-----------------|------------------|
|
||||
| [getAgents](#getAgents) | **GET** /agents | Gets all agents. |
|
||||
| Method | HTTP request | Description |
|
||||
|-----------------------------------|----------------------------------------------|--------------------------|
|
||||
| [getAgents](#getAgents) | **GET** /agents | Gets all agents. |
|
||||
| [getAgentAvatar](#getAgentAvatar) | **GET** /agents/${agentId}/avatars/-default- | Gets agent avatar by id. |
|
||||
|
||||
## getAgents
|
||||
|
||||
@@ -46,6 +47,31 @@ agentsApi.getAgents().then((agents) => {
|
||||
|
||||
**Return type**: [AgentPaging](#AgentPaging)
|
||||
|
||||
## getAgentAvatar
|
||||
|
||||
Gets agent avatar by agent id.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type |
|
||||
|---------------|----------|
|
||||
| **agentId** | string |
|
||||
|
||||
**Example**
|
||||
|
||||
```javascript
|
||||
import { AlfrescoApi, AgentsApi } from '@alfresco/js-api';
|
||||
|
||||
const alfrescoApi = new AlfrescoApi(/*..*/);
|
||||
const agentsApi = new AgentsApi(alfrescoApi);
|
||||
|
||||
agentsApi.getAgentAvatar('agentId').then((agentAvatarImage) => {
|
||||
console.log('API called successfully. Returned data: ' + agentAvatarImage);
|
||||
});
|
||||
```
|
||||
|
||||
**Return type**: String
|
||||
|
||||
# Models
|
||||
|
||||
## AgentPaging
|
||||
@@ -77,7 +103,8 @@ agentsApi.getAgents().then((agents) => {
|
||||
|
||||
**Properties**
|
||||
|
||||
| Name | Type |
|
||||
|----------|--------|
|
||||
| **id** | string |
|
||||
| **name** | string |
|
||||
| Name | Type |
|
||||
|-----------------|--------|
|
||||
| **id** | string |
|
||||
| **name** | string |
|
||||
| **description** | string |
|
||||
|
@@ -18,4 +18,5 @@
|
||||
export interface Agent {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
}
|
||||
|
22
lib/js-api/src/api/content-rest-api/model/agentWithAvatar.ts
Normal file
22
lib/js-api/src/api/content-rest-api/model/agentWithAvatar.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Agent } from './agent';
|
||||
|
||||
export interface AgentWithAvatar extends Agent {
|
||||
avatar: string;
|
||||
}
|
@@ -28,6 +28,7 @@ export * from './activityEntry';
|
||||
export * from './activityPaging';
|
||||
export * from './activityPagingList';
|
||||
export * from './agent';
|
||||
export * from './agentWithAvatar';
|
||||
export * from './agentEntry';
|
||||
export * from './agentPaging';
|
||||
export * from './agentPagingList';
|
||||
|
Reference in New Issue
Block a user