Skip to content
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

Merged
merged 5 commits into from
Oct 23, 2024
Merged

Conversation

DudaRobert
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

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")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@DudaRobert DudaRobert requested a review from BSekula October 22, 2024 10:13
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 {
Copy link
Contributor Author

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[]> {
Copy link
Contributor Author

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.

@DudaRobert DudaRobert marked this pull request as ready for review October 22, 2024 13:50
@@ -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.
Copy link
Contributor

@BSekula BSekula Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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[]> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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) {

@DudaRobert DudaRobert force-pushed the feature/AAE-26192-new-task-search-api branch 2 times, most recently from e4fb052 to ea60aa2 Compare October 23, 2024 08:44
@DudaRobert DudaRobert force-pushed the feature/AAE-26192-new-task-search-api branch from ea60aa2 to 6dd4231 Compare October 23, 2024 08:45
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
12.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@eromano eromano merged commit 0a89d9b into develop Oct 23, 2024
16 of 17 checks passed
@eromano eromano deleted the feature/AAE-26192-new-task-search-api branch October 23, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants