Browse Source
Merge branch 'lts-4.4' into fix/license-headers-lts-4.4
pull/16654/head
Viacheslav Klimov
3 weeks ago
Failed to extract signature
8 changed files with
75 additions and
7 deletions
tools/src/main/python/license-headers/curations.json
ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.html
ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.ts
ui-ngx/src/app/modules/home/components/converter/converter.component.ts
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.html
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.scss
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-converter-update-dialog.component.ts
ui-ngx/src/assets/locale/locale.constant-en_US.json
@ -1247,7 +1247,7 @@
"path" : "ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.html" ,
"header" : "busl" ,
"reason" : "PE view template converter-dialog.component.html. Reviewed form fields, bindings and entity/component selection implement the PE feature; the candidate shares standard Material dialog/form/tab scaffolding rather than a CE feature implementation. Reviewed CE candidate ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 955f8f58be2d9d462570164005f4a2ee693b0dd7)." ,
"contentHash" : "sha256:845e3846f9f41be29dc209df6c28c8870c3886886018155735affb0c49c5a9f9 "
"contentHash" : "sha256:d66640c8359f2341173ab63f009062a7b6382c58c4677ff754024a5fa2534c95 "
} ,
{
"path" : "ui-ngx/src/app/modules/home/components/converter/converter-test-dialog.component.scss" ,
@ -25,7 +25,8 @@
< tb-converter
#converterComponent
[entity]="converter"
[isEdit]="true">
[isEdit]="true"
[converterName]="converterName">
< / tb-converter >
< / div >
< div mat-dialog-actions class = "flex items-center justify-end" >
@ -39,6 +39,7 @@ export class ConverterDialogComponent extends DialogComponent<ConverterDialogCom
isEdit : boolean ;
dialogTitle :string ;
converter : Converter ;
converterName : string ;
@ViewChild ( 'converterComponent' , { static : true } ) converterComponent : ConverterComponent ;
@ -55,6 +56,7 @@ export class ConverterDialogComponent extends DialogComponent<ConverterDialogCom
ngOnInit() {
const { disabledIntegrationType , . . . converterInfo } = this . data . convertor
this . converter = converterInfo as Converter ;
this . converterName = this . isEdit ? null : this . converter . name ;
}
ngAfterViewInit() {
@ -268,7 +268,7 @@ export class ConverterComponent extends EntityComponent<Converter> implements On
}
this . updateForm ( converter , false ) ;
} else {
this . entityForm . get ( 'name' ) . patchValue ( '', { emitEvent : false } ) ;
this . entityForm . get ( 'name' ) . patchValue ( this . predefinedConverterName ? ? '', { emitEvent : false } ) ;
}
}
@ -11,11 +11,33 @@
< div class = "tb-converter-update-name" > {{ data.update.converter.name }}< / div >
@if (data.usedBy.length) {
< span class = "tb-progress-alert-msg tb-progress-alert-msg-warning" > {{ 'iot-hub.device-update-shared' | translate }}< / span >
< ul class = "tb-converter-update-packages" >
@for (name of data.usedBy; track $index) {
< li > {{ name }}< / li >
< div >
< ul class = "tb-converter-update-packages" >
@for (name of usedByShown; track $index) {
< li > {{ name }}< / li >
}
< / ul >
@if (usedByHidden.length) {
< div id = "tb-converter-update-more" class = "tb-converter-update-more" [ class . expanded ] = " usedByExpanded "
[attr.aria-hidden]="!usedByExpanded">
< ul class = "tb-converter-update-packages" >
@for (name of usedByHidden; track $index) {
< li > {{ name }}< / li >
}
< / ul >
< / div >
}
< / ul >
< / div >
@if (usedByHidden.length) {
< button type = "button" class = "tb-converter-update-toggle self-start" aria-controls = "tb-converter-update-more"
[attr.aria-expanded]="usedByExpanded" (click)="usedByExpanded = !usedByExpanded">
@if (usedByExpanded) {
{{ 'iot-hub.device-update-shared-less' | translate }}
} @else {
{{ 'iot-hub.device-update-shared-more' | translate:{ count: usedByHidden.length } }}
}
< / button >
}
}
@if (data.modified) {
< span class = "tb-progress-alert-msg tb-progress-alert-msg-warning" >
@ -43,6 +43,38 @@
color : rgba ( 0 , 0 , 0 , 0 .54 ) ;
}
/ / Material expansion-panel timing
. tb-converter-update-more {
display : grid ;
grid-template-rows : 0 fr ;
transition : grid - template-rows 225 ms cubic-bezier ( 0 .4 , 0 , 0 .2 , 1 ) ;
> ul {
overflow : hidden ;
min-height : 0 ;
}
& . expanded {
grid-template-rows : 1 fr ;
}
@media ( prefers-reduced-motion : reduce ) {
transition : none ;
}
}
. tb-converter-update-toggle {
padding : 0 ;
border : none ;
background : none ;
font-size : 12 px ;
font-weight : 500 ;
line-height : 16 px ;
color : var ( -- tb-primary-500 ) ;
cursor : pointer ;
& : hover ,
& : focus-visible {
text-decoration : underline ;
}
}
. tb-converter-update-link {
color : #305680 ;
text-decoration : underline ;
@ -21,6 +21,8 @@ export interface IotHubConverterUpdateDialogData {
usedBy : string [ ] ;
}
const USED_BY_SHOWN = 3 ;
/ * *
* Brings an installed device package 's default converter to ThingsBoard' s default converter now , without a new version of
* the package . Closes with true once it is updated .
@ -34,6 +36,9 @@ export interface IotHubConverterUpdateDialogData {
export class TbIotHubConverterUpdateDialogComponent extends DialogComponent < TbIotHubConverterUpdateDialogComponent , boolean > {
readonly modifiedHint = splitTextWithLink ( this . translate . instant ( 'iot-hub.device-update-modified' ) ) ;
readonly usedByShown : string [ ] ;
readonly usedByHidden : string [ ] ;
usedByExpanded = false ;
updating = false ;
errorMessage : string | null = null ;
@ -46,6 +51,10 @@ export class TbIotHubConverterUpdateDialogComponent extends DialogComponent<TbIo
private translate : TranslateService
) {
super ( store , router , dialogRef ) ;
// Collapse only when at least 2 packages would be hidden
const shownCount = data . usedBy . length > USED_BY_SHOWN + 1 ? USED_BY_SHOWN : data.usedBy.length ;
this . usedByShown = data . usedBy . slice ( 0 , shownCount ) ;
this . usedByHidden = data . usedBy . slice ( shownCount ) ;
}
downloadCurrent ( ) : void {
@ -6594,6 +6594,8 @@
"device-update-no-changes" : "No changes" ,
"device-update-new" : "New" ,
"device-update-shared" : "Used by other packages. The update affects them." ,
"device-update-shared-more" : "and {{count}} more" ,
"device-update-shared-less" : "Show less" ,
"device-update-new-default-converter" : "ThingsBoard has a new version of the default converter used by this package." ,
"device-update-modified" : "Has local changes. You can download the current version <a>here</a>." ,
"device-install-unexpected-error" : "Something went wrong. Try again." ,