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

Improved components by changing API usage from getDeviceType/ getAssetЕype to getDeviceProfileName/getAssetProfileName #9935

Conversation

rusikv
Copy link
Contributor

@rusikv rusikv commented Jan 3, 2024

Issue - #9321
Related BE - #9776

Before:

scrnli_1_3_2024_3-07-41.PM.webm

After:

scrnli_1_3_2024_3-12-11.PM.webm

General checklist

  • You have reviewed the guidelines document.
  • Labels that classify your pull request have been added.
  • The milestone is specified and corresponds to fix version.
  • Description references specific issue.
  • Description contains human-readable scope of changes.
  • Description contains brief notes about what needs to be added to the documentation.
  • No merge conflicts, commented blocks of code, code formatting issues.
  • Changes are backward compatible or upgrade script is provided.
  • Similar PR is opened for PE version to simplify merge. Crosslinks between PRs added. Required for internal contributors only.

Front-End feature checklist

  • Screenshots with affected component(s) are added. The best option is to provide 2 screens: before and after changes;
  • If you change the widget or other API, ensure it is backward-compatible or upgrade script is present.
  • Ensure new API is documented here

@@ -343,7 +344,7 @@ export class EntitySubTypeListComponent implements ControlValueAccessor, OnInit,
}
if (subTypesObservable) {
this.entitySubtypes = subTypesObservable.pipe(
map(subTypes => subTypes.map(subType => subType.type)),
map(subTypes => subTypes.map(subType => this.isEntitySubType(subType) ? subType.type : subType.name)),
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's better to do fetch type once when receiving data and not every time when filtering

Comment on lines 254 to 257
subTypes.forEach(subType => {
const typeName = this.isEntitySubType(subType) ? subType.type : subType.name;
return !excludeSubTypesSet.has(typeName) && filteredSubTypes.push(typeName);
});
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's better to do fetch type once when receiving data and not every time when filtering

subTypes.forEach(subType => {
const typeName = this.isEntitySubType(subType) ? subType.type : subType.name;
return !excludeSubTypesSet.has(typeName) && filteredSubTypes.push(typeName);
});
return filteredSubTypes;
}),
publishReplay(1),
Copy link
Member

Choose a reason for hiding this comment

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

Please change this deprecated method

}))
);
}

getSubTypes(): Observable<Array<EntitySubtype | string>> {
getSubTypes(): Observable<Array<EntitySubtype | string | EntityInfoData>> {
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps it is better to rewrite so the function returns only the string data type?

@vvlladd28 vvlladd28 added enhancement UI UI changes WIP Work In Progress labels Jan 4, 2024
@vvlladd28 vvlladd28 added this to the 3.6.3 milestone Jan 4, 2024
@rusikv rusikv requested a review from vvlladd28 January 5, 2024 13:54
Comment on lines 103 to 106
private deviceProfileService: DeviceProfileService,
private assetProfileService: AssetProfileService,
private edgeService: EdgeService,
private entityViewService: EntityViewService,
Copy link
Member

Choose a reason for hiding this comment

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

After refactoring the code, you need to clean the imports.

Comment on lines 129 to 132
private assetProfileService: AssetProfileService,
private deviceProfileService: DeviceProfileService,
private edgeService: EdgeService,
private entityViewService: EntityViewService,
Copy link
Member

Choose a reason for hiding this comment

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

After refactoring the code, you need to clean the imports.

Comment on lines 86 to 89
private deviceProfileService: DeviceProfileService,
private assetProfileService: AssetProfileService,
private edgeService: EdgeService,
private entityViewService: EntityViewService,
Copy link
Member

Choose a reason for hiding this comment

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

After refactoring the code, you need to clean the imports.

@rusikv rusikv requested a review from vvlladd28 January 8, 2024 10:27
@vvlladd28 vvlladd28 removed the WIP Work In Progress label Jan 8, 2024
@ikulikov ikulikov merged commit b7efe64 into thingsboard:master Jan 24, 2024
1 of 2 checks passed
@vvlladd28 vvlladd28 changed the title Added getAssetProfileNames and getDeviceProfileNames APIs Improved components by changing API usage from getDeviceType/ getAssetЕype to getDeviceProfileName/getAssetProfileName Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants