-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AAE-26192 New task search API #10319
Conversation
import { TaskQueryCloudRequestModel } from '../../../models/filter-cloud-model'; | ||
import { TaskCloudNodePaging } from '../../../models/task-cloud.model'; | ||
import { TaskListCloudSortingModel } from '../../../models/task-list-sorting.model'; | ||
|
||
@Injectable({ providedIn: 'root' }) | ||
export class ProcessTaskListCloudService extends BaseCloudService implements TaskListCloudServiceInterface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProcessTaskListCloudService
shouldn't implement that interface - it's not event shared between tasks and processes.
@@ -379,4 +380,29 @@ export class TaskFilterCloudService extends BaseCloudService { | |||
refreshFilter(filterKey: string): void { | |||
this.filterKeyToBeRefreshedSource.next(filterKey); | |||
} | |||
|
|||
private handleBackwardCompatibility(appName: string, key: string, filters: TaskFilterCloudModel[]): Observable<TaskFilterCloudModel[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method will filre at the start of the app, when we retrieve the filters from local storage or when we first populate them.
If we don't find the new keys in the retrieved filters, but we find their old counterparts we populate the new keys and leave the counterparts as they are.
@@ -28,3 +28,9 @@ export const PROCESS_FILTERS_SERVICE_TOKEN = new InjectionToken<PreferenceCloudS | |||
export const TASK_FILTERS_SERVICE_TOKEN = new InjectionToken<PreferenceCloudServiceInterface>('task-filters-cloud'); | |||
|
|||
export const TASK_LIST_CLOUD_TOKEN = new InjectionToken<TaskListCloudServiceInterface>('task-list-cloud'); | |||
|
|||
/** | |||
* Token used to indicate the method to be used while searching for tasks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Token used to indicate the method to be used while searching for tasks. | |
* Token used to indicate the what api to be used while searching for tasks. |
What I mean is, adding some info that we have new API 🤔
POST/GET can indicate that we have the same request url, but different HTTP method
* @param filters Array of task filters to be checked for backward compatibility. | ||
* @returns Observable of task filters with updated properties. | ||
*/ | ||
private handleBackwardsCompatibility(appName: string, key: string, filters: TaskFilterCloudModel[]): Observable<TaskFilterCloudModel[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private handleBackwardsCompatibility(appName: string, key: string, filters: TaskFilterCloudModel[]): Observable<TaskFilterCloudModel[]> { | |
private handleCreateFilterBackwardsCompatibility(appName: string, key: string, filters: TaskFilterCloudModel[]): Observable<TaskFilterCloudModel[]> { |
return this.fetchTaskList(requestNode).pipe(map((tasks) => tasks.list.pagination.totalItems)); | ||
} | ||
|
||
protected buildQueryData(requestNode: TaskListRequestModel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we infer return type here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just an object - even in the BaseCloudService.post
method it's any
|
||
Object.keys(queryData).forEach((key) => { | ||
const value = queryData[key]; | ||
if (value === undefined || value === null || value === '' || (Array.isArray(value) && (value.length === 0 || value[0] === null))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (value === undefined || value === null || value === '' || (Array.isArray(value) && (value.length === 0 || value[0] === null))) { | |
const isValueEmpty = !value; | |
const isValueEmptyArray = Array.isArray(value) && (value.length === 0 || value[0] === null); | |
if (isValueEmpty || isValueEmptyArray) { |
e4fb052
to
ea60aa2
Compare
ea60aa2
to
6dd4231
Compare
Quality Gate failedFailed conditions |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behaviour? (You can also link to an open issue here)
https://hyland.atlassian.net/browse/AAE-26192
What is the new behaviour?
https://hyland.atlassian.net/browse/AAE-26192
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: