diff --git a/.github/workflows/check-license-headers.yml b/.github/workflows/check-license-headers.yml index ca5cec2d04..753a9c565d 100644 --- a/.github/workflows/check-license-headers.yml +++ b/.github/workflows/check-license-headers.yml @@ -11,19 +11,12 @@ on: - master - rc - 'lts-[0-9]+.[0-9]+' - - 'license-lts-[0-9]+.[0-9]+' pull_request: branches: - master - rc - 'lts-[0-9]+.[0-9]+' - - 'license-lts-[0-9]+.[0-9]+' workflow_dispatch: - inputs: - ce-branch: - description: CE branch to compare against; defaults to the counterpart of the current branch - required: false - type: string permissions: contents: read @@ -53,27 +46,10 @@ jobs: java-version: 21 cache: maven - - name: Resolve CE branch - id: ce - env: - PE_BRANCH: ${{ github.base_ref || github.ref_name }} - CE_BRANCH: ${{ inputs.ce-branch }} - run: | - if [[ -z "$CE_BRANCH" ]]; then - case "$PE_BRANCH" in - master|rc) CE_BRANCH="$PE_BRANCH" ;; - lts-*|license-lts-*) CE_BRANCH="${PE_BRANCH#license-}" ;; - *) echo "::error::No CE counterpart is defined for branch $PE_BRANCH"; exit 1 ;; - esac - fi - echo "branch=$CE_BRANCH" >> "$GITHUB_OUTPUT" - - name: Check license headers - env: - CE_BRANCH: ${{ steps.ce.outputs.branch }} run: | mkdir -p target/license-provenance - ./check-license-headers.sh "${CE_BRANCH}" 2>&1 | tee target/license-provenance/console.log + ./check-license-headers.sh 2>&1 | tee target/license-provenance/console.log - name: Add findings to the job summary if: failure() && hashFiles('target/license-provenance/console.log') != '' diff --git a/application/pom.xml b/application/pom.xml index 1fdc656151..05096269a8 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard application diff --git a/application/src/main/data/json/demo/dashboards/firmware.json b/application/src/main/data/json/demo/dashboards/firmware.json index 45a88262f8..6a650b1bd9 100644 --- a/application/src/main/data/json/demo/dashboards/firmware.json +++ b/application/src/main/data/json/demo/dashboards/firmware.json @@ -279,7 +279,7 @@ "name": "Edit firmware", "icon": "edit", "type": "customPretty", - "customHtml": "
\n \n

Edit firmware {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", + "customHtml": "
\n \n

Edit firmware {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", "customCss": "form {\n min-width: 300px !important;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n firmwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n firmwareId: vm.entity.firmwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.firmwareId = formValues.firmwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}", "customResources": [], @@ -1142,7 +1142,7 @@ "name": "Edit firmware", "icon": "edit", "type": "customPretty", - "customHtml": "
\n \n

Edit firmware {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", + "customHtml": "
\n \n

Edit firmware {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", "customCss": "form {\n min-width: 300px !important;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n firmwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n firmwareId: vm.entity.firmwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.firmwareId = formValues.firmwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}", "customResources": [], @@ -1448,7 +1448,7 @@ "name": "Edit firmware", "icon": "edit", "type": "customPretty", - "customHtml": "
\n \n

Edit firmware {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", + "customHtml": "
\n \n

Edit firmware {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", "customCss": "form {\n min-width: 300px !important;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n firmwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n firmwareId: vm.entity.firmwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.firmwareId = formValues.firmwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}", "customResources": [], @@ -1754,7 +1754,7 @@ "name": "Edit firmware", "icon": "edit", "type": "customPretty", - "customHtml": "
\n \n

Edit firmware {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", + "customHtml": "
\n \n

Edit firmware {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", "customCss": "form {\n min-width: 300px !important;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n firmwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n firmwareId: vm.entity.firmwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.firmwareId = formValues.firmwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}", "customResources": [], @@ -2060,7 +2060,7 @@ "name": "Edit firmware", "icon": "edit", "type": "customPretty", - "customHtml": "
\n \n

Edit firmware {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", + "customHtml": "
\n \n

Edit firmware {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", "customCss": "form {\n min-width: 300px !important;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n firmwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n firmwareId: vm.entity.firmwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.firmwareId = formValues.firmwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}", "customResources": [], diff --git a/application/src/main/data/json/demo/dashboards/software.json b/application/src/main/data/json/demo/dashboards/software.json index 1fc1e0018f..96b3782315 100644 --- a/application/src/main/data/json/demo/dashboards/software.json +++ b/application/src/main/data/json/demo/dashboards/software.json @@ -279,7 +279,7 @@ "name": "Edit software", "icon": "edit", "type": "customPretty", - "customHtml": "
\n \n

Edit software {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", + "customHtml": "
\n \n

Edit software {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", "customCss": "form {\n min-width: 300px !important;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n softwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n softwareId: vm.entity.softwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.softwareId = formValues.softwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}", "customResources": [], @@ -1142,7 +1142,7 @@ "name": "Edit software", "icon": "edit", "type": "customPretty", - "customHtml": "
\n \n

Edit software {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", + "customHtml": "
\n \n

Edit software {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", "customCss": "form {\n min-width: 300px !important;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n softwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n softwareId: vm.entity.softwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.softwareId = formValues.softwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}", "customResources": [], @@ -1448,7 +1448,7 @@ "name": "Edit software", "icon": "edit", "type": "customPretty", - "customHtml": "
\n \n

Edit software {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", + "customHtml": "
\n \n

Edit software {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", "customCss": "form {\n min-width: 300px !important;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n softwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n softwareId: vm.entity.softwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.softwareId = formValues.softwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}", "customResources": [], @@ -1754,7 +1754,7 @@ "name": "Edit software", "icon": "edit", "type": "customPretty", - "customHtml": "
\n \n

Edit software {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", + "customHtml": "
\n \n

Edit software {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", "customCss": "form {\n min-width: 300px !important;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n softwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n softwareId: vm.entity.softwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.softwareId = formValues.softwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}", "customResources": [], @@ -2060,7 +2060,7 @@ "name": "Edit software", "icon": "edit", "type": "customPretty", - "customHtml": "
\n \n

Edit software {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", + "customHtml": "
\n \n

Edit software {{entityName}}

\n \n \n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
", "customCss": "form {\n min-width: 300px !important;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet entityService = $injector.get(widgetContext.servicesMap.get('entityService'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n\n vm.entityName = entityName;\n vm.entity = {};\n\n vm.editEntityFormGroup = vm.fb.group({\n softwareId: [null]\n });\n\n getEntityInfo();\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n\n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveEntity().subscribe(\n function () {\n // widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n };\n\n\n function getEntityInfo() {\n entityService.getEntity(entityId.entityType, entityId.id).subscribe(\n function (data) {\n vm.entity = data;\n vm.editEntityFormGroup.patchValue({\n softwareId: vm.entity.softwareId\n }, {emitEvent: false});\n }\n );\n }\n\n function saveEntity() {\n const formValues = vm.editEntityFormGroup.value;\n vm.entity.softwareId = formValues.softwareId;\n return deviceService.saveDevice(vm.entity);\n }\n}", "customResources": [], diff --git a/application/src/main/data/json/demo/dashboards/thermostats.json b/application/src/main/data/json/demo/dashboards/thermostats.json index 40866db9ef..c7b8d50354 100644 --- a/application/src/main/data/json/demo/dashboards/thermostats.json +++ b/application/src/main/data/json/demo/dashboards/thermostats.json @@ -167,7 +167,7 @@ "name": "Add", "icon": "add", "type": "customPretty", - "customHtml": "
\n \n

Add thermostat

\n \n \n
\n \n \n
\n
\n \n Thermostat name\n \n \n Thermostat name is required.\n \n \n
\n \n High temperature alarm\n \n \n High temperature threshold, °C\n \n \n High temperature threshold is required.\n \n \n\n \n Low humidity alarm\n \n\n \n Low humidity threshold, %\n \n \n Low humidity threshold is required.\n \n \n
\n
\n
\n \n \n
\n
", + "customHtml": "
\n \n

Add thermostat

\n \n \n
\n \n \n
\n
\n \n Thermostat name\n \n \n Thermostat name is required.\n \n \n
\n \n High temperature alarm\n \n \n High temperature threshold, °C\n \n \n High temperature threshold is required.\n \n \n\n \n Low humidity alarm\n \n\n \n Low humidity threshold, %\n \n \n Low humidity threshold is required.\n \n \n
\n
\n
\n \n \n
\n
", "customCss": ".add-entity-form{\n width: 300px;\n}\n", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\n\nopenAddEntityDialog();\n\nfunction openAddEntityDialog() {\n customDialog.customDialog(htmlTemplate, AddEntityDialogController).subscribe();\n}\n\nfunction AddEntityDialogController(instance) {\n let vm = instance;\n \n vm.addEntityFormGroup = vm.fb.group({\n entityName: ['', [vm.validators.required]],\n attributes: vm.fb.group({\n temperatureAlarmFlag: [false],\n temperatureAlarmThreshold: [{value: null, disabled: true}],\n humidityAlarmFlag: [false],\n humidityAlarmThreshold: [{value: null, disabled: true}]\n })\n });\n \n vm.addEntityFormGroup.get('attributes').get('temperatureAlarmFlag').valueChanges\n .subscribe(activate => {\n if (activate) {\n vm.addEntityFormGroup.get('attributes').get('temperatureAlarmThreshold').enable();\n } else {\n vm.addEntityFormGroup.get('attributes').get('temperatureAlarmThreshold').disable();\n }\n });\n \n vm.addEntityFormGroup.get('attributes').get('humidityAlarmFlag').valueChanges\n .subscribe(activate => {\n if (activate) {\n vm.addEntityFormGroup.get('attributes').get('humidityAlarmThreshold').enable();\n } else {\n vm.addEntityFormGroup.get('attributes').get('humidityAlarmThreshold').disable();\n }\n });\n\n vm.save = function() {\n vm.addEntityFormGroup.markAsPristine();\n saveEntityObservable().subscribe(\n function (entity) {\n saveAttributes(entity.id).subscribe(\n function () {\n widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n }\n );\n };\n \n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n \n function saveEntityObservable() {\n const formValues = vm.addEntityFormGroup.value;\n let entity = {\n name: formValues.entityName,\n type: \"thermostat\"\n };\n return deviceService.saveDevice(entity);\n }\n \n function saveAttributes(entityId) {\n let attributes = vm.addEntityFormGroup.get('attributes').value;\n let attributesArray = [];\n for (let key in attributes) {\n if(attributes[key] !== null) {\n attributesArray.push({key: key, value: attributes[key]});\n }\n }\n if (attributesArray.length > 0) {\n return attributeService.saveEntityAttributes(entityId, \"SERVER_SCOPE\", attributesArray);\n } else {\n return widgetContext.rxjs.of([]);\n }\n }\n}", "customResources": [], @@ -187,7 +187,7 @@ "name": "Edit", "icon": "edit", "type": "customPretty", - "customHtml": "
\n \n

Edit thermostat {{entityName}}

\n \n \n
\n \n \n
\n
\n \n Thermostat name\n \n \n
\n \n High temperature alarm\n \n \n High temperature threshold, °C\n \n \n High temperature threshold is required.\n \n \n\n \n Low humidity alarm\n \n\n \n Low humidity threshold, %\n \n \n Low humidity threshold is required.\n \n \n
\n
\n
\n \n \n
\n
", + "customHtml": "
\n \n

Edit thermostat {{entityName}}

\n \n \n
\n \n \n
\n
\n \n Thermostat name\n \n \n
\n \n High temperature alarm\n \n \n High temperature threshold, °C\n \n \n High temperature threshold is required.\n \n \n\n \n Low humidity alarm\n \n\n \n Low humidity threshold, %\n \n \n Low humidity threshold is required.\n \n \n
\n
\n
\n \n \n
\n
", "customCss": ".edit-entity-form{\n width: 300px;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\n\nopenEditEntityDialog();\n\nfunction openEditEntityDialog() {\n customDialog.customDialog(htmlTemplate, EditEntityDialogController).subscribe();\n}\n\nfunction EditEntityDialogController(instance) {\n let vm = instance;\n \n vm.entityId = entityId;\n vm.entityName = entityName;\n vm.attributes = {};\n \n vm.editEntityFormGroup = vm.fb.group({\n entityName: [''],\n attributes: vm.fb.group({\n temperatureAlarmFlag: [false],\n temperatureAlarmThreshold: [{value: null, disabled: true}],\n humidityAlarmFlag: [false],\n humidityAlarmThreshold: [{value: null, disabled: true}]\n })\n });\n \n vm.editEntityFormGroup.get('attributes').get('temperatureAlarmFlag').valueChanges\n .subscribe(activate => {\n if (activate) {\n vm.editEntityFormGroup.get('attributes').get('temperatureAlarmThreshold').enable();\n } else {\n vm.editEntityFormGroup.get('attributes').get('temperatureAlarmThreshold').disable();\n }\n });\n \n vm.editEntityFormGroup.get('attributes').get('humidityAlarmFlag').valueChanges\n .subscribe(activate => {\n if (activate) {\n vm.editEntityFormGroup.get('attributes').get('humidityAlarmThreshold').enable();\n } else {\n vm.editEntityFormGroup.get('attributes').get('humidityAlarmThreshold').disable();\n }\n });\n \n \n getEntityInfo();\n \n \n vm.save = function() {\n vm.editEntityFormGroup.markAsPristine();\n saveAttributes(entityId).subscribe(\n function () {\n vm.dialogRef.close(null);\n }\n );\n };\n \n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n \n function getEntityAttributes(attributes) {\n for (var i = 0; i < attributes.length; i++) {\n vm.attributes[attributes[i].key] = attributes[i].value;\n }\n }\n \n function getEntityInfo() {\n attributeService.getEntityAttributes(entityId, 'SERVER_SCOPE').subscribe(\n function (attributes) {\n getEntityAttributes(attributes);\n vm.editEntityFormGroup.patchValue({\n entityName: vm.entityName,\n attributes: vm.attributes\n });\n // if(vm.attributes.temperatureAlarmFlag) {\n // vm.editEntityFormGroup.get('attributes').get('temperatureAlarmThreshold').enable();\n // }\n // if(vm.attributes.humidityAlarmFlag) {\n // vm.editEntityFormGroup.get('attributes').get('humidityAlarmThreshold').enable();\n // }\n }\n );\n }\n \n function saveAttributes(entityId) {\n let attributes = vm.editEntityFormGroup.get('attributes').value;\n let attributesArray = [];\n for (let key in attributes) {\n if (attributes[key] !== vm.attributes[key]) {\n attributesArray.push({key: key, value: attributes[key]});\n }\n }\n if (attributesArray.length > 0) {\n return attributeService.saveEntityAttributes(entityId, \"SERVER_SCOPE\", attributesArray);\n } else {\n return widgetContext.rxjs.of([]);\n }\n }\n}", "customResources": [], diff --git a/application/src/main/data/json/system/widget_types/asset_admin_table.json b/application/src/main/data/json/system/widget_types/asset_admin_table.json index 41e0727a1c..cb3a270b6d 100644 --- a/application/src/main/data/json/system/widget_types/asset_admin_table.json +++ b/application/src/main/data/json/system/widget_types/asset_admin_table.json @@ -16,7 +16,7 @@ "dataKeySettingsDirective": "tb-entities-table-key-settings", "hasBasicMode": true, "basicModeDirective": "tb-entities-table-basic-config", - "defaultConfig": "{\"showTitle\":true,\"backgroundColor\":\"rgb(255, 255, 255)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"4px\",\"settings\":{\"entitiesTitle\":\"Asset admin table\",\"enableSearch\":true,\"enableSelectColumnDisplay\":true,\"enableStickyHeader\":true,\"enableStickyAction\":true,\"showCellActionsMenu\":true,\"reserveSpaceForHiddenAction\":\"true\",\"displayEntityName\":false,\"displayEntityLabel\":false,\"displayEntityType\":false,\"displayPagination\":true,\"defaultPageSize\":10,\"defaultSortOrder\":\"entityName\",\"useRowStyleFunction\":false},\"title\":\"Asset admin table\",\"dropShadow\":true,\"enableFullscreen\":true,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400,\"padding\":\"5px 10px 5px 10px\"},\"showLegend\":false,\"datasources\":[{\"type\":\"function\",\"name\":\"Simulated\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Entity name\",\"color\":\"#4caf50\",\"settings\":{},\"_hash\":0.6985800247727296,\"funcBody\":\"return 'Simulated';\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Entity type\",\"color\":\"#f44336\",\"settings\":{},\"_hash\":0.10073938422359707,\"funcBody\":\"return 'Device';\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#f44336\",\"settings\":{\"columnWidth\":\"0px\",\"useCellStyleFunction\":false,\"cellStyleFunction\":\"\",\"useCellContentFunction\":false,\"cellContentFunction\":\"\"},\"_hash\":0.6401141393938932,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"showTitleIcon\":false,\"titleIcon\":\"more_horiz\",\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"widgetStyle\":{},\"actions\":{\"headerButton\":[{\"name\":\"Add asset\",\"icon\":\"add\",\"type\":\"customPretty\",\"customHtml\":\"
\\n \\n

Add asset

\\n \\n \\n
\\n \\n \\n
\\n
\\n
\\n \\n Asset name\\n \\n \\n Asset name is required.\\n \\n \\n
\\n \\n \\n Label\\n \\n \\n
\\n
\\n \\n Latitude\\n \\n \\n \\n Longitude\\n \\n \\n
\\n
\\n
\\n
\\n \\n \\n \\n
\\n
\\n\",\"customCss\":\"\",\"customFunction\":\"let $injector = widgetContext.$scope.$injector;\\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\\nlet assetService = $injector.get(widgetContext.servicesMap.get('assetService'));\\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\\n\\nopenAddAssetDialog();\\n\\nfunction openAddAssetDialog() {\\n customDialog.customDialog(htmlTemplate, AddAssetDialogController).subscribe();\\n}\\n\\nfunction AddAssetDialogController(instance) {\\n let vm = instance;\\n \\n vm.addAssetFormGroup = vm.fb.group({\\n assetName: ['', [vm.validators.required]],\\n assetType: ['', [vm.validators.required]],\\n assetLabel: [''],\\n attributes: vm.fb.group({\\n latitude: [null],\\n longitude: [null]\\n }) \\n });\\n \\n vm.cancel = function() {\\n vm.dialogRef.close(null);\\n };\\n \\n vm.save = function() {\\n vm.addAssetFormGroup.markAsPristine();\\n let asset = {\\n name: vm.addAssetFormGroup.get('assetName').value,\\n type: vm.addAssetFormGroup.get('assetType').value,\\n label: vm.addAssetFormGroup.get('assetLabel').value\\n };\\n assetService.saveAsset(asset).subscribe(\\n function (asset) {\\n saveAttributes(asset.id).subscribe(\\n function () {\\n widgetContext.updateAliases();\\n vm.dialogRef.close(null);\\n }\\n );\\n }\\n );\\n };\\n \\n function saveAttributes(entityId) {\\n let attributes = vm.addAssetFormGroup.get('attributes').value;\\n let attributesArray = [];\\n for (let key in attributes) {\\n attributesArray.push({key: key, value: attributes[key]});\\n }\\n if (attributesArray.length > 0) {\\n return attributeService.saveEntityAttributes(entityId, \\\"SERVER_SCOPE\\\", attributesArray);\\n } else {\\n return widgetContext.rxjs.of([]);\\n }\\n }\\n}\",\"customResources\":[],\"id\":\"70837a9d-c3de-a9a7-03c5-dccd14998758\"}],\"actionCellButton\":[{\"name\":\"Edit asset\",\"icon\":\"edit\",\"type\":\"customPretty\",\"customHtml\":\"
\\n \\n

Edit asset

\\n \\n \\n
\\n \\n \\n
\\n
\\n
\\n \\n Asset name\\n \\n \\n Asset name is required.\\n \\n \\n
\\n \\n \\n Label\\n \\n \\n
\\n
\\n \\n Latitude\\n \\n \\n \\n Longitude\\n \\n \\n
\\n
\\n
\\n
\\n \\n \\n \\n
\\n
\\n\",\"customCss\":\"\",\"customFunction\":\"let $injector = widgetContext.$scope.$injector;\\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\\nlet assetService = $injector.get(widgetContext.servicesMap.get('assetService'));\\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\\n\\nopenEditAssetDialog();\\n\\nfunction openEditAssetDialog() {\\n customDialog.customDialog(htmlTemplate, EditAssetDialogController).subscribe();\\n}\\n\\nfunction EditAssetDialogController(instance) {\\n let vm = instance;\\n \\n vm.asset = null;\\n vm.attributes = {};\\n \\n vm.editAssetFormGroup = vm.fb.group({\\n assetName: ['', [vm.validators.required]],\\n assetType: ['', [vm.validators.required]],\\n assetLabel: [''],\\n attributes: vm.fb.group({\\n latitude: [null],\\n longitude: [null]\\n }) \\n });\\n \\n vm.cancel = function() {\\n vm.dialogRef.close(null);\\n };\\n \\n vm.save = function() {\\n vm.editAssetFormGroup.markAsPristine();\\n vm.asset.name = vm.editAssetFormGroup.get('assetName').value,\\n vm.asset.type = vm.editAssetFormGroup.get('assetType').value,\\n vm.asset.label = vm.editAssetFormGroup.get('assetLabel').value\\n assetService.saveAsset(vm.asset).subscribe(\\n function () {\\n saveAttributes().subscribe(\\n function () {\\n widgetContext.updateAliases();\\n vm.dialogRef.close(null);\\n }\\n );\\n }\\n );\\n };\\n \\n getEntityInfo();\\n \\n function getEntityInfo() {\\n assetService.getAsset(entityId.id).subscribe(\\n function (asset) {\\n attributeService.getEntityAttributes(entityId, 'SERVER_SCOPE',\\n ['latitude', 'longitude']).subscribe(\\n function (attributes) {\\n for (let i = 0; i < attributes.length; i++) {\\n vm.attributes[attributes[i].key] = attributes[i].value; \\n }\\n vm.asset = asset;\\n vm.editAssetFormGroup.patchValue(\\n {\\n assetName: vm.asset.name,\\n assetType: vm.asset.type,\\n assetLabel: vm.asset.label,\\n attributes: {\\n latitude: vm.attributes.latitude,\\n longitude: vm.attributes.longitude\\n }\\n }, {emitEvent: false}\\n );\\n } \\n );\\n }\\n ); \\n }\\n \\n function saveAttributes() {\\n let attributes = vm.editAssetFormGroup.get('attributes').value;\\n let attributesArray = [];\\n for (let key in attributes) {\\n attributesArray.push({key: key, value: attributes[key]});\\n }\\n if (attributesArray.length > 0) {\\n return attributeService.saveEntityAttributes(entityId, 'SERVER_SCOPE', attributesArray);\\n } else {\\n return widgetContext.rxjs.of([]);\\n }\\n }\\n}\",\"customResources\":[],\"id\":\"93931e52-5d7c-903e-67aa-b9435df44ff4\"},{\"name\":\"Delete asset\",\"icon\":\"delete\",\"type\":\"custom\",\"customFunction\":\"let $injector = widgetContext.$scope.$injector;\\nlet dialogs = $injector.get(widgetContext.servicesMap.get('dialogs'));\\nlet assetService = $injector.get(widgetContext.servicesMap.get('assetService'));\\n\\nopenDeleteAssetDialog();\\n\\nfunction openDeleteAssetDialog() {\\n let title = \\\"Are you sure you want to delete the asset \\\" + entityName + \\\"?\\\";\\n let content = \\\"Be careful, after the confirmation, the asset and all related data will become unrecoverable!\\\";\\n dialogs.confirm(title, content, 'Cancel', 'Delete').subscribe(\\n function (result) {\\n if (result) {\\n deleteAsset();\\n }\\n }\\n );\\n}\\n\\nfunction deleteAsset() {\\n assetService.deleteAsset(entityId.id).subscribe(\\n function () {\\n widgetContext.updateAliases();\\n }\\n );\\n}\\n\",\"id\":\"ec2708f6-9ff0-186b-e4fc-7635ebfa3074\"}]},\"configMode\":\"basic\",\"titleFont\":null,\"titleColor\":null}" + "defaultConfig": "{\"showTitle\":true,\"backgroundColor\":\"rgb(255, 255, 255)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"4px\",\"settings\":{\"entitiesTitle\":\"Asset admin table\",\"enableSearch\":true,\"enableSelectColumnDisplay\":true,\"enableStickyHeader\":true,\"enableStickyAction\":true,\"showCellActionsMenu\":true,\"reserveSpaceForHiddenAction\":\"true\",\"displayEntityName\":false,\"displayEntityLabel\":false,\"displayEntityType\":false,\"displayPagination\":true,\"defaultPageSize\":10,\"defaultSortOrder\":\"entityName\",\"useRowStyleFunction\":false},\"title\":\"Asset admin table\",\"dropShadow\":true,\"enableFullscreen\":true,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400,\"padding\":\"5px 10px 5px 10px\"},\"showLegend\":false,\"datasources\":[{\"type\":\"function\",\"name\":\"Simulated\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Entity name\",\"color\":\"#4caf50\",\"settings\":{},\"_hash\":0.6985800247727296,\"funcBody\":\"return 'Simulated';\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Entity type\",\"color\":\"#f44336\",\"settings\":{},\"_hash\":0.10073938422359707,\"funcBody\":\"return 'Device';\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#f44336\",\"settings\":{\"columnWidth\":\"0px\",\"useCellStyleFunction\":false,\"cellStyleFunction\":\"\",\"useCellContentFunction\":false,\"cellContentFunction\":\"\"},\"_hash\":0.6401141393938932,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"showTitleIcon\":false,\"titleIcon\":\"more_horiz\",\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"widgetStyle\":{},\"actions\":{\"headerButton\":[{\"name\":\"Add asset\",\"icon\":\"add\",\"type\":\"customPretty\",\"customHtml\":\"
\\n \\n

Add asset

\\n \\n \\n
\\n \\n \\n
\\n
\\n
\\n \\n Asset name\\n \\n \\n Asset name is required.\\n \\n \\n
\\n \\n \\n Label\\n \\n \\n
\\n
\\n \\n Latitude\\n \\n \\n \\n Longitude\\n \\n \\n
\\n
\\n
\\n
\\n \\n \\n \\n
\\n
\\n\",\"customCss\":\"\",\"customFunction\":\"let $injector = widgetContext.$scope.$injector;\\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\\nlet assetService = $injector.get(widgetContext.servicesMap.get('assetService'));\\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\\n\\nopenAddAssetDialog();\\n\\nfunction openAddAssetDialog() {\\n customDialog.customDialog(htmlTemplate, AddAssetDialogController).subscribe();\\n}\\n\\nfunction AddAssetDialogController(instance) {\\n let vm = instance;\\n \\n vm.addAssetFormGroup = vm.fb.group({\\n assetName: ['', [vm.validators.required]],\\n assetType: ['', [vm.validators.required]],\\n assetLabel: [''],\\n attributes: vm.fb.group({\\n latitude: [null],\\n longitude: [null]\\n }) \\n });\\n \\n vm.cancel = function() {\\n vm.dialogRef.close(null);\\n };\\n \\n vm.save = function() {\\n vm.addAssetFormGroup.markAsPristine();\\n let asset = {\\n name: vm.addAssetFormGroup.get('assetName').value,\\n type: vm.addAssetFormGroup.get('assetType').value,\\n label: vm.addAssetFormGroup.get('assetLabel').value\\n };\\n assetService.saveAsset(asset).subscribe(\\n function (asset) {\\n saveAttributes(asset.id).subscribe(\\n function () {\\n widgetContext.updateAliases();\\n vm.dialogRef.close(null);\\n }\\n );\\n }\\n );\\n };\\n \\n function saveAttributes(entityId) {\\n let attributes = vm.addAssetFormGroup.get('attributes').value;\\n let attributesArray = [];\\n for (let key in attributes) {\\n attributesArray.push({key: key, value: attributes[key]});\\n }\\n if (attributesArray.length > 0) {\\n return attributeService.saveEntityAttributes(entityId, \\\"SERVER_SCOPE\\\", attributesArray);\\n } else {\\n return widgetContext.rxjs.of([]);\\n }\\n }\\n}\",\"customResources\":[],\"id\":\"70837a9d-c3de-a9a7-03c5-dccd14998758\"}],\"actionCellButton\":[{\"name\":\"Edit asset\",\"icon\":\"edit\",\"type\":\"customPretty\",\"customHtml\":\"
\\n \\n

Edit asset

\\n \\n \\n
\\n \\n \\n
\\n
\\n
\\n \\n Asset name\\n \\n \\n Asset name is required.\\n \\n \\n
\\n \\n \\n Label\\n \\n \\n
\\n
\\n \\n Latitude\\n \\n \\n \\n Longitude\\n \\n \\n
\\n
\\n
\\n
\\n \\n \\n \\n
\\n
\\n\",\"customCss\":\"\",\"customFunction\":\"let $injector = widgetContext.$scope.$injector;\\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\\nlet assetService = $injector.get(widgetContext.servicesMap.get('assetService'));\\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\\n\\nopenEditAssetDialog();\\n\\nfunction openEditAssetDialog() {\\n customDialog.customDialog(htmlTemplate, EditAssetDialogController).subscribe();\\n}\\n\\nfunction EditAssetDialogController(instance) {\\n let vm = instance;\\n \\n vm.asset = null;\\n vm.attributes = {};\\n \\n vm.editAssetFormGroup = vm.fb.group({\\n assetName: ['', [vm.validators.required]],\\n assetType: ['', [vm.validators.required]],\\n assetLabel: [''],\\n attributes: vm.fb.group({\\n latitude: [null],\\n longitude: [null]\\n }) \\n });\\n \\n vm.cancel = function() {\\n vm.dialogRef.close(null);\\n };\\n \\n vm.save = function() {\\n vm.editAssetFormGroup.markAsPristine();\\n vm.asset.name = vm.editAssetFormGroup.get('assetName').value,\\n vm.asset.type = vm.editAssetFormGroup.get('assetType').value,\\n vm.asset.label = vm.editAssetFormGroup.get('assetLabel').value\\n assetService.saveAsset(vm.asset).subscribe(\\n function () {\\n saveAttributes().subscribe(\\n function () {\\n widgetContext.updateAliases();\\n vm.dialogRef.close(null);\\n }\\n );\\n }\\n );\\n };\\n \\n getEntityInfo();\\n \\n function getEntityInfo() {\\n assetService.getAsset(entityId.id).subscribe(\\n function (asset) {\\n attributeService.getEntityAttributes(entityId, 'SERVER_SCOPE',\\n ['latitude', 'longitude']).subscribe(\\n function (attributes) {\\n for (let i = 0; i < attributes.length; i++) {\\n vm.attributes[attributes[i].key] = attributes[i].value; \\n }\\n vm.asset = asset;\\n vm.editAssetFormGroup.patchValue(\\n {\\n assetName: vm.asset.name,\\n assetType: vm.asset.type,\\n assetLabel: vm.asset.label,\\n attributes: {\\n latitude: vm.attributes.latitude,\\n longitude: vm.attributes.longitude\\n }\\n }, {emitEvent: false}\\n );\\n } \\n );\\n }\\n ); \\n }\\n \\n function saveAttributes() {\\n let attributes = vm.editAssetFormGroup.get('attributes').value;\\n let attributesArray = [];\\n for (let key in attributes) {\\n attributesArray.push({key: key, value: attributes[key]});\\n }\\n if (attributesArray.length > 0) {\\n return attributeService.saveEntityAttributes(entityId, 'SERVER_SCOPE', attributesArray);\\n } else {\\n return widgetContext.rxjs.of([]);\\n }\\n }\\n}\",\"customResources\":[],\"id\":\"93931e52-5d7c-903e-67aa-b9435df44ff4\"},{\"name\":\"Delete asset\",\"icon\":\"delete\",\"type\":\"custom\",\"customFunction\":\"let $injector = widgetContext.$scope.$injector;\\nlet dialogs = $injector.get(widgetContext.servicesMap.get('dialogs'));\\nlet assetService = $injector.get(widgetContext.servicesMap.get('assetService'));\\n\\nopenDeleteAssetDialog();\\n\\nfunction openDeleteAssetDialog() {\\n let title = \\\"Are you sure you want to delete the asset \\\" + entityName + \\\"?\\\";\\n let content = \\\"Be careful, after the confirmation, the asset and all related data will become unrecoverable!\\\";\\n dialogs.confirm(title, content, 'Cancel', 'Delete').subscribe(\\n function (result) {\\n if (result) {\\n deleteAsset();\\n }\\n }\\n );\\n}\\n\\nfunction deleteAsset() {\\n assetService.deleteAsset(entityId.id).subscribe(\\n function () {\\n widgetContext.updateAliases();\\n }\\n );\\n}\\n\",\"id\":\"ec2708f6-9ff0-186b-e4fc-7635ebfa3074\"}]},\"configMode\":\"basic\",\"titleFont\":null,\"titleColor\":null}" }, "tags": [ "provisioning", diff --git a/application/src/main/data/json/system/widget_types/device_admin_table.json b/application/src/main/data/json/system/widget_types/device_admin_table.json index 220771effb..30d37dbca2 100644 --- a/application/src/main/data/json/system/widget_types/device_admin_table.json +++ b/application/src/main/data/json/system/widget_types/device_admin_table.json @@ -16,7 +16,7 @@ "dataKeySettingsDirective": "tb-entities-table-key-settings", "hasBasicMode": true, "basicModeDirective": "tb-entities-table-basic-config", - "defaultConfig": "{\"showTitle\":true,\"backgroundColor\":\"rgb(255, 255, 255)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"4px\",\"settings\":{\"entitiesTitle\":\"Device admin table\",\"enableSearch\":true,\"enableSelectColumnDisplay\":true,\"enableStickyHeader\":true,\"enableStickyAction\":true,\"showCellActionsMenu\":true,\"reserveSpaceForHiddenAction\":\"true\",\"displayEntityName\":false,\"displayEntityLabel\":false,\"displayEntityType\":false,\"displayPagination\":true,\"defaultPageSize\":10,\"defaultSortOrder\":\"entityName\",\"useRowStyleFunction\":false},\"title\":\"Device admin table\",\"dropShadow\":true,\"enableFullscreen\":true,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400,\"padding\":\"5px 10px 5px 10px\"},\"showLegend\":false,\"datasources\":[{\"type\":\"function\",\"name\":\"Simulated\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Entity name\",\"color\":\"#4caf50\",\"settings\":{},\"_hash\":0.8332260553092266,\"funcBody\":\"return 'Simulated';\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Entity type\",\"color\":\"#f44336\",\"settings\":{},\"_hash\":0.08583217494773887,\"funcBody\":\"return 'Device';\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#f44336\",\"settings\":{\"columnWidth\":\"0px\",\"useCellStyleFunction\":false,\"cellStyleFunction\":\"\",\"useCellContentFunction\":false,\"cellContentFunction\":\"\"},\"_hash\":0.6401141393938932,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"showTitleIcon\":false,\"titleIcon\":\"more_horiz\",\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"widgetStyle\":{},\"actions\":{\"headerButton\":[{\"name\":\"Add device\",\"icon\":\"add\",\"type\":\"customPretty\",\"customHtml\":\"
\\n \\n

Add device

\\n \\n \\n
\\n \\n \\n
\\n
\\n
\\n \\n Device name\\n \\n \\n Device name is required.\\n \\n \\n
\\n \\n \\n Label\\n \\n \\n
\\n
\\n \\n Latitude\\n \\n \\n \\n Longitude\\n \\n \\n
\\n
\\n
\\n
\\n \\n \\n \\n
\\n
\\n\",\"customCss\":\"\",\"customFunction\":\"let $injector = widgetContext.$scope.$injector;\\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\\n\\nopenAddDeviceDialog();\\n\\nfunction openAddDeviceDialog() {\\n customDialog.customDialog(htmlTemplate, AddDeviceDialogController).subscribe();\\n}\\n\\nfunction AddDeviceDialogController(instance) {\\n let vm = instance;\\n \\n vm.addDeviceFormGroup = vm.fb.group({\\n deviceName: ['', [vm.validators.required]],\\n deviceType: ['', [vm.validators.required]],\\n deviceLabel: [''],\\n attributes: vm.fb.group({\\n latitude: [null],\\n longitude: [null]\\n }) \\n });\\n \\n vm.cancel = function() {\\n vm.dialogRef.close(null);\\n };\\n \\n vm.save = function() {\\n vm.addDeviceFormGroup.markAsPristine();\\n let device = {\\n name: vm.addDeviceFormGroup.get('deviceName').value,\\n type: vm.addDeviceFormGroup.get('deviceType').value,\\n label: vm.addDeviceFormGroup.get('deviceLabel').value\\n };\\n deviceService.saveDevice(device).subscribe(\\n function (device) {\\n saveAttributes(device.id).subscribe(\\n function () {\\n widgetContext.updateAliases();\\n vm.dialogRef.close(null);\\n }\\n );\\n }\\n );\\n };\\n \\n function saveAttributes(entityId) {\\n let attributes = vm.addDeviceFormGroup.get('attributes').value;\\n let attributesArray = [];\\n for (let key in attributes) {\\n attributesArray.push({key: key, value: attributes[key]});\\n }\\n if (attributesArray.length > 0) {\\n return attributeService.saveEntityAttributes(entityId, \\\"SERVER_SCOPE\\\", attributesArray);\\n } else {\\n return widgetContext.rxjs.of([]);\\n }\\n }\\n}\",\"customResources\":[],\"id\":\"70837a9d-c3de-a9a7-03c5-dccd14998758\"}],\"actionCellButton\":[{\"name\":\"Edit device\",\"icon\":\"edit\",\"useShowWidgetActionFunction\":null,\"showWidgetActionFunction\":\"return true;\",\"type\":\"customPretty\",\"customHtml\":\"
\\n \\n

Edit device

\\n \\n \\n
\\n \\n \\n
\\n
\\n
\\n \\n Device name\\n \\n \\n Device name is required.\\n \\n \\n
\\n \\n \\n Label\\n \\n \\n
\\n
\\n \\n Latitude\\n \\n \\n \\n Longitude\\n \\n \\n
\\n
\\n
\\n
\\n \\n \\n \\n
\\n
\\n\",\"customCss\":\"\",\"customFunction\":\"let $injector = widgetContext.$scope.$injector;\\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\\n\\nopenEditDeviceDialog();\\n\\nfunction openEditDeviceDialog() {\\n customDialog.customDialog(htmlTemplate, EditDeviceDialogController).subscribe();\\n}\\n\\nfunction EditDeviceDialogController(instance) {\\n let vm = instance;\\n \\n vm.device = null;\\n vm.attributes = {};\\n \\n vm.editDeviceFormGroup = vm.fb.group({\\n deviceName: ['', [vm.validators.required]],\\n deviceType: ['', [vm.validators.required]],\\n deviceLabel: [''],\\n attributes: vm.fb.group({\\n latitude: [null],\\n longitude: [null]\\n }) \\n });\\n \\n vm.cancel = function() {\\n vm.dialogRef.close(null);\\n };\\n \\n vm.save = function() {\\n vm.editDeviceFormGroup.markAsPristine();\\n if (vm.editDeviceFormGroup.get('deviceType').value !== vm.device.type) {\\n delete vm.device.deviceProfileId;\\n }\\n vm.device.name = vm.editDeviceFormGroup.get('deviceName').value,\\n vm.device.type = vm.editDeviceFormGroup.get('deviceType').value,\\n vm.device.label = vm.editDeviceFormGroup.get('deviceLabel').value\\n deviceService.saveDevice(vm.device).subscribe(\\n function () {\\n saveAttributes().subscribe(\\n function () {\\n widgetContext.updateAliases();\\n vm.dialogRef.close(null);\\n }\\n );\\n }\\n );\\n };\\n \\n getEntityInfo();\\n \\n function getEntityInfo() {\\n deviceService.getDevice(entityId.id).subscribe(\\n function (device) {\\n attributeService.getEntityAttributes(entityId, 'SERVER_SCOPE',\\n ['latitude', 'longitude']).subscribe(\\n function (attributes) {\\n for (let i = 0; i < attributes.length; i++) {\\n vm.attributes[attributes[i].key] = attributes[i].value; \\n }\\n vm.device = device;\\n vm.editDeviceFormGroup.patchValue(\\n {\\n deviceName: vm.device.name,\\n deviceType: vm.device.type,\\n deviceLabel: vm.device.label,\\n attributes: {\\n latitude: vm.attributes.latitude,\\n longitude: vm.attributes.longitude\\n }\\n }, {emitEvent: false}\\n );\\n } \\n );\\n }\\n ); \\n }\\n \\n function saveAttributes() {\\n let attributes = vm.editDeviceFormGroup.get('attributes').value;\\n let attributesArray = [];\\n for (let key in attributes) {\\n attributesArray.push({key: key, value: attributes[key]});\\n }\\n if (attributesArray.length > 0) {\\n return attributeService.saveEntityAttributes(entityId, 'SERVER_SCOPE', attributesArray);\\n } else {\\n return widgetContext.rxjs.of([]);\\n }\\n }\\n}\",\"customResources\":[],\"openInSeparateDialog\":false,\"openInPopover\":false,\"id\":\"93931e52-5d7c-903e-67aa-b9435df44ff4\"},{\"name\":\"Delete device\",\"icon\":\"delete\",\"type\":\"custom\",\"customFunction\":\"let $injector = widgetContext.$scope.$injector;\\nlet dialogs = $injector.get(widgetContext.servicesMap.get('dialogs'));\\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\\n\\nopenDeleteDeviceDialog();\\n\\nfunction openDeleteDeviceDialog() {\\n let title = \\\"Are you sure you want to delete the device \\\" + entityName + \\\"?\\\";\\n let content = \\\"Be careful, after the confirmation, the device and all related data will become unrecoverable!\\\";\\n dialogs.confirm(title, content, 'Cancel', 'Delete').subscribe(\\n function (result) {\\n if (result) {\\n deleteDevice();\\n }\\n }\\n );\\n}\\n\\nfunction deleteDevice() {\\n deviceService.deleteDevice(entityId.id).subscribe(\\n function () {\\n widgetContext.updateAliases();\\n }\\n );\\n}\\n\",\"id\":\"ec2708f6-9ff0-186b-e4fc-7635ebfa3074\"}]},\"configMode\":\"basic\"}" + "defaultConfig": "{\"showTitle\":true,\"backgroundColor\":\"rgb(255, 255, 255)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"4px\",\"settings\":{\"entitiesTitle\":\"Device admin table\",\"enableSearch\":true,\"enableSelectColumnDisplay\":true,\"enableStickyHeader\":true,\"enableStickyAction\":true,\"showCellActionsMenu\":true,\"reserveSpaceForHiddenAction\":\"true\",\"displayEntityName\":false,\"displayEntityLabel\":false,\"displayEntityType\":false,\"displayPagination\":true,\"defaultPageSize\":10,\"defaultSortOrder\":\"entityName\",\"useRowStyleFunction\":false},\"title\":\"Device admin table\",\"dropShadow\":true,\"enableFullscreen\":true,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400,\"padding\":\"5px 10px 5px 10px\"},\"showLegend\":false,\"datasources\":[{\"type\":\"function\",\"name\":\"Simulated\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Entity name\",\"color\":\"#4caf50\",\"settings\":{},\"_hash\":0.8332260553092266,\"funcBody\":\"return 'Simulated';\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Entity type\",\"color\":\"#f44336\",\"settings\":{},\"_hash\":0.08583217494773887,\"funcBody\":\"return 'Device';\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#f44336\",\"settings\":{\"columnWidth\":\"0px\",\"useCellStyleFunction\":false,\"cellStyleFunction\":\"\",\"useCellContentFunction\":false,\"cellContentFunction\":\"\"},\"_hash\":0.6401141393938932,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}],\"alarmFilterConfig\":{\"statusList\":[\"ACTIVE\"]}}],\"showTitleIcon\":false,\"titleIcon\":\"more_horiz\",\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"widgetStyle\":{},\"actions\":{\"headerButton\":[{\"name\":\"Add device\",\"icon\":\"add\",\"type\":\"customPretty\",\"customHtml\":\"
\\n \\n

Add device

\\n \\n \\n
\\n \\n \\n
\\n
\\n
\\n \\n Device name\\n \\n \\n Device name is required.\\n \\n \\n
\\n \\n \\n Label\\n \\n \\n
\\n
\\n \\n Latitude\\n \\n \\n \\n Longitude\\n \\n \\n
\\n
\\n
\\n
\\n \\n \\n \\n
\\n
\\n\",\"customCss\":\"\",\"customFunction\":\"let $injector = widgetContext.$scope.$injector;\\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\\n\\nopenAddDeviceDialog();\\n\\nfunction openAddDeviceDialog() {\\n customDialog.customDialog(htmlTemplate, AddDeviceDialogController).subscribe();\\n}\\n\\nfunction AddDeviceDialogController(instance) {\\n let vm = instance;\\n \\n vm.addDeviceFormGroup = vm.fb.group({\\n deviceName: ['', [vm.validators.required]],\\n deviceType: ['', [vm.validators.required]],\\n deviceLabel: [''],\\n attributes: vm.fb.group({\\n latitude: [null],\\n longitude: [null]\\n }) \\n });\\n \\n vm.cancel = function() {\\n vm.dialogRef.close(null);\\n };\\n \\n vm.save = function() {\\n vm.addDeviceFormGroup.markAsPristine();\\n let device = {\\n name: vm.addDeviceFormGroup.get('deviceName').value,\\n type: vm.addDeviceFormGroup.get('deviceType').value,\\n label: vm.addDeviceFormGroup.get('deviceLabel').value\\n };\\n deviceService.saveDevice(device).subscribe(\\n function (device) {\\n saveAttributes(device.id).subscribe(\\n function () {\\n widgetContext.updateAliases();\\n vm.dialogRef.close(null);\\n }\\n );\\n }\\n );\\n };\\n \\n function saveAttributes(entityId) {\\n let attributes = vm.addDeviceFormGroup.get('attributes').value;\\n let attributesArray = [];\\n for (let key in attributes) {\\n attributesArray.push({key: key, value: attributes[key]});\\n }\\n if (attributesArray.length > 0) {\\n return attributeService.saveEntityAttributes(entityId, \\\"SERVER_SCOPE\\\", attributesArray);\\n } else {\\n return widgetContext.rxjs.of([]);\\n }\\n }\\n}\",\"customResources\":[],\"id\":\"70837a9d-c3de-a9a7-03c5-dccd14998758\"}],\"actionCellButton\":[{\"name\":\"Edit device\",\"icon\":\"edit\",\"useShowWidgetActionFunction\":null,\"showWidgetActionFunction\":\"return true;\",\"type\":\"customPretty\",\"customHtml\":\"
\\n \\n

Edit device

\\n \\n \\n
\\n \\n \\n
\\n
\\n
\\n \\n Device name\\n \\n \\n Device name is required.\\n \\n \\n
\\n \\n \\n Label\\n \\n \\n
\\n
\\n \\n Latitude\\n \\n \\n \\n Longitude\\n \\n \\n
\\n
\\n
\\n
\\n \\n \\n \\n
\\n
\\n\",\"customCss\":\"\",\"customFunction\":\"let $injector = widgetContext.$scope.$injector;\\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\\n\\nopenEditDeviceDialog();\\n\\nfunction openEditDeviceDialog() {\\n customDialog.customDialog(htmlTemplate, EditDeviceDialogController).subscribe();\\n}\\n\\nfunction EditDeviceDialogController(instance) {\\n let vm = instance;\\n \\n vm.device = null;\\n vm.attributes = {};\\n \\n vm.editDeviceFormGroup = vm.fb.group({\\n deviceName: ['', [vm.validators.required]],\\n deviceType: ['', [vm.validators.required]],\\n deviceLabel: [''],\\n attributes: vm.fb.group({\\n latitude: [null],\\n longitude: [null]\\n }) \\n });\\n \\n vm.cancel = function() {\\n vm.dialogRef.close(null);\\n };\\n \\n vm.save = function() {\\n vm.editDeviceFormGroup.markAsPristine();\\n if (vm.editDeviceFormGroup.get('deviceType').value !== vm.device.type) {\\n delete vm.device.deviceProfileId;\\n }\\n vm.device.name = vm.editDeviceFormGroup.get('deviceName').value,\\n vm.device.type = vm.editDeviceFormGroup.get('deviceType').value,\\n vm.device.label = vm.editDeviceFormGroup.get('deviceLabel').value\\n deviceService.saveDevice(vm.device).subscribe(\\n function () {\\n saveAttributes().subscribe(\\n function () {\\n widgetContext.updateAliases();\\n vm.dialogRef.close(null);\\n }\\n );\\n }\\n );\\n };\\n \\n getEntityInfo();\\n \\n function getEntityInfo() {\\n deviceService.getDevice(entityId.id).subscribe(\\n function (device) {\\n attributeService.getEntityAttributes(entityId, 'SERVER_SCOPE',\\n ['latitude', 'longitude']).subscribe(\\n function (attributes) {\\n for (let i = 0; i < attributes.length; i++) {\\n vm.attributes[attributes[i].key] = attributes[i].value; \\n }\\n vm.device = device;\\n vm.editDeviceFormGroup.patchValue(\\n {\\n deviceName: vm.device.name,\\n deviceType: vm.device.type,\\n deviceLabel: vm.device.label,\\n attributes: {\\n latitude: vm.attributes.latitude,\\n longitude: vm.attributes.longitude\\n }\\n }, {emitEvent: false}\\n );\\n } \\n );\\n }\\n ); \\n }\\n \\n function saveAttributes() {\\n let attributes = vm.editDeviceFormGroup.get('attributes').value;\\n let attributesArray = [];\\n for (let key in attributes) {\\n attributesArray.push({key: key, value: attributes[key]});\\n }\\n if (attributesArray.length > 0) {\\n return attributeService.saveEntityAttributes(entityId, 'SERVER_SCOPE', attributesArray);\\n } else {\\n return widgetContext.rxjs.of([]);\\n }\\n }\\n}\",\"customResources\":[],\"openInSeparateDialog\":false,\"openInPopover\":false,\"id\":\"93931e52-5d7c-903e-67aa-b9435df44ff4\"},{\"name\":\"Delete device\",\"icon\":\"delete\",\"type\":\"custom\",\"customFunction\":\"let $injector = widgetContext.$scope.$injector;\\nlet dialogs = $injector.get(widgetContext.servicesMap.get('dialogs'));\\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\\n\\nopenDeleteDeviceDialog();\\n\\nfunction openDeleteDeviceDialog() {\\n let title = \\\"Are you sure you want to delete the device \\\" + entityName + \\\"?\\\";\\n let content = \\\"Be careful, after the confirmation, the device and all related data will become unrecoverable!\\\";\\n dialogs.confirm(title, content, 'Cancel', 'Delete').subscribe(\\n function (result) {\\n if (result) {\\n deleteDevice();\\n }\\n }\\n );\\n}\\n\\nfunction deleteDevice() {\\n deviceService.deleteDevice(entityId.id).subscribe(\\n function () {\\n widgetContext.updateAliases();\\n }\\n );\\n}\\n\",\"id\":\"ec2708f6-9ff0-186b-e4fc-7635ebfa3074\"}]},\"configMode\":\"basic\"}" }, "tags": [ "provisioning", diff --git a/application/src/main/data/resources/dashboards/gateways_dashboard.json b/application/src/main/data/resources/dashboards/gateways_dashboard.json index a35d70d006..ed6b20a176 100644 --- a/application/src/main/data/resources/dashboards/gateways_dashboard.json +++ b/application/src/main/data/resources/dashboards/gateways_dashboard.json @@ -160,7 +160,7 @@ "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", "type": "customPretty", - "customHtml": "
\n \n

{{ 'gateway.launch-command' | translate }}

\n \n
\n \n
\n \n
\n \n
\n
\n", + "customHtml": "
\n \n

{{ 'gateway.launch-command' | translate }}

\n \n
\n \n
\n \n
\n \n
\n
\n", "customCss": ".container {\n display: grid;\n grid-template-rows: min-content minmax(auto, 1fr) min-content;\n height: 100%;\n max-height: 100vh;\n width: 600px;\n max-width: 100%;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\n\nopenCommands();\n\nfunction openCommands() {\n customDialog.customDialog(htmlTemplate, CommandsDialogController, {panelClass: \"test\"}).subscribe();\n}\n\nfunction CommandsDialogController(instance) {\n let vm = instance;\n \n vm.entityId = entityId.id;\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n}\n", "customResources": [ @@ -257,7 +257,7 @@ "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", "type": "customPretty", - "customHtml": "
\r\n \r\n

Add gateway

\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n Name\r\n \r\n \r\n Gateway name is required.\r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n", + "customHtml": "
\r\n \r\n

Add gateway

\r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n Name\r\n \r\n \r\n Gateway name is required.\r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n", "customCss": ".add-entity-form {\r\n min-width: 400px !important;\r\n}\r\n\r\n.add-entity-form .boolean-value-input {\r\n padding-left: 5px;\r\n}\r\n\r\n.add-entity-form .boolean-value-input .checkbox-label {\r\n margin-bottom: 8px;\r\n color: rgba(0,0,0,0.54);\r\n font-size: 12px;\r\n}\r\n\r\n.relations-list .header {\r\n padding-right: 5px;\r\n padding-bottom: 5px;\r\n padding-left: 5px;\r\n}\r\n\r\n.relations-list .header .cell {\r\n padding-right: 5px;\r\n padding-left: 5px;\r\n font-size: 12px;\r\n font-weight: 700;\r\n color: rgba(0, 0, 0, .54);\r\n white-space: nowrap;\r\n}\r\n\r\n.relations-list .mat-form-field-infix {\r\n width: auto !important;\r\n}\r\n\r\n.relations-list .body {\r\n padding-right: 5px;\r\n padding-bottom: 15px;\r\n padding-left: 5px;\r\n}\r\n\r\n.relations-list .body .row {\r\n padding-top: 5px;\r\n}\r\n\r\n.relations-list .body .cell {\r\n padding-right: 5px;\r\n padding-left: 5px;\r\n}\r\n\r\n.relations-list .body .md-button {\r\n margin: 0;\r\n}\r\n\r\n", "customFunction": "let $injector = widgetContext.$scope.$injector;\r\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\r\nlet assetService = $injector.get(widgetContext.servicesMap.get('assetService'));\r\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\r\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\r\nlet entityRelationService = $injector.get(widgetContext.servicesMap.get('entityRelationService'));\r\nlet userSettingsService = $injector.get(widgetContext.servicesMap.get('userSettingsService'));\r\n\r\nopenAddEntityDialog();\r\n\r\nfunction openAddEntityDialog() {\r\n customDialog.customDialog(htmlTemplate, AddEntityDialogController).subscribe();\r\n}\r\n\r\nfunction AddEntityDialogController(instance) {\r\n let vm = instance;\r\n let userSettings;\r\n userSettingsService.loadUserSettings().subscribe(settings=> {\r\n userSettings = settings;\r\n if (!userSettings.createdGatewaysCount) userSettings.createdGatewaysCount = 0;\r\n });\r\n \r\n\r\n vm.addEntityFormGroup = vm.fb.group({\r\n entityName: ['', [vm.validators.required, vm.validators.pattern(/.*\\S.*/)]],\r\n entityType: ['DEVICE'],\r\n entityLabel: [''],\r\n type: ['', [vm.validators.required]],\r\n });\r\n\r\n vm.cancel = function() {\r\n vm.dialogRef.close(null);\r\n };\r\n\r\n\r\n vm.save = function($event) {\r\n vm.addEntityFormGroup.markAsPristine();\r\n saveEntityObservable().subscribe(\r\n function (device) {\r\n widgetContext.updateAliases();\r\n userSettingsService.putUserSettings({ createdGatewaysCount: ++userSettings.createdGatewaysCount }).subscribe(_=>{\r\n });\r\n vm.dialogRef.close(null);\r\n openCommandDialog(device, $event);\r\n }\r\n );\r\n };\r\n \r\n function openCommandDialog(device, $event) {\r\n vm.device = device;\r\n let openCommandAction = widgetContext.actionsApi.getActionDescriptors(\"actionCellButton\").find(action => action.name == \"Launch command\");\r\n setTimeout(() => {\r\n widgetContext.actionsApi.handleWidgetAction($event, openCommandAction, device.id, device.name, {newDevice: true});\r\n });\r\n goToConfigState();\r\n }\r\n\r\n \r\n function goToConfigState() {\r\n const stateParams = {};\r\n stateParams.entityId = vm.device.id;\r\n stateParams.entityName = vm.device.name;\r\n const newStateParams = {\r\n targetEntityParamName: 'default',\r\n new_gateway: {\r\n entityId: vm.device.id,\r\n entityName: vm.device.name\r\n }\r\n }\r\n const params = {...stateParams, ...newStateParams};\r\n widgetContext.stateController.openState('gateway_details', params, false);\r\n }\r\n\r\n function saveEntityObservable() {\r\n const formValues = vm.addEntityFormGroup.value;\r\n let entity = {\r\n name: formValues.entityName.trim(),\r\n type: formValues.type,\r\n label: formValues.entityLabel,\r\n additionalInfo: {\r\n gateway: true\r\n }\r\n };\r\n return deviceService.saveDevice(entity);\r\n }\r\n}\r\n", "customResources": [], @@ -1536,7 +1536,7 @@ "useShowWidgetActionFunction": null, "showWidgetActionFunction": "return true;", "type": "customPretty", - "customHtml": "
\n \n

{{ 'gateway.launch-command' | translate }}

\n \n
\n \n
\n \n
\n \n
\n
\n", + "customHtml": "
\n \n

{{ 'gateway.launch-command' | translate }}

\n \n
\n \n
\n \n
\n \n
\n
\n", "customCss": ".container {\n display: grid;\n grid-template-rows: min-content minmax(auto, 1fr) min-content;\n height: 100%;\n max-height: 100vh;\n width: 600px;\n max-width: 100%;\n}", "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\n\nopenCommands();\n\nfunction openCommands() {\n customDialog.customDialog(htmlTemplate, CommandsDialogController, {panelClass: \"test\"}).subscribe();\n}\n\nfunction CommandsDialogController(instance) {\n let vm = instance;\n \n vm.entityId = entityId.id;\n\n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n}\n", "customResources": [ diff --git a/application/src/main/data/upgrade/lts/4.3.1.6/schema_update.sql b/application/src/main/data/upgrade/lts/4.3.1.6/schema_update.sql index c57c9ab598..fb95b9b15f 100644 --- a/application/src/main/data/upgrade/lts/4.3.1.6/schema_update.sql +++ b/application/src/main/data/upgrade/lts/4.3.1.6/schema_update.sql @@ -1,6 +1,7 @@ -- --- SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. --- SPDX-License-Identifier: BUSL-1.1 +-- SPDX-FileCopyrightText: Copyright The ThingsBoard Authors +-- SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. +-- SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 -- -- A copy of the tb_cluster block in dao/src/main/resources/sql/schema-entities.sql, because the no-downtime patch diff --git a/application/src/main/java/org/thingsboard/server/controller/SignUpController.java b/application/src/main/java/org/thingsboard/server/controller/SignUpController.java index a1bdf912bb..aff74dfcd0 100644 --- a/application/src/main/java/org/thingsboard/server/controller/SignUpController.java +++ b/application/src/main/java/org/thingsboard/server/controller/SignUpController.java @@ -2,7 +2,6 @@ // SPDX-License-Identifier: BUSL-1.1 package org.thingsboard.server.controller; -import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; import com.google.api.gax.core.FixedCredentialsProvider; import com.google.auth.oauth2.ServiceAccountCredentials; @@ -117,10 +116,6 @@ public class SignUpController extends BaseController { private static final String MOBILE_APP_BUNDLE_WAS_NOT_FOUND = "Mobile app bundle was not found"; - private static final String PRIVACY_POLICY_ACCEPTED = "privacyPolicyAccepted"; - - private static final String TERMS_OF_USE_ACCEPTED = "termsOfUseAccepted"; - private RestTemplate restTemplate; @Autowired @@ -402,8 +397,9 @@ public class SignUpController extends BaseController { String encodedPassword = userCredentials.getPassword(); UserCredentials credentials = userService.activateUserCredentials(TenantId.SYS_TENANT_ID, emailCode, encodedPassword); User user = userService.findUserById(TenantId.SYS_TENANT_ID, credentials.getUserId()); - setPrivacyPolicyAccepted(user); - setTermsOfUseAccepted(user); + long acceptedTs = System.currentTimeMillis(); + user.setPrivacyPolicyAccepted(acceptedTs); + user.setTermsOfUseAccepted(acceptedTs); user = userService.saveUser(tenantId, user); UserPrincipal principal = new UserPrincipal(UserPrincipal.Type.USER_NAME, user.getEmail()); SecurityUser securityUser = new SecurityUser(user, credentials.isEnabled(), principal, getMergedUserPermissions(user, false)); @@ -428,23 +424,6 @@ public class SignUpController extends BaseController { return tokenFactory.createTokenPair(securityUser); } - private void setPrivacyPolicyAccepted(User user) { - JsonNode additionalInfo = user.getAdditionalInfo(); - if (!(additionalInfo instanceof ObjectNode)) { - additionalInfo = JacksonUtil.newObjectNode(); - } - ((ObjectNode) additionalInfo).put(PRIVACY_POLICY_ACCEPTED, true); - user.setAdditionalInfo(additionalInfo); - } - - private boolean isPrivacyPolicyAccepted(User user) { - JsonNode additionalInfo = user.getAdditionalInfo(); - if (additionalInfo != null && additionalInfo.has(PRIVACY_POLICY_ACCEPTED)) { - return additionalInfo.get(PRIVACY_POLICY_ACCEPTED).asBoolean(); - } - return false; - } - @ApiOperation(value = "Check privacy policy (privacyPolicyAccepted)", notes = "Checks that current user accepted the privacy policy.") @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") @@ -453,43 +432,23 @@ public class SignUpController extends BaseController { Boolean privacyPolicyAccepted() throws ThingsboardException { SecurityUser securityUser = getCurrentUser(); User user = userService.findUserById(securityUser.getTenantId(), securityUser.getId()); - return isPrivacyPolicyAccepted(user); + return user.isPrivacyPolicyAccepted(); } @ApiOperation(value = "Accept privacy policy (acceptPrivacyPolicy)", - notes = "Accept privacy policy by the current user.") + notes = "Accept privacy policy by the current user. " + + "Stores the acceptance flag 'privacyPolicyAccepted' and the acceptance time 'privacyPolicyAcceptedTs' (epoch milliseconds) " + + "in the user's additional info. Repeated acceptance overwrites the stored time.") @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") @PostMapping(value = "/signup/acceptPrivacyPolicy") - public JsonNode acceptPrivacyPolicy() throws ThingsboardException { + public JwtPair acceptPrivacyPolicy() throws ThingsboardException { SecurityUser securityUser = getCurrentUser(); User user = userService.findUserById(securityUser.getTenantId(), securityUser.getId()); - setPrivacyPolicyAccepted(user); + user.setPrivacyPolicyAccepted(); user = userService.saveUser(securityUser.getTenantId(), user); UserPrincipal principal = new UserPrincipal(UserPrincipal.Type.USER_NAME, user.getEmail()); securityUser = new SecurityUser(user, true, principal, getMergedUserPermissions(user, false)); - JwtPair tokenPair = tokenFactory.createTokenPair(securityUser); - - ObjectNode tokenObject = JacksonUtil.newObjectNode(); - tokenObject.put("token", tokenPair.getToken()); - tokenObject.put("refreshToken", tokenPair.getRefreshToken()); - return tokenObject; - } - - private void setTermsOfUseAccepted(User user) { - JsonNode additionalInfo = user.getAdditionalInfo(); - if (!(additionalInfo instanceof ObjectNode)) { - additionalInfo = JacksonUtil.newObjectNode(); - } - ((ObjectNode) additionalInfo).put(TERMS_OF_USE_ACCEPTED, true); - user.setAdditionalInfo(additionalInfo); - } - - private boolean isTermsOfUseAccepted(User user) { - JsonNode additionalInfo = user.getAdditionalInfo(); - if (additionalInfo != null && additionalInfo.has(TERMS_OF_USE_ACCEPTED)) { - return additionalInfo.get(TERMS_OF_USE_ACCEPTED).asBoolean(); - } - return false; + return tokenFactory.createTokenPair(securityUser); } @ApiOperation(value = "Check Terms Of User (termsOfUseAccepted)", @@ -500,26 +459,23 @@ public class SignUpController extends BaseController { Boolean termsOfUseAccepted() throws ThingsboardException { SecurityUser securityUser = getCurrentUser(); User user = userService.findUserById(securityUser.getTenantId(), securityUser.getId()); - return isTermsOfUseAccepted(user); + return user.isTermsOfUseAccepted(); } @ApiOperation(value = "Accept Terms of Use (acceptTermsOfUse)", - notes = "Accept Terms of Use by the current user.") + notes = "Accept Terms of Use by the current user. " + + "Stores the acceptance flag 'termsOfUseAccepted' and the acceptance time 'termsOfUseAcceptedTs' (epoch milliseconds) " + + "in the user's additional info. Repeated acceptance overwrites the stored time.") @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") @PostMapping(value = "/signup/acceptTermsOfUse") - public JsonNode acceptTermsOfUse() throws ThingsboardException { + public JwtPair acceptTermsOfUse() throws ThingsboardException { SecurityUser securityUser = getCurrentUser(); User user = userService.findUserById(securityUser.getTenantId(), securityUser.getId()); - setTermsOfUseAccepted(user); + user.setTermsOfUseAccepted(); user = userService.saveUser(securityUser.getTenantId(), user); UserPrincipal principal = new UserPrincipal(UserPrincipal.Type.USER_NAME, user.getEmail()); securityUser = new SecurityUser(user, true, principal, getMergedUserPermissions(user, false)); - JwtPair tokenPair = tokenFactory.createTokenPair(securityUser); - - ObjectNode tokenObject = JacksonUtil.newObjectNode(); - tokenObject.put("token", tokenPair.getToken()); - tokenObject.put("refreshToken", tokenPair.getRefreshToken()); - return tokenObject; + return tokenFactory.createTokenPair(securityUser); } private void validateReCaptcha(String userResponse, String ipAddress, String recaptchaSecretKey) throws ThingsboardException { diff --git a/application/src/main/java/org/thingsboard/server/service/install/EntityDatabaseSchemaService.java b/application/src/main/java/org/thingsboard/server/service/install/EntityDatabaseSchemaService.java index 0382b1205a..4b08361076 100644 --- a/application/src/main/java/org/thingsboard/server/service/install/EntityDatabaseSchemaService.java +++ b/application/src/main/java/org/thingsboard/server/service/install/EntityDatabaseSchemaService.java @@ -1,6 +1,5 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors -// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. -// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 +// SPDX-License-Identifier: Apache-2.0 package org.thingsboard.server.service.install; public interface EntityDatabaseSchemaService extends DatabaseSchemaService { diff --git a/application/src/main/java/org/thingsboard/server/service/install/lts/V4_3_1_6Migration.java b/application/src/main/java/org/thingsboard/server/service/install/lts/V4_3_1_6Migration.java index 7a16cf6195..1756033ef1 100644 --- a/application/src/main/java/org/thingsboard/server/service/install/lts/V4_3_1_6Migration.java +++ b/application/src/main/java/org/thingsboard/server/service/install/lts/V4_3_1_6Migration.java @@ -1,5 +1,6 @@ -// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors +// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 package org.thingsboard.server.service.install.lts; import lombok.RequiredArgsConstructor; diff --git a/application/src/main/java/org/thingsboard/server/service/iot_hub/DefaultIotHubService.java b/application/src/main/java/org/thingsboard/server/service/iot_hub/DefaultIotHubService.java index c74c8be477..06ef375109 100644 --- a/application/src/main/java/org/thingsboard/server/service/iot_hub/DefaultIotHubService.java +++ b/application/src/main/java/org/thingsboard/server/service/iot_hub/DefaultIotHubService.java @@ -11,7 +11,6 @@ import org.springframework.stereotype.Service; import org.thingsboard.common.util.ExceptionUtil; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.Customer; -import org.thingsboard.server.common.data.Dashboard; import org.thingsboard.server.common.data.DeviceProfile; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.asset.AssetProfile; @@ -35,7 +34,6 @@ import org.thingsboard.server.common.data.id.RuleChainId; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.iot_hub.AlarmRuleInstalledItemDescriptor; import org.thingsboard.server.common.data.iot_hub.CalculatedFieldInstalledItemDescriptor; -import org.thingsboard.server.common.data.iot_hub.DashboardInstalledItemDescriptor; import org.thingsboard.server.common.data.iot_hub.DeviceInstalledItemDescriptor; import org.thingsboard.server.common.data.iot_hub.IotHubInstalledItem; import org.thingsboard.server.common.data.iot_hub.IotHubInstalledItemDescriptor; @@ -100,7 +98,6 @@ public class DefaultIotHubService implements IotHubService { private static final String SECTION_RULE_CHAIN_METADATA = "rule chain metadata"; private static final String ITEM_TYPE_WIDGET = "widget"; - private static final String ITEM_TYPE_DASHBOARD = "dashboard"; private static final String ITEM_TYPE_CALCULATED_FIELD = "calculated field"; private static final String ITEM_TYPE_ALARM_RULE = "alarm rule"; private static final String ITEM_TYPE_RULE_CHAIN = "rule chain"; @@ -183,7 +180,6 @@ public class DefaultIotHubService implements IotHubService { IotHubInstalledItemDescriptor descriptor = switch (itemType) { case "WIDGET" -> installWidget(user, tenantId, fileData); - case "DASHBOARD" -> installDashboard(user, tenantId, fileData, data); case "CALCULATED_FIELD" -> installCalculatedField(user, tenantId, fileData, data); case "ALARM_RULE" -> installAlarmRule(user, tenantId, fileData, data); case "RULE_CHAIN" -> installRuleChain(user, tenantId, fileData, data); @@ -244,58 +240,6 @@ public class DefaultIotHubService implements IotHubService { return descriptor; } - private DashboardInstalledItemDescriptor installDashboard(SecurityUser user, TenantId tenantId, byte[] fileData, JsonNode data) throws Exception { - Dashboard dashboard; - try { - dashboard = JacksonUtil.fromString(new String(fileData), Dashboard.class, true); - } catch (Exception e) { - throw parseFailure(ACTION_INSTALL, ITEM_TYPE_DASHBOARD, e); - } - dashboard.setId(null); - dashboard.setTenantId(tenantId); - - if (data != null && data.hasNonNull("customerId") && data.get("customerId").isTextual()) { - String strCustomerId = data.get("customerId").asText(); - if (!strCustomerId.isEmpty()) { - CustomerId customerId = new CustomerId(UUID.fromString(strCustomerId)); - Customer customer = customerService.findCustomerById(tenantId, customerId); - if (customer == null) { - throw new IllegalArgumentException("Customer with id [" + customerId + "] is not found"); - } - if (!tenantId.equals(customer.getTenantId())) { - throw new IllegalArgumentException("Customer [" + customerId + "] does not belong to the current tenant"); - } - dashboard.setCustomerId(customerId); - } - } - - List entityGroups = null; - if (data != null && data.hasNonNull("entityGroupId") && data.get("entityGroupId").isTextual()) { - String strEntityGroupId = data.get("entityGroupId").asText(); - if (!strEntityGroupId.isEmpty()) { - EntityGroupId entityGroupId = new EntityGroupId(UUID.fromString(strEntityGroupId)); - EntityGroupInfo entityGroup = checkEntityGroup(user, entityGroupId); - if (entityGroup.getType() != EntityType.DASHBOARD) { - throw new IllegalArgumentException("Entity group [" + entityGroupId + "] is not a dashboard group (type: " + entityGroup.getType() + ")"); - } - entityGroups = List.of(entityGroup); - // If the entity group is owned by a customer, align the dashboard owner with the group owner - // (mirrors BaseController.saveGroupEntity logic for new entities). - if (dashboard.getCustomerId() == null || dashboard.getCustomerId().isNullUid()) { - if (entityGroup.getOwnerId().getEntityType() == EntityType.CUSTOMER) { - dashboard.setOwnerId(new CustomerId(entityGroup.getOwnerId().getId())); - } - } - } - } - - Dashboard saved = tbDashboardService.save(dashboard, entityGroups, user); - log.debug("[{}] Dashboard installed: {}", tenantId, saved.getTitle()); - DashboardInstalledItemDescriptor descriptor = new DashboardInstalledItemDescriptor(); - descriptor.setDashboardId(saved.getId()); - return descriptor; - } - private EntityGroupInfo checkEntityGroup(SecurityUser user, EntityGroupId entityGroupId) throws ThingsboardException { EntityGroupInfo entityGroup = entityGroupService.findEntityGroupInfoById(user.getTenantId(), entityGroupId); if (entityGroup == null) { @@ -466,7 +410,6 @@ public class DefaultIotHubService implements IotHubService { } String itemType = installedItem.getItemType(); - IotHubInstalledItemDescriptor descriptor = installedItem.getDescriptor(); // Skip checksum validation for solution templates @@ -508,7 +451,6 @@ public class DefaultIotHubService implements IotHubService { switch (itemType) { case "WIDGET" -> updateWidget(user, tenantId, (WidgetInstalledItemDescriptor) descriptor, fileData); - case "DASHBOARD" -> updateDashboard(user, tenantId, (DashboardInstalledItemDescriptor) descriptor, fileData); case "CALCULATED_FIELD" -> updateCalculatedField(user, tenantId, (CalculatedFieldInstalledItemDescriptor) descriptor, fileData); case "ALARM_RULE" -> updateAlarmRule(user, tenantId, (AlarmRuleInstalledItemDescriptor) descriptor, fileData); case "RULE_CHAIN" -> updateRuleChain(tenantId, (RuleChainInstalledItemDescriptor) descriptor, fileData); @@ -567,22 +509,6 @@ public class DefaultIotHubService implements IotHubService { tbWidgetTypeService.save(existing, false, user); } - private void updateDashboard(SecurityUser user, TenantId tenantId, DashboardInstalledItemDescriptor descriptor, byte[] fileData) throws Exception { - Dashboard newDashboard; - try { - newDashboard = JacksonUtil.fromString(new String(fileData), Dashboard.class, true); - } catch (Exception e) { - throw parseFailure(ACTION_UPDATE, ITEM_TYPE_DASHBOARD, e); - } - Dashboard existing = dashboardService.findDashboardById(tenantId, descriptor.getDashboardId()); - if (existing == null) { - throw new Exception("Dashboard not found for update"); - } - existing.setTitle(newDashboard.getTitle()); - existing.setConfiguration(newDashboard.getConfiguration()); - tbDashboardService.save(existing, (List) null, user); - } - private void updateCalculatedField(SecurityUser user, TenantId tenantId, CalculatedFieldInstalledItemDescriptor descriptor, byte[] fileData) throws Exception { CalculatedField newCf; try { @@ -649,8 +575,6 @@ public class DefaultIotHubService implements IotHubService { IotHubInstalledItemDescriptor descriptor = installedItem.getDescriptor(); if (descriptor instanceof WidgetInstalledItemDescriptor wd) { return calculateWidgetChecksum(tenantId, wd); - } else if (descriptor instanceof DashboardInstalledItemDescriptor dd) { - return calculateDashboardChecksum(tenantId, dd); } else if (descriptor instanceof CalculatedFieldInstalledItemDescriptor cd) { return calculateCalculatedFieldChecksum(tenantId, cd.getCalculatedFieldId()); } else if (descriptor instanceof AlarmRuleInstalledItemDescriptor ad) { @@ -672,16 +596,6 @@ public class DefaultIotHubService implements IotHubService { return sha256(content); } - private String calculateDashboardChecksum(TenantId tenantId, DashboardInstalledItemDescriptor descriptor) { - Dashboard dashboard = dashboardService.findDashboardById(tenantId, descriptor.getDashboardId()); - if (dashboard == null) { - return null; - } - String content = (dashboard.getTitle() != null ? dashboard.getTitle() : "") + - (dashboard.getConfiguration() != null ? dashboard.getConfiguration().toString() : ""); - return sha256(content); - } - private String calculateWidgetChecksum(TenantId tenantId, WidgetInstalledItemDescriptor descriptor) { WidgetTypeDetails widgetType = widgetTypeService.findWidgetTypeDetailsById(tenantId, descriptor.getWidgetTypeId()); if (widgetType == null) { @@ -865,11 +779,6 @@ public class DefaultIotHubService implements IotHubService { if (widgetType != null) { tbWidgetTypeService.delete(widgetType, user); } - } else if (descriptor instanceof DashboardInstalledItemDescriptor dd) { - Dashboard dashboard = dashboardService.findDashboardById(tenantId, dd.getDashboardId()); - if (dashboard != null) { - tbDashboardService.delete(dashboard, user); - } } else if (descriptor instanceof CalculatedFieldInstalledItemDescriptor cd) { CalculatedField calculatedField = calculatedFieldService.findById(tenantId, cd.getCalculatedFieldId()); if (calculatedField != null) { diff --git a/application/src/test/java/org/thingsboard/server/controller/SignUpControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/SignUpControllerSqlTest.java index 143326d394..02b37c92ba 100644 --- a/application/src/test/java/org/thingsboard/server/controller/SignUpControllerSqlTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/SignUpControllerSqlTest.java @@ -14,6 +14,7 @@ import org.testcontainers.shaded.org.apache.commons.lang3.RandomStringUtils; import org.thingsboard.server.common.data.Customer; import org.thingsboard.server.common.data.CustomerInfo; import org.thingsboard.server.common.data.Dashboard; +import org.thingsboard.server.common.data.DataConstants; import org.thingsboard.server.common.data.EntityInfo; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.StringUtils; @@ -35,11 +36,11 @@ import org.thingsboard.server.common.data.oauth2.PlatformType; import org.thingsboard.server.common.data.page.PageLink; import org.thingsboard.server.common.data.selfregistration.DefaultDashboardParams; import org.thingsboard.server.common.data.selfregistration.HomeDashboardParams; -import org.thingsboard.server.common.data.selfregistration.V2CaptchaParams; import org.thingsboard.server.common.data.selfregistration.MobileRedirectParams; import org.thingsboard.server.common.data.selfregistration.MobileSelfRegistrationParams; import org.thingsboard.server.common.data.selfregistration.SignUpField; import org.thingsboard.server.common.data.selfregistration.SignUpFieldId; +import org.thingsboard.server.common.data.selfregistration.V2CaptchaParams; import org.thingsboard.server.common.data.selfregistration.WebSelfRegistrationParams; import org.thingsboard.server.common.data.signup.SignUpRequest; import org.thingsboard.server.common.data.signup.SignUpResult; @@ -200,6 +201,38 @@ public class SignUpControllerSqlTest extends AbstractControllerTest { removeCreatedUser(user); } + @Test + public void testActivationByEmailCodeStoresPolicyAcceptanceTimestamps() throws Exception { + createWebSelfRegistrationSettings(); + doSignUp(createWebSignUpRequest(CUSTOMER_TEST_EMAIL)); + User user = userService.findUserByEmail(tenantId, CUSTOMER_TEST_EMAIL); + String activateToken = userService.findUserCredentialsByUserId(tenantId, user.getId()).getActivateToken(); + + doPost("/api/noauth/activateByEmailCode", JsonNode.class, "emailCode", activateToken); + + User activatedUser = userService.findUserById(tenantId, user.getId()); + assertPrivacyPolicyAccepted(activatedUser); + assertTermsOfUseAccepted(activatedUser); + + removeCreatedUser(activatedUser); + } + + @Test + public void testAcceptPrivacyPolicyStoresAcceptanceTimestamp() { + doPost("/api/signup/acceptPrivacyPolicy", JsonNode.class); + + User user = userService.findUserById(tenantId, tenantAdminUserId); + assertPrivacyPolicyAccepted(user); + } + + @Test + public void testAcceptTermsOfUseStoresAcceptanceTimestamp() { + doPost("/api/signup/acceptTermsOfUse", JsonNode.class); + + User user = userService.findUserById(tenantId, tenantAdminUserId); + assertTermsOfUseAccepted(user); + } + @Test public void testSelfRegistrationCreateMessageInRuleChain() throws Exception { createWebSelfRegistrationSettings(); @@ -263,6 +296,22 @@ public class SignUpControllerSqlTest extends AbstractControllerTest { return signUpRequest; } + private void assertPrivacyPolicyAccepted(User user) { + assertThat(user.isPrivacyPolicyAccepted()).isTrue(); + assertAcceptedTsIsPositive(user, DataConstants.PRIVACY_POLICY_ACCEPTED_TS); + } + + private void assertTermsOfUseAccepted(User user) { + assertThat(user.isTermsOfUseAccepted()).isTrue(); + assertAcceptedTsIsPositive(user, DataConstants.TERMS_OF_USE_ACCEPTED_TS); + } + + private void assertAcceptedTsIsPositive(User user, String acceptedTsKey) { + JsonNode acceptedTs = user.getAdditionalInfo().path(acceptedTsKey); + assertThat(acceptedTs.isNumber()).isTrue(); + assertThat(acceptedTs.asLong()).isPositive(); + } + protected SignUpRequest createMobileSignUpRequest(String email, String pkgName, String appSecret, PlatformType platformType) { var signUpRequest = new SignUpRequest(); signUpRequest.setFields(Map.of(SignUpFieldId.EMAIL, email, diff --git a/application/src/test/java/org/thingsboard/server/install/ThingsboardInstallServiceTest.java b/application/src/test/java/org/thingsboard/server/install/ThingsboardInstallServiceTest.java index 0fe371aa77..8591952462 100644 --- a/application/src/test/java/org/thingsboard/server/install/ThingsboardInstallServiceTest.java +++ b/application/src/test/java/org/thingsboard/server/install/ThingsboardInstallServiceTest.java @@ -1,5 +1,6 @@ -// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors +// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 package org.thingsboard.server.install; import org.junit.jupiter.api.BeforeEach; diff --git a/application/src/test/java/org/thingsboard/server/service/install/SqlEntityDatabaseSchemaServiceClusterIdTest.java b/application/src/test/java/org/thingsboard/server/service/install/SqlEntityDatabaseSchemaServiceClusterIdTest.java index 88d6bfba03..f8f1cd800d 100644 --- a/application/src/test/java/org/thingsboard/server/service/install/SqlEntityDatabaseSchemaServiceClusterIdTest.java +++ b/application/src/test/java/org/thingsboard/server/service/install/SqlEntityDatabaseSchemaServiceClusterIdTest.java @@ -1,5 +1,6 @@ -// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors +// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 package org.thingsboard.server.service.install; import org.junit.jupiter.api.BeforeEach; diff --git a/application/src/test/java/org/thingsboard/server/service/iot_hub/DefaultIotHubServiceTest.java b/application/src/test/java/org/thingsboard/server/service/iot_hub/DefaultIotHubServiceTest.java index cb9221db18..2f1a0ada5b 100644 --- a/application/src/test/java/org/thingsboard/server/service/iot_hub/DefaultIotHubServiceTest.java +++ b/application/src/test/java/org/thingsboard/server/service/iot_hub/DefaultIotHubServiceTest.java @@ -15,8 +15,8 @@ import org.mockito.junit.jupiter.MockitoExtension; import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.id.IotHubInstalledItemId; import org.thingsboard.server.common.data.id.TenantId; -import org.thingsboard.server.common.data.iot_hub.DashboardInstalledItemDescriptor; import org.thingsboard.server.common.data.iot_hub.IotHubInstalledItem; +import org.thingsboard.server.common.data.iot_hub.RuleChainInstalledItemDescriptor; import org.thingsboard.server.dao.iot_hub.IotHubInstalledItemService; import org.thingsboard.server.service.security.model.SecurityUser; @@ -89,7 +89,7 @@ class DefaultIotHubServiceTest { mockTenant(); String versionId = UUID.randomUUID().toString(); String itemId = UUID.randomUUID().toString(); - when(iotHubRestClient.getVersionInfo(versionId)).thenReturn(version(versionId, itemId, "DASHBOARD", "Root", "1.0")); + when(iotHubRestClient.getVersionInfo(versionId)).thenReturn(version(versionId, itemId, "RULE_CHAIN", "Root", "1.0")); when(iotHubInstalledItemService.findInstalledItemIdsByTenantIdAndItemIdIn(eq(tenantId), any())).thenReturn(List.of()); InstallPlan plan = service.resolveInstallPlan(user, versionId); @@ -107,7 +107,7 @@ class DefaultIotHubServiceTest { String versionId = UUID.randomUUID().toString(); String rootItemId = UUID.randomUUID().toString(); String relatedItemId = UUID.randomUUID().toString(); - ObjectNode root = version(versionId, rootItemId, "DASHBOARD", "Root", "1.0"); + ObjectNode root = version(versionId, rootItemId, "RULE_CHAIN", "Root", "1.0"); root.putArray("relatedItems").add(relatedItemId); when(iotHubRestClient.getVersionInfo(versionId)).thenReturn(root); when(iotHubRestClient.getPublishedVersionByItemId(relatedItemId)) @@ -129,7 +129,7 @@ class DefaultIotHubServiceTest { String versionId = UUID.randomUUID().toString(); String rootItemId = UUID.randomUUID().toString(); String relatedItemId = UUID.randomUUID().toString(); - ObjectNode root = version(versionId, rootItemId, "DASHBOARD", "Root", "1.0"); + ObjectNode root = version(versionId, rootItemId, "RULE_CHAIN", "Root", "1.0"); root.putArray("relatedItems").add(relatedItemId); when(iotHubRestClient.getVersionInfo(versionId)).thenReturn(root); when(iotHubRestClient.getPublishedVersionByItemId(relatedItemId)).thenReturn(null); @@ -149,7 +149,7 @@ class DefaultIotHubServiceTest { String versionId = UUID.randomUUID().toString(); String rootItemId = UUID.randomUUID().toString(); String relatedItemId = UUID.randomUUID().toString(); - ObjectNode root = version(versionId, rootItemId, "DASHBOARD", "Root", "1.0"); + ObjectNode root = version(versionId, rootItemId, "RULE_CHAIN", "Root", "1.0"); root.putArray("relatedItems").add(relatedItemId); when(iotHubRestClient.getVersionInfo(versionId)).thenReturn(root); when(iotHubRestClient.getPublishedVersionByItemId(relatedItemId)).thenThrow(new RuntimeException("boom")); @@ -280,7 +280,7 @@ class DefaultIotHubServiceTest { when(iotHubInstalledItemService.findInstalledItemIdsByTenantIdAndItemIdIn(eq(tenantId), any())).thenReturn(List.of()); IotHubInstalledItem depItem = installedItem(UUID.randomUUID()); IotHubInstalledItem rootItem = installedItem(UUID.randomUUID()); - DashboardInstalledItemDescriptor rootDescriptor = new DashboardInstalledItemDescriptor(); + RuleChainInstalledItemDescriptor rootDescriptor = new RuleChainInstalledItemDescriptor(); rootItem.setDescriptor(rootDescriptor); doReturn(depItem).when(service).doInstallVersion(eq(user), eq(depVersionId), any(), any()); doReturn(rootItem).when(service).doInstallVersion(eq(user), eq(rootVersionId), any(), any()); diff --git a/check-license-headers.sh b/check-license-headers.sh index 4103afa0f8..6176d4d7e9 100755 --- a/check-license-headers.sh +++ b/check-license-headers.sh @@ -8,21 +8,18 @@ set -euo pipefail usage() { echo "Checks SPDX license headers against CE provenance." - echo "usage: $0 [--fix] [--ce-remote ] [--output target/...]" - echo " ce-ref CE branch, tag or commit matching this PE branch, e.g. lts-4.2;" - echo " fetched from the CE repository on every run" + echo "usage: $0 [--fix] [--ce-ref ] [--ce-remote ] [--output target/...]" echo " --fix restamp files whose expected header the check determined" - echo " --ce-remote CE repository to fetch from (default: https://github.com/thingsboard/thingsboard.git)" + echo " and remove redundant or orphaned curations" + echo " --ce-ref CE branch, tag or commit that this branch integrates, fetched on every run;" + echo " without it, CE is the history that does not contain the relicensing commit" + echo " --ce-remote CE repository to fetch --ce-ref from (default: https://github.com/thingsboard/thingsboard.git)" } -if [[ $# -eq 0 || "$1" == "-h" || "$1" == "--help" || "$1" == -* ]]; then +if [[ $# -gt 0 && ( "$1" == "-h" || "$1" == "--help" ) ]]; then usage - [[ $# -gt 0 && ( "$1" == "-h" || "$1" == "--help" ) ]] && exit 0 - exit 2 + exit 0 fi -ce_ref="$1" -shift - cd "$(git rev-parse --show-toplevel)" -exec python3 tools/src/main/python/license-headers/check_license_headers.py check --ce-ref "$ce_ref" "$@" +exec python3 tools/src/main/python/license-headers/check_license_headers.py check "$@" diff --git a/common/actor/pom.xml b/common/actor/pom.xml index 207337ae57..d1f4eda97b 100644 --- a/common/actor/pom.xml +++ b/common/actor/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/agent-api/pom.xml b/common/agent-api/pom.xml index 116cd3478a..648bab6df3 100644 --- a/common/agent-api/pom.xml +++ b/common/agent-api/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/cache/pom.xml b/common/cache/pom.xml index e4ba4342e6..5b476b30cc 100644 --- a/common/cache/pom.xml +++ b/common/cache/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/cluster-api/pom.xml b/common/cluster-api/pom.xml index 257f6c2712..64c3d49d39 100644 --- a/common/cluster-api/pom.xml +++ b/common/cluster-api/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/coap-server/pom.xml b/common/coap-server/pom.xml index cb76c5f68c..50347cb551 100644 --- a/common/coap-server/pom.xml +++ b/common/coap-server/pom.xml @@ -2,7 +2,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/dao-api/pom.xml b/common/dao-api/pom.xml index 3ce813d21c..72b0c0fe97 100644 --- a/common/dao-api/pom.xml +++ b/common/dao-api/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/data/pom.xml b/common/data/pom.xml index d3e060a8b3..815bf191f7 100644 --- a/common/data/pom.xml +++ b/common/data/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/DataConstants.java b/common/data/src/main/java/org/thingsboard/server/common/data/DataConstants.java index 625f1fc514..9d20a0e5e8 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/DataConstants.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/DataConstants.java @@ -160,6 +160,11 @@ public class DataConstants { public static final String CF_QUEUE_NAME = "CalculatedFields"; public static final String CF_STATES_QUEUE_NAME = "CalculatedFieldStates"; + public static final String PRIVACY_POLICY_ACCEPTED = "privacyPolicyAccepted"; + public static final String PRIVACY_POLICY_ACCEPTED_TS = "privacyPolicyAcceptedTs"; + public static final String TERMS_OF_USE_ACCEPTED = "termsOfUseAccepted"; + public static final String TERMS_OF_USE_ACCEPTED_TS = "termsOfUseAcceptedTs"; + public static final String LATEST_TELEMETRY_SCOPE = "LATEST_TELEMETRY"; } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/User.java b/common/data/src/main/java/org/thingsboard/server/common/data/User.java index c8f3683736..17797a912a 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/User.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/User.java @@ -6,6 +6,8 @@ package org.thingsboard.server.common.data; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.BooleanNode; +import com.fasterxml.jackson.databind.node.LongNode; import io.swagger.v3.oas.annotations.media.Schema; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -251,6 +253,34 @@ public class User extends BaseDataWithAdditionalInfo implements GroupEnt return !isSystemAdmin() && !isTenantAdmin(); } + @JsonIgnore + public boolean isPrivacyPolicyAccepted() { + return getAdditionalInfoField(DataConstants.PRIVACY_POLICY_ACCEPTED, JsonNode::asBoolean, false); + } + + public void setPrivacyPolicyAccepted() { + setPrivacyPolicyAccepted(System.currentTimeMillis()); + } + + public void setPrivacyPolicyAccepted(long acceptedTs) { + setAdditionalInfoField(DataConstants.PRIVACY_POLICY_ACCEPTED, BooleanNode.TRUE); + setAdditionalInfoField(DataConstants.PRIVACY_POLICY_ACCEPTED_TS, LongNode.valueOf(acceptedTs)); + } + + @JsonIgnore + public boolean isTermsOfUseAccepted() { + return getAdditionalInfoField(DataConstants.TERMS_OF_USE_ACCEPTED, JsonNode::asBoolean, false); + } + + public void setTermsOfUseAccepted() { + setTermsOfUseAccepted(System.currentTimeMillis()); + } + + public void setTermsOfUseAccepted(long acceptedTs) { + setAdditionalInfoField(DataConstants.TERMS_OF_USE_ACCEPTED, BooleanNode.TRUE); + setAdditionalInfoField(DataConstants.TERMS_OF_USE_ACCEPTED_TS, LongNode.valueOf(acceptedTs)); + } + @JsonIgnore public String getLocale() { return getAdditionalInfoField("lang", JsonNode::asText, Locale.US.toString()); diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/iot_hub/DashboardInstalledItemDescriptor.java b/common/data/src/main/java/org/thingsboard/server/common/data/iot_hub/DashboardInstalledItemDescriptor.java deleted file mode 100644 index e39e6d7be8..0000000000 --- a/common/data/src/main/java/org/thingsboard/server/common/data/iot_hub/DashboardInstalledItemDescriptor.java +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors -// SPDX-License-Identifier: Apache-2.0 -package org.thingsboard.server.common.data.iot_hub; - -import lombok.Data; -import org.thingsboard.server.common.data.id.DashboardId; - -@Data -public class DashboardInstalledItemDescriptor implements IotHubInstalledItemDescriptor { - - private DashboardId dashboardId; - -} diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/iot_hub/IotHubInstalledItemDescriptor.java b/common/data/src/main/java/org/thingsboard/server/common/data/iot_hub/IotHubInstalledItemDescriptor.java index e35cadaea6..675dbe4601 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/iot_hub/IotHubInstalledItemDescriptor.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/iot_hub/IotHubInstalledItemDescriptor.java @@ -15,7 +15,6 @@ import java.io.Serializable; property = "type") @JsonSubTypes({ @Type(name = "WIDGET", value = WidgetInstalledItemDescriptor.class), - @Type(name = "DASHBOARD", value = DashboardInstalledItemDescriptor.class), @Type(name = "CALCULATED_FIELD", value = CalculatedFieldInstalledItemDescriptor.class), @Type(name = "ALARM_RULE", value = AlarmRuleInstalledItemDescriptor.class), @Type(name = "RULE_CHAIN", value = RuleChainInstalledItemDescriptor.class), diff --git a/common/data/src/main/java/org/thingsboard/server/exception/DataValidationException.java b/common/data/src/main/java/org/thingsboard/server/exception/DataValidationException.java index 42a6b1af56..034dfa82a4 100644 --- a/common/data/src/main/java/org/thingsboard/server/exception/DataValidationException.java +++ b/common/data/src/main/java/org/thingsboard/server/exception/DataValidationException.java @@ -1,6 +1,5 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors -// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. -// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 +// SPDX-License-Identifier: Apache-2.0 package org.thingsboard.server.exception; public class DataValidationException extends RuntimeException { diff --git a/common/data/src/test/java/org/thingsboard/server/common/data/UserTest.java b/common/data/src/test/java/org/thingsboard/server/common/data/UserTest.java new file mode 100644 index 0000000000..3220ba22a6 --- /dev/null +++ b/common/data/src/test/java/org/thingsboard/server/common/data/UserTest.java @@ -0,0 +1,188 @@ +// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: BUSL-1.1 +package org.thingsboard.server.common.data; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.databind.node.TextNode; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; + +import java.util.function.Consumer; +import java.util.function.ObjLongConsumer; +import java.util.function.Predicate; + +import static org.assertj.core.api.Assertions.assertThat; + +class UserTest { + + private static final long TS = 1_700_000_000_000L; + + @Getter + @RequiredArgsConstructor + enum PolicyDocument { + + PRIVACY_POLICY(DataConstants.PRIVACY_POLICY_ACCEPTED, DataConstants.PRIVACY_POLICY_ACCEPTED_TS, + User::setPrivacyPolicyAccepted, User::setPrivacyPolicyAccepted, User::isPrivacyPolicyAccepted), + TERMS_OF_USE(DataConstants.TERMS_OF_USE_ACCEPTED, DataConstants.TERMS_OF_USE_ACCEPTED_TS, + User::setTermsOfUseAccepted, User::setTermsOfUseAccepted, User::isTermsOfUseAccepted); + + private final String acceptedKey; + private final String acceptedTsKey; + private final Consumer accept; + private final ObjLongConsumer acceptAt; + private final Predicate accepted; + + PolicyDocument other() { + return this == PRIVACY_POLICY ? TERMS_OF_USE : PRIVACY_POLICY; + } + + } + + @ParameterizedTest + @EnumSource(PolicyDocument.class) + void shouldCreateAdditionalInfo_whenAdditionalInfoIsNull(PolicyDocument document) { + // GIVEN + User user = new User(); + + // WHEN + document.getAcceptAt().accept(user, TS); + + // THEN + assertAcceptedAt(user, document, TS); + } + + @ParameterizedTest + @EnumSource(PolicyDocument.class) + void shouldReplaceAdditionalInfo_whenAdditionalInfoIsNotObject(PolicyDocument document) { + // GIVEN + User user = new User(); + user.setAdditionalInfo(TextNode.valueOf("not an object")); + + // WHEN + document.getAcceptAt().accept(user, TS); + + // THEN + assertAcceptedAt(user, document, TS); + } + + @ParameterizedTest + @EnumSource(PolicyDocument.class) + void shouldPreserveExistingFields_whenAdditionalInfoIsObject(PolicyDocument document) { + // GIVEN + User user = new User(); + ObjectNode additionalInfo = JsonNodeFactory.instance.objectNode(); + additionalInfo.put("lang", "en_US"); + user.setAdditionalInfo(additionalInfo); + + // WHEN + document.getAcceptAt().accept(user, TS); + + // THEN + assertAcceptedAt(user, document, TS); + assertThat(user.getAdditionalInfo().get("lang").asText()).isEqualTo("en_US"); + } + + @ParameterizedTest + @EnumSource(PolicyDocument.class) + void shouldOverwriteTimestamp_whenAcceptedAgain(PolicyDocument document) { + // GIVEN + User user = new User(); + document.getAcceptAt().accept(user, TS); + + // WHEN + document.getAcceptAt().accept(user, TS + 1); + + // THEN + assertAcceptedAt(user, document, TS + 1); + } + + @ParameterizedTest + @EnumSource(PolicyDocument.class) + void shouldNotTouchOtherDocument(PolicyDocument document) { + // GIVEN + User user = new User(); + + // WHEN + document.getAcceptAt().accept(user, TS); + + // THEN + PolicyDocument other = document.other(); + assertThat(user.getAdditionalInfo().has(other.getAcceptedKey())).isFalse(); + assertThat(user.getAdditionalInfo().has(other.getAcceptedTsKey())).isFalse(); + assertThat(other.getAccepted().test(user)).isFalse(); + } + + @ParameterizedTest + @EnumSource(PolicyDocument.class) + void shouldStampCurrentTime_whenAcceptedWithoutTimestamp(PolicyDocument document) { + // GIVEN + User user = new User(); + long before = System.currentTimeMillis(); + + // WHEN + document.getAccept().accept(user); + + // THEN + long after = System.currentTimeMillis(); + assertThat(document.getAccepted().test(user)).isTrue(); + assertThat(user.getAdditionalInfo().get(document.getAcceptedTsKey()).asLong()).isBetween(before, after); + } + + @ParameterizedTest + @EnumSource(PolicyDocument.class) + void shouldReportAccepted_whenMarked(PolicyDocument document) { + // GIVEN + User user = new User(); + document.getAcceptAt().accept(user, TS); + + // WHEN-THEN + assertThat(document.getAccepted().test(user)).isTrue(); + } + + @ParameterizedTest + @EnumSource(PolicyDocument.class) + void shouldReportNotAccepted_whenAdditionalInfoIsNull(PolicyDocument document) { + // GIVEN + User user = new User(); + + // WHEN-THEN + assertThat(document.getAccepted().test(user)).isFalse(); + } + + @ParameterizedTest + @EnumSource(PolicyDocument.class) + void shouldReportNotAccepted_whenFlagIsAbsent(PolicyDocument document) { + // GIVEN + User user = new User(); + user.setAdditionalInfo(JsonNodeFactory.instance.objectNode()); + + // WHEN-THEN + assertThat(document.getAccepted().test(user)).isFalse(); + } + + @ParameterizedTest + @EnumSource(PolicyDocument.class) + void shouldReportNotAccepted_whenFlagIsFalse(PolicyDocument document) { + // GIVEN + User user = new User(); + ObjectNode additionalInfo = JsonNodeFactory.instance.objectNode(); + additionalInfo.put(document.getAcceptedKey(), false); + user.setAdditionalInfo(additionalInfo); + + // WHEN-THEN + assertThat(document.getAccepted().test(user)).isFalse(); + } + + private static void assertAcceptedAt(User user, PolicyDocument document, long expectedTs) { + JsonNode additionalInfo = user.getAdditionalInfo(); + assertThat(additionalInfo).isInstanceOf(ObjectNode.class); + assertThat(additionalInfo.get(document.getAcceptedKey()).asBoolean()).isTrue(); + assertThat(additionalInfo.get(document.getAcceptedTsKey()).asLong()).isEqualTo(expectedTs); + assertThat(document.getAccepted().test(user)).isTrue(); + } + +} diff --git a/common/discovery-api/pom.xml b/common/discovery-api/pom.xml index 3c7df8d6a0..d7cb25266b 100644 --- a/common/discovery-api/pom.xml +++ b/common/discovery-api/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/edge-api/pom.xml b/common/edge-api/pom.xml index bbd2463752..77005c642c 100644 --- a/common/edge-api/pom.xml +++ b/common/edge-api/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/edge-api/src/main/proto/edge.proto b/common/edge-api/src/main/proto/edge.proto index b6fbc6a82e..0c17d43e5f 100644 --- a/common/edge-api/src/main/proto/edge.proto +++ b/common/edge-api/src/main/proto/edge.proto @@ -41,6 +41,7 @@ enum EdgeVersion { V_4_2_2_4 = 4224; V_4_2_2_5 = 4225; V_4_2_2_6 = 4226; + V_4_2_2_7 = 4227; V_4_3_0_1 = 15; V_4_3_1 = 4310; V_4_3_1_1 = 4311; @@ -49,7 +50,9 @@ enum EdgeVersion { V_4_3_1_4 = 4314; V_4_3_1_5 = 4315; V_4_3_1_6 = 4316; + V_4_3_1_7 = 4317; V_4_4_0 = 4400; + V_4_4_0_1 = 4401; V_LATEST = 99999; } diff --git a/common/edqs/pom.xml b/common/edqs/pom.xml index 33be32a08c..c4806872cd 100644 --- a/common/edqs/pom.xml +++ b/common/edqs/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/integration/apache-pulsar/pom.xml b/common/integration/apache-pulsar/pom.xml index dabe13c243..8d2bcb44c1 100644 --- a/common/integration/apache-pulsar/pom.xml +++ b/common/integration/apache-pulsar/pom.xml @@ -11,7 +11,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/integration/aws-integrations/pom.xml b/common/integration/aws-integrations/pom.xml index 59f1830998..7629907753 100644 --- a/common/integration/aws-integrations/pom.xml +++ b/common/integration/aws-integrations/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/integration/azure-integrations/pom.xml b/common/integration/azure-integrations/pom.xml index f521b0f1c7..dad9f38033 100644 --- a/common/integration/azure-integrations/pom.xml +++ b/common/integration/azure-integrations/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/integration/cluster-integration-api/pom.xml b/common/integration/cluster-integration-api/pom.xml index d26c39df6b..151d787c23 100644 --- a/common/integration/cluster-integration-api/pom.xml +++ b/common/integration/cluster-integration-api/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/integration/coap-integrations/pom.xml b/common/integration/coap-integrations/pom.xml index 6142b068b0..f75a62aed9 100644 --- a/common/integration/coap-integrations/pom.xml +++ b/common/integration/coap-integrations/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/integration/gcloud-integrations/pom.xml b/common/integration/gcloud-integrations/pom.xml index 4a7ebfed15..b909cfb628 100644 --- a/common/integration/gcloud-integrations/pom.xml +++ b/common/integration/gcloud-integrations/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/integration/http-integrations/pom.xml b/common/integration/http-integrations/pom.xml index 99aa616128..5b2606505a 100644 --- a/common/integration/http-integrations/pom.xml +++ b/common/integration/http-integrations/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/integration/integration-api/pom.xml b/common/integration/integration-api/pom.xml index 892a3bd16f..23fbb4f012 100644 --- a/common/integration/integration-api/pom.xml +++ b/common/integration/integration-api/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/integration/kafka-integrations/pom.xml b/common/integration/kafka-integrations/pom.xml index de0ae80585..1da4a2e5bc 100644 --- a/common/integration/kafka-integrations/pom.xml +++ b/common/integration/kafka-integrations/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/integration/mqtt-integrations/pom.xml b/common/integration/mqtt-integrations/pom.xml index bc2df4cf5e..2880ab2710 100644 --- a/common/integration/mqtt-integrations/pom.xml +++ b/common/integration/mqtt-integrations/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration @@ -67,7 +67,7 @@ junit junit - RELEASE + 4.13.2 test diff --git a/common/integration/opcua-integrations/pom.xml b/common/integration/opcua-integrations/pom.xml index d8e861692c..af25e34904 100644 --- a/common/integration/opcua-integrations/pom.xml +++ b/common/integration/opcua-integrations/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/integration/pom.xml b/common/integration/pom.xml index df625de93c..ffc4d21947 100644 --- a/common/integration/pom.xml +++ b/common/integration/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/integration/rabbitmq-integrations/pom.xml b/common/integration/rabbitmq-integrations/pom.xml index 1f733387ef..c4f120c054 100644 --- a/common/integration/rabbitmq-integrations/pom.xml +++ b/common/integration/rabbitmq-integrations/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/integration/remote-integration-api/pom.xml b/common/integration/remote-integration-api/pom.xml index 50a0a6f815..a0efa16741 100644 --- a/common/integration/remote-integration-api/pom.xml +++ b/common/integration/remote-integration-api/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/integration/tuya-integrations/pom.xml b/common/integration/tuya-integrations/pom.xml index d67fe3cc7c..6bb785b285 100644 --- a/common/integration/tuya-integrations/pom.xml +++ b/common/integration/tuya-integrations/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.common.integration diff --git a/common/message/pom.xml b/common/message/pom.xml index e2132029e6..7fdcc5d7e3 100644 --- a/common/message/pom.xml +++ b/common/message/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/pom.xml b/common/pom.xml index 9474839791..dd7abf9c65 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard common diff --git a/common/proto/pom.xml b/common/proto/pom.xml index 4908ee0cd7..f27ab28dd3 100644 --- a/common/proto/pom.xml +++ b/common/proto/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/queue/pom.xml b/common/queue/pom.xml index 9aeba1959b..1107cb9d80 100644 --- a/common/queue/pom.xml +++ b/common/queue/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/report/pom.xml b/common/report/pom.xml index 22374c1ff8..4c5569f5b3 100644 --- a/common/report/pom.xml +++ b/common/report/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/script/pom.xml b/common/script/pom.xml index 7f24d645b6..4c65c0ad49 100644 --- a/common/script/pom.xml +++ b/common/script/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/script/remote-js-client/pom.xml b/common/script/remote-js-client/pom.xml index 50df7069f5..8107306a8c 100644 --- a/common/script/remote-js-client/pom.xml +++ b/common/script/remote-js-client/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT script org.thingsboard.common.script diff --git a/common/script/script-api/pom.xml b/common/script/script-api/pom.xml index 698e51e0a4..59d85f86a1 100644 --- a/common/script/script-api/pom.xml +++ b/common/script/script-api/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT script org.thingsboard.common.script diff --git a/common/stats/pom.xml b/common/stats/pom.xml index 1a116f1b37..53cc5e4eaf 100644 --- a/common/stats/pom.xml +++ b/common/stats/pom.xml @@ -2,7 +2,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/transport/coap/pom.xml b/common/transport/coap/pom.xml index 2e3e82a831..fe30177622 100644 --- a/common/transport/coap/pom.xml +++ b/common/transport/coap/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.common.transport diff --git a/common/transport/http/pom.xml b/common/transport/http/pom.xml index fc7b58100f..577da5ed0c 100644 --- a/common/transport/http/pom.xml +++ b/common/transport/http/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.common.transport diff --git a/common/transport/lwm2m/pom.xml b/common/transport/lwm2m/pom.xml index 11fc33f05c..3a195d23eb 100644 --- a/common/transport/lwm2m/pom.xml +++ b/common/transport/lwm2m/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.common.transport diff --git a/common/transport/mqtt/pom.xml b/common/transport/mqtt/pom.xml index 420995f740..f10782e394 100644 --- a/common/transport/mqtt/pom.xml +++ b/common/transport/mqtt/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.common.transport diff --git a/common/transport/pom.xml b/common/transport/pom.xml index 2aa7a33ef1..57728b92b7 100644 --- a/common/transport/pom.xml +++ b/common/transport/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/transport/snmp/pom.xml b/common/transport/snmp/pom.xml index fa24bc6e3c..654180c79a 100644 --- a/common/transport/snmp/pom.xml +++ b/common/transport/snmp/pom.xml @@ -1,7 +1,8 @@ org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport diff --git a/common/transport/transport-api/pom.xml b/common/transport/transport-api/pom.xml index bb31960dd9..94160d8e4d 100644 --- a/common/transport/transport-api/pom.xml +++ b/common/transport/transport-api/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard.common - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.common.transport diff --git a/common/util/pom.xml b/common/util/pom.xml index 3faf8e398e..38dafbf900 100644 --- a/common/util/pom.xml +++ b/common/util/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/common/version-control/pom.xml b/common/version-control/pom.xml index 6dff34b0ff..0691144f3d 100644 --- a/common/version-control/pom.xml +++ b/common/version-control/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT common org.thingsboard.common diff --git a/dao/pom.xml b/dao/pom.xml index c16be92787..1330f42cda 100644 --- a/dao/pom.xml +++ b/dao/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard dao diff --git a/dao/src/main/java/org/thingsboard/server/dao/subscription/TbClusterStore.java b/dao/src/main/java/org/thingsboard/server/dao/subscription/TbClusterStore.java index c5686e18c3..e9ff978875 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/subscription/TbClusterStore.java +++ b/dao/src/main/java/org/thingsboard/server/dao/subscription/TbClusterStore.java @@ -1,5 +1,6 @@ -// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors +// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 package org.thingsboard.server.dao.subscription; import lombok.RequiredArgsConstructor; diff --git a/dao/src/test/java/org/thingsboard/server/dao/subscription/TbClusterStoreTest.java b/dao/src/test/java/org/thingsboard/server/dao/subscription/TbClusterStoreTest.java index d37a73cf76..986a731a8f 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/subscription/TbClusterStoreTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/subscription/TbClusterStoreTest.java @@ -1,5 +1,6 @@ -// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. -// SPDX-License-Identifier: BUSL-1.1 +// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors +// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 package org.thingsboard.server.dao.subscription; import org.junit.jupiter.api.Test; diff --git a/edqs/pom.xml b/edqs/pom.xml index 8a331de831..1d6a0c8428 100644 --- a/edqs/pom.xml +++ b/edqs/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard edqs diff --git a/integration/apache-pulsar/pom.xml b/integration/apache-pulsar/pom.xml index 1f2209de28..f81588fb8d 100644 --- a/integration/apache-pulsar/pom.xml +++ b/integration/apache-pulsar/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/integration/aws/pom.xml b/integration/aws/pom.xml index 4087d35ffa..41a86f31d3 100644 --- a/integration/aws/pom.xml +++ b/integration/aws/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/integration/azure/pom.xml b/integration/azure/pom.xml index 2e0fadb59c..86a6a23a29 100644 --- a/integration/azure/pom.xml +++ b/integration/azure/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/integration/coap/pom.xml b/integration/coap/pom.xml index 7f639ffab3..caf30f83f2 100644 --- a/integration/coap/pom.xml +++ b/integration/coap/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/integration/executor/pom.xml b/integration/executor/pom.xml index 2c925ae21e..41a281d9f9 100644 --- a/integration/executor/pom.xml +++ b/integration/executor/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/integration/http/pom.xml b/integration/http/pom.xml index e71c8b9220..1d619ab324 100644 --- a/integration/http/pom.xml +++ b/integration/http/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/integration/kafka/pom.xml b/integration/kafka/pom.xml index 7625ac1da6..28e498fa45 100644 --- a/integration/kafka/pom.xml +++ b/integration/kafka/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/integration/mqtt/pom.xml b/integration/mqtt/pom.xml index 8d75054d4a..2bc8af134e 100644 --- a/integration/mqtt/pom.xml +++ b/integration/mqtt/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/integration/opc-ua/pom.xml b/integration/opc-ua/pom.xml index 5f1feee9a0..e1ae8ffc85 100644 --- a/integration/opc-ua/pom.xml +++ b/integration/opc-ua/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/integration/pom.xml b/integration/pom.xml index 10e14d5cdf..2f3ec66166 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard integration diff --git a/integration/pubsub/pom.xml b/integration/pubsub/pom.xml index 4ebf2c9004..286d29f1bc 100644 --- a/integration/pubsub/pom.xml +++ b/integration/pubsub/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/integration/rabbitmq/pom.xml b/integration/rabbitmq/pom.xml index 0fd0baa9f6..081147ad5a 100644 --- a/integration/rabbitmq/pom.xml +++ b/integration/rabbitmq/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/integration/tcp-udp/pom.xml b/integration/tcp-udp/pom.xml index f8978a6476..1ae99f25ef 100644 --- a/integration/tcp-udp/pom.xml +++ b/integration/tcp-udp/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/integration/tuya/pom.xml b/integration/tuya/pom.xml index d1d35600fe..1d84b18221 100644 --- a/integration/tuya/pom.xml +++ b/integration/tuya/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration org.thingsboard.integration diff --git a/migrator/pom.xml b/migrator/pom.xml index dc214af268..7de06d3f90 100644 --- a/migrator/pom.xml +++ b/migrator/pom.xml @@ -12,7 +12,7 @@ thingsboard org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT migrator diff --git a/monitoring/pom.xml b/monitoring/pom.xml index 2da4f1df9d..53c5d3ec8a 100644 --- a/monitoring/pom.xml +++ b/monitoring/pom.xml @@ -2,7 +2,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard diff --git a/msa/black-box-tests/pom.xml b/msa/black-box-tests/pom.xml index a400f2509f..82d4ca6810 100644 --- a/msa/black-box-tests/pom.xml +++ b/msa/black-box-tests/pom.xml @@ -11,7 +11,7 @@ org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa org.thingsboard.msa @@ -128,10 +128,6 @@ awaitility test - - org.eclipse.californium - californium-core - ch.qos.logback logback-classic diff --git a/msa/edqs/pom.xml b/msa/edqs/pom.xml index fe10886ab0..19129f8365 100644 --- a/msa/edqs/pom.xml +++ b/msa/edqs/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/integration/apache-pulsar/pom.xml b/msa/integration/apache-pulsar/pom.xml index a500bf1dee..be95124a98 100644 --- a/msa/integration/apache-pulsar/pom.xml +++ b/msa/integration/apache-pulsar/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/integration/aws/pom.xml b/msa/integration/aws/pom.xml index 88aac0688f..42c4cc38fa 100644 --- a/msa/integration/aws/pom.xml +++ b/msa/integration/aws/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/integration/azure/pom.xml b/msa/integration/azure/pom.xml index f3da36fa70..da528c71ec 100644 --- a/msa/integration/azure/pom.xml +++ b/msa/integration/azure/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/integration/coap/pom.xml b/msa/integration/coap/pom.xml index a0a4599231..06059a5e01 100644 --- a/msa/integration/coap/pom.xml +++ b/msa/integration/coap/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/integration/executor/pom.xml b/msa/integration/executor/pom.xml index 03b691a486..24946b9f3e 100644 --- a/msa/integration/executor/pom.xml +++ b/msa/integration/executor/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/integration/http/pom.xml b/msa/integration/http/pom.xml index 79afb60403..7041c2c4fd 100644 --- a/msa/integration/http/pom.xml +++ b/msa/integration/http/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/integration/kafka/pom.xml b/msa/integration/kafka/pom.xml index 8aacaee624..9d90ca755d 100644 --- a/msa/integration/kafka/pom.xml +++ b/msa/integration/kafka/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/integration/mqtt/pom.xml b/msa/integration/mqtt/pom.xml index 31dc11484c..5095573d29 100644 --- a/msa/integration/mqtt/pom.xml +++ b/msa/integration/mqtt/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/integration/opc-ua/pom.xml b/msa/integration/opc-ua/pom.xml index 41beaf8378..d6eb1e39b3 100644 --- a/msa/integration/opc-ua/pom.xml +++ b/msa/integration/opc-ua/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/integration/pom.xml b/msa/integration/pom.xml index 163e458073..c7debdd00a 100644 --- a/msa/integration/pom.xml +++ b/msa/integration/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa diff --git a/msa/integration/pubsub/pom.xml b/msa/integration/pubsub/pom.xml index c3a9cd9f10..f1dd1b878e 100644 --- a/msa/integration/pubsub/pom.xml +++ b/msa/integration/pubsub/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/integration/rabbitmq/pom.xml b/msa/integration/rabbitmq/pom.xml index bcbd8f24a0..a79d9bfd2a 100644 --- a/msa/integration/rabbitmq/pom.xml +++ b/msa/integration/rabbitmq/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/integration/tcp-udp/pom.xml b/msa/integration/tcp-udp/pom.xml index 0641df3861..ca9e7cf50d 100644 --- a/msa/integration/tcp-udp/pom.xml +++ b/msa/integration/tcp-udp/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/integration/tuya/pom.xml b/msa/integration/tuya/pom.xml index cb7cbad262..434db9bbe6 100644 --- a/msa/integration/tuya/pom.xml +++ b/msa/integration/tuya/pom.xml @@ -10,7 +10,7 @@ org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT integration diff --git a/msa/js-executor/package.json b/msa/js-executor/package.json index c1195784d4..f534a6d07b 100644 --- a/msa/js-executor/package.json +++ b/msa/js-executor/package.json @@ -1,7 +1,7 @@ { "name": "thingsboard-js-executor", "private": true, - "version": "4.4.0", + "version": "4.4.0.1", "description": "ThingsBoard JavaScript Executor Microservice", "main": "server.ts", "bin": "server.js", diff --git a/msa/js-executor/pom.xml b/msa/js-executor/pom.xml index c41b4727c1..f5b5baf0c9 100644 --- a/msa/js-executor/pom.xml +++ b/msa/js-executor/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/migrator/pom.xml b/msa/migrator/pom.xml index b5858de7d1..a6d7ae86a8 100644 --- a/msa/migrator/pom.xml +++ b/msa/migrator/pom.xml @@ -11,7 +11,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa diff --git a/msa/monitoring/pom.xml b/msa/monitoring/pom.xml index 09d8a26aca..0bd2786a49 100644 --- a/msa/monitoring/pom.xml +++ b/msa/monitoring/pom.xml @@ -12,7 +12,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa diff --git a/msa/pom.xml b/msa/pom.xml index 648a45c884..bfb8655728 100644 --- a/msa/pom.xml +++ b/msa/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard msa diff --git a/msa/report/pom.xml b/msa/report/pom.xml index 1f2e13ace4..8a3361d2c3 100644 --- a/msa/report/pom.xml +++ b/msa/report/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/tb-node/pom.xml b/msa/tb-node/pom.xml index 0371448f18..8227d7bcb0 100644 --- a/msa/tb-node/pom.xml +++ b/msa/tb-node/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/transport/coap/pom.xml b/msa/transport/coap/pom.xml index 30745968fb..1354f57dab 100644 --- a/msa/transport/coap/pom.xml +++ b/msa/transport/coap/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.msa.transport diff --git a/msa/transport/http/pom.xml b/msa/transport/http/pom.xml index 9c0dfb115d..10d593c1ea 100644 --- a/msa/transport/http/pom.xml +++ b/msa/transport/http/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.msa.transport diff --git a/msa/transport/lwm2m/pom.xml b/msa/transport/lwm2m/pom.xml index d40ef6eaa8..23fcf1aa52 100644 --- a/msa/transport/lwm2m/pom.xml +++ b/msa/transport/lwm2m/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.msa.transport diff --git a/msa/transport/mqtt/pom.xml b/msa/transport/mqtt/pom.xml index 3c2fd5027c..682986ec8b 100644 --- a/msa/transport/mqtt/pom.xml +++ b/msa/transport/mqtt/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard.msa - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.msa.transport diff --git a/msa/transport/pom.xml b/msa/transport/pom.xml index 0b5440d192..12bba190cf 100644 --- a/msa/transport/pom.xml +++ b/msa/transport/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/transport/snmp/pom.xml b/msa/transport/snmp/pom.xml index 6c2c71d541..c96784b765 100644 --- a/msa/transport/snmp/pom.xml +++ b/msa/transport/snmp/pom.xml @@ -11,7 +11,7 @@ org.thingsboard.msa transport - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT org.thingsboard.msa.transport diff --git a/msa/vc-executor-docker/pom.xml b/msa/vc-executor-docker/pom.xml index fc1d839e67..db28206847 100644 --- a/msa/vc-executor-docker/pom.xml +++ b/msa/vc-executor-docker/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/vc-executor/pom.xml b/msa/vc-executor/pom.xml index 8f44e65f8d..f1092bf837 100644 --- a/msa/vc-executor/pom.xml +++ b/msa/vc-executor/pom.xml @@ -1,7 +1,8 @@ org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/web-report/docker/Dockerfile b/msa/web-report/docker/Dockerfile index 5eb0e50e8b..69e3c12a56 100644 --- a/msa/web-report/docker/Dockerfile +++ b/msa/web-report/docker/Dockerfile @@ -23,7 +23,7 @@ COPY package/linux/conf ./config COPY ${pkg.name}.conf ./conf COPY src/api ./api COPY src/config ./config -COPY src/server.js ./ +COPY src/inspectorShim.js src/server.js ./ RUN apt-get update \ && apt-get install -yq --no-install-recommends fonts-noto-cjk-extra fonts-roboto fonts-noto-color-emoji fonts-unifont libfreetype6 xfonts-scalable fonts-liberation \ diff --git a/msa/web-report/docker/start-web-report.sh b/msa/web-report/docker/start-web-report.sh index d206f54a02..390c77e2d7 100755 --- a/msa/web-report/docker/start-web-report.sh +++ b/msa/web-report/docker/start-web-report.sh @@ -14,7 +14,7 @@ source "${CONF_FOLDER}/${configfile}" cd ${pkg.installFolder} -export CHROME_EXECUTABLE=$(node -e "console.log(require('playwright-core/lib/server').registry.findExecutable('chromium').executablePath());") +export CHROME_EXECUTABLE=$(node -e "console.log(require('playwright-chromium').chromium.executablePath());") # This will forward this PID 1 to the node.js and forward SIGTERM for graceful shutdown as well exec node server.js diff --git a/msa/web-report/inspectorShim.ts b/msa/web-report/inspectorShim.ts new file mode 100644 index 0000000000..a9e7f5946b --- /dev/null +++ b/msa/web-report/inspectorShim.ts @@ -0,0 +1,21 @@ +// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: BUSL-1.1 +import Module from 'module'; + +// The Node.js runtime embedded by pkg is built without the inspector, but Playwright loads the 'inspector' module +// at startup and only uses it in page.pause() to check whether a debugger is attached. Must be imported before Playwright. +const moduleLoader = Module as unknown as { _load: (request: string, ...args: unknown[]) => unknown }; +const load = moduleLoader._load; +moduleLoader._load = function(request: string, ...args: unknown[]) { + if (request === 'inspector' || request === 'node:inspector') { + try { + return load.call(this, request, ...args); + } catch (e: any) { + if (e?.code === 'ERR_INSPECTOR_NOT_AVAILABLE') { + return { url: () => undefined }; + } + throw e; + } + } + return load.call(this, request, ...args); +}; diff --git a/msa/web-report/install.js b/msa/web-report/install.js index 694766c315..842978aaec 100644 --- a/msa/web-report/install.js +++ b/msa/web-report/install.js @@ -2,92 +2,51 @@ // SPDX-License-Identifier: BUSL-1.1 const fse = require('fs-extra'); const path = require('path'); -const server = require('playwright-core/lib/server'); +const { execFileSync } = require('child_process'); -const EXECUTABLE_PATHS = { - 'ubuntu22.04-x64': ['chrome-linux', 'chrome'], - 'win64': ['chrome-win', 'chrome.exe'] +// Chromium builds packaged with the service, downloaded by the Playwright CLI as if it ran on the target platform. +const PLATFORMS = { + linux: { hostPlatform: 'ubuntu24.04-x64', downloadDir: 'chromiumLinux', chromeDir: 'chrome-linux64', binary: 'tb-web-report', pkgOutput: 'thingsboard-web-report-linux' }, + windows: { hostPlatform: 'win64', downloadDir: 'chromiumWin', chromeDir: 'chrome-win64', binary: 'tb-web-report.exe', pkgOutput: 'thingsboard-web-report-win.exe' } }; -let _projectRoot = null; -let browsersJSON = null; -let chromium = null; - (async() => { - browsersJSON = fse.readJsonSync(path.join(projectRoot(), 'node_modules', 'playwright-core', 'browsers.json')).browsers; - chromium = browsersJSON.find(d => d.name === 'chromium'); - await server.registry.install([createdExecutables('ubuntu22.04-x64'), createdExecutables('win64')], true); - await copyChromeFromPkg('ubuntu22.04-x64'); - await copyChromeFromPkg('win64'); - await fse.move(path.join(projectRoot(), 'target', 'thingsboard-web-report-linux'), - path.join(targetPackageDir('ubuntu22.04-x64'), 'bin', 'tb-web-report'), - {overwrite: true}); - await fse.move(path.join(projectRoot(), 'target', 'thingsboard-web-report-win.exe'), - path.join(targetPackageDir('win64'), 'bin', 'tb-web-report.exe'), - {overwrite: true}); -})(); - - -function projectRoot() { - if (!_projectRoot) { - _projectRoot = __dirname; + for (const [targetDir, platform] of Object.entries(PLATFORMS)) { + const downloadDir = path.join(projectRoot(), 'target', platform.downloadDir); + installChromium(platform.hostPlatform, downloadDir); + const chromiumDir = path.join(targetPackageDir(targetDir), 'chromium'); + await fse.emptyDir(chromiumDir); + await fse.copy(path.join(downloadDir, chromiumRevisionDir(), platform.chromeDir), chromiumDir); + await fse.move(path.join(projectRoot(), 'target', platform.pkgOutput), + path.join(targetPackageDir(targetDir), 'bin', platform.binary), + {overwrite: true}); } - return _projectRoot; +})().catch(e => { + console.error(e); + process.exit(1); +}); + +function installChromium(hostPlatform, downloadDir) { + execFileSync(process.execPath, [path.join(path.dirname(require.resolve('playwright-core/package.json')), 'cli.js'), 'install', '--no-shell', 'chromium'], { + stdio: 'inherit', + env: { + ...process.env, + PLAYWRIGHT_HOST_PLATFORM_OVERRIDE: hostPlatform, + PLAYWRIGHT_BROWSERS_PATH: downloadDir, + PLAYWRIGHT_SKIP_BROWSER_GC: '1' + } + }); } -function targetPackageDir(platform) { - return path.join(projectRoot(), 'target', 'package', platformTargetDir(platform)); +function chromiumRevisionDir() { + const browsers = fse.readJsonSync(path.join(projectRoot(), 'node_modules', 'playwright-core', 'browsers.json')).browsers; + return 'chromium-' + browsers.find(b => b.name === 'chromium').revision; } -function targetChromiumDir(platform) { - return path.join(targetPackageDir(platform), 'chromium'); -} - -function downloadChromiumDir(platform) { - let platformDir; - if (platform === 'ubuntu22.04-x64') { - platformDir = 'chromiumLinux'; - } else if (platform === 'win64') { - platformDir = 'chromiumWin'; - } - return path.join(projectRoot(), 'target', platformDir); -} - -function platformTargetDir(platform) { - if (platform === 'ubuntu22.04-x64') { - return 'linux'; - } else if (platform === 'win64') { - return 'windows'; - } - return ''; -} - -async function copyChromeFromPkg(platform) { - const chromiumDir = targetChromiumDir(platform); - await fse.emptyDir(chromiumDir); - let fromDir = path.join(downloadChromiumDir(platform), EXECUTABLE_PATHS[platform][0]) - await fse.copy(fromDir, chromiumDir); +function projectRoot() { + return __dirname; } -function createdExecutables(platform) { - const chromiumData = JSON.parse(JSON.stringify(chromium)); - chromiumData.dir = downloadChromiumDir(platform); - chromiumData.platform = platform; - const executablePath = path.join(chromiumData.dir, ...EXECUTABLE_PATHS[platform]); - return { - type: 'browser', - name: 'chromium', - browserName: 'chromium', - directory: chromium.dir, - platform: platform, - executablePath: () => executablePath, - executablePathOrDie: sdkLanguage => server.registry.executablePathOrDie('chromium', executablePath, true, sdkLanguage), - installType: 'download-by-default', - _validateHostRequirements: (sdkLanguage) => server.registry._validateHostRequirements(sdkLanguage, 'chromium', chromium.dir, ['chrome-linux'], [], ['chrome-win']), - downloadURLs: server.registry._downloadURLs(chromiumData), - browserVersion: chromiumData.browserVersion, - _install: () => server.registry._downloadExecutable(chromiumData, executablePath), - _dependencyGroup: 'chromium', - _isHermeticInstallation: true, - }; +function targetPackageDir(targetDir) { + return path.join(projectRoot(), 'target', 'package', targetDir); } diff --git a/msa/web-report/package.json b/msa/web-report/package.json index 1f89c501f1..a4a5433e9e 100644 --- a/msa/web-report/package.json +++ b/msa/web-report/package.json @@ -1,7 +1,7 @@ { "name": "thingsboard-web-report", "private": true, - "version": "4.4.0", + "version": "4.4.0.1", "description": "ThingsBoard Web Reporting Microservice", "main": "server.ts", "bin": "server.js", @@ -10,15 +10,14 @@ "test": "echo \"Error: no test specified\" && exit 1", "start": "nodemon --watch '.' --ext 'ts' --exec 'ts-node server.ts'", "start-prod": "nodemon --watch '.' --ext 'ts' --exec 'NODE_ENV=production ts-node server.ts'", - "build": "tsc", - "postinstall": "node -e \"if (process.env.NODE_ENV !== 'production') { try { const stdout = require('child_process').execSync('patch-package').toString(); console.log(stdout); } catch (error) { console.log(error.message); if (error.stderr) { console.error(error.stderr.toString()); } process.exit(-1); } }\"" + "build": "tsc" }, "dependencies": { "config": "~4.1.1", "express": "~5.1.0", "js-yaml": "^4.1.1", - "playwright-chromium": "~1.54.2", - "playwright-core": "~1.54.2", + "playwright-chromium": "~1.64.0", + "playwright-core": "~1.64.0", "winston": "~3.17.0", "winston-daily-rotate-file": "~5.0.0" }, @@ -37,7 +36,6 @@ "@yao-pkg/pkg": "^6.6.0", "fs-extra": "~11.3.1", "nodemon": "~3.1.10", - "patch-package": "^8.0.1", "postinstall-postinstall": "^2.1.0", "ts-node": "~10.9.2", "typescript": "~5.9.3" @@ -46,7 +44,9 @@ "assets": [ "node_modules/config/**/*.*", "node_modules/open/xdg-open", - "node_modules/playwright-core/lib/server/chromium/appIcon.png" + "../../node_modules/playwright-core/browsers.json", + "node_modules/playwright-core/lib/server/chromium/appIcon.png", + "../../node_modules/playwright-core/lib/webp_codec.wasm" ] } } diff --git a/msa/web-report/patches/playwright-core+1.54.2.patch b/msa/web-report/patches/playwright-core+1.54.2.patch deleted file mode 100644 index dfdcfa8409..0000000000 --- a/msa/web-report/patches/playwright-core+1.54.2.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/playwright-core/lib/server/registry/index.js b/node_modules/playwright-core/lib/server/registry/index.js -index 4525491..16abf8c 100644 ---- a/node_modules/playwright-core/lib/server/registry/index.js -+++ b/node_modules/playwright-core/lib/server/registry/index.js -@@ -1044,7 +1044,7 @@ Run "${buildPlaywrightCLICommand(sdkLanguage, "install " + name)}"` : ""; - } - _downloadURLs(descriptor) { - const paths = DOWNLOAD_PATHS[descriptor.name]; -- const downloadPathTemplate = paths[import_hostPlatform.hostPlatform] || paths[""]; -+ const downloadPathTemplate = paths[descriptor.platform] || paths[import_hostPlatform.hostPlatform] || paths['']; - if (!downloadPathTemplate) - return []; - const downloadPath = util.format(downloadPathTemplate, descriptor.revision); diff --git a/msa/web-report/pom.xml b/msa/web-report/pom.xml index b9006e548e..e3d9832b79 100644 --- a/msa/web-report/pom.xml +++ b/msa/web-report/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa org.thingsboard.msa diff --git a/msa/web-report/server.ts b/msa/web-report/server.ts index 68da46297c..e000c860c4 100644 --- a/msa/web-report/server.ts +++ b/msa/web-report/server.ts @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. // SPDX-License-Identifier: BUSL-1.1 +import './inspectorShim'; import express from 'express'; import bodyParser from 'body-parser'; import config from 'config'; diff --git a/msa/web-report/yarn.lock b/msa/web-report/yarn.lock index 073cb11bed..d2ee63937d 100644 --- a/msa/web-report/yarn.lock +++ b/msa/web-report/yarn.lock @@ -249,11 +249,6 @@ tinyglobby "^0.2.11" unzipper "^0.12.3" -"@yarnpkg/lockfile@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" - integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== - accepts@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/accepts/-/accepts-2.0.0.tgz#bbcf4ba5075467f3f2131eab3cffc73c2f5d7895" @@ -286,7 +281,7 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^4.0.0, ansi-styles@^4.1.0: +ansi-styles@^4.0.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== @@ -368,7 +363,7 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -braces@^3.0.3, braces@~3.0.2: +braces@~3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== @@ -388,7 +383,7 @@ bytes@3.1.2, bytes@^3.1.2: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== -call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: +call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== @@ -396,17 +391,7 @@ call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1, call-bind-apply- es-errors "^1.3.0" function-bind "^1.1.2" -call-bind@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c" - integrity sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== - dependencies: - call-bind-apply-helpers "^1.0.0" - es-define-property "^1.0.0" - get-intrinsic "^1.2.4" - set-function-length "^1.2.2" - -call-bound@^1.0.2, call-bound@^1.0.4: +call-bound@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.4.tgz#238de935d2a2a692928c538c7ccfa91067fd062a" integrity sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== @@ -414,14 +399,6 @@ call-bound@^1.0.2, call-bound@^1.0.4: call-bind-apply-helpers "^1.0.2" get-intrinsic "^1.3.0" -chalk@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - chokidar@^3.5.2: version "3.6.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" @@ -447,11 +424,6 @@ chownr@^3.0.0: resolved "https://registry.yarnpkg.com/chownr/-/chownr-3.0.0.tgz#9855e64ecd240a9cc4267ce8a4aa5d24a1da15e4" integrity sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g== -ci-info@^3.7.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" - integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== - cliui@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" @@ -553,15 +525,6 @@ create-require@^1.1.0: resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== -cross-spawn@^7.0.3: - version "7.0.6" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" - integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - debug@4, debug@^4, debug@^4.3.5, debug@^4.4.0: version "4.4.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.4.1.tgz#e5a8bc6cbc4c6cd3e64308b0693a3d4fa550189b" @@ -581,15 +544,6 @@ deep-extend@^0.6.0: resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== -define-data-property@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" - integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== - dependencies: - es-define-property "^1.0.0" - es-errors "^1.3.0" - gopd "^1.0.1" - depd@2.0.0, depd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" @@ -648,7 +602,7 @@ end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" -es-define-property@^1.0.0, es-define-property@^1.0.1: +es-define-property@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== @@ -754,13 +708,6 @@ finalhandler@^2.1.0: parseurl "^1.3.3" statuses "^2.0.1" -find-yarn-workspace-root@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd" - integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ== - dependencies: - micromatch "^4.0.2" - fn.name@1.x.x: version "1.1.0" resolved "https://registry.yarnpkg.com/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc" @@ -789,15 +736,6 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@^10.0.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" - integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-extra@^11.2.0, fs-extra@~11.3.1: version "11.3.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.3.1.tgz#ba7a1f97a85f94c6db2e52ff69570db3671d5a74" @@ -822,7 +760,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.2.4, get-intrinsic@^1.2.5, get-intrinsic@^1.3.0: +get-intrinsic@^1.2.5, get-intrinsic@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== @@ -858,12 +796,12 @@ glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -gopd@^1.0.1, gopd@^1.2.0: +gopd@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== -graceful-fs@^4.1.11, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2: +graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -873,18 +811,6 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-property-descriptors@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" - integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== - dependencies: - es-define-property "^1.0.0" - has-symbols@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" @@ -975,11 +901,6 @@ is-core-module@^2.16.0: dependencies: hasown "^2.0.2" -is-docker@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" - integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== - is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -1012,28 +933,11 @@ is-stream@^2.0.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== -is-wsl@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== - dependencies: - is-docker "^2.0.0" - -isarray@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" - integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== - isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - js-yaml@^4.1.1: version "4.3.2" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.3.2.tgz#8e44fb14a2643c59726bb15787b5f1512cb3d3fb" @@ -1046,17 +950,6 @@ jsesc@^3.0.2: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== -json-stable-stringify@^1.0.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.3.0.tgz#8903cfac42ea1a0f97f35d63a4ce0518f0cc6a70" - integrity sha512-qtYiSSFlwot9XHtF9bD9c7rwKjr+RecWT//ZnPvSmEjpV5mmPOCN4j8UjY5hbjNkOwZ/jQv3J6R1/pL7RwgMsg== - dependencies: - call-bind "^1.0.8" - call-bound "^1.0.4" - isarray "^2.0.5" - jsonify "^0.0.1" - object-keys "^1.1.1" - json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" @@ -1071,18 +964,6 @@ jsonfile@^6.0.1: optionalDependencies: graceful-fs "^4.1.6" -jsonify@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.1.tgz#2aa3111dae3d34a0f151c63f3a45d995d9420978" - integrity sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg== - -klaw-sync@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" - integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== - dependencies: - graceful-fs "^4.1.11" - kuler@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/kuler/-/kuler-2.0.0.tgz#e2c570a3800388fb44407e851531c1d670b061b3" @@ -1120,14 +1001,6 @@ merge-descriptors@^2.0.0: resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-2.0.0.tgz#ea922f660635a2249ee565e0449f951e6b603808" integrity sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g== -micromatch@^4.0.2: - version "4.0.8" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" - integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== - dependencies: - braces "^3.0.3" - picomatch "^2.3.1" - mime-db@^1.54.0: version "1.54.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.54.0.tgz#cddb3ee4f9c64530dff640236661d42cb6a314f5" @@ -1252,11 +1125,6 @@ object-inspect@^1.13.3: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.4.tgz#8375265e21bc20d0fa582c22e1b13485d6e00213" integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== -object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - on-finished@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" @@ -1278,14 +1146,6 @@ one-time@^1.0.0: dependencies: fn.name "1.x.x" -open@^7.4.2: - version "7.4.2" - resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" - integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== - dependencies: - is-docker "^2.0.0" - is-wsl "^2.1.1" - p-is-promise@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-3.0.0.tgz#58e78c7dfe2e163cf2a04ff869e7c1dba64a5971" @@ -1296,31 +1156,6 @@ parseurl@^1.3.3: resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== -patch-package@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-8.0.1.tgz#79d02f953f711e06d1f8949c8a13e5d3d7ba1a60" - integrity sha512-VsKRIA8f5uqHQ7NGhwIna6Bx6D9s/1iXlA1hthBVBEbkq+t4kXD0HHt+rJhf/Z+Ci0F/HCB2hvn0qLdLG+Qxlw== - dependencies: - "@yarnpkg/lockfile" "^1.1.0" - chalk "^4.1.2" - ci-info "^3.7.0" - cross-spawn "^7.0.3" - find-yarn-workspace-root "^2.0.0" - fs-extra "^10.0.0" - json-stable-stringify "^1.0.2" - klaw-sync "^6.0.0" - minimist "^1.2.6" - open "^7.4.2" - semver "^7.5.3" - slash "^2.0.0" - tmp "^0.2.4" - yaml "^2.2.2" - -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" @@ -1336,7 +1171,7 @@ picocolors@^1.1.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: +picomatch@^2.0.4, picomatch@^2.2.1: version "2.3.2" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.2.tgz#5a942915e26b372dc0f0e6753149a16e6b1c5601" integrity sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA== @@ -1346,17 +1181,17 @@ picomatch@^4.0.2: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.4.tgz#fd6f5e00a143086e074dffe4c924b8fb293b0589" integrity sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A== -playwright-chromium@~1.54.2: - version "1.54.2" - resolved "https://registry.yarnpkg.com/playwright-chromium/-/playwright-chromium-1.54.2.tgz#0466c9b85dae95dc22fc668f3aac1da1feb2598e" - integrity sha512-8ytI6xNjB//5zWSZUvOvn+N9xkXw6GXiDuBePOejcDiyUmzl5R5rvAU7MTl6h633sS3JVmlCS10EhYCt4Crzsg== +playwright-chromium@~1.64.0: + version "1.64.0" + resolved "https://registry.yarnpkg.com/playwright-chromium/-/playwright-chromium-1.64.0.tgz#8280d7916bb7d8b758080e17935cebaaebb3b5aa" + integrity sha512-w56jKvqiCLa0/Nb6BltYER4r89EG0L9v1MI2g7PZV6gGKrRH7oSfwUqMlHBnZ7t6gd6WfFdAg2+rECSNRE43sQ== dependencies: - playwright-core "1.54.2" + playwright-core "1.64.0" -playwright-core@1.54.2, playwright-core@~1.54.2: - version "1.54.2" - resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.54.2.tgz#73cc5106f19ec6b9371908603d61a7f171ebd8f0" - integrity sha512-n5r4HFbMmWsB4twG7tJLDN9gmBUeSPcsBZiWSE4DnYz9mJMAFqr2ID7+eGC9kpEnxExJ1epttwR59LEWCk8mtA== +playwright-core@1.64.0, playwright-core@~1.64.0: + version "1.64.0" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.64.0.tgz#a765f91dabd2b2cadd67e87439842c1d6c72c652" + integrity sha512-T9r+MZkTECl2+oUcZ26YgZzTrYidTsIhYYkJix+6iDOymOb1FB2RLLSOxRGnZGv5DStt+aduIVbt+E8WygXYpg== postinstall-postinstall@^2.1.0: version "2.1.0" @@ -1550,35 +1385,11 @@ serve-static@^2.2.0: parseurl "^1.3.3" send "^1.2.0" -set-function-length@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" - integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== - dependencies: - define-data-property "^1.1.4" - es-errors "^1.3.0" - function-bind "^1.1.2" - get-intrinsic "^1.2.4" - gopd "^1.0.1" - has-property-descriptors "^1.0.2" - setprototypeof@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - side-channel-list@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/side-channel-list/-/side-channel-list-1.0.0.tgz#10cb5984263115d3b7a0e336591e290a830af8ad" @@ -1647,11 +1458,6 @@ simple-update-notifier@^2.0.0: dependencies: semver "^7.5.3" -slash@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" - integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== - stack-trace@0.0.x: version "0.0.10" resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" @@ -1716,13 +1522,6 @@ supports-color@^5.5.0: dependencies: has-flag "^3.0.0" -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" @@ -1773,11 +1572,6 @@ tinyglobby@^0.2.11: fdir "^6.4.4" picomatch "^4.0.2" -tmp@^0.2.4: - version "0.2.7" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.7.tgz#26f4db11d1601ce8012dcb8a798ece1c06a99059" - integrity sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -1909,13 +1703,6 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - winston-daily-rotate-file@~5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/winston-daily-rotate-file/-/winston-daily-rotate-file-5.0.0.tgz#8cd94800025490e47c00ec892b655a5821f4266d" @@ -1976,11 +1763,6 @@ yallist@^5.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-5.0.0.tgz#00e2de443639ed0d78fd87de0d27469fbcffb533" integrity sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw== -yaml@^2.2.2: - version "2.8.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.2.tgz#5694f25eca0ce9c3e7a9d9e00ce0ddabbd9e35c5" - integrity sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A== - yargs-parser@^20.2.2: version "20.2.9" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" diff --git a/msa/web-ui/package.json b/msa/web-ui/package.json index 0f0c3cdcad..1aed9569a1 100644 --- a/msa/web-ui/package.json +++ b/msa/web-ui/package.json @@ -1,7 +1,7 @@ { "name": "thingsboard-web-ui", "private": true, - "version": "4.4.0", + "version": "4.4.0.1", "description": "ThingsBoard Web UI Microservice", "main": "server.ts", "bin": "server.js", diff --git a/msa/web-ui/pom.xml b/msa/web-ui/pom.xml index 6e6c24ab0f..652bb2dc5c 100644 --- a/msa/web-ui/pom.xml +++ b/msa/web-ui/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT msa org.thingsboard.msa diff --git a/netty-mqtt/pom.xml b/netty-mqtt/pom.xml index 22277fa836..6733a24fb2 100644 --- a/netty-mqtt/pom.xml +++ b/netty-mqtt/pom.xml @@ -9,11 +9,11 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard netty-mqtt - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT jar Netty MQTT Client diff --git a/packaging/build.gradle b/packaging/build.gradle deleted file mode 100644 index 5b1ae8fef0..0000000000 --- a/packaging/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. -// SPDX-License-Identifier: BUSL-1.1 -plugins { - id 'groovy' - id 'java-library' -} - -repositories { - mavenCentral() -} - -dependencies { - implementation localGroovy() - implementation gradleApi() - implementation 'com.netflix.nebula:gradle-ospackage-plugin:12.1.1' - implementation 'org.apache.commons:commons-lang3:3.9' -} - -buildDir = projectBuildDir -version = projectVersion - -compileGroovy { - destinationDirectory = file("${buildDir}/classes") -} - -description 'ThingsBoard packaging plugin for constructing RPM and DEB package files.' diff --git a/packaging/java/build.gradle b/packaging/java/build.gradle index 089b9ae550..b9c18c276f 100644 --- a/packaging/java/build.gradle +++ b/packaging/java/build.gradle @@ -1,20 +1,11 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors -// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. -// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 +// SPDX-License-Identifier: Apache-2.0 import org.apache.tools.ant.filters.ReplaceTokens -buildscript { - repositories { - mavenLocal() - mavenCentral() - } - dependencies { - classpath("org.thingsboard:packaging:${projectVersion}") - } +plugins { + id "com.netflix.nebula.ospackage" version "12.1.1" } -apply plugin: "thingsboard.package" - buildDir = projectBuildDir version = projectVersion base { diff --git a/packaging/pom.xml b/packaging/pom.xml deleted file mode 100644 index 1f842ae087..0000000000 --- a/packaging/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - 4.0.0 - - org.thingsboard - 4.4.0-SNAPSHOT - thingsboard - - packaging - jar - - ThingsBoard Packaging Plugin - https://thingsboard.io - - - UTF-8 - ${basedir}/.. - - - - - com.netflix.nebula - gradle-ospackage-plugin - 12.1.1 - - - org.codehaus.groovy - groovy-all - 3.0.9 - pom - provided - - - org.gradle - gradle-tooling-api - 7.1.1 - provided - - - org.gradle - gradle-core - 6.1.1 - provided - - - - - - org.thingsboard - gradle-maven-plugin - - ${main.dir}/packaging - - build - - - -PprojectBuildDir=${project.build.directory} - -PprojectVersion=${project.version} - - - - - compile - - invoke - - - - - - - - - repo.gradle.org - https://repo.gradle.org/gradle/libs-releases-local - - - diff --git a/packaging/src/main/groovy/org/thingsboard/packaging/DebMaintainerScriptsGenerator.groovy b/packaging/src/main/groovy/org/thingsboard/packaging/DebMaintainerScriptsGenerator.groovy deleted file mode 100644 index 8111d50c10..0000000000 --- a/packaging/src/main/groovy/org/thingsboard/packaging/DebMaintainerScriptsGenerator.groovy +++ /dev/null @@ -1,101 +0,0 @@ -/* - * SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ -package org.thingsboard.packaging - -import com.netflix.gradle.plugins.deb.Deb -import com.netflix.gradle.plugins.deb.TemplateHelper -import com.netflix.gradle.plugins.utils.FileSystemActions -import groovy.transform.Canonical -import groovy.transform.CompileDynamic - -class DebMaintainerScriptsGenerator { - private final Deb task - private final TemplateHelper templateHelper - private final File destination - private final FileSystemActions fileSystem - - DebMaintainerScriptsGenerator(Deb task, TemplateHelper templateHelper, File destination, FileSystemActions fileSystem) { - this.destination = destination - this.task = task - this.templateHelper = templateHelper - this.fileSystem = fileSystem - } - - void generate(Map context) { - templateHelper.generateFile("control", context) - - def configurationFiles = task.allConfigurationFiles - if (configurationFiles.any()) { - templateHelper.generateFile("conffiles", [files: configurationFiles] ) - } - - List scripts = [ - new MaintainerScript("preinst", task.preInstallFile, task.allPreInstallCommands), - new PostInstScript(task.postInstallFile, task.allPostInstallCommands, context), - new MaintainerScript("prerm", task.preUninstallFile, task.allPreUninstallCommands), - new MaintainerScript("postrm", task.postUninstallFile, task.allPostUninstallCommands) - ] - if (task.configFile) { - scripts << new MaintainerScript("config", task.configFile, []) - } - if (task.templatesFile) { - scripts << new MaintainerScript("templates", task.templatesFile, []) - } - - def installUtils = task.allCommonCommands.collect { stripShebang(it) } - for (script in scripts) { - if(script.file) { - fileSystem.copy(script.file, new File(destination, script.name)) - } else if (script.needsTemplateGeneration()) { - Map commands = [commands: installUtils + script.commands.collect { stripShebang(it) }] as Map - templateHelper.generateFile(script.name, context + commands) - } - } - } - - /** - * Works with nulls, Strings and Files. - * - * @param script - * @return - */ - @CompileDynamic - private static String stripShebang(Object script) { - StringBuilder result = new StringBuilder() - script?.eachLine { line -> - if (!line.matches('^#!.*$')) { - result.append line - result.append "\n" - } - } - result.toString() - } - - @Canonical - private static class MaintainerScript { - String name - File file - List commands - - boolean needsTemplateGeneration() { - return commands - } - } - - private static class PostInstScript extends MaintainerScript { - Map context - - PostInstScript(File file, List commands, Map context) { - super("postinst", file, commands) - this.context = context - } - - @Override - boolean needsTemplateGeneration() { - return super.needsTemplateGeneration() || context['dirs'] - } - } -} - diff --git a/packaging/src/main/groovy/org/thingsboard/packaging/DebPackaging.groovy b/packaging/src/main/groovy/org/thingsboard/packaging/DebPackaging.groovy deleted file mode 100644 index 407132975c..0000000000 --- a/packaging/src/main/groovy/org/thingsboard/packaging/DebPackaging.groovy +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ -package org.thingsboard.packaging - -import com.netflix.gradle.plugins.deb.Deb -import com.netflix.gradle.plugins.packaging.AbstractPackagingCopyAction -import org.gradle.api.file.ProjectLayout -import org.gradle.api.tasks.InputFile -import org.gradle.api.tasks.Optional - -import javax.inject.Inject - -abstract class DebPackaging extends Deb { - - @Inject - DebPackaging(ProjectLayout projectLayout) { - super(projectLayout) - } - - @InputFile - @Optional - File configFile - - @InputFile - @Optional - File templatesFile - - @Override - AbstractPackagingCopyAction createCopyAction() { - return new DebPackagingCopyAction(this, new File(projectLayout.buildDirectory.getAsFile().get(), "debian")) - } - -} diff --git a/packaging/src/main/groovy/org/thingsboard/packaging/DebPackagingCopyAction.groovy b/packaging/src/main/groovy/org/thingsboard/packaging/DebPackagingCopyAction.groovy deleted file mode 100644 index 1812fc759c..0000000000 --- a/packaging/src/main/groovy/org/thingsboard/packaging/DebPackagingCopyAction.groovy +++ /dev/null @@ -1,368 +0,0 @@ -/* - * SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ -package org.thingsboard.packaging - -import com.netflix.gradle.plugins.deb.control.MultiArch -import com.netflix.gradle.plugins.deb.validation.DebTaskPropertiesValidator -import com.netflix.gradle.plugins.packaging.AbstractPackagingCopyAction -import com.netflix.gradle.plugins.packaging.Dependency -import com.netflix.gradle.plugins.packaging.Directory -import com.netflix.gradle.plugins.packaging.Link -import com.netflix.gradle.plugins.utils.ApacheCommonsFileSystemActions -import com.netflix.gradle.plugins.utils.DeprecationLoggerUtils -import com.netflix.gradle.plugins.utils.FilePermissionUtil -import com.netflix.gradle.plugins.deb.InstallLineGenerator -import com.netflix.gradle.plugins.deb.Deb -import com.netflix.gradle.plugins.deb.DebFileVisitorStrategy -import com.netflix.gradle.plugins.deb.TemplateHelper -import groovy.transform.Canonical -import org.apache.commons.lang3.StringUtils -import org.apache.commons.lang3.time.DateFormatUtils -import org.gradle.api.GradleException -import org.gradle.api.internal.file.copy.CopyAction -import org.gradle.api.internal.file.copy.FileCopyDetailsInternal -import org.slf4j.Logger -import org.slf4j.LoggerFactory -import org.vafer.jdeb.Compression -import org.vafer.jdeb.Console -import org.vafer.jdeb.DataProducer -import org.vafer.jdeb.DebMaker -import org.vafer.jdeb.mapping.Mapper -import org.vafer.jdeb.mapping.PermMapper -import org.vafer.jdeb.producers.DataProducerLink -import org.vafer.jdeb.producers.DataProducerPathTemplate -import org.redline_rpm.payload.Directive - -import static com.netflix.gradle.plugins.utils.GradleUtils.lookup -/** - * Forked and modified from org.jamel.pkg4j.gradle.tasks.BuildDebTask - */ -class DebPackagingCopyAction extends AbstractPackagingCopyAction { - static final Logger logger = LoggerFactory.getLogger(DebPackagingCopyAction.class) - - File debianDir - List dependencies - List conflicts - List recommends - List suggests - List enhances - List preDepends - List breaks - List replaces - List provides - List dataProducers - List installDirs - private final DebTaskPropertiesValidator debTaskPropertiesValidator = new DebTaskPropertiesValidator() - private DebFileVisitorStrategy debFileVisitorStrategy - private final DebMaintainerScriptsGenerator maintainerScriptsGenerator - private final InstallLineGenerator installLineGenerator - - DebPackagingCopyAction(Deb debTask, File debianDir) { - super(debTask) - debTaskPropertiesValidator.validate(debTask) - dependencies = [] - conflicts = [] - recommends = [] - suggests = [] - enhances = [] - preDepends = [] - breaks = [] - replaces = [] - dataProducers = [] - installDirs = [] - provides = [] - this.debianDir = debianDir - debFileVisitorStrategy = new DebFileVisitorStrategy(dataProducers, installDirs) - maintainerScriptsGenerator = new DebMaintainerScriptsGenerator(debTask, new TemplateHelper(debianDir, '/deb'), debianDir, new ApacheCommonsFileSystemActions()) - installLineGenerator = new InstallLineGenerator() - } - - @Canonical - static class InstallDir { - String name - String user - String group - } - - @Override - void startVisit(CopyAction action) { - super.startVisit(action) - - debianDir.deleteDir() - debianDir.mkdirs() - - } - - @Override - void visitFile(FileCopyDetailsInternal fileDetails, def specToLookAt) { - logger.debug "adding file {}", fileDetails.relativePath.pathString - - def inputFile = extractFile(fileDetails) - - Directive fileType = lookup(specToLookAt, 'fileType') - if (fileType == 'CONFIG') { - logger.debug "mark {} as configuration file", fileDetails.relativePath.pathString - task.configurationFile(fileDetails.relativePath.pathString) - } - - String user = lookup(specToLookAt, 'user') ?: task.user - Integer uid = (Integer) lookup(specToLookAt, 'uid') ?: task.uid ?: 0 - String group = lookup(specToLookAt, 'permissionGroup') ?: task.permissionGroup - Integer gid = (Integer) lookup(specToLookAt, 'gid') ?: task.gid ?: 0 - - Integer explicitMode = FilePermissionUtil.getFileMode(specToLookAt) - int fileMode = explicitMode != null ? explicitMode : FilePermissionUtil.getUnixPermission(fileDetails) - - debFileVisitorStrategy.addFile(fileDetails, inputFile, user, uid, group, gid, fileMode) - } - - @Override - void visitDir(FileCopyDetailsInternal dirDetails, def specToLookAt) { - def specCreateDirectoryEntry = lookup(specToLookAt, 'createDirectoryEntry') - boolean createDirectoryEntry = specCreateDirectoryEntry!=null ? specCreateDirectoryEntry : task.createDirectoryEntry - if (createDirectoryEntry) { - - logger.debug "adding directory {}", dirDetails.relativePath.pathString - String user = lookup(specToLookAt, 'user') ?: task.user - Integer uid = (Integer) lookup(specToLookAt, 'uid') ?: task.uid ?: 0 - String group = lookup(specToLookAt, 'permissionGroup') ?: task.permissionGroup - Integer gid = (Integer) lookup(specToLookAt, 'gid') ?: task.gid ?: 0 - Boolean setgid = lookup(specToLookAt, 'setgid') - - Integer explicitDirMode = FilePermissionUtil.getDirMode(specToLookAt) - int dirMode = explicitDirMode != null ? explicitDirMode : FilePermissionUtil.getUnixPermission(dirDetails) - if (setgid == null) { - setgid = task.setgid - } - if (setgid) { - dirMode = dirMode | 02000 - } - - debFileVisitorStrategy.addDirectory(dirDetails, user, uid, group, gid, dirMode) - } - } - - @Override - protected void addLink(Link link) { - dataProducers << new DataProducerLink(link.path, link.target, true, null, null, null); - } - - @Override - protected void addDependency(Dependency dep) { - dependencies << dep.toDebString() - } - - @Override - protected void addConflict(Dependency dep) { - conflicts << dep.toDebString() - } - - @Override - protected void addProvides(Dependency dep) { - String providesString = dep.packageName - if (dep.version) { - providesString += " (= ${dep.version})" - } - provides << providesString - } - - @Override - protected void addObsolete(Dependency dep) { - logger.warn "Obsoletes functionality not implemented for deb files" - } - - protected void addRecommends(Dependency dep) { - recommends << dep.toDebString() - } - - protected void addSuggests(Dependency dep) { - suggests << dep.toDebString() - } - - protected void addEnhances(Dependency dep) { - enhances << dep.toDebString() - } - - protected void addPreDepends(Dependency dep) { - preDepends << dep.toDebString() - } - - protected void addBreaks(Dependency dep) { - breaks << dep.toDebString() - } - - protected void addReplaces(Dependency dep) { - replaces << dep.toDebString() - } - - @Override - protected void addDirectory(Directory directory) { - def user = directory.user ? directory.user : task.user - def permissionGroup = directory.permissionGroup ? directory.permissionGroup : task.permissionGroup - dataProducers << new DataProducerPathTemplate( - [directory.path] as String[], null, null, - [ new PermMapper(-1, -1, user, permissionGroup, - directory.permissions, -1, 0, null) ] as Mapper[]) - } - - protected String getMultiArch() { - def archString = task.getArchString() - def multiArch = task.getMultiArch() - if (('all' == archString) && (MultiArch.SAME == multiArch)) { - throw new IllegalArgumentException('Deb packages with Architecture: all cannot declare Multi-Arch: same') - } - def multiArchString = multiArch?.name()?.toLowerCase() ?: '' - return multiArchString - } - - protected Map getCustomFields() { - task.getAllCustomFields().collectEntries { String key, String val -> - // in the deb control file, header XB-Foo becomes Foo in the binary package - ['XB-' + key.capitalize(), val] - } as Map - } - - @Override - protected void end() { - for (Dependency recommends : task.allRecommends) { - logger.debug "adding recommends on {} {}", recommends.packageName, recommends.version - addRecommends(recommends) - } - - for (Dependency suggests : task.allSuggests) { - logger.debug "adding suggests on {} {}", suggests.packageName, suggests.version - addSuggests(suggests) - } - - for (Dependency enhances : task.allEnhances) { - logger.debug "adding enhances on {} {}", enhances.packageName, enhances.version - addEnhances(enhances) - } - - for (Dependency preDepends : task.allPreDepends) { - logger.debug "adding preDepends on {} {}", preDepends.packageName, preDepends.version - addPreDepends(preDepends) - } - - for (Dependency breaks : task.getAllBreaks()) { - logger.debug "adding breaks on {} {}", breaks.packageName, breaks.version - addBreaks(breaks) - } - - for (Dependency replaces : task.allReplaces) { - logger.debug "adding replaces on {} {}", replaces.packageName, replaces.version - addReplaces(replaces) - } - - maintainerScriptsGenerator.generate(toContext()) - - task.allSupplementaryControlFiles.each { supControl -> - File supControlFile = supControl instanceof File ? supControl as File : task.project.file(supControl) - new File(debianDir, supControlFile.name).bytes = supControlFile.bytes - } - - DebMaker maker = new DebMaker(new GradleLoggerConsole(), dataProducers, null) - File debFile = task.getArchiveFile().get().asFile - maker.setControl(debianDir) - maker.setDeb(debFile) - if (StringUtils.isNotBlank(task.getSigningKeyId()) - && StringUtils.isNotBlank(task.getSigningKeyPassphrase()) - && task.getSigningKeyRingFile().exists()) { - maker.setKey(task.getSigningKeyId()) - maker.setPassphrase(task.getSigningKeyPassphrase()) - maker.setKeyring(task.getSigningKeyRingFile()) - maker.setSignPackage(true) - } - - try { - logger.info("Creating debian package: ${debFile}") - maker.setCompression(Compression.GZIP.toString()) - maker.makeDeb() - } catch (Exception e) { - throw new GradleException("Can't build debian package ${debFile}", e) - } - - logger.info 'Created deb {}', debFile - } - - private static class GradleLoggerConsole implements Console { - @Override - void debug(String message) { - logger.debug(message) - } - - @Override - void info(String message) { - logger.info(message) - } - - @Override - void warn(String message) { - logger.warn(message) - } - } - - /** - * Map to be consumed by generateFile when transforming template - */ - def Map toContext() { - Map context = [:] - DeprecationLoggerUtils.whileDisabled { - context = [ - name: task.getPackageName(), - version: task.getVersion(), - release: task.getRelease(), - maintainer: task.getMaintainer(), - uploaders: task.getUploaders(), - priority: task.getPriority(), - epoch: task.getEpoch(), - description: task.getPackageDescription() ?: '', - distribution: task.getDistribution(), - summary: task.getSummary(), - section: task.getPackageGroup(), - time: DateFormatUtils.SMTP_DATETIME_FORMAT.format(new Date()), - provides: StringUtils.join(provides, ", "), - depends: StringUtils.join(dependencies, ", "), - url: task.getUrl(), - arch: task.getArchString(), - multiArch: getMultiArch(), - conflicts: StringUtils.join(conflicts, ", "), - recommends: StringUtils.join(recommends, ", "), - suggests: StringUtils.join(suggests, ", "), - enhances: StringUtils.join(enhances, ", " ), - preDepends: StringUtils.join(preDepends, ", "), - breaks: StringUtils.join(breaks, ", "), - replaces: StringUtils.join(replaces, ", "), - fullVersion: buildFullVersion(), - customFields: getCustomFields(), - - // Uses install command for directory - dirs: installDirs.collect { InstallDir dir -> [install: installLineGenerator.generate(dir)] } - ] - } - return context - } - - private String buildFullVersion() { - StringBuilder fullVersion = new StringBuilder() - - DeprecationLoggerUtils.whileDisabled { - if (task.getEpoch() != 0) { - fullVersion <<= task.getEpoch() - fullVersion <<= ':' - } - - fullVersion <<= task.getVersion() - - if(task.getRelease()) { - fullVersion <<= '-' - fullVersion <<= task.getRelease() - } - - } - - fullVersion.toString() - } -} \ No newline at end of file diff --git a/packaging/src/main/groovy/org/thingsboard/packaging/PackagingPlugin.groovy b/packaging/src/main/groovy/org/thingsboard/packaging/PackagingPlugin.groovy deleted file mode 100644 index 4bd1b6b137..0000000000 --- a/packaging/src/main/groovy/org/thingsboard/packaging/PackagingPlugin.groovy +++ /dev/null @@ -1,31 +0,0 @@ -/* - * SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. - * SPDX-License-Identifier: BUSL-1.1 - */ -package org.thingsboard.packaging - -import com.netflix.gradle.plugins.packaging.SystemPackagingBasePlugin -import com.netflix.gradle.plugins.packaging.SystemPackagingPlugin -import com.netflix.gradle.plugins.rpm.Rpm -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.api.logging.Logger -import org.gradle.api.logging.Logging - -public class PackagingPlugin implements Plugin { - private static Logger logger = Logging.getLogger(SystemPackagingPlugin); - - Project project - DebPackaging debTask - Rpm rpmTask - - void apply(Project project) { - - this.project = project - - project.plugins.apply(SystemPackagingBasePlugin.class) - debTask = project.tasks.create('buildDeb', DebPackaging) - rpmTask = project.tasks.create('buildRpm', Rpm) - } - -} diff --git a/packaging/src/main/resources/META-INF/gradle-plugins/thingsboard.package.properties b/packaging/src/main/resources/META-INF/gradle-plugins/thingsboard.package.properties deleted file mode 100644 index 62c700534c..0000000000 --- a/packaging/src/main/resources/META-INF/gradle-plugins/thingsboard.package.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=org.thingsboard.packaging.PackagingPlugin diff --git a/pom.xml b/pom.xml index 063be9b852..c7f5abd993 100755 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT pom ThingsBoard @@ -219,7 +219,6 @@ common rule-engine dao - packaging edqs transport integration @@ -1242,16 +1241,6 @@ byte-buddy-agent ${bytebuddy.version} - - net.bytebuddy - byte-buddy - ${bytebuddy.version} - - - net.bytebuddy - byte-buddy-agent - ${bytebuddy.version} - org.thingsboard.langchain4j langchain4j-bom diff --git a/report/pom.xml b/report/pom.xml index 191edabe0e..f428e65d22 100644 --- a/report/pom.xml +++ b/report/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard report diff --git a/rest-client/pom.xml b/rest-client/pom.xml index b44f1a422c..1be733ccee 100644 --- a/rest-client/pom.xml +++ b/rest-client/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard rest-client diff --git a/rule-engine/pom.xml b/rule-engine/pom.xml index dddeb7c5b0..59b274c450 100644 --- a/rule-engine/pom.xml +++ b/rule-engine/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard rule-engine diff --git a/rule-engine/rule-engine-api/pom.xml b/rule-engine/rule-engine-api/pom.xml index 232869e651..c0eaa24237 100644 --- a/rule-engine/rule-engine-api/pom.xml +++ b/rule-engine/rule-engine-api/pom.xml @@ -12,7 +12,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT rule-engine org.thingsboard.rule-engine diff --git a/rule-engine/rule-engine-components/pom.xml b/rule-engine/rule-engine-components/pom.xml index de56ad349b..312a8396fe 100644 --- a/rule-engine/rule-engine-components/pom.xml +++ b/rule-engine/rule-engine-components/pom.xml @@ -12,7 +12,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT rule-engine org.thingsboard.rule-engine diff --git a/tools/pom.xml b/tools/pom.xml index 9aaf06dae9..41d179c115 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard tools diff --git a/tools/src/main/python/license-headers/README.md b/tools/src/main/python/license-headers/README.md index 3e198be6f3..4f2eab2a1e 100644 --- a/tools/src/main/python/license-headers/README.md +++ b/tools/src/main/python/license-headers/README.md @@ -1,29 +1,52 @@ # License header provenance check Verifies that every file carries the SPDX header its origin requires: `apache` -for unchanged CE files, `ce-modified` for CE files with PE changes, `pe-only` -for files that do not exist in CE. A `pom.xml` added in PE under a directory -that has no files in CE is `pe-only` even when it resembles a CE `pom.xml`: -module identity, dependencies and packaging define the PE artifact. +for unchanged CE files, `ce-modified` for CE files with changes, and the third +header of this repository, `busl`, for files that do not come from CE. The +third header is the only `templates/license-header-.txt` besides the +`ce-modified` one, and its `` names it in the output and in curations. + +CE is the history of the ThingsBoard Community Edition under Apache-2.0. The +check compares against the latest CE commits merged into the current branch: + +- By default, CE commits are the ones that do not have the relicensing commit + `31936b09d24` in their history, for example pre-4.4 master and the lts-4.3 + commits merged into lts-4.4. +- With `--ce-ref`, CE commits are the history of the given CE branch, tag, or + commit, without the commits that have the relicensing commit in their + history. Use it when the history of the current branch does not come from CE + alone. The ref is fetched from `https://github.com/thingsboard/thingsboard.git` + on every run; pass `--ce-remote` to fetch from another URL or a local clone. + +## Rules + +A file whose path exists in CE is `apache` when its content without the +header equals a CE version of it, or a clean merge of its CE versions, and +`ce-modified` otherwise. + +A file whose path does not exist in CE is `busl`, except when it needs a +decision: its content is at least 50% similar to a CE file, or CE history once +had this path. A `pom.xml` added under a directory that has no files in CE is +`busl` even when it resembles a CE `pom.xml`: module identity, dependencies and +packaging define the new artifact. ## Run ```sh -./check-license-headers.sh lts-4.2 +./check-license-headers.sh ``` -The argument is the CE branch, tag, or commit matching the current PE branch. It -is fetched from `https://github.com/thingsboard/thingsboard.git` on every run, so -the clone needs network access but no CE remote of its own. Pass `--ce-remote` -to fetch from another URL or a local CE clone instead. +The check needs the full Git history of the clone. ## Fix automatically ```sh -./check-license-headers.sh lts-4.2 --fix +./check-license-headers.sh --fix ``` -Restamps every file whose expected header the check determined by itself. +Restamps every file whose expected header the check determined by itself and +removes curations that are redundant, because the check decides the same header +by itself, or that belong to files no longer in scope. ## Add a curation @@ -31,15 +54,18 @@ For files the check cannot decide ("Needs a decision"), record the decision in `curations.json` next to this file: 1. Put the correct header on the file. A file that exists in CE, even renamed - or moved, is `ce-modified`; a file that does not exist in CE is `pe-only`. + or moved, is `ce-modified`; a file that does not exist in CE is `busl`. 2. Run `sha256sum path/to/File.java`. 3. Add an entry and rerun the check: ```json { "path": "path/to/File.java", - "contentHash": "sha256:<64 hex digits>", - "header": "pe-only", - "reason": "Which CE file this was compared against and why the header follows." + "header": "busl", + "reason": "Which CE file this was compared against and why the header follows.", + "contentHash": "sha256:<64 hex digits>" } ``` + +A curation whose file changed since the review is stale and fails the check +until someone reviews the file again and updates `contentHash`. diff --git a/tools/src/main/python/license-headers/check_license_headers.py b/tools/src/main/python/license-headers/check_license_headers.py index 13ff9f75ad..1ff6faf77c 100644 --- a/tools/src/main/python/license-headers/check_license_headers.py +++ b/tools/src/main/python/license-headers/check_license_headers.py @@ -24,11 +24,24 @@ import uuid import xml.etree.ElementTree as ET +TEMPLATE_DIRECTORY = "tools/src/main/python/license-headers/templates" + + +def non_ce_header(directory): + kinds = sorted(path.name[len("license-header-"):-len(".txt")] for path in directory.glob("license-header-*.txt")) + kinds = [kind for kind in kinds if kind != "ce-modified"] + if len(kinds) != 1: + raise RuntimeError(f"Expected exactly one license-header-.txt besides the ce-modified one in {directory}") + return kinds[0] + + +NON_CE = non_ce_header(Path(__file__).resolve().parent / "templates") TEMPLATES = { - "apache": "tools/src/main/python/license-headers/templates/license-header.txt", - "ce-modified": "tools/src/main/python/license-headers/templates/license-header-ce-modified.txt", - "pe-only": "tools/src/main/python/license-headers/templates/license-header-busl.txt", + "apache": f"{TEMPLATE_DIRECTORY}/license-header.txt", + "ce-modified": f"{TEMPLATE_DIRECTORY}/license-header-ce-modified.txt", + NON_CE: f"{TEMPLATE_DIRECTORY}/license-header-{NON_CE}.txt", } +RELICENSING_COMMIT = "31936b09d24871e421f212502a8342f9d8aabb20" CE_REMOTE = "https://github.com/thingsboard/thingsboard.git" CURATIONS = "tools/src/main/python/license-headers/curations.json" README = "tools/src/main/python/license-headers/README.md" @@ -152,16 +165,37 @@ def fetch(repo, remote, ref): return resolve(repo, "FETCH_HEAD") -def unique_base(repo, left, right): - bases = git(repo, "merge-base", "--all", left, right).decode().splitlines() - if len(bases) != 1: - raise Failure(f"found {len(bases)} merge bases between PE HEAD and the CE ref, expected exactly one. " - "Check that the right CE branch was passed.") - return bases[0] +def independent(repo, commits): + return sorted(git(repo, "merge-base", "--independent", *commits).decode().split()) + + +def contains(repo, ancestor, descendant): + return run(["git", "merge-base", "--is-ancestor", ancestor, descendant], repo, ok=(0, 1, 128)).returncode == 0 -def first_parent_commits(repo, revision): - return git(repo, "rev-list", "--first-parent", revision).decode().splitlines() +def relicensed_ce_bases(repo, head): + if not contains(repo, RELICENSING_COMMIT, head): + raise Failure(f"the relicensing commit {RELICENSING_COMMIT[:11]} is not in the history of HEAD. " + "Pass --ce-ref with the CE branch that this branch integrates.") + records = git(repo, "rev-list", "--parents", "--ancestry-path", f"{RELICENSING_COMMIT}..{head}").decode().splitlines() + records.append(git(repo, "rev-list", "--parents", "-1", RELICENSING_COMMIT).decode().strip()) + commits = {record.split()[0] for record in records} + parents = {parent for record in records for parent in record.split()[1:]} + return independent(repo, sorted(parents - commits)) + + +def merged_ce_bases(repo, head, baseline): + bases = run(["git", "merge-base", "--all", head, baseline], repo, ok=(0, 1)).stdout.decode().split() + if not bases: + raise Failure("HEAD shares no history with the CE ref. Check that the right CE branch was passed.") + ce = [ce_base for base in bases + for ce_base in (relicensed_ce_bases(repo, base) if contains(repo, RELICENSING_COMMIT, base) else [base])] + return independent(repo, ce) + + +def merge_blobs(repo, ours, base, theirs): + result = run(["git", "merge-file", "-p", "--object-id", ours, base, theirs], repo, ok=range(0, 256)) + return result.stdout if result.returncode == 0 else None def tree(repo, revision): @@ -203,10 +237,6 @@ class Change: new: str status: str - @property - def deleted(self): - return self.status == "D" - def history(repo, revision, *options): raw = git(repo, "log", "--first-parent", "--diff-merges=first-parent", "--root", "--raw", "--no-abbrev", @@ -239,21 +269,6 @@ def parse_history(raw): raise Failure(f"Unexpected Git history token: {token[:80]!r}") -def integration_boundary(repo, anchor, head): - chain = first_parent_commits(repo, head) - low, high = 0, len(chain) - while low < high: - middle = (low + high) // 2 - code = run(["git", "merge-base", "--is-ancestor", anchor, chain[middle]], repo, ok=(0, 1)).returncode - if code == 0: - low = middle + 1 - else: - high = middle - if not low: - raise Failure("CE anchor is not in PE history") - return chain[low - 1] - - def git_ignored(repo, paths): if not paths: return set() @@ -513,7 +528,7 @@ class Mycila: (directory / name).write_bytes(self.templates[header]) def add(self, key, name, content): - group = "pe" if key[0] == "pe" else "ce" + group = "head" if key[0] == "head" else "ce" path = self.root / "files" / group / str(len(self.paths)) / PurePosixPath(name).name path.parent.mkdir(parents=True) path.write_bytes(content) @@ -561,11 +576,11 @@ class Mycila: def remove_headers(self, keys): before = {key: self.contents[key] for key in keys} with self.guarded(keys): - results = self.invoke("remove", "pe-only", keys, styles=(STRICT_XML,)) + results = self.invoke("remove", NON_CE, keys, styles=(STRICT_XML,)) unchanged = [key for key, result in results.items() if result == "NOOP" and PurePosixPath(self.paths[key]).suffix in BLOCK_COMMENT_SUFFIXES] if unchanged: - self.invoke("remove", "pe-only", unchanged, styles=(STRICT_XML, STRICT_BLOCK)) + self.invoke("remove", NON_CE, unchanged, styles=(STRICT_XML, STRICT_BLOCK)) removed = {} for key in keys: content, removed[key] = split_removed(before[key], self.contents[key]) @@ -690,14 +705,14 @@ class Mycila: selected = set(keys) if selected == set(self.paths): return ["files/**"] - if selected == {key for key in self.paths if key[0] == "pe"}: - return ["files/pe/**"] + if selected == {key for key in self.paths if key[0] == "head"}: + return ["files/head/**"] return [str(PurePosixPath(self.paths[key]).parent) + "/*" for key in keys] def normalized_copies(mycila, source_refs, names, nonempty): sources = set(source_refs) & nonempty - destinations = {("pe", name) for name in names} & nonempty + destinations = {("head", name) for name in names} & nonempty if not sources or not destinations: return {} git(mycila.root, "init", "--quiet") @@ -712,7 +727,7 @@ def normalized_copies(mycila, source_refs, names, nonempty): for source, destination, similarity in parse_copies(raw): source_key, destination_key = keys[source], keys[destination] if source_key not in sources or destination_key not in destinations: - raise Failure("Normalized copy escaped the selected CE/PE inputs") + raise Failure("Normalized copy escaped the selected CE and HEAD inputs") copies[destination_key[1]].append({"path": source_key[0], "blob": source_key[1], "ref": source_refs[source_key], "similarity": similarity}) return dict(copies) @@ -742,160 +757,78 @@ class Evidence: path: str content_hash: str current: str - curation: dict | None - inherited: bool - recreated: bool - ce_hash: str | None - pe_hash: str - candidates: list - historical: list - in_comparison: bool - pe_addition: bool = False + curation: dict | None = None + ce_versions: tuple = () + identical: dict | None = None copies: tuple = () + deleted: dict | None = None directory_in_ce: bool = True - ce_ref: str | None = None - ce_blob: str | None = None - - @property - def strong(self): - return [c for c in self.historical if c["path"] == self.path or c.get("contentMatches")] - - def ce_traces(self): - return bool(self.candidates or self.copies or self.in_comparison or self.strong) - def pe_module_descriptor(self): + def module_descriptor(self): return (PurePosixPath(self.path).name == MODULE_DESCRIPTOR and not self.directory_in_ce - and not (self.candidates or self.in_comparison or self.strong)) + and self.deleted is None and all(copy["similarity"] < 100 for copy in self.copies)) def decide(evidence): row = {"path": evidence.path, "contentHash": evidence.content_hash, "currentHeader": evidence.current} - if evidence.curation is not None: - return row | curated_verdict(evidence) - if evidence.recreated: - return row | {"status": "unresolved", "expectedHeader": None, - "reason": "deleted and recreated at this path, origin unclear"} - if evidence.inherited and evidence.ce_hash is not None: - comparison = {"comparison": {"path": evidence.path, "ref": evidence.ce_ref, "blob": evidence.ce_blob}} - if evidence.pe_hash == evidence.ce_hash: - return row | verdict(evidence.current, "apache", "same path in CE, content identical") | comparison - return row | verdict(evidence.current, "ce-modified", "same path in CE, content differs") | comparison - if evidence.pe_addition and not evidence.ce_traces(): - return row | verdict(evidence.current, "pe-only", "added in PE, no CE evidence") - if evidence.pe_addition and evidence.pe_module_descriptor(): - return row | verdict(evidence.current, "pe-only", "build descriptor of a module that does not exist in CE") - return row | open_question(evidence) + inferred = infer(evidence) + curation = evidence.curation + if curation is None: + return row | inferred + if curation["contentHash"] != evidence.content_hash: + return row | {"status": "stale-curation", "expectedHeader": None, + "reason": "file changed since the curation, re-review and update contentHash"} + if inferred["expectedHeader"] == curation["header"]: + return row | inferred | {"redundantCuration": True} + return row | verdict(evidence.current, curation["header"], "curation: " + curation["reason"]) + + +def infer(evidence): + if evidence.ce_versions: + versions = {"ceVersions": list(evidence.ce_versions)} + if evidence.identical is None: + return verdict(evidence.current, "ce-modified", "same path in CE, content differs") | versions + reason = ("same path in CE, content identical" if "blob" in evidence.identical + else "same path in CE, content identical to a clean merge of its CE versions") + return verdict(evidence.current, "apache", reason) | versions | {"identicalTo": evidence.identical} + if evidence.module_descriptor(): + return verdict(evidence.current, NON_CE, "build descriptor of a module that does not exist in CE") + if evidence.copies: + suggested = "apache" if evidence.copies[0]["similarity"] == 100 else None + return unresolved("similar content exists in CE under another path", suggested, + copyCandidates=list(evidence.copies)) + if evidence.deleted is not None: + return unresolved("CE history had this path", None, historicalCandidate=evidence.deleted) + return verdict(evidence.current, NON_CE, "not in CE, no CE evidence") def verdict(current, expected, reason): return {"status": "match" if current == expected else "mismatch", "expectedHeader": expected, "reason": reason} -def curated_verdict(evidence): - curation = evidence.curation - if curation["contentHash"] != evidence.content_hash: - return {"status": "stale-curation", "expectedHeader": None, - "reason": "file changed since the curation, re-review and update contentHash"} - return verdict(evidence.current, curation["header"], "curation: " + curation["reason"]) - - -def open_question(evidence): - strong = evidence.strong - ranked = [ - (evidence.candidates, "identical content exists in CE under another path", "apache"), - (evidence.copies, "similar content exists in CE under another path", None), - (strong, "CE history has this path or content", None), - (evidence.in_comparison, "present in CE, but not in the shared ancestry", None), - (True, "no CE evidence, but not proven to be added in PE", "pe-only"), - ] - _, reason, suggested = next(item for item in ranked if item[0]) - return { - "status": "unresolved", - "expectedHeader": None, - "suggestedHeader": suggested, - "reason": reason, - "candidates": evidence.candidates[:10], - "historicalCandidates": strong[:10], - "copyCandidates": list(evidence.copies), - "candidateCount": len(evidence.candidates), - "historicalCandidateCount": len(strong), - } +def unresolved(reason, suggested, **candidates): + return {"status": "unresolved", "expectedHeader": None, "suggestedHeader": suggested, "reason": reason} | candidates @dataclass(frozen=True) class Lineage: head: str - baseline: str - anchor: str - boundary: str - ce_commits: frozenset - ce_changes: list - comparison: dict - shared: dict - pe_tree: dict - additions: dict - recreated: frozenset + bases: tuple + trees: dict + deleted: dict @classmethod - def load(cls, repo, head, baseline): + def load(cls, repo, head, bases): if git(repo, "rev-parse", "--is-shallow-repository").decode().strip() == "true": raise Failure("this clone is shallow and the check needs full history. Run git fetch --unshallow.") - anchor = unique_base(repo, head, baseline) - ce_chain = first_parent_commits(repo, baseline) - ce_commits = frozenset(ce_chain) - if anchor not in ce_commits: - raise Failure("the shared ancestor is not on the CE ref's first-parent chain. " - "Pass the CE mainline branch that the PE branch integrates.") - boundary = integration_boundary(repo, anchor, head) - shared = tree(repo, anchor) - additions = {} - for change in history(repo, head, "--diff-filter=A"): - additions.setdefault(change.path, change.commit) - ce_changes = history(repo, baseline) - divergent = frozenset(ce_chain[:ce_chain.index(anchor)]) - divergence = (history(repo, f"{boundary}..{head}") - + [change for change in ce_changes if change.commit in divergent]) - return cls( - head=head, - baseline=baseline, - anchor=anchor, - boundary=boundary, - ce_commits=ce_commits, - ce_changes=ce_changes, - comparison=tree(repo, baseline), - shared=shared, - pe_tree=tree(repo, head), - additions=additions, - recreated=frozenset(change.path for change in divergence - if change.status in {"A", "D"} and change.path in shared), - ) - - def unmatched(self, names): - return {name for name in names - if name not in self.shared or name not in self.comparison or name in self.recreated} - - def pe_addition(self, name): - if name not in self.pe_tree: - return True - return name in self.additions and self.additions[name] not in self.ce_commits - - def added_by(self, name): - if name not in self.pe_tree: - return self.additions.get(name, "working-tree addition") - return self.additions.get(name) - - -def historical_versions(ce_changes, unmatched): - basenames = {PurePosixPath(name).name for name in unmatched} - versions = {} - for change in ce_changes: - if change.path not in unmatched and PurePosixPath(change.path).name not in basenames: - continue - oid = change.old if change.deleted else change.new - if set(oid) == {"0"}: - continue - versions.setdefault((change.path, oid), change.commit + "^1" if change.deleted else change.commit) - return versions + deleted = {} + for base in bases: + for change in history(repo, base, "--diff-filter=D"): + deleted.setdefault(change.path, {"path": change.path, "ref": change.commit + "^1", "blob": change.old}) + return cls(head=head, bases=tuple(bases), trees={base: tree(repo, base) for base in bases}, deleted=deleted) + + def versions(self, name): + return [(base, files[name]) for base, files in self.trees.items() if name in files] def comparable_ce_files(comparison, names): @@ -909,108 +842,114 @@ def comparable_ce_files(comparison, names): class Comparison: lineage: Lineage contents: dict - unmatched: set headers: dict normalized: dict - nonempty: set copies: dict - exact_index: dict - historic_index: dict + merges: dict ce_directories: frozenset def classify(self, name, curation): - key = ("pe", name) - lineage = self.lineage - unmatched = name in self.unmatched - historic = self.historical_candidates(name) if unmatched else [] - evidence = Evidence( + key = ("head", name) + versions = self.lineage.versions(name) + identical = next(({"path": name, "ref": base, "blob": oid} for base, oid in versions + if self.normalized[(name, oid)] == self.normalized[key]), self.merges.get(name)) + copies = sorted(self.copies.get(name, []), key=lambda copy: (-copy["similarity"], copy["path"])) + return decide(Evidence( path=name, content_hash=raw_hash(self.contents[name]), current=self.headers[key], curation=curation, - inherited=name in lineage.shared, - recreated=name in lineage.recreated, - ce_hash=self.normalized.get((name, lineage.comparison.get(name))), - pe_hash=self.normalized[key], - candidates=self.exact_index.get(self.normalized[key], []) if unmatched else [], - historical=historic, - in_comparison=name in lineage.comparison, - pe_addition=lineage.pe_addition(name), - copies=self.copies.get(name, []), + ce_versions=tuple({"path": name, "ref": base, "blob": oid} for base, oid in versions), + identical=identical, + copies=tuple(copies), + deleted=self.lineage.deleted.get(name), directory_in_ce=str(PurePosixPath(name).parent) in self.ce_directories, - ce_ref=lineage.baseline, - ce_blob=lineage.comparison.get(name), - ) - row = decide(evidence) - if unmatched: - row["peAddition"] = lineage.added_by(name) - row["basenameHintCount"] = len(historic) - len(evidence.strong) - return row - - def historical_candidates(self, name): - key = ("pe", name) - candidates = [] - for version in self.historic_index.get(PurePosixPath(name).name, []): - matches = (key in self.nonempty - and self.normalized[key] == self.normalized[(version["path"], version["blob"])]) - candidates.append(version | {"contentMatches": matches}) - candidates.sort(key=lambda candidate: (not candidate["contentMatches"], candidate["path"] != name)) - return candidates + )) def compare(repo, plugin, lineage, contents): names = list(contents) - unmatched = lineage.unmatched(names) - versions = historical_versions(lineage.ce_changes, unmatched) - counterparts = comparable_ce_files(lineage.comparison, names) - source_refs = versions | {key: lineage.baseline for key in counterparts.items()} - bytes_by_id = blobs(repo, [oid for _, oid in source_refs]) + new_paths = {name for name in names if not lineage.versions(name)} + sources = {} + for base, files in lineage.trees.items(): + for name in names: + if name in files: + sources.setdefault((name, files[name]), base) + for key in comparable_ce_files(files, new_paths).items(): + sources.setdefault(key, base) + bytes_by_id = blobs(repo, [oid for _, oid in sources]) with tempfile.TemporaryDirectory(prefix="license-provenance-") as temporary: mycila = Mycila(repo, Path(temporary), plugin) for name, content in contents.items(): - mycila.add(("pe", name), name, content) - for path, oid in sorted(source_refs): + mycila.add(("head", name), name, content) + for path, oid in sorted(sources): mycila.add((path, oid), path, bytes_by_id[oid]) console.begin("Recognizing headers") - recognized = mycila.current_headers([("pe", name) for name in names]) + recognized = mycila.current_headers([("head", name) for name in names]) console.end() console.begin("Comparing against CE") normalized = mycila.strip_headers() headers = mycila.header_states(recognized) - nonempty = mycila.nonempty() - copies = normalized_copies(mycila, source_refs, unmatched, nonempty) - exact_index = defaultdict(list) - for path, oid in counterparts.items(): - if (path, oid) in nonempty: - exact_index[normalized[(path, oid)]].append({"path": path, "ref": lineage.baseline, "blob": oid}) - historic_index = defaultdict(list) - for (path, oid), ref in versions.items(): - historic_index[PurePosixPath(path).name].append({"path": path, "ref": ref, "blob": oid}) + copies = normalized_copies(mycila, sources, new_paths, mycila.nonempty()) + merges = clean_merges(repo, plugin, lineage, names, normalized) console.end(f"done ({len(normalized)} file versions)") return Comparison( lineage=lineage, contents=contents, - unmatched=unmatched, headers=headers, normalized=normalized, - nonempty=nonempty, copies=copies, - exact_index=dict(exact_index), - historic_index=dict(historic_index), - ce_directories=frozenset(str(parent) for path in lineage.comparison for parent in PurePosixPath(path).parents), + merges=merges, + ce_directories=frozenset(str(parent) for files in lineage.trees.values() + for path in files for parent in PurePosixPath(path).parents), ) +def clean_merges(repo, plugin, lineage, names, normalized): + merged = {} + for index, left in enumerate(lineage.bases): + for right in lineage.bases[index + 1:]: + ancestors = git(repo, "merge-base", "--all", left, right).decode().split() + if len(ancestors) != 1: + continue + ancestry = tree(repo, ancestors[0]) + for name in names: + ours, theirs = lineage.trees[left].get(name), lineage.trees[right].get(name) + if ours is None or theirs is None or ours == theirs or name not in ancestry: + continue + if normalized[("head", name)] in {normalized[(name, ours)], normalized[(name, theirs)]}: + continue + content = merge_blobs(repo, ours, ancestry[name], theirs) + if content is not None: + merged[(name, left, right)] = (content, {"path": name, "merge": [left, right], + "base": ancestors[0]}) + if not merged: + return {} + with tempfile.TemporaryDirectory(prefix="license-provenance-") as temporary: + mycila = Mycila(repo, Path(temporary), plugin) + for key, (content, _) in merged.items(): + mycila.add(key, key[0], content) + hashes = mycila.strip_headers() + result = {} + for key, (_, description) in merged.items(): + if hashes[key] == normalized[("head", key[0])]: + result.setdefault(key[0], description) + return result + + def current_branch(repo): branch = git(repo, "rev-parse", "--abbrev-ref", "HEAD").decode().strip() return "" if branch == "HEAD" else branch -def print_banner(repo, head, ce_remote, ce_ref, baseline): +def print_banner(repo, head, ce): console.line("License header provenance check") - console.line(f" PE head {head[:11]} {current_branch(repo)}".rstrip()) - console.line(f" CE remote {ce_remote}") - console.line(f" CE ref {ce_ref}" + (f" → {baseline[:11]}" if baseline != ce_ref else "")) + console.line(f" HEAD {head[:11]} {current_branch(repo)}".rstrip()) + if "ref" in ce: + console.line(f" CE remote {ce['remote']}") + console.line(f" CE ref {ce['ref']}" + (f" → {ce['commit'][:11]}" if ce["commit"] != ce["ref"] else "")) + else: + console.line(f" CE commits without the relicensing commit {ce['relicensingCommit'][:11]} in their history") console.line() @@ -1039,16 +978,15 @@ def describe_mismatch(row): def describe_unresolved(row, ref_names): hint = f" (hint: {row['suggestedHeader']})" if row.get("suggestedHeader") else "" details = [f"has {header_name(row['currentHeader'])}, no expected header yet{hint}"] - evidence = ([("exact CE match", candidate) for candidate in row.get("candidates", [])] - + [(f"similar CE file ({candidate['similarity']}%)", candidate) - for candidate in row.get("copyCandidates", [])] - + [("CE history", candidate) for candidate in row.get("historicalCandidates", [])]) + evidence = [(f"similar CE file ({candidate['similarity']}%)", candidate) + for candidate in row.get("copyCandidates", [])] + if "historicalCandidate" in row: + evidence.append(("CE history", row["historicalCandidate"])) if not evidence: return details + [row["reason"]] label, candidate = evidence[0] details.append(f"{label}: {candidate['path']} at {ref_name(candidate['ref'], ref_names)}") - others = (row.get("candidateCount", 0) + len(row.get("copyCandidates", [])) - + row.get("historicalCandidateCount", 0) - 1) + others = len(evidence) - 1 if others > 0: details.append(f"another {others} candidate{'s' if others != 1 else ''} in the report") return details @@ -1058,8 +996,12 @@ def describe_stale(row): return [row["reason"]] -def print_group(title, rows, describe, hint): - console.line(f"{title} ({len(rows)})", "red") +def describe_redundant(row): + return [f"curated {row['expectedHeader']}, the check decides {row['expectedHeader']} by itself"] + + +def print_group(title, rows, describe, hint, style="red"): + console.line(f"{title} ({len(rows)})", style) for row in rows: console.line(f" {row['path']}") for detail in describe(row): @@ -1084,6 +1026,16 @@ def print_restamped(rows): console.line() +def print_removed_curations(removed): + if not removed: + return + console.line(f"Removed curations ({len(removed)})", "green") + for entry in removed: + console.line(f" {entry['path']}") + console.line(f" {entry['reason']}") + console.line() + + def print_findings(rows, curation_issues, ref_names): mismatches = [row for row in rows if row["status"] == "mismatch"] unresolved = [row for row in rows if row["status"] == "unresolved"] @@ -1096,7 +1048,14 @@ def print_findings(rows, curation_issues, ref_names): print_group("Needs a decision", unresolved, lambda row: describe_unresolved(row, ref_names), f"Decide the origin and add a curation, see {README}") if stale: - print_group("Stale curations", stale, describe_stale, f"Remove or update the entry in {CURATIONS}") + hint = (f"Review the file and update the entry in {CURATIONS}; --fix removes entries of files no longer in scope" + if any(row["status"] == "stale-curation" and "contentHash" in row for row in stale) + else "Rerun with --fix to remove them") + print_group("Stale curations", stale, describe_stale, hint) + redundant = [row for row in rows if row.get("redundantCuration")] + if redundant: + print_group("Redundant curations", redundant, describe_redundant, + f"Rerun with --fix to remove them from {CURATIONS}", style=None) def print_summary(rows, curation_issues, report): @@ -1145,8 +1104,8 @@ def restamp(repo, plugin, rows, contents): templates = {header: template_lines(content) for header, content in mycila.templates.items()} for name, header in current.items(): if header not in TEMPLATES: - expected[("pe", name)] = wanted[name] - mycila.add(("pe", name), name, contents[name]) + expected[("head", name)] = wanted[name] + mycila.add(("head", name), name, contents[name]) continue try: stamped[name] = swap_header(contents[name], templates[header], templates[wanted[name]]) @@ -1157,9 +1116,9 @@ def restamp(repo, plugin, rows, contents): stamped |= {key[1]: content for key, content in results.items()} skipped |= {key[1]: reason for key, reason in rejected.items()} for name, content in stamped.items(): - if ("pe", name) not in mycila.paths: - mycila.add(("pe", name), name, content) - headers = mycila.current_headers([("pe", name) for name in stamped]) + if ("head", name) not in mycila.paths: + mycila.add(("head", name), name, content) + headers = mycila.current_headers([("head", name) for name in stamped]) wrong = sorted(key[1] for key, header in headers.items() if header != wanted[key[1]]) if wrong: raise Failure(f"Restamping did not produce the expected header: {wrong[:20]}") @@ -1174,13 +1133,32 @@ def restamp(repo, plugin, rows, contents): console.end(f"{len(stamped)} files" + (f", {len(skipped)} skipped" if skipped else "")) +def prune_curations(path, rows, orphaned): + obsolete = {row["path"]: "the check decides the same header by itself" for row in rows if row.get("redundantCuration")} + obsolete |= {row["path"]: row["reason"] for row in orphaned} + if not obsolete: + return [] + data = json.loads(path.read_text(encoding="utf-8")) + data["curations"] = [entry for entry in data["curations"] if entry["path"] not in obsolete] + path.write_text(json.dumps(data, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") + for row in rows: + row.pop("redundantCuration", None) + return [{"path": name, "reason": reason} for name, reason in sorted(obsolete.items())] + + def check(args): repo = repository_root() head = resolve(repo, "HEAD") - console.begin(f"Fetching {args.ce_ref} from {args.ce_remote}") - baseline = fetch(repo, args.ce_remote, args.ce_ref) - console.end() - print_banner(repo, head, args.ce_remote, args.ce_ref, baseline) + if args.ce_ref: + console.begin(f"Fetching {args.ce_ref} from {args.ce_remote}") + baseline = fetch(repo, args.ce_remote, args.ce_ref) + console.end() + ce = {"remote": args.ce_remote, "ref": args.ce_ref, "commit": baseline} + ref_names = {baseline: args.ce_ref} + else: + ce = {"relicensingCommit": RELICENSING_COMMIT} + ref_names = {} + print_banner(repo, head, ce) destination = report_destination(repo, args.output) plugin = read_plugin(repo) reject_module_overrides(repo) @@ -1188,8 +1166,9 @@ def check(args): curation_bytes = curation_path.read_bytes() curations = load_curations(curation_path) console.begin("Resolving Git history") - lineage = Lineage.load(repo, head, baseline) - console.end() + bases = merged_ce_bases(repo, head, ce["commit"]) if "ref" in ce else relicensed_ce_bases(repo, head) + lineage = Lineage.load(repo, head, bases) + console.end("done (CE base " + ", ".join(ref_name(base, ref_names) for base in bases) + ")") console.begin("Collecting Mycila scope") scope = discover_scope(repo, plugin) console.end(f"{len(scope.eligible)} files ({scope.ignored} Git-ignored skipped)") @@ -1200,19 +1179,21 @@ def check(args): orphaned = [{"path": name, "status": "stale-curation", "reason": "file is no longer in scope"} for name in sorted(set(curations) - set(scope.eligible))] ensure_inputs_unchanged(repo, lineage, curation_path, curation_bytes, contents) + removed = [] if args.fix: restamp(repo, plugin, rows, contents) + removed = prune_curations(curation_path, rows, orphaned) + orphaned = [] summary = Counter(row["status"] for row in rows) result = { - "schemaVersion": 1, - "peHead": lineage.head, - "ceComparison": {"remote": args.ce_remote, "input": args.ce_ref, "commit": lineage.baseline}, - "ceHistory": {"tip": lineage.baseline, "firstParent": True}, - "sharedAncestor": lineage.anchor, - "peIntegrationBoundary": lineage.boundary, + "schemaVersion": 2, + "head": lineage.head, + "ce": ce | {"bases": list(lineage.bases)}, "scope": {"supported": len(scope.eligible), "unknown": scope.unknown, "modules": scope.modules}, "summary": dict(summary), "restamped": sorted(row["path"] for row in rows if "previousHeader" in row), + "removedCurations": removed, + "redundantCurations": sorted(row["path"] for row in rows if row.get("redundantCuration")), "curationIssues": orphaned, "files": rows, } @@ -1220,7 +1201,8 @@ def check(args): destination.write_text(json.dumps(result, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") report = destination.relative_to(repo) if destination.is_relative_to(repo) else destination print_restamped(rows) - print_findings(rows, orphaned, {baseline: args.ce_ref}) + print_removed_curations(removed) + print_findings(rows, orphaned, ref_names) print_summary(rows, orphaned, report) return 1 if orphaned or summary.keys() - {"match"} else 0 @@ -1228,14 +1210,15 @@ def check(args): def main(argv=None): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("command", choices=["check"]) - parser.add_argument("--ce-ref", required=True, - help="CE tree and first-parent history to check against; a branch, tag, or commit " - "of the CE repository, fetched from --ce-remote on every run") + parser.add_argument("--ce-ref", + help="CE branch, tag, or commit that this branch integrates, fetched from --ce-remote; " + "without it, CE is the history of HEAD that does not contain the relicensing commit") parser.add_argument("--ce-remote", default=CE_REMOTE, help=f"Git URL or path of the CE repository to fetch --ce-ref from (default: {CE_REMOTE})") parser.add_argument("--output", default="target/license-provenance/report.json") parser.add_argument("--fix", action="store_true", - help="restamp files whose expected header the check determined; unrecognized headers are kept") + help="restamp files whose expected header the check determined and remove redundant or " + "orphaned curations; unrecognized headers are kept") args = parser.parse_args(argv) try: return check(args) diff --git a/tools/src/main/python/license-headers/curations.json b/tools/src/main/python/license-headers/curations.json index 24d666cad7..75b0eb6a2c 100644 --- a/tools/src/main/python/license-headers/curations.json +++ b/tools/src/main/python/license-headers/curations.json @@ -21,43 +21,43 @@ }, { "path": "application/src/main/java/org/thingsboard/server/service/edge/rpc/fetch/IntegrationsEdgeEventFetcher.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific service adapter/message IntegrationsEdgeEventFetcher.java. Reviewed methods bind the common framework to PE integration, scheduler, encryption/secret, group, or customer-parent behavior. This is a new typed PE extension, not a relocation of the candidate CE implementation. Reviewed candidate application/src/main/java/org/thingsboard/server/service/edge/rpc/fetch/DevicesEdgeEventFetcher.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob a5461f8dbad84f4fe8c7fbededef00b55194dc60).", "contentHash": "sha256:be65c16d06ead4246c0f643391006aa1f94f03ce1ae2d6204e8f2296af5a1b27" }, { "path": "application/src/main/java/org/thingsboard/server/service/edge/rpc/fetch/PublicCustomerUserGroupEdgeEventFetcher.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific service adapter/message PublicCustomerUserGroupEdgeEventFetcher.java. Reviewed methods bind the common framework to PE integration, scheduler, encryption/secret, group, or customer-parent behavior. This is a new typed PE extension, not a relocation of the candidate CE implementation. Reviewed candidate application/src/main/java/org/thingsboard/server/service/edge/rpc/fetch/CustomerEdgeEventFetcher.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 43b4cb4d874eae2dedfd1c5f37e6de36b086a934).", "contentHash": "sha256:010b08d77586afad2bf0a4275f58d3b2288663b70e155fd4843b2ff0a26bbc85" }, { "path": "application/src/main/java/org/thingsboard/server/service/edge/rpc/fetch/SchedulerEventsEdgeEventFetcher.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific service adapter/message SchedulerEventsEdgeEventFetcher.java. Reviewed methods bind the common framework to PE integration, scheduler, encryption/secret, group, or customer-parent behavior. This is a new typed PE extension, not a relocation of the candidate CE implementation. Reviewed candidate application/src/main/java/org/thingsboard/server/service/edge/rpc/fetch/OtaPackagesEdgeEventFetcher.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 1e4579338841150ec1ec3a92a94aa92bb5ce0a4d).", "contentHash": "sha256:517a1c83d0f0152606cf20f08eabd9000d1eb69b24e364513f6d1de6f7129c0e" }, { "path": "application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/ek/EncryptionKeyEdgeProcessor.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific service adapter/message EncryptionKeyEdgeProcessor.java. Reviewed methods bind the common framework to PE integration, scheduler, encryption/secret, group, or customer-parent behavior. This is a new typed PE extension, not a relocation of the candidate CE implementation. Reviewed candidate application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantProfileEdgeProcessor.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob c9ae94086dae1febc08dbfa31ef5c06f07ec54f7).", "contentHash": "sha256:6c92f974c7d8fc9670126f7aab0b9f0dde82fd6c9ca4661cfc1f7d8d59ecb41f" }, { "path": "application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/secret/SecretEdgeProcessor.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific service adapter/message SecretEdgeProcessor.java. Reviewed methods bind the common framework to PE integration, scheduler, encryption/secret, group, or customer-parent behavior. This is a new typed PE extension, not a relocation of the candidate CE implementation. Reviewed candidate application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/queue/QueueEdgeProcessor.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8e5a65b588937e5703ff87f301be023d27ce1808).", "contentHash": "sha256:6f960791993777f636b230e3829422af292370a5b5a113b082dc2d05ee151491" }, { "path": "application/src/main/java/org/thingsboard/server/service/integration/rpc/IntegrationSessionCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate application/src/main/java/org/thingsboard/server/service/sync/vc/VersionControlTaskCaffeineCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d234314aee9f02efb853f0a3372f9e0de1b7869c).", "contentHash": "sha256:c9a90236fcf1d34d67c1fce37580b30be8f0bfea4cd2f6c1f0a49ba38203f0ec" }, { "path": "application/src/main/java/org/thingsboard/server/service/integration/rpc/IntegrationSessionRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate application/src/main/java/org/thingsboard/server/service/sync/vc/repository/RepositorySettingsRedisCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob e7ca801e138a16a706d25723ffb7983b2e7850ee).", "contentHash": "sha256:7493855212ea1a169ca6746df584c829fb40ca834259fa6381b38cf84dba2345" }, @@ -69,25 +69,25 @@ }, { "path": "application/src/main/java/org/thingsboard/server/service/solutions/data/definition/EdgeEntityGroupDefinition.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific service adapter/message EdgeEntityGroupDefinition.java. Reviewed methods bind the common framework to PE integration, scheduler, encryption/secret, group, or customer-parent behavior. This is a new typed PE extension, not a relocation of the candidate CE implementation. Reviewed candidate application/src/main/java/org/thingsboard/server/service/solutions/data/definition/DashboardUserDetailsDefinition.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 2ec470182985b893360eda095d9b3bf4d68652bd).", "contentHash": "sha256:5655c383fe30473d814ba43fb456e8f5324954fe00a1faf6f69d2295df00727f" }, { "path": "application/src/main/java/org/thingsboard/server/service/solutions/data/definition/SchedulerEventDefinition.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific service adapter/message SchedulerEventDefinition.java. Reviewed methods bind the common framework to PE integration, scheduler, encryption/secret, group, or customer-parent behavior. This is a new typed PE extension, not a relocation of the candidate CE implementation. Reviewed candidate application/src/main/java/org/thingsboard/server/service/solutions/data/definition/DeviceDefinition.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 81239c46dd5f0e3c24c9fc52dff3ba1075dbbd1e).", "contentHash": "sha256:8135b6d076e6d6381428bd0992aa8f216260ecacec165cbb8d7e2e40f137601d" }, { "path": "application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/impl/CustomerExportService.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific service adapter/message CustomerExportService.java. Reviewed methods bind the common framework to PE integration, scheduler, encryption/secret, group, or customer-parent behavior. This is a new typed PE extension, not a relocation of the candidate CE implementation. Reviewed candidate application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/impl/NotificationTemplateExportService.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob c3fc08f097f8e8ec1c90406211ad433947c5ecdd).", "contentHash": "sha256:ae8c3bbc5fbb804a32fc2fb7d5aef7be5c6bd11e434e5f0d41226f5099e3696b" }, { "path": "application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/impl/RoleExportService.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific service adapter/message RoleExportService.java. Reviewed methods bind the common framework to PE integration, scheduler, encryption/secret, group, or customer-parent behavior. This is a new typed PE extension, not a relocation of the candidate CE implementation. Reviewed candidate application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/impl/NotificationTemplateExportService.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob c3fc08f097f8e8ec1c90406211ad433947c5ecdd).", "contentHash": "sha256:a7ede744921df38436eeab40ce73847e0c04e95c469cfb61c593439466ac1aae" }, @@ -105,127 +105,103 @@ }, { "path": "application/src/main/java/org/thingsboard/server/service/ws/log/cmd/LogsSubscriptionCmd.java", - "header": "pe-only", + "header": "busl", "reason": "PE WebSocket logs subscription command added in 4005afabb81 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE application/src/main/java/org/thingsboard/server/service/ws/notification/cmd/MarkAllNotificationsAsReadCmd.java shares only the WebSocket command boilerplate. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 47cb85519d0).", "contentHash": "sha256:8b74007cf36b206be04ea7f1ca385b34c58256647a645a88d2e90188f8b3fd3f" }, { "path": "application/src/main/java/org/thingsboard/server/service/ws/log/cmd/LogsUnsubscribeCmd.java", - "header": "pe-only", + "header": "busl", "reason": "PE WebSocket logs subscription command added in 4005afabb81 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE application/src/main/java/org/thingsboard/server/service/ws/notification/cmd/NotificationsUnsubCmd.java shares only the WebSocket command boilerplate. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 1a7a6119358).", "contentHash": "sha256:fd319f8910fa50f4db8dd30fe3f90e60e34910e1ddc0bb9db390db64f56b27db" }, { "path": "application/src/test/java/org/thingsboard/server/service/install/update/DefaultDataUpdateServiceTest.java", - "header": "pe-only", + "header": "busl", "reason": "CE deleted its DefaultDataUpdateServiceTest (version 3.3.0 device profile conversion tests) in ba440ba7c1f. PE recreated a test at the same path in cdae38adc6b with entirely new content covering the CE-to-PE upgrade chain; nothing of the CE file (last CE version 40527f3da02^1, blob abfab844917) remains beyond the class name.", "contentHash": "sha256:c0ebbc47ce2ff97d2e00182781ed38ca137ad54393e706c064c0ca6919b27eb8" }, { "path": "application/src/test/java/org/thingsboard/server/service/integration/rpc/IntegrationRpcSslTest.java", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE application/src/test/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSslTest.java, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:ee00a93535d92e1b048a3c79b90e9741c8091a3db7c794eb3dd2aa38aee18142" }, - { - "path": "application/src/test/java/org/thingsboard/server/transport/lwm2m/Lwm2mTestHelper.java", - "header": "apache", - "reason": "Unmodified CE code from CE master, not yet in CE lts-4.4. Byte-identical to CE master 3150f863b7952d723ffb3a62ffbc0116946c2000 (blob 29c95099771c693b55b4e7c7b5dc3cc307ce4ea2). Brought by the LwM2M fixes thingsboard/thingsboard#15962 and #16095, merged into CE master after CE lts-4.4 forked on 2026-08-06; PE lts-4.4 inherited them from PE master, where thingsboard-pe#5090 already stamped them apache. Remove this entry once CE lts-4.4 contains these commits.", - "contentHash": "sha256:a416dd1dc4252d105cf67e26545e67c0c31c2ad4919a61e2a9f7a8597b64dd1e" - }, - { - "path": "application/src/test/java/org/thingsboard/server/transport/lwm2m/client/LwM2mTestObject.java", - "header": "apache", - "reason": "Unmodified CE code from CE master, not yet in CE lts-4.4. Byte-identical to CE master 3150f863b7952d723ffb3a62ffbc0116946c2000 (blob 6c0f3011ec428bc9aad07130afab1132e882d389). Brought by the LwM2M fixes thingsboard/thingsboard#15962 and #16095, merged into CE master after CE lts-4.4 forked on 2026-08-06; PE lts-4.4 inherited them from PE master, where thingsboard-pe#5090 already stamped them apache. Remove this entry once CE lts-4.4 contains these commits.", - "contentHash": "sha256:8ca86329a94705f67fa56de12c3d6c0c30bf1e35064fa1fd43e9fdfb182eca11" - }, - { - "path": "application/src/test/java/org/thingsboard/server/transport/lwm2m/rpc/AbstractRpcLwM2MIntegrationTest.java", - "header": "apache", - "reason": "Unmodified CE code from CE master, not yet in CE lts-4.4. Byte-identical to CE master 3150f863b7952d723ffb3a62ffbc0116946c2000 (blob d81c3c4856dc3354feacf0f24e337f534fb8b312). Brought by the LwM2M fixes thingsboard/thingsboard#15962 and #16095, merged into CE master after CE lts-4.4 forked on 2026-08-06; PE lts-4.4 inherited them from PE master, where thingsboard-pe#5090 already stamped them apache. Remove this entry once CE lts-4.4 contains these commits.", - "contentHash": "sha256:eeb512f1445800ddab3c42adfbba0ce1ea354b0daf1384766dadcec814350952" - }, - { - "path": "application/src/test/java/org/thingsboard/server/transport/lwm2m/rpc/sql/RpcLwm2mIntegrationWriteTest.java", - "header": "apache", - "reason": "Unmodified CE code from CE master, not yet in CE lts-4.4. Byte-identical to CE master 3150f863b7952d723ffb3a62ffbc0116946c2000 (blob 30c37ae6c58bd11e3fada59f232c426b7b9d6b0f). Brought by the LwM2M fixes thingsboard/thingsboard#15962 and #16095, merged into CE master after CE lts-4.4 forked on 2026-08-06; PE lts-4.4 inherited them from PE master, where thingsboard-pe#5090 already stamped them apache. Remove this entry once CE lts-4.4 contains these commits.", - "contentHash": "sha256:345e60fe8b881d8d405115d5c63cea5f711b28f5769d86a6b7d7b34eebf97770" - }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/agent/AgentAppProfileCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache added in 41416ebe327 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardTitlesCaffeineCache.java shares only the Caffeine or Redis cache boilerplate and caches a different key and value type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob f2e2f32f037).", "contentHash": "sha256:7fd51b57a41b929355ecef4546c78a3f93512341dbb7cc945ad4ffefbb2ab387" }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/agent/AgentAppProfileRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache added in 41416ebe327 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardTitlesRedisCache.java shares only the Caffeine or Redis cache boilerplate and caches a different key and value type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 4c1bf7dedbe).", "contentHash": "sha256:031627cc6dcd58cf6c6d6716354b44683c9941f3df7de5e402553c85dc3b2d95" }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/agent/AgentAppUnitCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache added in ad644d12571 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE application/src/main/java/org/thingsboard/server/service/mobile/secret/MobileSecretCaffeineCache.java shares only the Caffeine or Redis cache boilerplate and caches a different key and value type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 54a7dbffd4a).", "contentHash": "sha256:990761d74d185d7a442431414535c9d17fda135fbc277bdf47aa2d96f19fd05b" }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/agent/AgentAppUnitRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache added in ad644d12571 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE application/src/main/java/org/thingsboard/server/service/mobile/secret/MobileSecretRedisCache.java shares only the Caffeine or Redis cache boilerplate and caches a different key and value type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 93fd57a5349).", "contentHash": "sha256:a47374fba6bde5c35994d2032c4a411800a182f6cb6839143d3a682161a078df" }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/agent/AgentApplicationCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache added in af7fd5a1e48 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE application/src/main/java/org/thingsboard/server/service/mobile/secret/MobileSecretCaffeineCache.java shares only the Caffeine or Redis cache boilerplate and caches a different key and value type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 54a7dbffd4a).", "contentHash": "sha256:155d0c7a83e8d7ed9b286aacde0c4a38678683c274b266cea76aa0df28ed497b" }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/agent/AgentApplicationRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache added in af7fd5a1e48 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE application/src/main/java/org/thingsboard/server/service/mobile/secret/MobileSecretRedisCache.java shares only the Caffeine or Redis cache boilerplate and caches a different key and value type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 93fd57a5349).", "contentHash": "sha256:e21a3ff66992dbd39dcf90beac995d995021589e4704bbee562a7939386ec2d0" }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/agent/AgentCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache added in 7a16579509e as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE common/cache/src/main/java/org/thingsboard/server/cache/user/UserCaffeineCache.java shares only the Caffeine or Redis cache boilerplate and caches a different key and value type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 3eb9c3f16f6).", "contentHash": "sha256:2dc0d5327adb18a679896841e5513b1de0cf818737e227d5cd95089902d2ed1f" }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/agent/AgentProfileCacheEvictEvent.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache evict event added in 6c303b45f74 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE dao/src/main/java/org/thingsboard/server/dao/asset/AssetCacheEvictEvent.java shares only the cache evict event boilerplate. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob b3fcac6e36b).", "contentHash": "sha256:9f304ce36c924585ac28fea987f026555f550c77db5272c43a2b0144eb89d34b" }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/agent/AgentProfileCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache added in 6c303b45f74 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE common/cache/src/main/java/org/thingsboard/server/cache/edge/RelatedEdgesCaffeineCache.java shares only the Caffeine or Redis cache boilerplate and caches a different key and value type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 5227ae6ab4b).", "contentHash": "sha256:a3e5ff4080061f355876a3578e239dd3897178155b48a8f9891549422a5ce868" }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/agent/AgentProfileRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache added in 6c303b45f74 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE dao/src/main/java/org/thingsboard/server/dao/asset/AssetProfileRedisCache.java shares only the Caffeine or Redis cache boilerplate and caches a different key and value type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 2e200a04882).", "contentHash": "sha256:5d2b42b22d657f1db2afa6e1ad3edaccabc0f44ed0a1d13ea3423aafcaff9d50" }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/agent/AgentRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache added in 7a16579509e as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE dao/src/main/java/org/thingsboard/server/dao/asset/AssetRedisCache.java shares only the Caffeine or Redis cache boilerplate and caches a different key and value type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 488c9f37404).", "contentHash": "sha256:479b7a977e88848a1990e583ffafa3cc21661b5541be191225638ae32267c8ea" }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/secret/SecretCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate common/cache/src/main/java/org/thingsboard/server/cache/user/UserCaffeineCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 3eb9c3f16f619210d6ccdf4e3084ee36ec954796).", "contentHash": "sha256:f1e0248aa094af0c672f09ef90f85787d0a3133c50ea65be357a732ea7205c04" }, { "path": "common/cache/src/main/java/org/thingsboard/server/cache/secret/SecretRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/tenant/TenantRedisCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob ce21e1ffbb0b41ca7d6272d469bd4b8e436debeb).", "contentHash": "sha256:57d9b4ecaf1793a33a3df7df6a3eae5e1327e5e31cee77ef4fd6da3b4163c707" }, @@ -237,187 +213,187 @@ }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/CustomMenuDeleteResult.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type CustomMenuDeleteResult.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/TbImageDeleteResult.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 85c2cdacc01a8a75e3daa236ff7a698817a3a162).", "contentHash": "sha256:23f6394bb5203ef9d3334bf3089f07fe41ab673d9345f356f602bf65fcca33d1" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/SecretType.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type SecretType.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/HasName.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 24d65f5772e82f4a4a408e21aaf0fd051080c547).", "contentHash": "sha256:3a8512446f1164abbbcca0e424e8da1ec16cef85520d280ca1c42650acbce2d9" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/TbSecretDeleteResult.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type TbSecretDeleteResult.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/TbResourceDeleteResult.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d2b359f23bb29e608b20ab8b9859c8f0ddc2d66a).", "contentHash": "sha256:9c8df7fb5c8b07d9ebdf6cc46c98efee2134b867f1f92d738b0843c7b0a944a1" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/agent/AgentInstructions.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent installation instructions model added in e0db7ac7154 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE common/data/src/main/java/org/thingsboard/server/common/data/edge/EdgeInstructions.java shares only the instructions model boilerplate. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 409985284c6).", "contentHash": "sha256:ce067f7aad61fb79c44ac80ceda3b26e9908a8a648380097754ff9ee097256b1" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/BlobEntityFields.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type BlobEntityFields.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/EntityViewFields.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d21d495cf1871bdeca471f00d92c73d4d444a12a).", "contentHash": "sha256:0fc26ec79e200fe6bf97b58993a9830be23175c260155764408f3f3b7d84bed1" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/ConverterFields.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type ConverterFields.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/RuleChainFields.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d8dd1c8a433275ae690d5ca9296a55b5c23bf464).", "contentHash": "sha256:660e6258198919edbbc5a08704fb9eee5dbaf797d248da0c96987957ae03ca16" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/IntegrationFields.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type IntegrationFields.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/RuleChainFields.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d8dd1c8a433275ae690d5ca9296a55b5c23bf464).", "contentHash": "sha256:7c07ebe99b44c9d69f05eb88cdc680b03f30cbc26d115e74980fa9a5df2e2c70" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/RoleFields.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type RoleFields.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/EntityViewFields.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d21d495cf1871bdeca471f00d92c73d4d444a12a).", "contentHash": "sha256:603f0ba6af402c8f7bc499bfa09e88472bcab45f4d1b5fe55efd29cc3b1af194" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/event/IntegrationDebugEvent.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type IntegrationDebugEvent.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/event/RuleChainDebugEvent.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob c6b34615adad82d53a1a913956f7517064548c35).", "contentHash": "sha256:5e585c566be6b92d56bd6331144861c1b0a0d5529c07dbc6de340ed805bc23e0" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/event/RawDataEvent.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type RawDataEvent.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/event/RuleChainDebugEvent.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob c6b34615adad82d53a1a913956f7517064548c35).", "contentHash": "sha256:c0e10159c33bea76a60a6f0f62d756ae181d1a3bac045c10978f2b7aaa82223b" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/event/RawDataEventFilter.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type RawDataEventFilter.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/event/ErrorEventFilter.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8b1a03b8480db898d3d6182de8f9cd91588daaf9).", "contentHash": "sha256:9329939e43514544231b9329f3f190ada2872780773c3bbb60fadcec8726174d" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/housekeeper/EntitiesCleanupHousekeeperTask.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type EntitiesCleanupHousekeeperTask.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/housekeeper/TenantEntitiesDeletionHousekeeperTask.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob be7ff6f7ecaee9e9afe78f097a8945d92a0dae88).", "contentHash": "sha256:b568f724c8f1ba201545a387c302af3a3376288d5bb8101c3151cd1d421eb38f" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/AgentAppEventId.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent entity id added in c17541e44d6 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE common/data/src/main/java/org/thingsboard/server/common/data/id/CalculatedFieldId.java shares only the entity id boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 094df0e9354).", "contentHash": "sha256:0c99ed7caf9ec1e379c26d9cdf43be0dd82ed0a91c5dee58f1786ffd97123e57" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/AgentAppProfileId.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent entity id added in 41416ebe327 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE common/data/src/main/java/org/thingsboard/server/common/data/id/OtaPackageId.java shares only the entity id boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob f9f508f13f2).", "contentHash": "sha256:ce4de69553918cb1630f5efbc255fb767490927b54713d6c828e81c5fa5e59f1" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/AgentAppUnitId.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent entity id added in ad644d12571 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE common/data/src/main/java/org/thingsboard/server/common/data/id/OtaPackageId.java shares only the entity id boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob f9f508f13f2).", "contentHash": "sha256:afef46f334d3bc87fe2a8959d12b8c8032861e084421119836160d73a90ef953" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/AgentApplicationId.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent entity id added in af7fd5a1e48 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE common/data/src/main/java/org/thingsboard/server/common/data/id/CalculatedFieldId.java shares only the entity id boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 094df0e9354).", "contentHash": "sha256:ac7ba9e268ea1806fb8a589b108f1e60f86696170fea1787f2bca12cf2fc76bb" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/AgentBulkActionId.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent entity id added in bd59c7ca3b1 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE common/data/src/main/java/org/thingsboard/server/common/data/id/CalculatedFieldId.java shares only the entity id boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 094df0e9354).", "contentHash": "sha256:72511cab888de959c7d07a447c1e75d6422634bf4a40f0bf3c8acb252bb29fa3" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/AgentId.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent entity id added in 297416ceb40 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE common/data/src/main/java/org/thingsboard/server/common/data/id/CalculatedFieldId.java shares only the entity id boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 094df0e9354).", "contentHash": "sha256:6802bd0d22005158617e0dafb29a0594b3a8f6a6a48bf76aa3c2e55094cf06d0" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/AgentProfileId.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent entity id added in 6c303b45f74 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE common/data/src/main/java/org/thingsboard/server/common/data/id/OtaPackageId.java shares only the entity id boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob f9f508f13f2).", "contentHash": "sha256:3b401949924a7959176f33288586ebaa9d5faad8c6b9512c9388b42ad628502b" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/BlobEntityId.java", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate common/data/src/main/java/org/thingsboard/server/common/data/id/QueueStatsId.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 7a921e875505b9f45e1074958631ba146263c31b).", "contentHash": "sha256:f9f618191dabbebf321eed10073d66f2e8179d46866a797b13905f120e5994d3" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/ConverterId.java", - "header": "pe-only", + "header": "busl", "reason": "PE-only entity ID wrapper introduced in 7914c997a70cd903ac248f896c0fb27ea96cef18. Its similarity to common/data/src/main/java/org/thingsboard/server/common/data/id/AssetId.java reflects the shared ID-wrapper template. Maintainer explicitly resolved ConverterId as PE-authored because converters are a PE-only feature; the same resolution applies to this comparable PE-only entity wrapper.", "contentHash": "sha256:8deda011e1724896c0de879f8c0222f741d830a47e906bdad2b1d88529ed6f61" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/CustomMenuId.java", - "header": "pe-only", + "header": "busl", "reason": "PE-only entity ID wrapper introduced in 60c8fb1928699c07128c3e6beb43964687a5333c. Its similarity to common/data/src/main/java/org/thingsboard/server/common/data/id/AdminSettingsId.java reflects the shared ID-wrapper template. Maintainer explicitly resolved ConverterId as PE-authored because converters are a PE-only feature; the same resolution applies to this comparable PE-only entity wrapper.", "contentHash": "sha256:6a1db9c609fe31e1dfb256bfb6ada0eb8e93168ad5c55f31dc37d66fc6b75c11" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/EncryptionKeyId.java", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate common/data/src/main/java/org/thingsboard/server/common/data/id/UserCredentialsId.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 6c17ba5aec7d3e4b1e07f3a5e89fe144441fb0a4).", "contentHash": "sha256:7e225578277de32f0d700b6aecd1e6a65b9295e866a268e392c1bf1a2655c65e" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/EntityGroupId.java", - "header": "pe-only", + "header": "busl", "reason": "PE-only entity ID wrapper introduced in 887106583064b1bc0383d25614fbeda418e3d6d6. Its similarity to common/data/src/main/java/org/thingsboard/server/common/data/id/AssetId.java reflects the shared ID-wrapper template. Maintainer explicitly resolved ConverterId as PE-authored because converters are a PE-only feature; the same resolution applies to this comparable PE-only entity wrapper.", "contentHash": "sha256:05abfcc7a496011ddbceaa4f3de74be4c3ee2501ea58c00415be583ed3150dd3" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/GroupPermissionId.java", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceId.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 7dd840815b540966a1dc57440cf5108a35119552).", "contentHash": "sha256:63be26285040fa04f1a6013308facf49230e5f84926faeb16c6ed580b7a983c7" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/IntegrationId.java", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate common/data/src/main/java/org/thingsboard/server/common/data/id/QueueId.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob c7ee46da2adae547e4b7714d7070bb610274f571).", "contentHash": "sha256:0e7a96c5a4887b56312319e305a991fd6bd73d6659e668b0a75d0a7d91d1cd34" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/ReportId.java", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate common/data/src/main/java/org/thingsboard/server/common/data/id/UserId.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d4f113bef57ca782c35511ea2a8fbd3e364b9d9b).", "contentHash": "sha256:6abcc328dcb3049873c5b1a193b642b7cb25848740aaa98e5250ad44cd7bfed6" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/ReportTemplateId.java", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceId.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 7dd840815b540966a1dc57440cf5108a35119552).", "contentHash": "sha256:73395faf888c2d8f87478352625208900a16d4a2be3f025e118fe93fc1b67992" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/RoleId.java", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate common/data/src/main/java/org/thingsboard/server/common/data/id/QueueId.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob c7ee46da2adae547e4b7714d7070bb610274f571).", "contentHash": "sha256:e79ad6b47c787958d36ef4907e3b5f7710df51aeca037fcb930558910a074b6c" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/SchedulerEventId.java", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceId.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 7dd840815b540966a1dc57440cf5108a35119552).", "contentHash": "sha256:154a64d766ce75dcf9be0838b6996cfe7112ee77416c33ec08a2db209088b1a3" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/id/SecretId.java", - "header": "pe-only", + "header": "busl", "reason": "PE-only entity ID wrapper introduced in 2d5a5b65587edb42acf3b415b1689065c905d493. Its similarity to common/data/src/main/java/org/thingsboard/server/common/data/id/NotificationTemplateId.java reflects the shared ID-wrapper template. Maintainer explicitly resolved ConverterId as PE-authored because converters are a PE-only feature; the same resolution applies to this comparable PE-only entity wrapper.", "contentHash": "sha256:03a67a1bea463f9ad641dfc4f27f82ef1936a47745dbd019d9f9ea0a88623db8" }, @@ -429,52 +405,40 @@ }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/menu/CustomMenuConfig.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type CustomMenuConfig.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/mobile/layout/MobileLayoutConfig.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8cf0bfb6182c8d094f765109db4e901222cb6448).", "contentHash": "sha256:8dd8c85820f87b3a6c97440bf3df112e4f5f74f109ced154d2a129ac89f54147" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/menu/MenuItem.java", - "header": "pe-only", + "header": "busl", "reason": "PE custom menu model interface introduced in 2eb81a2baa9 alongside CustomMenuConfig. The candidate CE DeviceConfiguration.java matches only on Jackson polymorphism annotations, not on the menu model. Reviewed candidate at 317a75614137ab5ddd1aecef1abd4c2fcdcb8710 (blob 6fe689d17c0).", "contentHash": "sha256:da19b1162913a636119fcc953d6366b990d24a6fda8df540497653bb317407b0" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/notification/info/IntegrationLifecycleEventNotificationInfo.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type IntegrationLifecycleEventNotificationInfo.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/notification/info/RuleEngineComponentLifecycleEventNotificationInfo.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob aa71e620bd31d4520a52f12a4968542407f3b649).", "contentHash": "sha256:dfaccc965ece5db3133d1b9615190c56cd288f91da82cd98313a23d4733e2252" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/notification/info/PlanUpgradeRequestNotificationInfo.java", - "header": "pe-only", + "header": "busl", "reason": "PE plan upgrade request notification added in 358c8ec5e5f for the PE solution template level check. The candidate CE EntitiesLimitIncreaseRequestNotificationInfo.java shares only the NotificationInfo and Lombok boilerplate and carries different fields. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob f00014567d9).", "contentHash": "sha256:42eceb50f497f9f0b5022b1fdc06157926f458d59376d24c285fb5fbb590617f" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/notification/info/ReportGeneratedNotificationInfo.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type ReportGeneratedNotificationInfo.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/notification/info/EdgeConnectionNotificationInfo.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 05fa093fb717fabbac402bf1255fba78b86fbef1).", "contentHash": "sha256:8eeb130cc283f525cf47d693e61fbdec0c29b32c2912e51473a909042c7ab812" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/notification/rule/trigger/IntegrationLifecycleEventTrigger.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type IntegrationLifecycleEventTrigger.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/notification/rule/trigger/RuleEngineComponentLifecycleEventTrigger.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob e4c967c19792ecf5fa6409973459efe5ce73cb8d).", "contentHash": "sha256:c5da9a11ed196635c09972733cf511bee2bd111242c0d084d115d37e2e7524c5" }, - { - "path": "common/data/src/main/java/org/thingsboard/server/common/data/notification/targets/platform/UserGroupListFilter.java", - "header": "pe-only", - "reason": "PE-specific data/configuration type UserGroupListFilter.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/notification/targets/platform/UserListFilter.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob e0adb26d59bf493b3e53444327c6da6255806853).", - "contentHash": "sha256:64563fbc6ee416025b555c14cf3c517c5027bfc112a883078cc717ed471c5b52" - }, - { - "path": "common/data/src/main/java/org/thingsboard/server/common/data/notification/targets/platform/UserRoleFilter.java", - "header": "pe-only", - "reason": "PE-specific data/configuration type UserRoleFilter.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/notification/targets/platform/UserListFilter.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob e0adb26d59bf493b3e53444327c6da6255806853).", - "contentHash": "sha256:007e94e798f25a9d0ccd1716b8a68eada4fe3ced71e531bd0538c2c56e24ecb7" - }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/permission/Operation.java", "header": "ce-modified", @@ -487,135 +451,87 @@ "reason": "Reviewed relocation from application/src/main/java/org/thingsboard/server/service/security/permission/Resource.java in PE commit d97b2f71224e96c27fbdf287f592a08b6fa0407b. The source exists in shared CE ancestry 4c2aa4a60368318eafc2dea155b93721668654c4. The relocated CE permission enum has PE permission/group extensions. Compared with CE fa82445a7078506defbaadc5bea07227dc1b016d (blob d8b4dd8f4ef95df06ba22fd584813f437a8b453a); a move alone does not imply PE authorship.", "contentHash": "sha256:635cb50f3945d1bca662a7100a6129bea1270755bf4fe7cd6bc9849f228a4f08" }, - { - "path": "common/data/src/main/java/org/thingsboard/server/common/data/query/EntityGroupListFilter.java", - "header": "pe-only", - "reason": "PE-specific data/configuration type EntityGroupListFilter.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/query/EntityListFilter.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 43feb031908aaabba3677d8bc78aaa814bb03010).", - "contentHash": "sha256:7c6b5eaa41feb8a6e50e808da65c682b2b28e9b8736510fd50e5371f0856c91e" - }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/query/EntityGroupNameFilter.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type EntityGroupNameFilter.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/query/EntityNameFilter.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob a3889bc7c07de44917eac165a9c4e8578bbbcd62).", "contentHash": "sha256:46cc0073210fb81fb1a71f44604042da6056f78f62468cf45bdc78cdaf8cdd09" }, - { - "path": "common/data/src/main/java/org/thingsboard/server/common/data/query/StateEntityFilter.java", - "header": "pe-only", - "reason": "PE-specific data/configuration type StateEntityFilter.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/query/SingleEntityFilter.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 046f86f4146154859564ad3aa69aa84aadc47139).", - "contentHash": "sha256:46835b82b0320007209a5d53528f9fdb534af41c2fcb5a528754c316c530394a" - }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/query/StateEntityOwnerFilter.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type StateEntityOwnerFilter.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/query/SingleEntityFilter.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 046f86f4146154859564ad3aa69aa84aadc47139).", "contentHash": "sha256:7a975a7d8a09186888ef9c4bda1153d9a07b0e05a7229b05d1fd949fc969dc76" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/report/configuration/AlarmFilterConfig.java", - "header": "pe-only", + "header": "busl", "reason": "PE-specific data/configuration type AlarmFilterConfig.java. Reviewed fields, type discriminators and serialization hooks describe PE entities or PE behavior; matching CE types supply only the common DTO/interface pattern. Resolved as PE-authored consistently with the maintainer decision for PE entity wrappers. Reviewed candidate common/data/src/main/java/org/thingsboard/server/common/data/query/AlarmCountQuery.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 77003a9452ddada65e857f343fcdb952a16b88c9).", "contentHash": "sha256:96317b71595643540f2a5311ab9328e88a54e764fa56d9ba36b8be48a6af69de" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/setup/LicenseClaimInfo.java", - "header": "pe-only", + "header": "busl", "reason": "New PE DTO for in-product license activation, added with the setup flow in 973423dc272. The only similarity to CE common/data/src/main/java/org/thingsboard/server/common/data/TbProperty.java is Lombok annotation boilerplate.", "contentHash": "sha256:b3e742bbbe86fc3f050320c7f84a4db986130d94db0648384b8138b8f0a30b23" }, { "path": "common/data/src/main/java/org/thingsboard/server/common/data/setup/SetupInfo.java", - "header": "pe-only", + "header": "busl", "reason": "New PE DTO for the first-time system setup state, added with the setup flow in 973423dc272. The only similarity to CE common/data/src/main/java/org/thingsboard/server/common/data/TbProperty.java is Lombok annotation boilerplate.", "contentHash": "sha256:270369239ea8a5fac515ab759903b9f993268b5d32cf830afcb210cba1783a97" }, - { - "path": "common/data/src/main/java/org/thingsboard/server/exception/DataValidationException.java", - "header": "ce-modified", - "reason": "Reviewed relocation from dao/src/main/java/org/thingsboard/server/dao/exception/DataValidationException.java in PE commit 18bb4e5323c87f26fbad43ef7e9f31bf4181e705. The source exists in shared CE ancestry ec7e2852728a6f24f94e40fc6a10e63a4931d320. Package declaration changed; current implementation otherwise matches the CE counterpart. Compared with CE fa82445a7078506defbaadc5bea07227dc1b016d (blob f9f807e380305778913dd9a6cf97529c05191a83); a move alone does not imply PE authorship.", - "contentHash": "sha256:0797bc8471f7ac22635688b1590dbced0ec2c191daa64bd0fc76a8bb64eb4f31" - }, { "path": "common/integration/cluster-integration-api/src/main/java/org/thingsboard/server/service/integration/downlink/DownlinkCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate common/cache/src/main/java/org/thingsboard/server/cache/user/UserCaffeineCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 3eb9c3f16f619210d6ccdf4e3084ee36ec954796).", "contentHash": "sha256:a9d0227cd25ad5c855d8c7c44096974883ab975cc518ead6c816e6d8d5710621" }, { "path": "common/integration/cluster-integration-api/src/main/java/org/thingsboard/server/service/integration/downlink/DownlinkRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/relation/RelationRedisCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 11ef52d606360951413466ee2ae966f8f7a0181b).", "contentHash": "sha256:d354b1117c635eefc6d2abd6ca574ef2f738cdf06b52fa2c92a64548f5826973" }, { "path": "common/integration/integration-api/src/main/java/org/thingsboard/integration/api/util/ExceptionUtil.java", - "header": "pe-only", + "header": "busl", "reason": "The PE integration utility was introduced in e3e90e9a96a9ade8e4dc8f97dccd9e6c4b71a839 (2021-11-03), before the matching common/util CE path appeared on the selected mainline in 95f07b39942 (2023-08-15). The later CE match does not establish that this PE utility was inherited from that CE path. Reviewed CE candidate common/util/src/main/java/org/thingsboard/common/util/ExceptionUtil.java at 95f07b39942cdf63d6cb8c95b05d2abe9de2601e (blob 2ec15f3724b7eaa46d5016485d087535570cdb4e).", "contentHash": "sha256:694f9344df39779e731ca8bced08184b4d364b172f7da9b4a3050a1b851c3d37" }, { "path": "common/integration/integration-api/src/main/java/org/thingsboard/integration/api/util/TbIntegrationExecutorOrIntegrationComponent.java", - "header": "pe-only", + "header": "busl", "reason": "PE service activation annotation. Conditional component wiring identifies PE integration processes; shared Spring annotation syntax is launch scaffolding, which the maintainer resolved as PE-only. Reviewed similarity candidate common/queue/src/main/java/org/thingsboard/server/queue/util/TbCoreComponent.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 224f52fb329eedd5b6be37d9625c17f81032086c).", "contentHash": "sha256:2532fe77ca3458baffa12c317daff7af64e72ae3b74509dbf4ca7295378e2417" }, - { - "path": "common/integration/mqtt-integrations/src/main/java/org/thingsboard/integration/mqtt/azure/AzureIotHubSasCredentials.java", - "header": "pe-only", - "reason": "New PE file implementing a PE feature. It was written by adapting CE rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/azure/AzureIotHubSasCredentials.java, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", - "contentHash": "sha256:8e35a5cf2c10fcfa6a922a60aabdd0864358dc9efdc73f6db76eab58153cb9c0" - }, - { - "path": "common/integration/mqtt-integrations/src/main/java/org/thingsboard/integration/mqtt/credentials/AnonymousCredentials.java", - "header": "pe-only", - "reason": "The MQTT integration credential family originated in PE application/service/integration/mqtt in d601117d0fa (2017-12-25) and moved into the integration module in 72a187ee116 (2019-06-11). The matching CE rule-engine family appeared later on the selected CE mainline in 9fce3e068e4 (2018-05-28); this is retained PE integration code. Reviewed CE candidate rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/credentials/AnonymousCredentials.java at 1265a9a1e364aed339377b05f93354f01fa949f5 (blob dfbba93de5a7c073e09582db5ffae79f02fa8df4).", - "contentHash": "sha256:eb7bf7aaa4d8670c119c148af47fabfe66edbe3c544d0a04185a3943ff090d71" - }, - { - "path": "common/integration/mqtt-integrations/src/main/java/org/thingsboard/integration/mqtt/credentials/BasicCredentials.java", - "header": "pe-only", - "reason": "Retained PE MQTT integration credentials from the original application/service/integration/mqtt credential family, moved into common/integration by 72a187ee116. The later CE rule-engine credential counterpart is not evidence that the earlier PE integration family was inherited from CE. Reviewed CE candidate rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/credentials/BasicCredentials.java at 1265a9a1e364aed339377b05f93354f01fa949f5 (blob 9674115d7572c1b3d9eee2015dc73de4b6ca555c).", - "contentHash": "sha256:5523afe4ef62be834ceba35909248ebcaf85b657d765c536376273aae6e50126" - }, { "path": "common/integration/mqtt-integrations/src/main/java/org/thingsboard/integration/mqtt/credentials/CertPemClientCredentials.java", - "header": "pe-only", + "header": "busl", "reason": "Retained PE MQTT integration client-certificate credentials from the original integration credential family. Similar CE rule-engine credential implementations do not establish CE origin for that earlier PE family; PE supplies its client-certificate configuration. Reviewed CE candidate rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/credentials/CertPemCredentials.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 46d844d2c4aff3d5af24802dfee974f0af416113).", "contentHash": "sha256:d4ae03b84f499bede7580d21ed131995793ee01d9a5bbd602f48a1a47325e896" }, - { - "path": "common/integration/mqtt-integrations/src/main/java/org/thingsboard/integration/mqtt/credentials/MqttClientCredentials.java", - "header": "pe-only", - "reason": "PE integration credential interface and subtype registration, retained from the integration family introduced in d601117d0fa before its CE rule-engine counterpart. Its Jackson subtype declarations identify PE integration credential implementations. Reviewed CE candidate rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/credentials/MqttClientCredentials.java at c041b3f44d100acf6289bc0a8f4004f9854f533e^1 (blob 1c397614ea5a08d5caf132dcd3b22c08e9194b0e).", - "contentHash": "sha256:e5bf626f0429ecf2aee0a251d48ce96338d726271ab78fd3dcbdd5060f6a52cc" - }, - { - "path": "common/queue/src/main/java/org/thingsboard/server/queue/provider/KafkaTbIntegrationExecutorQueueFactory.java", - "header": "pe-only", - "reason": "New PE file implementing a PE feature. It was written by adapting CE common/queue/src/main/java/org/thingsboard/server/queue/provider/KafkaTbRuleEngineQueueFactory.java, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", - "contentHash": "sha256:23520476f4bc1b69a96abb6fc37d5988d00ef874d7bc769be4b60c316926d1dc" - }, { "path": "common/queue/src/main/java/org/thingsboard/server/queue/settings/TbQueueIntegrationApiSettings.java", - "header": "pe-only", + "header": "busl", "reason": "Configuration value holder for the PE integration API queue. Shared Spring property/queue-settings syntax is PE service scaffolding; it does not establish inheritance from transport API settings. Reviewed candidate common/queue/src/main/java/org/thingsboard/server/queue/settings/TbQueueTransportApiSettings.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 2cf2465e0489576f87dbbf9eb58928aac4964682).", "contentHash": "sha256:824e280c760c6765eb5a18c10497e001aec3e1dc2c4c3bd78a7de3c771675dec" }, { "path": "common/queue/src/main/java/org/thingsboard/server/queue/util/TbCoreOrIntegrationExecutorComponent.java", - "header": "pe-only", + "header": "busl", "reason": "PE service activation annotation. Conditional component wiring identifies PE integration processes; shared Spring annotation syntax is launch scaffolding, which the maintainer resolved as PE-only. Reviewed similarity candidate common/queue/src/main/java/org/thingsboard/server/queue/util/TbCoreComponent.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 224f52fb329eedd5b6be37d9625c17f81032086c).", "contentHash": "sha256:a947f906aa032b9d76b794ec6e0a1efa7e0738f2be7d53306b71b02652e73095" }, { "path": "common/queue/src/main/java/org/thingsboard/server/queue/util/TbIntegrationComponent.java", - "header": "pe-only", + "header": "busl", "reason": "PE service activation annotation. Conditional component wiring identifies PE integration processes; shared Spring annotation syntax is launch scaffolding, which the maintainer resolved as PE-only. Reviewed similarity candidate common/queue/src/main/java/org/thingsboard/server/queue/util/TbCoreComponent.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 224f52fb329eedd5b6be37d9625c17f81032086c).", "contentHash": "sha256:9b51d060dbba0e2955286a26aedea80c0f90321c80256028f28e543098cbd9f7" }, { "path": "common/queue/src/main/java/org/thingsboard/server/queue/util/TbIntegrationExecutorComponent.java", - "header": "pe-only", + "header": "busl", "reason": "PE service activation annotation. Conditional component wiring identifies PE integration processes; shared Spring annotation syntax is launch scaffolding, which the maintainer resolved as PE-only. Reviewed similarity candidate common/queue/src/main/java/org/thingsboard/server/queue/util/TbCoreComponent.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 224f52fb329eedd5b6be37d9625c17f81032086c).", "contentHash": "sha256:ab1938bf307d633bebb4653d4ad2ed7d9da046e3c52ed4feb5eefca2fa21542b" }, @@ -637,93 +553,69 @@ "reason": "PE moved/copied the CE CSV parsing utility and added report CSV generation. The parseCsv implementation is retained, with a different package and additional output support. Reviewed CE candidate application/src/main/java/org/thingsboard/server/utils/CsvUtils.java at a203c336f11265de3c4a6317496749d499930f86 (blob a40b41955ded5c67a0cb29b9733e3f1010d552c3). The current normalized PE body differs from the selected CE counterpart.", "contentHash": "sha256:b8053ea556c7f0c3208c6113358952109653bdc53101db3946925d2ba26dd750" }, - { - "path": "common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/downlink/DefaultLwM2mDownlinkMsgHandler.java", - "header": "apache", - "reason": "Unmodified CE code from CE master, not yet in CE lts-4.4. Byte-identical to CE master 3150f863b7952d723ffb3a62ffbc0116946c2000 (blob ef9aae62ad67fc8d60e66af779021eb96bdb6aff). Brought by the LwM2M fixes thingsboard/thingsboard#15962 and #16095, merged into CE master after CE lts-4.4 forked on 2026-08-06; PE lts-4.4 inherited them from PE master, where thingsboard-pe#5090 already stamped them apache. Remove this entry once CE lts-4.4 contains these commits.", - "contentHash": "sha256:d43ecbef2a4359efc743e64f7ef50a596428164fa3f174694b25ab32bc9938dd" - }, - { - "path": "common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/utils/LwM2MTransportUtil.java", - "header": "apache", - "reason": "Unmodified CE code from CE master, not yet in CE lts-4.4. Byte-identical to CE master 3150f863b7952d723ffb3a62ffbc0116946c2000 (blob 562707bd1708e52c3edfb66dcb8d3daf4368401e). Brought by the LwM2M fixes thingsboard/thingsboard#15962 and #16095, merged into CE master after CE lts-4.4 forked on 2026-08-06; PE lts-4.4 inherited them from PE master, where thingsboard-pe#5090 already stamped them apache. Remove this entry once CE lts-4.4 contains these commits.", - "contentHash": "sha256:19e816d5cc7a39f62fd08c7fedd4fa26ffe9343c2f5b70f8ae711ef23a0cf210" - }, - { - "path": "common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/utils/LwM2mValueConverterImpl.java", - "header": "apache", - "reason": "Unmodified CE code from CE master, not yet in CE lts-4.4. Byte-identical to CE master 3150f863b7952d723ffb3a62ffbc0116946c2000 (blob 6f958ede4a33f6ffdcd7001438147c467cc139f8). Brought by the LwM2M fixes thingsboard/thingsboard#15962 and #16095, merged into CE master after CE lts-4.4 forked on 2026-08-06; PE lts-4.4 inherited them from PE master, where thingsboard-pe#5090 already stamped them apache. Remove this entry once CE lts-4.4 contains these commits.", - "contentHash": "sha256:15786a30ae24809a8e14a3683efd1439485948b2c222d0b0eaf2cdfc88310d77" - }, - { - "path": "common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/util/JsonUtils.java", - "header": "apache", - "reason": "Unmodified CE code from CE master, not yet in CE lts-4.4. Byte-identical to CE master 3150f863b7952d723ffb3a62ffbc0116946c2000 (blob 83f2b53f632a9cf709c38a4cebca4d20a112c627). Brought by the LwM2M fixes thingsboard/thingsboard#15962 and #16095, merged into CE master after CE lts-4.4 forked on 2026-08-06; PE lts-4.4 inherited them from PE master, where thingsboard-pe#5090 already stamped them apache. Remove this entry once CE lts-4.4 contains these commits.", - "contentHash": "sha256:6433bb1de8e359136d111382b3ec6c571aadb446a66bd802b13b91ab14503e1c" - }, { "path": "dao/src/main/java/org/thingsboard/server/dao/agent/AgentSessionCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache added in 0860d0b3960 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE common/cache/src/main/java/org/thingsboard/server/cache/edge/RelatedEdgesCaffeineCache.java shares only the Caffeine or Redis cache boilerplate and caches a different key and value type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 5227ae6ab4b).", "contentHash": "sha256:aafceb8b51bf36086486d42fda7a649a641d5f445d98c7a15ff8ad02bdabbac2" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/agent/AgentSessionRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE agent cache added in 0860d0b3960 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE common/cache/src/main/java/org/thingsboard/server/cache/edge/RelatedEdgesRedisCache.java shares only the Caffeine or Redis cache boilerplate and caches a different key and value type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 992d730c040).", "contentHash": "sha256:fec697d4d3b9bef98b9bc70409c3686ba113e3b105648ce50b5b9d11bd9a56dd" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/alarm/AlarmTypeNamesCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE alarm type names cache added in 96e98fab02d (PR #4809), a new cache of HashSet per tenant. The candidate CE TenantExistsCaffeineCache.java shares only the Caffeine cache boilerplate. Reviewed candidate at 317a75614137ab5ddd1aecef1abd4c2fcdcb8710 (blob 3012eba487d).", "contentHash": "sha256:45395fcd7c6fe21de78753964c237c0eca266b98fb45585a2c93db4127ac9ffe" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/alarm/AlarmTypeNamesRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "PE alarm type names cache added in 96e98fab02d (PR #4809), a new cache of HashSet per tenant. The candidate CE AlarmTypesRedisCache.java shares only the Redis cache boilerplate and caches a different value type. Reviewed candidate at 317a75614137ab5ddd1aecef1abd4c2fcdcb8710 (blob 5a194f53c90).", "contentHash": "sha256:b81968eeb66338075a41b39a4cc23969afc1549034ec8d22ee271db558ecabd3" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/group/EntityGroupCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate application/src/main/java/org/thingsboard/server/service/sync/vc/VersionControlTaskCaffeineCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d234314aee9f02efb853f0a3372f9e0de1b7869c).", "contentHash": "sha256:56211a47297025cb13f32ff0084ff83a05c2ab9867d8899c75f1864091146719" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/group/EntityGroupRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/edge/EdgeSessionRedisCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 5815e6a2b12e512aee3840fcf5854cd7a356323c).", "contentHash": "sha256:83d5b9463bc6c4ea25507b3b39bfe2f8074aee086d3bca6fded23c1b5be051f5" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/integration/IntegrationCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/asset/AssetProfileCaffeineCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob b8f7ffb2999a137d289e9770a5bba49cfc8d2586).", "contentHash": "sha256:362ff6b017d0194cca8a0c5dea141f6dededb69bf869bc5bfafdc5c3d4ce6352" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/integration/IntegrationRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/edge/EdgeSessionRedisCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 5815e6a2b12e512aee3840fcf5854cd7a356323c).", "contentHash": "sha256:5b0efbb6186386c04a4e3a3b945bb14a5076da308219b7605db4b3ed8614cda1" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/mail/MailOauth2StateCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/tenant/TenantExistsCaffeineCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 3012eba487d178cfd04ae4daa8836ff3c682fc10).", "contentHash": "sha256:1e3416c13ff454bf0a715e2077eb8319f0c2e2486d55dfee545335787d723f05" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/mail/MailOauth2StateRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardTitlesRedisCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 4c1bf7dedbe2011e9e4f64438b54abfb13c5ea9c).", "contentHash": "sha256:0b87f32876ccabf2e3556ca55a2601069df02cffb5176c9401b5dcfb950d2ec5" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/menu/CustomMenuRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/ota/OtaPackageRedisCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob f6d3be49ad455d23778055b73a2b4e173b6af2e6).", "contentHash": "sha256:cbb54a6efdf2def2c28508ac213452548f0ddb86d39f3680dad3f4eb89dd5014" }, @@ -747,73 +639,67 @@ }, { "path": "dao/src/main/java/org/thingsboard/server/dao/model/sql/RawDataEventEntity.java", - "header": "pe-only", + "header": "busl", "reason": "PE raw-event persistence mapping. Fields, event type and construction of RawDataEvent implement the PE event model; shared EventEntity/JPA boilerplate is a template pattern rather than a relocated CE entity. Reviewed candidate dao/src/main/java/org/thingsboard/server/dao/model/sql/RuleChainDebugEventEntity.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob aaf7ff2b6e51339993941058855269fd4d9bdc57).", "contentHash": "sha256:cfa8ba902a093c7d70c5feade1a9b234d138f4732999ceb7c171db66d36d5cde" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/role/RoleCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/entityview/EntityViewCaffeineCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 2c6fa38067b1eb54a9ffe38403aa468e3b7a969b).", "contentHash": "sha256:12900991af3126054c70c7728f7eca028d7d99be2012327bec5d8f1c92de8950" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/role/RoleRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate common/cache/src/main/java/org/thingsboard/server/cache/user/UserRedisCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d29adee75fa437835aff754e546988e96634462b).", "contentHash": "sha256:c7655f346e31d8246589338841e355e26e2214b7756cb1df86182c1b94904b96" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/sql/encryptionkey/EncryptionKeyRepository.java", - "header": "pe-only", + "header": "busl", "reason": "PE persistence interface EncryptionKeyRepository.java. Reviewed Spring Data declarations/query bindings target PE entities and event tables; shared repository declaration/query conventions do not establish CE file lineage. Reviewed candidate dao/src/main/java/org/thingsboard/server/dao/sql/mobile/QrCodeSettingsRepository.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 1c3698a65321ae135c121273cffad1823037efc6).", "contentHash": "sha256:2f21444816a51a96ca08b86deaae88752cd06a15ed77090bd23d95c2322c8237" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/sql/event/ConverterDebugEventRepository.java", - "header": "pe-only", + "header": "busl", "reason": "PE persistence interface ConverterDebugEventRepository.java. Reviewed Spring Data declarations/query bindings target PE entities and event tables; shared repository declaration/query conventions do not establish CE file lineage. Reviewed candidate dao/src/main/java/org/thingsboard/server/dao/sql/event/RuleChainDebugEventRepository.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d78a927584d361e4e493b0350deea08e0cbcffae).", "contentHash": "sha256:127aa93c838e333ee9cfd46ff9d7cc3115a4c2fae494e15c164ba48f3b1f5ce2" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/sql/event/IntegrationDebugEventRepository.java", - "header": "pe-only", + "header": "busl", "reason": "PE persistence interface IntegrationDebugEventRepository.java. Reviewed Spring Data declarations/query bindings target PE entities and event tables; shared repository declaration/query conventions do not establish CE file lineage. Reviewed candidate dao/src/main/java/org/thingsboard/server/dao/sql/event/RuleChainDebugEventRepository.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d78a927584d361e4e493b0350deea08e0cbcffae).", "contentHash": "sha256:0811f9b5587cd522b098029ffeda922cbcb787d9559b9de95ca5c96df73bcc9b" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/sql/event/RawEventRepository.java", - "header": "pe-only", + "header": "busl", "reason": "PE persistence interface RawEventRepository.java. Reviewed Spring Data declarations/query bindings target PE entities and event tables; shared repository declaration/query conventions do not establish CE file lineage. Reviewed candidate dao/src/main/java/org/thingsboard/server/dao/sql/event/ErrorEventRepository.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob bed19b008d18634d8e4c35fcbe059bad3a51ae51).", "contentHash": "sha256:a89153896cfac844fdc9747b211715273fbdb3ec57e368df2537a6e9c8178b3e" }, - { - "path": "dao/src/main/java/org/thingsboard/server/dao/sql/secret/SecretRepository.java", - "header": "pe-only", - "reason": "PE persistence interface SecretRepository.java. Reviewed Spring Data declarations/query bindings target PE entities and event tables; shared repository declaration/query conventions do not establish CE file lineage. Reviewed candidate dao/src/main/java/org/thingsboard/server/dao/sql/domain/DomainRepository.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob fc35b71fb97fa795345886a607a01cedac36b43a).", - "contentHash": "sha256:6eb360663c17d9dba72b69a858ca199c45644ea63c2a9519c1421e302479f2b5" - }, { "path": "dao/src/main/java/org/thingsboard/server/dao/translation/CustomTranslationRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsRedisCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob a3521a8e79ce09595ae48480d4883378af97510c).", "contentHash": "sha256:93b54abaf0465bfe2bdd36cabc3fce721d23136c0d2b107bd2c8de911f16b846" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/user/UserPermissionCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/user/UserSettingsCaffeineCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 3aee29656141d963210ac1fa2732fd7cc9ef4242).", "contentHash": "sha256:5922b2b6e7fff8efc57de90dd591617c6dd96697bda52ff820545aa80afe6311" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/wl/WhiteLabelingCaffeineCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/tenant/TenantProfileCaffeineCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 1cf96e785a610b8ddf08c3743ee8ccf1c94737b4).", "contentHash": "sha256:293c4b75b530ae131651fc0282a26695709f47d3d9a847d7cb04be880d2603e6" }, { "path": "dao/src/main/java/org/thingsboard/server/dao/wl/WhiteLabelingRedisCache.java", - "header": "pe-only", + "header": "busl", "reason": "Typed cache adapter for a PE feature. Reviewed as a new PE cache registration using the shared cache framework: service/cache identity and entity/key types are PE-specific. Constructor and Spring annotation overlap with CE cache adapters is framework template use, analogous to the maintainer-resolved PE entity ID wrappers. Reviewed similarity candidate dao/src/main/java/org/thingsboard/server/dao/tenant/TenantProfileRedisCache.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob b70176297a970343f9c824cb823d0a0ecfe19188).", "contentHash": "sha256:141ab2848c00ab580599bc175dee897549c7454633f13fa31e5feb203fb361b0" }, @@ -825,385 +711,373 @@ }, { "path": "integration/apache-pulsar/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:cf5c082afdeefe8e6a4d8194b55908e9fa169a048fa48583f1acbfa14772c5e9" }, { "path": "integration/apache-pulsar/src/main/conf/tb-apache-pulsar-integration.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/conf/tb-http-transport.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:7b979999dff4fd91053c080c1895b149887d7a65628c3fb1dda2594ba90f583d" }, { "path": "integration/apache-pulsar/src/main/java/org/thingsboard/integration/ThingsboardApachePulsarIntegrationApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:e936a600d1f54ca816ecd3ddf0a4b2b332067766655e2af824615f3d6bb27460" }, { "path": "integration/apache-pulsar/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/logback.xml at 850d6d948c27bcc1b1b2393aafb79ec509808ec8 (blob 1172a89c280eb41bc351a79184b4ec70f7746c20).", "contentHash": "sha256:5803e6b88326e4a0dd5c6a0d556bed085828104c2b8f5dd8370f444da7ec0875" }, { "path": "integration/aws/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:cf5c082afdeefe8e6a4d8194b55908e9fa169a048fa48583f1acbfa14772c5e9" }, { "path": "integration/aws/src/main/conf/tb-aws-integration.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/conf/tb-http-transport.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:7b979999dff4fd91053c080c1895b149887d7a65628c3fb1dda2594ba90f583d" }, { "path": "integration/aws/src/main/java/org/thingsboard/integration/ThingsboardAwsSqsIntegrationApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:6db6655a9081907a488c37863bcfee9caf51580cf50a4f67ccfeb7b9306eee99" }, { "path": "integration/aws/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/logback.xml at 850d6d948c27bcc1b1b2393aafb79ec509808ec8 (blob 1172a89c280eb41bc351a79184b4ec70f7746c20).", "contentHash": "sha256:5803e6b88326e4a0dd5c6a0d556bed085828104c2b8f5dd8370f444da7ec0875" }, { "path": "integration/azure/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:cf5c082afdeefe8e6a4d8194b55908e9fa169a048fa48583f1acbfa14772c5e9" }, { "path": "integration/azure/src/main/conf/tb-azure-integration.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/conf/tb-http-transport.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:7b979999dff4fd91053c080c1895b149887d7a65628c3fb1dda2594ba90f583d" }, { "path": "integration/azure/src/main/java/org/thingsboard/integration/ThingsboardAzureIntegrationApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:25141e16043e4890a099837f6aca125b5d67726ad7b14886b88b289493d38292" }, { "path": "integration/azure/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/logback.xml at 850d6d948c27bcc1b1b2393aafb79ec509808ec8 (blob 1172a89c280eb41bc351a79184b4ec70f7746c20).", "contentHash": "sha256:5803e6b88326e4a0dd5c6a0d556bed085828104c2b8f5dd8370f444da7ec0875" }, { "path": "integration/coap/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:cf5c082afdeefe8e6a4d8194b55908e9fa169a048fa48583f1acbfa14772c5e9" }, { "path": "integration/coap/src/main/conf/tb-coap-integration.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/conf/tb-http-transport.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:7b979999dff4fd91053c080c1895b149887d7a65628c3fb1dda2594ba90f583d" }, { "path": "integration/coap/src/main/java/org/thingsboard/integration/ThingsboardCoapIntegrationApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:691ed1e7c96845e81ccfdcf522c836794f4045180c74d50be1613122517397c4" }, { "path": "integration/coap/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/logback.xml at 850d6d948c27bcc1b1b2393aafb79ec509808ec8 (blob 1172a89c280eb41bc351a79184b4ec70f7746c20).", "contentHash": "sha256:5803e6b88326e4a0dd5c6a0d556bed085828104c2b8f5dd8370f444da7ec0875" }, { "path": "integration/executor/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate msa/tb/docker/logback.xml at 64332ecaa07735ee5bc6e5d7e644cf0aec396dd8 (blob 01fc5d30a832ee07355a38acf32823b3dd1b9e34).", "contentHash": "sha256:3771054bb15eb923916b680806c34710c166152c75e02180ebe5d59c119d3e11" }, { "path": "integration/executor/src/main/conf/tb-integration-executor.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate msa/vc-executor/src/main/conf/tb-vc-executor.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:07b101062bdea0f8e83c43bf23e31611b95e253320b7764d6be3e50c2a1a3578" }, { "path": "integration/executor/src/main/java/org/thingsboard/integration/ThingsboardIntegrationExecutorApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:e90986dc965608a6880ae3af8dbf5ffb1c0c980f6237f274cddbaf68daf557f1" }, - { - "path": "integration/executor/src/main/java/org/thingsboard/integration/service/IntegrationQueueRoutingInfoService.java", - "header": "pe-only", - "reason": "PE integration-executor wiring: this dummy routing implementation returns no rule-engine queues/routing because the integration executor does not produce rule-engine messages. Shared service-interface syntax is PE launch scaffolding. Reviewed candidate msa/vc-executor/src/main/java/org/thingsboard/server/vc/service/VersionControlQueueRoutingInfoService.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 5ad54b92f7318c9b181ba7ccbbf65d14e3fa5558).", - "contentHash": "sha256:6f249d1322eaf2d54074772efa5467c8ce5a77353d7ea6c05ee12057b37831cf" - }, { "path": "integration/executor/src/main/java/org/thingsboard/integration/service/IntegrationTenantRoutingInfoService.java", - "header": "pe-only", + "header": "busl", "reason": "PE integration-executor wiring: this dummy routing implementation returns no rule-engine queues/routing because the integration executor does not produce rule-engine messages. Shared service-interface syntax is PE launch scaffolding. Reviewed candidate msa/vc-executor/src/main/java/org/thingsboard/server/vc/service/VersionControlTenantRoutingInfoService.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 397eecf629f9b8296ad846d71a7a971006b25d3d).", "contentHash": "sha256:e1059ec007348a1020278d34ee67613d814d16d639c1c27e5f731fddfb0e4299" }, { "path": "integration/executor/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate msa/vc-executor/src/main/resources/logback.xml at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob c868af4b6c1fbb8e65d18387d577ddf5d8c9dd71).", "contentHash": "sha256:82f1e20adbaeadfe9fcc4b5fa65580e48cbf26d39dd0e8bd205db3bfb2842b7b" }, - { - "path": "integration/executor/src/main/resources/tb-integration-executor.yml", - "header": "pe-only", - "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/tb-coap-transport.yml at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob f9909e5fdc19ee9137cbbb45d775c72337a106c5).", - "contentHash": "sha256:6c0f39b89e3c6ede1649cebaa652ebe06f8680c157b2e85d1788bd4fb777c138" - }, { "path": "integration/http/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:cf5c082afdeefe8e6a4d8194b55908e9fa169a048fa48583f1acbfa14772c5e9" }, { "path": "integration/http/src/main/conf/tb-http-integration.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/conf/tb-http-transport.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:7b979999dff4fd91053c080c1895b149887d7a65628c3fb1dda2594ba90f583d" }, { "path": "integration/http/src/main/java/org/thingsboard/integration/ThingsboardHttpIntegrationApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:59f8ead9c9b6253a580f01a239eda2ccc43a851aeebaec97a37d23230ab66ef3" }, { "path": "integration/http/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/logback.xml at 850d6d948c27bcc1b1b2393aafb79ec509808ec8 (blob 1172a89c280eb41bc351a79184b4ec70f7746c20).", "contentHash": "sha256:5803e6b88326e4a0dd5c6a0d556bed085828104c2b8f5dd8370f444da7ec0875" }, { "path": "integration/kafka/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:cf5c082afdeefe8e6a4d8194b55908e9fa169a048fa48583f1acbfa14772c5e9" }, { "path": "integration/kafka/src/main/conf/tb-kafka-integration.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/conf/tb-http-transport.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:7b979999dff4fd91053c080c1895b149887d7a65628c3fb1dda2594ba90f583d" }, { "path": "integration/kafka/src/main/java/org.thingsboard.integration/ThingsboardKafkaIntegrationApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:27244242d6347081f7df657de86a0094141fcd531d19c23ea05598662274c393" }, { "path": "integration/kafka/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/logback.xml at 850d6d948c27bcc1b1b2393aafb79ec509808ec8 (blob 1172a89c280eb41bc351a79184b4ec70f7746c20).", "contentHash": "sha256:5803e6b88326e4a0dd5c6a0d556bed085828104c2b8f5dd8370f444da7ec0875" }, { "path": "integration/mqtt/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:cf5c082afdeefe8e6a4d8194b55908e9fa169a048fa48583f1acbfa14772c5e9" }, { "path": "integration/mqtt/src/main/conf/tb-mqtt-integration.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/conf/tb-http-transport.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:7b979999dff4fd91053c080c1895b149887d7a65628c3fb1dda2594ba90f583d" }, { "path": "integration/mqtt/src/main/java/org/thingsboard/integration/ThingsboardMqttIntegrationApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:d86b071123017296f700b39fd782125f3781f752000e7b682f5b5d19b47ca786" }, { "path": "integration/mqtt/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/logback.xml at 850d6d948c27bcc1b1b2393aafb79ec509808ec8 (blob 1172a89c280eb41bc351a79184b4ec70f7746c20).", "contentHash": "sha256:5803e6b88326e4a0dd5c6a0d556bed085828104c2b8f5dd8370f444da7ec0875" }, { "path": "integration/opc-ua/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:cf5c082afdeefe8e6a4d8194b55908e9fa169a048fa48583f1acbfa14772c5e9" }, { "path": "integration/opc-ua/src/main/conf/tb-opc-ua-integration.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/conf/tb-http-transport.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:7b979999dff4fd91053c080c1895b149887d7a65628c3fb1dda2594ba90f583d" }, { "path": "integration/opc-ua/src/main/java/org/thingsboard/integration/ThingsboardOpcUaIntegrationApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:90d84265a8162ad0c7a41af520eea332d30860b6b7bc5b7fc1bbd26a0b79a872" }, { "path": "integration/opc-ua/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/logback.xml at 850d6d948c27bcc1b1b2393aafb79ec509808ec8 (blob 1172a89c280eb41bc351a79184b4ec70f7746c20).", "contentHash": "sha256:5803e6b88326e4a0dd5c6a0d556bed085828104c2b8f5dd8370f444da7ec0875" }, { "path": "integration/pubsub/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:cf5c082afdeefe8e6a4d8194b55908e9fa169a048fa48583f1acbfa14772c5e9" }, { "path": "integration/pubsub/src/main/conf/tb-pubsub-integration.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/conf/tb-http-transport.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:7b979999dff4fd91053c080c1895b149887d7a65628c3fb1dda2594ba90f583d" }, { "path": "integration/pubsub/src/main/java/org.thingsboard.integration/ThingsboardPubsubIntegrationApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:3094ee2d2c68ec0d8a9408c94fc0e0a4b10ce509a13c017f87863ca5dc16cf7a" }, { "path": "integration/pubsub/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/logback.xml at 850d6d948c27bcc1b1b2393aafb79ec509808ec8 (blob 1172a89c280eb41bc351a79184b4ec70f7746c20).", "contentHash": "sha256:5803e6b88326e4a0dd5c6a0d556bed085828104c2b8f5dd8370f444da7ec0875" }, { "path": "integration/rabbitmq/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:cf5c082afdeefe8e6a4d8194b55908e9fa169a048fa48583f1acbfa14772c5e9" }, { "path": "integration/rabbitmq/src/main/conf/tb-rabbitmq-integration.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/conf/tb-http-transport.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:7b979999dff4fd91053c080c1895b149887d7a65628c3fb1dda2594ba90f583d" }, { "path": "integration/rabbitmq/src/main/java/org.thingsboard.integration/ThingsboardRabbitMQIntegrationApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:ed34f503030a866f28185e57e49f587c0d9e60ac920b8d1f04f70a92709f1be9" }, { "path": "integration/rabbitmq/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/logback.xml at 850d6d948c27bcc1b1b2393aafb79ec509808ec8 (blob 1172a89c280eb41bc351a79184b4ec70f7746c20).", "contentHash": "sha256:5803e6b88326e4a0dd5c6a0d556bed085828104c2b8f5dd8370f444da7ec0875" }, { "path": "integration/tcp-udp/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:cf5c082afdeefe8e6a4d8194b55908e9fa169a048fa48583f1acbfa14772c5e9" }, { "path": "integration/tcp-udp/src/main/conf/tb-tcp-udp-integration.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/conf/tb-http-transport.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:7b979999dff4fd91053c080c1895b149887d7a65628c3fb1dda2594ba90f583d" }, { "path": "integration/tcp-udp/src/main/java/org/thingsboard/integration/ThingsboardTcpUdpIntegrationApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:ee08452a0831c93e2a1ff1bfd94cb59555b98942fbdfcb4f380a7aba0560cd21" }, { "path": "integration/tcp-udp/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/logback.xml at 850d6d948c27bcc1b1b2393aafb79ec509808ec8 (blob 1172a89c280eb41bc351a79184b4ec70f7746c20).", "contentHash": "sha256:5803e6b88326e4a0dd5c6a0d556bed085828104c2b8f5dd8370f444da7ec0875" }, { "path": "integration/tuya/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:cf5c082afdeefe8e6a4d8194b55908e9fa169a048fa48583f1acbfa14772c5e9" }, { "path": "integration/tuya/src/main/conf/tb-tuya-integration.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/conf/tb-http-transport.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:7b979999dff4fd91053c080c1895b149887d7a65628c3fb1dda2594ba90f583d" }, { "path": "integration/tuya/src/main/java/org.thingsboard.integration/ThingsboardTuyaIntegrationApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/http/src/main/java/org/thingsboard/server/http/ThingsboardHttpTransportApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 98be09069a487befab217c9b7c036fc6132fc97b).", "contentHash": "sha256:4b2e581ef56329a1697517256829c3414da7c759db9584737583d09efe6c6cbf" }, { "path": "integration/tuya/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate transport/coap/src/main/resources/logback.xml at 850d6d948c27bcc1b1b2393aafb79ec509808ec8 (blob 1172a89c280eb41bc351a79184b4ec70f7746c20).", "contentHash": "sha256:5803e6b88326e4a0dd5c6a0d556bed085828104c2b8f5dd8370f444da7ec0875" }, { "path": "migrator/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate msa/black-box-tests/src/test/resources/logback.xml at 5cf26d485143c27f8d445a6f5c91d0d71dab69ec (blob 305a2d2df4890c446daf6a9d6a295aaa26a94b4f).", "contentHash": "sha256:48892851f4af439ea2710cb51547b6e19e498a845361081a13602da0cd0291ee" }, { "path": "migrator/src/main/conf/tb-migrator.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate msa/vc-executor/src/main/conf/tb-vc-executor.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:c0c3e9f37faf24271c879fe6da9f309ff0d1e79625a4c0f047f006f77186121a" }, { "path": "migrator/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate msa/black-box-tests/src/test/resources/logback.xml at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob ceb1aa9a969295acae909a08bc69335635994c08).", "contentHash": "sha256:2e3102a6f69e2a198581f84619160003dbee70b236b9782a6bcb44b3ff7c040a" }, { "path": "monitoring/src/main/java/org/thingsboard/monitoring/config/integration/IntegrationMonitoringTarget.java", - "header": "pe-only", + "header": "busl", "reason": "Data holder for PE integration-monitoring targets. Its integration/device configuration fields and simple interface accessors are a PE feature type, analogous to the maintainer-resolved PE entity wrappers. Reviewed CE candidate monitoring/src/main/java/org/thingsboard/monitoring/config/transport/TransportMonitoringTarget.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 7fa6ec3f461008043d90cdadec4d1bc18da2e238).", "contentHash": "sha256:25f4ef99a14df1d2e94444440be0ac3c78f11eab18b4fef95ba7045fea2659f2" }, { "path": "monitoring/src/main/java/org/thingsboard/monitoring/service/integration/impl/CoapIntegrationHealthChecker.java", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE monitoring/src/main/java/org/thingsboard/monitoring/service/transport/impl/CoapTransportHealthChecker.java, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:d052fff33aea9d375bbfa2c1655bc016a7d4232cc1aed77be9534dc23f6068e9" }, { "path": "monitoring/src/main/java/org/thingsboard/monitoring/service/integration/impl/HttpIntegrationHealthChecker.java", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE monitoring/src/main/java/org/thingsboard/monitoring/service/transport/impl/HttpTransportHealthChecker.java, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:7a4b0c71c3185997d717d3ff197f7734826141bb89347b054dd5277a5979e8da" }, { "path": "monitoring/src/main/java/org/thingsboard/monitoring/service/integration/impl/MqttIntegrationHealthChecker.java", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE monitoring/src/main/java/org/thingsboard/monitoring/service/transport/impl/MqttTransportHealthChecker.java, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:cb5c91b3db565f7378a2e4876568d438492c46dd212fb34a82fa99cb40a7ddf5" }, { "path": "msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomerEntityView.java", - "header": "pe-only", + "header": "busl", "reason": "New PE customer/entity-view UI scenario; shared TestNG/Selenium customer setup and navigation conventions do not make it the CE customer-user management test. Reviewed CE candidate msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersUsersTest.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 6207b643a76b1101e57a8ec3165f7e10e23289bc).", "contentHash": "sha256:0ad2805b0448e73070dc19dcd848470c213e0fb18da4b0798ab1021c9e311d1f" }, { "path": "msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomerGroupsTest.java", - "header": "pe-only", + "header": "busl", "reason": "New PE customer-group UI scenario. Groups are a PE feature; shared TestNG/Selenium setup and customer navigation are test scaffolding, not the candidate CE customer-user scenario. Reviewed CE candidate msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/tests/customerSmoke/ManageCustomersUsersTest.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 6207b643a76b1101e57a8ec3165f7e10e23289bc).", "contentHash": "sha256:d28050eb87aeb2e254427bec8b9a4a827d355624c867457f3ab8b05868ce89cd" }, @@ -1215,193 +1089,181 @@ }, { "path": "msa/black-box-tests/src/test/resources/advanced/mosquitto/mosquitto.conf", - "header": "pe-only", + "header": "busl", "reason": "PE integration-test broker fixture introduced in 295c81a3b6a (2021-11-01); the matching CE test path appeared later on this mainline in fb66d2fdfd8 (2024-01-10). Its two-line listener/anonymous-access configuration is test scaffolding, not meaningful proof of CE inheritance. Reviewed CE candidate msa/black-box-tests/src/test/resources/mosquitto/mosquitto.conf at fb66d2fdfd837cb094668e04355251269feadeac (blob 7136ad64b0374eac9f46beb35d033a2f97eeb448).", "contentHash": "sha256:b16ddb9bcfd179a9348c678e530e50924d8d678f2c9e1c05012deae7cb7969ea" }, { "path": "msa/black-box-tests/src/test/resources/black-box.xml", - "header": "pe-only", + "header": "busl", "reason": "PE black-box test setup and logging/suite configuration. This selects the PE test environment and scenarios using shared configuration syntax. Curated as PE-only test scaffolding consistently with the maintainer decision for PE module launch/logging files. Reviewed similarity candidate msa/black-box-tests/src/test/resources/connectivity.xml at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 7cd96bb429343ed9153b67281b1e48602beb28c7).", "contentHash": "sha256:2a0dca3720c2f97ea0c782b69e2ff574656838600f459b31ff2ccff857147695" }, { "path": "msa/black-box-tests/src/test/resources/solutionTemplates.xml", - "header": "pe-only", + "header": "busl", "reason": "PE black-box test setup and logging/suite configuration. This selects the PE test environment and scenarios using shared configuration syntax. Curated as PE-only test scaffolding consistently with the maintainer decision for PE module launch/logging files. Reviewed similarity candidate msa/black-box-tests/src/test/resources/smokeDevices.xml at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob cfcd51065f974c4474ffc02b1912edd5ae6e4ff9).", "contentHash": "sha256:9640476817a2a1ef28061a3694a4363984449f489c576385fe1528dd4a626dc0" }, { "path": "msa/black-box-tests/src/test/resources/tb-integration/coap/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "PE black-box test setup and logging/suite configuration. This selects the PE test environment and scenarios using shared configuration syntax. Curated as PE-only test scaffolding consistently with the maintainer decision for PE module launch/logging files. Reviewed similarity candidate docker/tb-transports/lwm2m/conf/logback.xml at 7667afaeae02ab3dcc6a8bb389ad6f0ab14cb441 (blob 199e138fc165b8522bc723ad1cd947fc927afeaa).", "contentHash": "sha256:34387c217c4f5832535c8e13006d9298af50daad948d9ec1f5e1d6b1592719e8" }, { "path": "msa/black-box-tests/src/test/resources/tb-integration/http/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "PE black-box test setup and logging/suite configuration. This selects the PE test environment and scenarios using shared configuration syntax. Curated as PE-only test scaffolding consistently with the maintainer decision for PE module launch/logging files. Reviewed similarity candidate docker/tb-transports/lwm2m/conf/logback.xml at 7667afaeae02ab3dcc6a8bb389ad6f0ab14cb441 (blob 199e138fc165b8522bc723ad1cd947fc927afeaa).", "contentHash": "sha256:0a3de0e8a98fdf8a8d2ded9be1d30617d15b6ac60868d9244752943264e02c13" }, { "path": "msa/black-box-tests/src/test/resources/tb-integration/mqtt/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "PE black-box test setup and logging/suite configuration. This selects the PE test environment and scenarios using shared configuration syntax. Curated as PE-only test scaffolding consistently with the maintainer decision for PE module launch/logging files. Reviewed similarity candidate docker/tb-transports/lwm2m/conf/logback.xml at 7667afaeae02ab3dcc6a8bb389ad6f0ab14cb441 (blob 199e138fc165b8522bc723ad1cd947fc927afeaa).", "contentHash": "sha256:e5c4bb50d6d47ad700882c8a243ba60b07919afb4cfafddcfa1bee26ac5af49e" }, { "path": "msa/black-box-tests/src/test/resources/tb-integration/tcp/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "PE black-box test setup and logging/suite configuration. This selects the PE test environment and scenarios using shared configuration syntax. Curated as PE-only test scaffolding consistently with the maintainer decision for PE module launch/logging files. Reviewed similarity candidate docker/tb-transports/lwm2m/conf/logback.xml at da4c74287216fc6962c74f084c2eedebf06e1a64 (blob d2485675ee170b4f4b050d055c7941d0dae5cc65).", "contentHash": "sha256:d39d097a880dc0286dbcf123ecd1c5f65dac7ebf5a955cffce09c2726279f936" }, { "path": "msa/black-box-tests/src/test/resources/tb-integration/udp/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "PE black-box test setup and logging/suite configuration. This selects the PE test environment and scenarios using shared configuration syntax. Curated as PE-only test scaffolding consistently with the maintainer decision for PE module launch/logging files. Reviewed similarity candidate docker/tb-transports/lwm2m/conf/logback.xml at da4c74287216fc6962c74f084c2eedebf06e1a64 (blob d2485675ee170b4f4b050d055c7941d0dae5cc65).", "contentHash": "sha256:d39d097a880dc0286dbcf123ecd1c5f65dac7ebf5a955cffce09c2726279f936" }, { "path": "msa/black-box-tests/src/test/resources/tb-transports/lwm2m.conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "PE black-box test setup and logging/suite configuration. This selects the PE test environment and scenarios using shared configuration syntax. Curated as PE-only test scaffolding consistently with the maintainer decision for PE module launch/logging files. Reviewed similarity candidate msa/black-box-tests/src/test/resources/tb-transports/http/conf/logback.xml at c5a72ed8dfc6d857521d270f43227eea14aae72c (blob 0408be6bd3d60dcb52ea33d848d59a64b9f05f4a).", "contentHash": "sha256:07215daf98184b8a76b9acba083f49e8c623a0be25660c859dcd8b29677672ce" }, { "path": "msa/web-report/config/logger.ts", - "header": "pe-only", + "header": "busl", "reason": "New PE module for the PE web-report service. Its body is identical to CE msa/web-ui/config/logger.ts, which PE still carries and which is a week older; the PE file is a copy for a PE-only service, not the CE file. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:aec71ee9557d9b8f0691e46617d923403e73b03cb204c3e8c837200487337398" }, { "path": "msa/web-report/config/tb-web-report.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate msa/js-executor/config/tb-js-executor.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 95e43f9ea9875eaed7e06ef3559914a901727636).", "contentHash": "sha256:f4568fd8a8158238c9d60bf6fce8ea4c7a3d98959bcf1e9fb3ef91aced0a3c46" }, { "path": "report/src/main/conf/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/logback.xml at d23c8fc0d5a408f1bb560ec2b7af0622e93008fb (blob 850a28b2125c6fe56ce01769400e72d5ee58f7c4).", "contentHash": "sha256:2199b91f2b4129821cda9a07a4e5bc694069d0e570ec2ff8700cdf470766158d" }, { "path": "report/src/main/conf/tb-report.conf", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/conf/tb-edqs.conf at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 8dfd269ed6ccce1fda74b540f47f231d03bb550f).", "contentHash": "sha256:ebb59345cb5fe92e9fdd8cd2c7f51b7b80274d42e0b1a8ba668b00b880f33773" }, { "path": "report/src/main/java/org/thingsboard/server/report/ThingsboardReportApplication.java", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/java/org/thingsboard/server/edqs/ThingsboardEdqsApplication.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 334a36dec0f8a3820749d7a228ce2908738d4bf7).", "contentHash": "sha256:2bec03b3d69af065c3e7d6f25dbcf5b9cb735a43718fd150bd586a6f59b283e0" }, { "path": "report/src/main/resources/logback.xml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/resources/logback.xml at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 2e1f143c71a3625cea9407fc59969f5ba8ab027e).", "contentHash": "sha256:a8318968283848ae237b61382d2413c1afb0532fd9d3c9eec3e55989cb52d170" }, { "path": "report/src/main/resources/tb-report.yml", - "header": "pe-only", + "header": "busl", "reason": "Launch, logging or runtime scaffolding for a PE service. Maintainer explicitly resolved this PE module scaffolding as PE-only; matching CE startup/logging conventions do not override that decision. Reviewed similarity candidate edqs/src/main/resources/edqs.yml at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob cad0fcaccc785af0853c77f05d385adb4c102f67).", "contentHash": "sha256:64e2775735521015bd88c79f68db101ff69f536c681db8239764c434205a0583" }, { "path": "rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetCustomerAttributeNodeConfiguration.java", - "header": "pe-only", + "header": "busl", "reason": "Configuration holder for the PE customer-attribute rule node. Reviewed property defaults configure this PE node; common rule-node configuration/clone patterns do not establish derivation from the CE entity-data node. Reviewed candidate rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetEntityDataNodeConfiguration.java at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob f68fdf321b69b24e3e15bd2a311e2ccfa86ff890).", "contentHash": "sha256:0b91a00b698884c6654781d43c0debb2e61dcfcb9898811e27dc13baafde2bb0" }, - { - "path": "rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/transform/TbAbstractDuplicateMsgNode.java", - "header": "pe-only", - "reason": "New PE file implementing a PE feature. It was written by adapting CE rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/transform/TbAbstractTransformNode.java, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", - "contentHash": "sha256:ca13fdc9263fd9dbd0637547d192cd80b01454f0e8aca719460e30fe392427e1" - }, { "path": "ui-ngx/src/app/modules/home/components/converter/converter-autocomplete.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE converter autocomplete styling. The entire body is a host-scoped Material icon-link border/color reset, also present in unrelated CE autocomplete controls. This trivial shared UI style does not establish CE provenance for a PE converter component. Reviewed candidate ui-ngx/src/app/modules/home/components/profile/tenant-profile-autocomplete.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 95fd62939ec09897ed96164f7a2a47d6805c3245).", "contentHash": "sha256:03445abafd2f4f71cd541c2ee3c33e195e37ad711630971fc35fd393c66419ff" }, { "path": "ui-ngx/src/app/modules/home/components/converter/converter-dialog.component.html", - "header": "pe-only", + "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" }, { "path": "ui-ngx/src/app/modules/home/components/converter/converter-test-dialog.component.scss", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE ui-ngx/src/app/shared/components/dialog/node-script-test-dialog.component.scss, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:0d83f8ec2da9c911f51d8e5eebe7da1b5db1f3100c483aa24769dc58ea75c3ad" }, { "path": "ui-ngx/src/app/modules/home/components/group/add-group-entity-dialog.component.scss", - "header": "pe-only", + "header": "busl", "reason": "New PE stylesheet for the PE group feature. At authoring it was a verbatim copy of CE ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.scss, which PE still carries; CE later reduced its own file. Copying a CE stylesheet into a new PE-feature file does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:95cf2c6fb04db4641bda522c6a9a5c9e3faab6626e14ce4b9942417ae5379b8b" }, { "path": "ui-ngx/src/app/modules/home/components/group/entity-group.component.scss", - "header": "pe-only", + "header": "busl", "reason": "Empty :host selector in a PE component stylesheet. Identical empty selector boilerplate at multiple unrelated CE paths supplies no meaningful derivation evidence. Reviewed candidate ui-ngx/src/app/modules/home/components/relation/relation-dialog.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 16bc26c7e2a0cc952ac46e0b6edd105c17c402c5).", "contentHash": "sha256:a5a5674d23eaffbd00a99169958c14939b326ad5a68a1c614c1d3dec1635ef2b" }, { "path": "ui-ngx/src/app/modules/home/components/group/group-contact-based.component.ts", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE ui-ngx/src/app/modules/home/components/entity/contact-based.component.ts, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:56a6d5bf2593d2e7801cb1e357b8de9073334e7f2d053bd118182ef4dae2181a" }, - { - "path": "ui-ngx/src/app/modules/home/components/group/manage-owner-and-groups-dialog.component.html", - "header": "pe-only", - "reason": "PE view template manage-owner-and-groups-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/dialogs/assign-to-customer-dialog.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 4af3aa07a136de6f06469ab94134f84552ed0f80).", - "contentHash": "sha256:6663727de4d162e6fc966c2e36dd771058655f0a801232a56e3425825f6cbe54" - }, { "path": "ui-ngx/src/app/modules/home/components/integration/integration-credentials/integration-credentials.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet integration-credentials.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/modules/home/components/vc/repository-settings.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 3afa2cb78cc2f392a082443fd322d95ba39420f9).", "contentHash": "sha256:2efcf5a42fc436b3e0d3170b04d3636c62ded1e37d48133328216fa05cdb015f" }, { "path": "ui-ngx/src/app/modules/home/components/rule-node/action/integration-downlink-config.component.ts", - "header": "pe-only", + "header": "busl", "reason": "PE typed UI adapter integration-downlink-config.component.ts. Reviewed implementation only registers the PE component, supplies typed framework inputs or constructs its PE configuration form; matching generic Angular/ThingsBoard component hooks are template use. Reviewed CE candidate ui-ngx/src/app/modules/home/components/rule-node/flow/rule-chain-input.component.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 0403a37563356ff2843d9e87610dcad9a7d50169).", "contentHash": "sha256:7e5a32c33b1e1e45e9fec84e17be78be867f0e03db1d6cf004b84a1aac3fb51a" }, { "path": "ui-ngx/src/app/modules/home/components/rule-node/transformation/duplicate-to-related-config.component.ts", - "header": "pe-only", + "header": "busl", "reason": "PE typed UI adapter duplicate-to-related-config.component.ts. Reviewed implementation only registers the PE component, supplies typed framework inputs or constructs its PE configuration form; matching generic Angular/ThingsBoard component hooks are template use. Reviewed CE candidate ui-ngx/src/app/modules/home/components/rule-node/action/rpc-request-config.component.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 546f344863860f44a1387c1bc6c90db3645deb91).", "contentHash": "sha256:c0649f9045eb6dbafa55e5550713acc0e9d67f6f6e13e52fa0074fdbbb273548" }, { "path": "ui-ngx/src/app/modules/home/components/scheduler/config/attribute-key-value-table.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet attribute-key-value-table.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/shared/components/kv-map.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 1edb7e50bae24728db678a8e7fb2c125cc3f4bfe).", "contentHash": "sha256:4e0a33867eb7f194e3730470d67d96d75f96919fbc9e71a636e67a4b35743b31" }, { "path": "ui-ngx/src/app/modules/home/components/scheduler/config/attribute-key-value-table.component.ts", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE ui-ngx/src/app/shared/components/kv-map.component.ts, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:aa1d298b5af277bb5d67d87630717443d35830a787e725d442e0ec3de4173f0b" }, { "path": "ui-ngx/src/app/modules/home/components/task/cancel-task-dialog.component.html", - "header": "pe-only", + "header": "busl", "reason": "PE view template cancel-task-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/shared/components/dialog/confirm-dialog.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 5c8ea6eea22ccdf1a4b13f995e9c6e3421930e17).", "contentHash": "sha256:022ea913628bc1f57a62725f79121c2ea4a63ed1d6a4e36d872fbac189526d15" }, { "path": "ui-ngx/src/app/modules/home/components/task/cancel-task-dialog.component.ts", - "header": "pe-only", + "header": "busl", "reason": "PE typed UI adapter cancel-task-dialog.component.ts. Reviewed implementation only registers the PE component, supplies typed framework inputs or constructs its PE configuration form; matching generic Angular/ThingsBoard component hooks are template use. Reviewed CE candidate ui-ngx/src/app/shared/components/dialog/confirm-dialog.component.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob b2f1ed3fe90cc938948859dd8632916395b03c10).", "contentHash": "sha256:8d455120aedd994c624b5a988d50190543bc4cc14bd175c92aa9bc7ab093095c" }, @@ -1443,67 +1305,49 @@ }, { "path": "ui-ngx/src/app/modules/home/components/widget/lib/settings/common/dynamic-form/dynamic-form-dialog.component.html", - "header": "pe-only", + "header": "busl", "reason": "PE view template dynamic-form-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/shared/components/dialog/json-object-edit-dialog.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 289cf0f05bdd688553a048d086c9d9777af22adc).", "contentHash": "sha256:6c778dd93549307431435beb68b13b78b98c1e2c02fb453ec25a9485656d60dc" }, { "path": "ui-ngx/src/app/modules/home/components/widget/lib/settings/scheduler/custom-scheduler-event-type.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet custom-scheduler-event-type.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/modules/home/components/widget/lib/settings/chart/label-data-key.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 07a8abe1a493414539469c0939c01c5572e7618e).", "contentHash": "sha256:50b35b72e6f2065f1defd1f06be189cf1786d5d1cfb5ce079a12b70d8dd8ef5f" }, { "path": "ui-ngx/src/app/modules/home/components/wizard/entity-group-wizard-dialog.component.scss", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.scss, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:c0370968c3b22e8c69b22cb6d94d77c8265aea5ec4376ee2051f5159b343dea0" }, - { - "path": "ui-ngx/src/app/modules/home/dialogs/add-entity-groups-to-edge-dialog.component.html", - "header": "pe-only", - "reason": "PE view template add-entity-groups-to-edge-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/dialogs/assign-to-customer-dialog.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 4af3aa07a136de6f06469ab94134f84552ed0f80).", - "contentHash": "sha256:a388333c5d948f47324c0a03f0a16cd1e2ee4baab27c8a851553f97a1ca3fe44" - }, - { - "path": "ui-ngx/src/app/modules/home/dialogs/select-owner-dialog.component.html", - "header": "pe-only", - "reason": "PE view template select-owner-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/dialogs/assign-to-customer-dialog.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 4af3aa07a136de6f06469ab94134f84552ed0f80).", - "contentHash": "sha256:df68ce9ec827575d8a46e9602df0b3b5bfbd755441cfc0322d7ec0ea95352186" - }, - { - "path": "ui-ngx/src/app/modules/home/dialogs/share-entity-group-dialog.component.html", - "header": "pe-only", - "reason": "PE view template share-entity-group-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:e36c42e81593ec7f224cbf8be4dce11a594a28085c81c49c860c1132f19b3920" - }, { "path": "ui-ngx/src/app/modules/home/pages/admin/custom-css-dialog.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet custom-css-dialog.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/shared/components/protobuf-content.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 0633395c0a9e8241a8ea678aa45e58d86b8bc03d).", "contentHash": "sha256:f93050686508da34bf976a8705f94f4e9dacc48d80bcbd486e0cc83df80d3558" }, { "path": "ui-ngx/src/app/modules/home/pages/admin/oauth2/domains/domain-dialog.component.html", - "header": "pe-only", + "header": "busl", "reason": "PE view template domain-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/pages/mobile/applications/mobile-app-dialog.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d984ac99c9941ea1420c0e922d867cddf89b30c1).", "contentHash": "sha256:bf1d2015aa9eaecbd24f5ba2fc5a9e3f3fb5cf39901170e4d9d1cb9e9a25bf27" }, { "path": "ui-ngx/src/app/modules/home/pages/agent/agent-profile-tabs.component.ts", - "header": "pe-only", + "header": "busl", "reason": "PE agent entity tabs component added in 6c303b45f74 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE ui-ngx/src/app/modules/home/pages/edge/edge-tabs.component.ts shares only the entity tabs component boilerplate. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 58bc88a8db4).", "contentHash": "sha256:285dd70a9a6dc12120df933e9ba8d6cc9b453571eb6c6390c9646bfc7c2fb52e" }, { "path": "ui-ngx/src/app/modules/home/pages/agent/agent-tabs.component.html", - "header": "pe-only", + "header": "busl", "reason": "PE agent entity tabs component added in f5e28c9cc42 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE ui-ngx/src/app/modules/home/pages/edge/edge-tabs.component.html shares only the entity tabs component boilerplate. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 3f298aff3d1).", "contentHash": "sha256:b96f8ce0a2df420a7411d8ff9e26409c530ecc3ff7fa35dd32db75792e130720" }, { "path": "ui-ngx/src/app/modules/home/pages/agent/agent-tabs.component.ts", - "header": "pe-only", + "header": "busl", "reason": "PE agent entity tabs component added in f5e28c9cc42 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE ui-ngx/src/app/modules/home/pages/edge/edge-tabs.component.ts shares only the entity tabs component boilerplate. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 58bc88a8db4).", "contentHash": "sha256:774979b5f77b5d58e1d7dfabc31f6271a46cfa346b8f43e6bb18db92e0cb2429" }, @@ -1513,63 +1357,45 @@ "reason": "Retained CE file subsequently deleted on the CE mainline in d81add6fd73 (Angular 15 migration). PE keeps the assets table header stylesheet and updated it for the MDC slide toggle. Reviewed against last CE path version 80430897422ae13b600ee9c9dbc57f7d558a3b4b^1 (blob 488e5b4c27e).", "contentHash": "sha256:57aabaed35a0bf7d372df84d6d3c7e7562eeccc06bd19655f94000bd2693f3c0" }, - { - "path": "ui-ngx/src/app/modules/home/pages/converter/converter-tabs.component.html", - "header": "pe-only", - "reason": "PE view template converter-tabs.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/pages/rulechain/rulechain-tabs.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob cd93367fc0cf1a7b4cdb66a7b2cbdebf54c6b9c4).", - "contentHash": "sha256:a262251d15be697e4a048aefa756b376fd3cdca7093d3ff486f4e632c24d145c" - }, { "path": "ui-ngx/src/app/modules/home/pages/converter/converter.module.ts", - "header": "pe-only", + "header": "busl", "reason": "Angular module/routing registration for a PE feature. Imports, declarations and routes select PE components using common Angular module scaffolding; no CE feature implementation is relocated. Reviewed candidate ui-ngx/src/app/modules/home/pages/asset/asset.module.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob d6dcf2b0b4232555f55d4ab649e8fe10b1dd1a2e).", "contentHash": "sha256:92d96e89c654fa7d0e000083169e992e709ed6a050ce180f71fa11970479bdb2" }, - { - "path": "ui-ngx/src/app/modules/home/pages/custom-menu/add-custom-menu-item-dialog.component.html", - "header": "pe-only", - "reason": "PE view template add-custom-menu-item-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/pages/admin/oauth2/clients/client-dialog.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 168100e58624f5c65473ab68270ae19842eef2ea).", - "contentHash": "sha256:9a924655c21da389103bb38a050aefc51c15440cc78dfa7ef35ca0061bfc86b6" - }, { "path": "ui-ngx/src/app/modules/home/pages/custom-menu/custom-menu-is-assigned-dialog.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet custom-menu-is-assigned-dialog.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/modules/home/components/entity/entity-filter.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 5b9bc415b1673aef9b04efc49fbba6e6e60f9542).", "contentHash": "sha256:8a466986f9717ef42218e90101e674dc0957d8ed808e2c70323d1aef92889b6c" }, { "path": "ui-ngx/src/app/modules/home/pages/custom-menu/custom-menu-item-panel.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet custom-menu-item-panel.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/modules/home/pages/mobile/bundes/layout/custom-mobile-page-panel.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 436a97786ff0da99ec5ba041f9bd1ac93d9ba9f1).", "contentHash": "sha256:e1a151ac24400139741d18b999c89ba128f89fc39fb465000a5a14c20fb4ad8d" }, { "path": "ui-ngx/src/app/modules/home/pages/custom-menu/default-menu-item-panel.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet default-menu-item-panel.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/modules/home/pages/mobile/bundes/layout/default-mobile-page-panel.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 2aa92b7fc991e197c659586893635c0161acacd7).", "contentHash": "sha256:f6c5562d4b8fde74a83b406f9216e33db4be95dc706029fea299686e4f0f1d9a" }, { "path": "ui-ngx/src/app/modules/home/pages/custom-menu/edit-custom-menu-name-panel.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet edit-custom-menu-name-panel.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/modules/home/pages/mobile/common/editor-panel.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob f25f26b1499b0d43cbcc272e7f5f96c1a916402d).", "contentHash": "sha256:4db1893e34f34d9dec7534d0a0b937a8a667a154cf10aa201beda605e7bf7de8" }, { "path": "ui-ngx/src/app/modules/home/pages/custom-translation/add-new-language-dialog.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet add-new-language-dialog.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/modules/home/pages/device/device-credentials-dialog.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 4fa7a8e072bf9c5a830b04cb8af04d6fd5dd6650).", "contentHash": "sha256:8f197828a805fb07ae43bd26c9ccc9b0eb676d2d3ea8fce41380f1bc4f98d615" }, - { - "path": "ui-ngx/src/app/modules/home/pages/dashboard/public-dashboard-link.dialog.component.html", - "header": "pe-only", - "reason": "New PE file implementing a PE feature. It was written by adapting CE ui-ngx/src/app/modules/home/pages/dashboard/make-dashboard-public-dialog.component.html, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", - "contentHash": "sha256:32d3a2ee42bc23949a121a100dc09125891341255f5c1cd8a0d69d447fc5f78d" - }, { "path": "ui-ngx/src/app/modules/home/pages/dashboard/public-dashboard-link.dialog.component.ts", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE ui-ngx/src/app/modules/home/pages/dashboard/make-dashboard-public-dialog.component.ts, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:07f295f637db24d600798215d33391f4e966954899f644a41b9735f5ed5392db" }, @@ -1581,271 +1407,265 @@ }, { "path": "ui-ngx/src/app/modules/home/pages/iframe/iframe-view.module.ts", - "header": "pe-only", + "header": "busl", "reason": "Angular module/routing registration for a PE feature. Imports, declarations and routes select PE components using common Angular module scaffolding; no CE feature implementation is relocated. Reviewed candidate ui-ngx/src/app/modules/home/pages/gateways/gateways.module.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 06642bcec58f37ba9aabcb21906cae8ea6882ef4).", "contentHash": "sha256:04319dafb2225682d3e837e066951ca560774754b002bf17e69949c44e40392f" }, { "path": "ui-ngx/src/app/modules/home/pages/integration/integration-tabs.component.html", - "header": "pe-only", + "header": "busl", "reason": "PE view template integration-tabs.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/pages/rulechain/rulechain-tabs.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob cd93367fc0cf1a7b4cdb66a7b2cbdebf54c6b9c4).", "contentHash": "sha256:04789ea4b1719b43a5a2d6e2a99732ca15f0e383e4ba9f0efd13f8f4fe8b5f22" }, { "path": "ui-ngx/src/app/modules/home/pages/integration/integrations-center.module.ts", - "header": "pe-only", + "header": "busl", "reason": "Angular module/routing registration for a PE feature. Imports, declarations and routes select PE components using common Angular module scaffolding; no CE feature implementation is relocated. Reviewed candidate ui-ngx/src/app/modules/home/pages/features/features.module.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 666a51c1c5c17a5371d1a917f7affd80727f3b24).", "contentHash": "sha256:47fe9e43f0f7eb6a01565c41e911ae9a451cab2bc27b03cfef45a074932f30ad" }, { "path": "ui-ngx/src/app/modules/home/pages/reporting/components/report-components.module.ts", - "header": "pe-only", + "header": "busl", "reason": "Angular module/routing registration for a PE feature. Imports, declarations and routes select PE components using common Angular module scaffolding; no CE feature implementation is relocated. Reviewed candidate ui-ngx/src/app/modules/home/pages/tenant-profile/tenant-profile.module.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob df9e721af53a3071547aceaacbda46ccf2473cbb).", "contentHash": "sha256:45d76d1fb0aaeb307752c285aa2f37b01ea21da4d41a0891a71ad1e65dbe311f" }, { "path": "ui-ngx/src/app/modules/home/pages/reporting/components/report-filter.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet report-filter.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/modules/home/components/device/device-info-filter.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 3ae672c7127931e4e4319d5dc7e71141376f0748).", "contentHash": "sha256:da626900ef28ef02b905929e282ee584ca15bf67b4d4e459f70b08453411fca9" }, { "path": "ui-ngx/src/app/modules/home/pages/reporting/template/report-template-filter.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet report-template-filter.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/modules/home/components/device/device-info-filter.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 3ae672c7127931e4e4319d5dc7e71141376f0748).", "contentHash": "sha256:dea9f1bf653bbcdce195758ffbc6ec4094fec81815ed56546bd87db12dc59744" }, { "path": "ui-ngx/src/app/modules/home/pages/reporting/template/report-template-tabs.component.html", - "header": "pe-only", + "header": "busl", "reason": "PE view template report-template-tabs.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/pages/admin/resource/resource-tabs.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 1d98f4be180a627825f67cd728c7573df21c460a).", "contentHash": "sha256:da2f62bffceff569b198cfa0d3c0e79bd48205d7b447570a29f2eda17e065f51" }, { "path": "ui-ngx/src/app/modules/home/pages/role/role-routing.module.ts", - "header": "pe-only", + "header": "busl", "reason": "Angular module/routing registration for a PE feature. Imports, declarations and routes select PE components using common Angular module scaffolding; no CE feature implementation is relocated. Reviewed candidate ui-ngx/src/app/modules/home/pages/asset/asset-routing.module.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 54d492c26c4155d0245f0bfc2fff83692134e37e).", "contentHash": "sha256:aa8d2de86008837f6dec87ce12ffbca38549a270a904a0527aa8889b78411ddf" }, { "path": "ui-ngx/src/app/modules/home/pages/role/role-tabs.component.html", - "header": "pe-only", + "header": "busl", "reason": "PE view template role-tabs.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/pages/rulechain/rulechain-tabs.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob cd93367fc0cf1a7b4cdb66a7b2cbdebf54c6b9c4).", "contentHash": "sha256:b2ae43c7b2ab71c5d5df9cd75ce6a1ff953e385309b7af81a9c600a38831d3c6" }, { "path": "ui-ngx/src/app/modules/home/pages/role/role-tabs.component.ts", - "header": "pe-only", + "header": "busl", "reason": "PE typed UI adapter role-tabs.component.ts. Reviewed implementation only registers the PE component, supplies typed framework inputs or constructs its PE configuration form; matching generic Angular/ThingsBoard component hooks are template use. Reviewed CE candidate ui-ngx/src/app/modules/home/pages/user/user-tabs.component.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 298af6f0de496cda1e6df834eee45dd41bb9a23e).", "contentHash": "sha256:929f68d9553ebdc6f8f326503c0e5308cde763e18dedebd80a38d96c14a493a5" }, { "path": "ui-ngx/src/app/modules/home/pages/role/role.module.ts", - "header": "pe-only", + "header": "busl", "reason": "Angular module/routing registration for a PE feature. Imports, declarations and routes select PE components using common Angular module scaffolding; no CE feature implementation is relocated. Reviewed candidate ui-ngx/src/app/modules/home/pages/alarm/alarm.module.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 9438e743d19cc4234935fed2a42ef0d8e7b9558f).", "contentHash": "sha256:7d8e38e285631d2a7a74ba52a9eb1bc050101a9460df8d1e7d635242acde7fa3" }, { "path": "ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.ts", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE ui-ngx/src/app/modules/home/pages/rulechain/rulechains-table-config.resolver.ts, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:f155dcd3181ac77f5a8ea303eeda6a8471b298c3cce8f496d2b4945630b3ed18" }, { "path": "ui-ngx/src/app/modules/home/pages/scheduler/scheduler.module.ts", - "header": "pe-only", + "header": "busl", "reason": "Angular module/routing registration for a PE feature. Imports, declarations and routes select PE components using common Angular module scaffolding; no CE feature implementation is relocated. Reviewed candidate ui-ngx/src/app/modules/home/pages/alarm/alarm.module.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 9438e743d19cc4234935fed2a42ef0d8e7b9558f).", "contentHash": "sha256:f508ee1debcd3c5ee023ebad3ee947341c1e95cdd7c88785cef9e03eb37e23fe" }, { "path": "ui-ngx/src/app/modules/home/pages/secret-storage/edit-secret-description-panel.component.html", - "header": "pe-only", + "header": "busl", "reason": "PE secret storage description panel added in 77ae0916f57. The similar CE api-key/edit-api-key-description-panel.component.html was added later in fba08a32126 and derives from this PE component, not the reverse. Reviewed candidate at 317a75614137ab5ddd1aecef1abd4c2fcdcb8710 (blob 1a3f159af48).", "contentHash": "sha256:a3572174fc3c63d9389f20ea55a7c0219a67c6325bdc56ccb894048925f62978" }, { "path": "ui-ngx/src/app/modules/home/pages/secret-storage/edit-secret-description-panel.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet edit-secret-description-panel.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/modules/home/pages/mobile/common/editor-panel.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob f25f26b1499b0d43cbcc272e7f5f96c1a916402d).", "contentHash": "sha256:82f20a273c21c5170ff6f3ad9ff2324e603da4eb36459a51dcbc3895110cdebd" }, { "path": "ui-ngx/src/app/modules/home/pages/secret-storage/edit-secret-description-panel.component.ts", - "header": "pe-only", + "header": "busl", "reason": "PE secret storage description panel added in 77ae0916f57. The similar CE api-key/edit-api-key-description-panel.component.ts was added later in fba08a32126 and derives from this PE component, not the reverse. Reviewed candidate at 317a75614137ab5ddd1aecef1abd4c2fcdcb8710 (blob 8f05a755f4b).", "contentHash": "sha256:cf1053f3738a80ab4581710b5baa7019cd230e9ab1991334de6fdb599fa7fdfb" }, { "path": "ui-ngx/src/app/modules/home/pages/secret-storage/secret-storage-table-header.component.html", - "header": "pe-only", + "header": "busl", "reason": "PE view template secret-storage-table-header.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/pages/admin/oauth2/domains/domain-table-header.component.html at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 020f728f8f65de07090b5009fb2bc4bd6392bd42).", "contentHash": "sha256:091faa8d74ea1100ee5f053507ecddd0f9394b0062f7daabf388f65ed80b8303" }, { "path": "ui-ngx/src/app/modules/home/pages/secret-storage/secret-storage-table-header.component.ts", - "header": "pe-only", + "header": "busl", "reason": "PE typed UI adapter secret-storage-table-header.component.ts. Reviewed implementation only registers the PE component, supplies typed framework inputs or constructs its PE configuration form; matching generic Angular/ThingsBoard component hooks are template use. Reviewed CE candidate ui-ngx/src/app/modules/home/pages/admin/oauth2/domains/domain-table-header.component.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob ff947407912f1f20e387908f81b6793f6d63329d).", "contentHash": "sha256:83242ac9bc768c1ced27bcd492129edbd269bd51a22dc77a6a95d854148c20f5" }, { "path": "ui-ngx/src/app/modules/home/pages/task-manager/task-filter-config.component.scss", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE ui-ngx/src/app/modules/home/components/alarm/alarm-filter-config.component.scss, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:61fa659a2477b7372421b810654383ac280f932ef41ab9b9ff912b8b5fcccae5" }, { "path": "ui-ngx/src/app/modules/home/pages/task-manager/task-manager-header.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE task manager page header stylesheet added in 61d991bde83. The candidate CE audit-log-header.component.scss matches only on generic host layout properties. Reviewed candidate at 317a75614137ab5ddd1aecef1abd4c2fcdcb8710 (blob 0d057f16ca9).", "contentHash": "sha256:c97d917157cdbed82ac411d7e6a69a1c8590ac8dedace15ad8b1959f917cb6bf" }, - { - "path": "ui-ngx/src/app/modules/signup/pages/signup/signup-dialog.component.html", - "header": "pe-only", - "reason": "PE view template signup-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:07fb450cc0a3d66a35fcb5e56089294ad1181e741f87eef9a76ae38cbbc74882" - }, { "path": "ui-ngx/src/app/modules/signup/pages/signup/signup-dialog.component.scss", - "header": "pe-only", + "header": "busl", "reason": "PE component stylesheet signup-dialog.component.scss. Reviewed overlap consists of shared Material fieldset/panel/button typography, sizing, spacing or host-layout conventions; it does not identify a relocated CE component implementation. Curated as PE-specific UI template use. Reviewed CE candidate ui-ngx/src/app/shared/components/dialog/alert-dialog.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 47d8bacd5a1553261a5270fdbe20483feaefe019).", "contentHash": "sha256:4f7db5013f99b1ff93b7b52ed1ac046bffcc29c5b134e4ac94d58b231125b792" }, { "path": "ui-ngx/src/app/shared/components/role/group-permission-dialog.component.scss", - "header": "pe-only", + "header": "busl", "reason": "Empty :host selector in a PE component stylesheet. Identical empty selector boilerplate at multiple unrelated CE paths supplies no meaningful derivation evidence. Reviewed candidate ui-ngx/src/app/modules/home/components/relation/relation-dialog.component.scss at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 16bc26c7e2a0cc952ac46e0b6edd105c17c402c5).", "contentHash": "sha256:a5a5674d23eaffbd00a99169958c14939b326ad5a68a1c614c1d3dec1635ef2b" }, { "path": "ui-ngx/src/app/shared/components/role/group-permissions.component.scss", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE ui-ngx/src/app/modules/home/components/relation/relation-table.component.scss, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:51982e085e708736d820e335c4a5e5680d0310242cc0d88924e4dd0df9d165d3" }, { "path": "ui-ngx/src/app/shared/components/secret-storage/secret-file-input.component.scss", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE ui-ngx/src/app/shared/components/image/scada-symbol-input.component.scss, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:1f70e7b2aa179ef028828fc8ec07322cbc3030fd416c3998905b9bdad5b82fe0" }, { "path": "ui-ngx/src/app/shared/components/secret-storage/secrets-datasource.ts", - "header": "pe-only", + "header": "busl", "reason": "New PE file implementing a PE feature. It was written by adapting CE ui-ngx/src/app/modules/home/pages/admin/resource/resources-datasource.ts, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.", "contentHash": "sha256:835c6fa6c2148c1559c789560141edc94266081bb7a0e40b5eafe0ae3c5c8e5c" }, { "path": "ui-ngx/src/app/shared/models/id/agent-app-event-id.ts", - "header": "pe-only", + "header": "busl", "reason": "PE agent id model added in d4b8d886666 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE ui-ngx/src/app/shared/models/id/api-key-id.ts shares only the id model boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 4fdaf78cc8c).", "contentHash": "sha256:5394bb91dcfa542c6b1ed9b66b02cdfa9c39cf9040ace8a82b549a934439e53a" }, { "path": "ui-ngx/src/app/shared/models/id/agent-app-profile-id.ts", - "header": "pe-only", + "header": "busl", "reason": "PE agent id model added in d4b8d886666 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE ui-ngx/src/app/shared/models/id/api-key-id.ts shares only the id model boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 4fdaf78cc8c).", "contentHash": "sha256:c98507fd6db9721528ca966240c425e4912fced4c75946287128e0f6443570a5" }, { "path": "ui-ngx/src/app/shared/models/id/agent-app-unit-id.ts", - "header": "pe-only", + "header": "busl", "reason": "PE agent id model added in d4b8d886666 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE ui-ngx/src/app/shared/models/id/api-key-id.ts shares only the id model boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 4fdaf78cc8c).", "contentHash": "sha256:0fc9b5ff2357b5a4c0cfef0b8587e06b729af597171b3ef3176b896fe10dadaa" }, { "path": "ui-ngx/src/app/shared/models/id/agent-application-id.ts", - "header": "pe-only", + "header": "busl", "reason": "PE agent id model added in d4b8d886666 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE ui-ngx/src/app/shared/models/id/api-key-id.ts shares only the id model boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 4fdaf78cc8c).", "contentHash": "sha256:b9e4599aa9331025fd1d3acdc0e5517b9fdb5da1de42a53191403ac309910e86" }, { "path": "ui-ngx/src/app/shared/models/id/agent-bulk-action-id.ts", - "header": "pe-only", + "header": "busl", "reason": "PE agent id model added in d4b8d886666 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE ui-ngx/src/app/shared/models/id/api-key-id.ts shares only the id model boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 4fdaf78cc8c).", "contentHash": "sha256:d296382d0c5b61cb4dbd838d76723dcb55ab076a9723fbbfe0adef69cd773caf" }, { "path": "ui-ngx/src/app/shared/models/id/agent-id.ts", - "header": "pe-only", + "header": "busl", "reason": "PE agent id model added in d4b8d886666 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE ui-ngx/src/app/shared/models/id/edge-id.ts shares only the id model boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob d498fac3fd4).", "contentHash": "sha256:f506cf21dbc6beb6dca58fec54c94b930b24acd67d493d71480372414795a6a4" }, { "path": "ui-ngx/src/app/shared/models/id/agent-profile-id.ts", - "header": "pe-only", + "header": "busl", "reason": "PE agent id model added in 6c303b45f74 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE ui-ngx/src/app/shared/models/id/api-key-id.ts shares only the id model boilerplate for a different entity type. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 4fdaf78cc8c).", "contentHash": "sha256:94e21066461722c588d1236d7987d56d401bc6db57c988d7bdcede47f69f6d59" }, { "path": "ui-ngx/src/app/shared/models/id/blob-entity-id.ts", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/asset-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 86ca874a92346a950b6912d78116f1f7ee6bb654).", "contentHash": "sha256:fbc3242e2779a0efef79b7eb712a9ea7d8a005cfd1e8911b04ac519550a9e4b8" }, { "path": "ui-ngx/src/app/shared/models/id/converter-id.ts", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/asset-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 86ca874a92346a950b6912d78116f1f7ee6bb654).", "contentHash": "sha256:026023794900881beb9d750c09677069e168c2d2197c8761c984025634bae9d3" }, { "path": "ui-ngx/src/app/shared/models/id/custom-menu-id.ts", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/audit-log-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 0b71456990b38a79ab3ca4b7a16ddb14028b7826).", "contentHash": "sha256:64061a7b1ea13d059e6d5b0540f09cd92fbe4579b1e4ae723ccce406d4be29a6" }, { "path": "ui-ngx/src/app/shared/models/id/entity-group-id.ts", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/asset-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 86ca874a92346a950b6912d78116f1f7ee6bb654).", "contentHash": "sha256:67845a93ddf3538fcfa441462dcee91323a919ba7ddc1976893d990c5c7f75a2" }, { "path": "ui-ngx/src/app/shared/models/id/group-permission-id.ts", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/asset-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 86ca874a92346a950b6912d78116f1f7ee6bb654).", "contentHash": "sha256:a7da045fd161a17762972c7ee408ce1451fe0c49e57eb9a1442cdf57df826990" }, { "path": "ui-ngx/src/app/shared/models/id/integration-id.ts", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/asset-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 86ca874a92346a950b6912d78116f1f7ee6bb654).", "contentHash": "sha256:b9c27683121e76bdc532adaac53358ad580773a1d1eed8976f4d55bf6e80ebfc" }, { "path": "ui-ngx/src/app/shared/models/id/job-id.ts", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/rpc-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob aec7fdfd20624ec695fc1e9887a8d1b2a71a7b08).", "contentHash": "sha256:01cfdef0179068bc653191fa66379c1f11cf26cdd7217f698d49b8402f65ce94" }, { "path": "ui-ngx/src/app/shared/models/id/report-id.ts", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/asset-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 86ca874a92346a950b6912d78116f1f7ee6bb654).", "contentHash": "sha256:70dc05081708c87753a03174402e008fe78a7200f08c6d10b7f400d4f38f9aa4" }, { "path": "ui-ngx/src/app/shared/models/id/report-template-id.ts", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/asset-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 86ca874a92346a950b6912d78116f1f7ee6bb654).", "contentHash": "sha256:892ed8adcc467a827946c4bf2ff276b08d3bc75305e86dc9edf5c7022b067ad9" }, { "path": "ui-ngx/src/app/shared/models/id/role-id.ts", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/user-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 74174fe25b19f9abd2bea3a8b5f5740ce005566b).", "contentHash": "sha256:9179b142fe0c7f3ef567afcef917dd4822b04652802aa9fb20b98bca725d116b" }, { "path": "ui-ngx/src/app/shared/models/id/scheduler-event-id.ts", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/asset-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 86ca874a92346a950b6912d78116f1f7ee6bb654).", "contentHash": "sha256:9a8cf3df121815fd26f958ed542b2ee6b064c7671c234652b9615eba1b5aa662" }, { "path": "ui-ngx/src/app/shared/models/id/secret-storage-id.ts", - "header": "pe-only", + "header": "busl", "reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/asset-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 86ca874a92346a950b6912d78116f1f7ee6bb654).", "contentHash": "sha256:5427b1c6bf59f9e9372c47717fee96bf94bddeaf65ad920b77647b16539bf5f9" } diff --git a/tools/src/main/python/license-headers/test_check_license_headers.py b/tools/src/main/python/license-headers/test_check_license_headers.py index e017fad801..a025443e75 100644 --- a/tools/src/main/python/license-headers/test_check_license_headers.py +++ b/tools/src/main/python/license-headers/test_check_license_headers.py @@ -54,72 +54,91 @@ class GitFixture: class DecisionTests(unittest.TestCase): + VERSION = {"path": "a.java", "ref": "b" * 40, "blob": "c" * 40} + COPY = {"path": "source.java", "ref": "a" * 40, "blob": "c" * 40, "similarity": 78} + def decide(self, **changes): - evidence = dict(path="a.java", content_hash=p.raw_hash(b"reviewed"), current="pe-only", curation=None, - inherited=True, recreated=False, ce_hash="same", pe_hash="same", - candidates=[], historical=[], in_comparison=True) + evidence = dict(path="a.java", content_hash=p.raw_hash(b"reviewed"), current=p.NON_CE, + ce_versions=(self.VERSION,), identical=self.VERSION) return p.decide(p.Evidence(**(evidence | changes))) + def new(self, **changes): + return self.decide(**(dict(ce_versions=(), identical=None) | changes)) + def test_current_header_does_not_establish_origin(self): row = self.decide() - self.assertEqual("apache", row["expectedHeader"]) - self.assertEqual("mismatch", row["status"]) - self.assertEqual("ce-modified", self.decide(pe_hash="changed")["expectedHeader"]) + self.assertEqual(("mismatch", "apache"), (row["status"], row["expectedHeader"])) + self.assertEqual(self.VERSION, row["identicalTo"]) + row = self.decide(identical=None) + self.assertEqual(("ce-modified", "same path in CE, content differs"), (row["expectedHeader"], row["reason"])) + self.assertEqual([self.VERSION], row["ceVersions"]) + + def test_clean_merge_of_ce_versions_is_apache(self): + merge = {"path": "a.java", "merge": ["b" * 40, "d" * 40], "base": "e" * 40} + row = self.decide(current="apache", identical=merge) + self.assertEqual(("match", "apache"), (row["status"], row["expectedHeader"])) + self.assertEqual("same path in CE, content identical to a clean merge of its CE versions", row["reason"]) + self.assertEqual(merge, row["identicalTo"]) + + def test_new_path_without_ce_evidence_is_non_ce(self): + row = self.new() + self.assertEqual(("match", p.NON_CE, "not in CE, no CE evidence"), + (row["status"], row["expectedHeader"], row["reason"])) + + def test_ce_evidence_for_a_new_path_needs_a_decision(self): + row = self.new(copies=(self.COPY,)) + self.assertEqual(("unresolved", None, None), (row["status"], row["expectedHeader"], row["suggestedHeader"])) + self.assertEqual([self.COPY], row["copyCandidates"]) + self.assertEqual("apache", self.new(copies=(self.COPY | {"similarity": 100},))["suggestedHeader"]) + deleted = {"path": "a.java", "ref": "f" * 40 + "^1", "blob": "c" * 40} + row = self.new(deleted=deleted) + self.assertEqual(("unresolved", "CE history had this path"), (row["status"], row["reason"])) + self.assertEqual(deleted, row["historicalCandidate"]) + + def test_descriptor_of_a_module_absent_in_ce_is_non_ce_despite_similar_ce_descriptors(self): + copy = self.COPY | {"path": "transport/mqtt/pom.xml"} + descriptor = dict(path="integration/mqtt/pom.xml", copies=(copy,), directory_in_ce=False) + row = self.new(**descriptor) + self.assertEqual(("match", p.NON_CE), (row["status"], row["expectedHeader"])) + for evidence in (dict(directory_in_ce=True), + dict(path="integration/mqtt/Mqtt.java"), + dict(copies=(copy | {"similarity": 100},)), + dict(deleted={"path": "integration/mqtt/pom.xml", "ref": "f" * 40, "blob": "c" * 40})): + self.assertEqual("unresolved", self.new(**(descriptor | evidence))["status"], evidence) def test_matching_curation_precedes_inference(self): - curation = dict(contentHash=p.raw_hash(b"reviewed"), header="pe-only", reason="Independent replacement") - self.assertEqual("match", self.decide(curation=curation)["status"]) + curation = dict(contentHash=p.raw_hash(b"reviewed"), header="ce-modified", reason="Reviewed") + row = self.decide(current="ce-modified", curation=curation) + self.assertEqual(("match", "ce-modified", "curation: Reviewed"), + (row["status"], row["expectedHeader"], row["reason"])) + self.assertNotIn("redundantCuration", row) + row = self.new(copies=(self.COPY,), curation=curation | {"header": p.NON_CE}) + self.assertEqual(("match", p.NON_CE), (row["status"], row["expectedHeader"])) + self.assertNotIn("redundantCuration", row) curation["contentHash"] = p.raw_hash(b"different") self.assertEqual("stale-curation", self.decide(curation=curation)["status"]) - def test_recreated_and_missing_ce_files_do_not_silently_pass(self): - self.assertEqual("unresolved", self.decide(recreated=True)["status"]) - row = self.decide(inherited=False, in_comparison=False, ce_hash=None) - self.assertEqual("unresolved", row["status"]) - self.assertEqual("pe-only", row["suggestedHeader"]) - self.assertIsNone(row["expectedHeader"]) - - def test_identical_cross_path_source_is_not_proof(self): - row = self.decide(inherited=False, candidates=[{"path": "original.java"}]) - self.assertEqual("unresolved", row["status"]) - self.assertEqual("apache", row["suggestedHeader"]) - - def test_pe_additions_pass_without_strong_ce_evidence(self): - added = dict(inherited=False, in_comparison=False, ce_hash=None, pe_addition=True) - self.assertEqual("match", self.decide(**added)["status"]) - self.assertEqual("match", self.decide(**added, historical=[{"path": "other/a.java"}])["status"]) - for evidence in (dict(historical=[{"path": "a.java"}]), - dict(historical=[{"path": "other/a.java", "contentMatches": True}]), - dict(copies=[{"path": "other.java", "similarity": 78}])): - self.assertEqual("unresolved", self.decide(**added, **evidence)["status"]) - - def test_descriptor_of_a_module_absent_in_ce_is_pe_only_despite_similar_ce_descriptors(self): - descriptor = dict(path="integration/mqtt/pom.xml", inherited=False, in_comparison=False, ce_hash=None, - pe_addition=True, copies=[{"path": "transport/mqtt/pom.xml", "similarity": 78}], - directory_in_ce=False) - row = self.decide(**descriptor) - self.assertEqual("match", row["status"]) - self.assertEqual("pe-only", row["expectedHeader"]) - for evidence in (dict(directory_in_ce=True), - dict(path="integration/mqtt/Mqtt.java"), - dict(pe_addition=False), - dict(candidates=[{"path": "transport/mqtt/pom.xml"}]), - dict(historical=[{"path": "transport/mqtt/pom.xml", "contentMatches": True}])): - self.assertEqual("unresolved", self.decide(**(descriptor | evidence))["status"]) + def test_curation_that_repeats_the_inferred_header_is_redundant(self): + curation = dict(contentHash=p.raw_hash(b"reviewed"), header="apache", reason="Reviewed") + row = self.decide(current="apache", curation=curation) + self.assertEqual(("match", "apache", "same path in CE, content identical", True), + (row["status"], row["expectedHeader"], row["reason"], row["redundantCuration"])) + row = self.new(curation=curation | {"header": p.NON_CE}) + self.assertTrue(row["redundantCuration"]) def test_console_groups_findings_by_required_action(self): missing = self.decide(current=p.MISSING) foreign = self.decide(path="vendored.java", current=p.FOREIGN) - candidate = {"path": "original.java", "ref": "b" * 40, "blob": "c" * 40} - renamed = self.decide(path="new.java", inherited=False, candidates=[candidate, candidate]) - copied = self.decide(path="copied.java", inherited=False, in_comparison=False, ce_hash=None, - copies=[{"path": "source.java", "ref": "a" * 40, "similarity": 78}]) - changed = self.decide(curation=dict(contentHash=p.raw_hash(b"other"), header="pe-only", reason="Reviewed")) + copied = self.new(path="copied.java", copies=(self.COPY, self.COPY | {"path": "other.java", "similarity": 60})) + historical = self.new(path="gone.java", deleted={"path": "gone.java", "ref": "d" * 40 + "^1", "blob": "c" * 40}) + changed = self.decide(curation=dict(contentHash=p.raw_hash(b"other"), header=p.NON_CE, reason="Reviewed")) clean = self.decide(path="clean.java", current="apache") + redundant = self.decide(path="curated.java", current="apache", + curation=dict(contentHash=p.raw_hash(b"reviewed"), header="apache", reason="Reviewed")) orphaned = dict(path="deleted.java", status="stale-curation", reason="file is no longer in scope") stderr, stdout = io.StringIO(), io.StringIO() with redirect_stderr(stderr), redirect_stdout(stdout): - rows = [missing, foreign, renamed, copied, changed, clean] + rows = [missing, foreign, copied, historical, changed, clean, redundant] p.print_findings(rows, [orphaned], {"a" * 40: "ce/lts-4.2"}) p.print_summary(rows, [orphaned], "target/report.json") output = stderr.getvalue() @@ -135,13 +154,13 @@ class DecisionTests(unittest.TestCase): → Rerun with --fix to restamp automatically Needs a decision (2) - new.java - has pe-only, no expected header yet (hint: apache) - exact CE match: original.java at {"b" * 11} - another 1 candidate in the report copied.java - has pe-only, no expected header yet + has {p.NON_CE}, no expected header yet similar CE file (78%): source.java at ce/lts-4.2 + another 1 candidate in the report + gone.java + has {p.NON_CE}, no expected header yet + CE history: gone.java at {"d" * 11}^1 → Decide the origin and add a curation, see {p.README} Stale curations (2) @@ -149,12 +168,31 @@ class DecisionTests(unittest.TestCase): file changed since the curation, re-review and update contentHash deleted.java file is no longer in scope - → Remove or update the entry in {p.CURATIONS} + → Review the file and update the entry in {p.CURATIONS}; --fix removes entries of files no longer in scope - 6 findings in 6 files. Report: target/report.json + Redundant curations (1) + curated.java + curated apache, the check decides apache by itself + → Rerun with --fix to remove them from {p.CURATIONS} + + 6 findings in 7 files. Report: target/report.json """), output) self.assertEqual("", stdout.getvalue()) + def test_orphaned_curations_alone_point_to_fix(self): + orphaned = dict(path="deleted.java", status="stale-curation", reason="file is no longer in scope") + stderr = io.StringIO() + with redirect_stderr(stderr): + p.print_findings([self.decide(current="apache")], [orphaned], {}) + self.assertIn(" → Rerun with --fix to remove them\n", stderr.getvalue()) + + def test_console_lists_removed_curations(self): + stderr = io.StringIO() + with redirect_stderr(stderr): + p.print_removed_curations([{"path": "a.java", "reason": "file is no longer in scope"}]) + p.print_removed_curations([]) + self.assertEqual("Removed curations (1)\n a.java\n file is no longer in scope\n\n", stderr.getvalue()) + def test_console_closes_an_interrupted_phase_before_reporting(self): stderr = io.StringIO() with redirect_stderr(stderr): @@ -164,7 +202,7 @@ class DecisionTests(unittest.TestCase): self.assertEqual("Resolving Git history ... failed\n\nError: boom\n", stderr.getvalue()) def test_console_summarizes_a_clean_run(self): - rows = [self.decide(current="apache"), self.decide(path="b.java", pe_hash="changed", current="ce-modified")] + rows = [self.decide(current="apache"), self.decide(path="b.java", identical=None, current="ce-modified")] stderr = io.StringIO() with redirect_stderr(stderr): p.print_restamped(rows) @@ -173,7 +211,7 @@ class DecisionTests(unittest.TestCase): "Report: target/report.json\n", stderr.getvalue()) def test_console_lists_restamped_files(self): - rows = [self.decide(current="apache"), self.decide(path="b.java", pe_hash="changed", current="ce-modified")] + rows = [self.decide(current="apache"), self.decide(path="b.java", identical=None, current="ce-modified")] rows[1]["previousHeader"] = p.LEGACY stderr = io.StringIO() with redirect_stderr(stderr): @@ -297,11 +335,26 @@ class InputTests(unittest.TestCase): write([entry]) self.assertEqual({"a.java"}, set(p.load_curations(path))) for entries in ([entry, entry], [entry | {"reason": " "}], - [entry | {"path": "../a.java"}], [entry | {"header": "MIT"}]): + [entry | {"path": "../a.java"}], [entry | {"header": "MIT"}], + [entry | {"header": "pe-only"}]): write(entries) with self.assertRaises(p.Failure): p.load_curations(path) + def test_non_ce_header_is_the_only_other_template(self): + directory = temporary_directory(self) + for name in ("license-header.txt", "license-header-ce-modified.txt", "notes.txt"): + (directory / name).write_text("header\n") + with self.assertRaises(RuntimeError): + p.non_ce_header(directory) + (directory / "license-header-busl.txt").write_text("header\n") + self.assertEqual("busl", p.non_ce_header(directory)) + (directory / "license-header-pe.txt").write_text("header\n") + with self.assertRaises(RuntimeError): + p.non_ce_header(directory) + self.assertEqual(f"{p.TEMPLATE_DIRECTORY}/license-header-{p.NON_CE}.txt", p.TEMPLATES[p.NON_CE]) + self.assertTrue((this_repository() / p.TEMPLATES[p.NON_CE]).is_file()) + def test_plugin_version_and_configuration_come_from_root_pom(self): repo = temporary_directory(self) p.git(repo, "init") @@ -341,33 +394,117 @@ class GitHistoryTests(unittest.TestCase): self.assertEqual({initial, merged}, {change.commit for change in changes}) self.assertEqual(source, changes[0].path) - git("checkout", "side") - git.write("side-only.java", "not integrated\n") - git.commit("side only") - git("checkout", "lts-4.2") - self.assertNotIn("side-only.java", {change.path for change in p.history(git.root, "HEAD")}) - git("rm", source) git.commit("delete") - deleted = p.history(git.root, "HEAD")[0] - self.assertTrue(deleted.deleted) - self.assertEqual(b"merged result\n", p.blobs(git.root, [deleted.old])[deleted.old]) - - def test_integration_boundary_does_not_walk_preintegration_pe_history(self): + deleted = p.history(git.root, "HEAD", "--diff-filter=D") + self.assertEqual(["D"], [change.status for change in deleted]) + self.assertEqual(b"merged result\n", p.blobs(git.root, [deleted[0].old])[deleted[0].old]) + + def relicensed_fixture(self): + git = GitFixture(temporary_directory(self), "master") + git.write("Base.java", "base\n") + git.commit("CE base") + git("checkout", "-b", "lts-4.3") + git.write("Fix.java", "lts fix\n") + fix = git.commit("CE fix") + git("checkout", "master") + git.write("Feature.java", "CE feature\n") + last = git.commit("last Apache commit") + git.write("Tb.java", "TB feature\n") + relicensing = git.commit("relicensing") + git("merge", "--no-ff", "lts-4.3", "-m", "integrate CE fix") + return git, fix, last, relicensing + + def test_relicensed_ce_bases_are_the_latest_ce_commits_merged_into_the_branch(self): + git, fix, last, relicensing = self.relicensed_fixture() + with patch.object(p, "RELICENSING_COMMIT", relicensing): + self.assertEqual(sorted([fix, last]), p.relicensed_ce_bases(git.root, git("rev-parse", "HEAD"))) + git("checkout", "lts-4.3") + git.write("Fix.java", "second lts fix\n") + second = git.commit("second CE fix") + git("checkout", "master") + self.assertEqual(sorted([fix, last]), p.relicensed_ce_bases(git.root, git("rev-parse", "HEAD"))) + git("merge", "--no-ff", "lts-4.3", "-m", "integrate second CE fix") + self.assertEqual(sorted([second, last]), p.relicensed_ce_bases(git.root, git("rev-parse", "HEAD"))) + self.assertEqual([last], p.relicensed_ce_bases(git.root, relicensing)) + + def test_relicensed_ce_bases_need_the_relicensing_commit_in_history(self): + git, _, _, relicensing = self.relicensed_fixture() + with patch.object(p, "RELICENSING_COMMIT", relicensing), self.assertRaisesRegex(p.Failure, "Pass --ce-ref"): + p.relicensed_ce_bases(git.root, git("rev-parse", "lts-4.3")) + with patch.object(p, "RELICENSING_COMMIT", "0" * 40), self.assertRaisesRegex(p.Failure, "Pass --ce-ref"): + p.relicensed_ce_bases(git.root, git("rev-parse", "HEAD")) + + def test_merged_ce_bases_follow_the_integrated_ce_commit(self): git = GitFixture(temporary_directory(self), "ce") - git.write("initial", "initial") - git.commit("initial") - git("branch", "pe") - git.write("ce-file", "CE") - anchor = git.commit("CE addition") - git("checkout", "pe") - git.write("pe-file", "PE") - git.commit("PE addition") - git("merge", "ce", "-m", "CE integration") - boundary = git("rev-parse", "HEAD") - git.write("pe-file", "PE edit") - git.commit("PE edit") - self.assertEqual(boundary, p.integration_boundary(git.root, anchor, "HEAD")) + git.write("Base.java", "base\n") + git.commit("CE base") + git("checkout", "-b", "integrating") + git.write("Own.java", "own\n") + git.commit("own addition") + git("checkout", "ce") + git.write("Base.java", "CE fix\n") + integrated = git.commit("CE fix") + git("checkout", "integrating") + git("merge", "--no-ff", "ce", "-m", "integrate CE") + git("checkout", "ce") + git.write("Base.java", "later CE fix\n") + tip = git.commit("not yet integrated") + self.assertEqual([integrated], p.merged_ce_bases(git.root, git("rev-parse", "integrating"), tip)) + git("checkout", "--orphan", "unrelated") + git.write("Other.java", "other\n") + unrelated = git.commit("unrelated history") + with self.assertRaisesRegex(p.Failure, "shares no history"): + p.merged_ce_bases(git.root, unrelated, tip) + + def test_merged_ce_bases_below_a_relicensed_ce_ref_exclude_relicensed_commits(self): + git, fix, last, relicensing = self.relicensed_fixture() + ce_tip = git("rev-parse", "HEAD") + git("checkout", "-b", "downstream", git("rev-list", "--max-parents=0", "HEAD")) + git.write("Own.java", "own\n") + own = git.commit("own history without the relicensing commit") + git("merge", "--no-ff", "master", "-m", "integrate CE master") + head = git("rev-parse", "HEAD") + with patch.object(p, "RELICENSING_COMMIT", relicensing): + self.assertIn(own, p.relicensed_ce_bases(git.root, head)) + self.assertEqual(sorted([fix, last]), p.merged_ce_bases(git.root, head, ce_tip)) + + def test_lineage_records_first_parent_ce_deletions(self): + git = GitFixture(temporary_directory(self), "ce") + git.write("Gone.java", "removed from CE\n") + git.write("Kept.java", "kept\n") + git.commit("CE base") + git("checkout", "-b", "side") + git.write("Temporary.java", "never on the mainline\n") + git.commit("side addition") + git("rm", "Temporary.java") + git.commit("side removal") + git("checkout", "ce") + git("merge", "--no-ff", "side", "-m", "integrate side") + git("rm", "Gone.java") + removal = git.commit("CE removal") + lineage = p.Lineage.load(git.root, removal, [removal]) + self.assertEqual({"Gone.java"}, set(lineage.deleted)) + self.assertEqual(removal + "^1", lineage.deleted["Gone.java"]["ref"]) + self.assertEqual(b"removed from CE\n", p.blobs(git.root, [lineage.deleted["Gone.java"]["blob"]]) + [lineage.deleted["Gone.java"]["blob"]]) + self.assertEqual([(removal, git("rev-parse", f"{removal}:Kept.java"))], lineage.versions("Kept.java")) + self.assertEqual([], lineage.versions("Gone.java")) + + def test_merge_blobs_returns_only_clean_merges(self): + git = GitFixture(temporary_directory(self), "main") + git.write("File.java", "one\ntwo\nthree\nfour\nfive\n") + git.commit("base") + base = git("rev-parse", "HEAD:File.java") + + def blob(content): + git.write("File.java", content) + git.commit(content.splitlines()[0]) + return git("rev-parse", "HEAD:File.java") + + ours, theirs = blob("ONE\ntwo\nthree\nfour\nfive\n"), blob("one\ntwo\nthree\nfour\nFIVE\n") + self.assertEqual(b"ONE\ntwo\nthree\nfour\nFIVE\n", p.merge_blobs(git.root, ours, base, theirs)) + self.assertIsNone(p.merge_blobs(git.root, ours, base, blob("uno\ntwo\nthree\nfour\nfive\n"))) def test_ignore_filter_keeps_tracked_and_unignored_files(self): repo = temporary_directory(self) @@ -393,10 +530,10 @@ class GitHistoryTests(unittest.TestCase): original = b"class Source {\n" + b" void action() { doUsefulWork(); }\n" * 20 + b"}\n" tool.add(source, "Source.java", original) tool.add(empty, "Empty.java", b"\n") - tool.add(("pe", "Renamed.java"), "Renamed.java", + tool.add(("head", "Renamed.java"), "Renamed.java", original.replace(b"Source", b"Renamed").replace(b"\n", b"\r\n")) - tool.add(("pe", "Other.java"), "Other.java", b"independent PE implementation\n") - tool.add(("pe", "Blank.java"), "Blank.java", b"\r\n") + tool.add(("head", "Other.java"), "Other.java", b"independent implementation\n") + tool.add(("head", "Blank.java"), "Blank.java", b"\r\n") found = p.normalized_copies(tool, {source: "selected-mainline", empty: "selected-mainline"}, ["Renamed.java", "Other.java", "Blank.java"], tool.nonempty()) self.assertEqual({"Renamed.java"}, set(found)) @@ -412,19 +549,19 @@ class FetchTests(unittest.TestCase): self.ce("tag", "-a", "v4.2.0", "-m", "release") self.ce.write("Base.java", "second\n") self.second = self.ce.commit("second") - self.pe = GitFixture(temporary_directory(self), "pe") - self.pe.write("Pe.java", "pe\n") - self.pe.commit("pe base") + self.local = GitFixture(temporary_directory(self), "main") + self.local.write("Own.java", "own\n") + self.local.commit("own base") def fetch(self, ref): - return p.fetch(self.pe.root, str(self.ce.root), ref) + return p.fetch(self.local.root, str(self.ce.root), ref) def test_fetches_branches_tags_and_commits(self): self.assertEqual(self.second, self.fetch("lts-4.2")) self.assertEqual(self.second, self.fetch("refs/heads/lts-4.2")) self.assertEqual(self.first, self.fetch("v4.2.0")) self.assertEqual(self.first, self.fetch(self.first)) - self.assertEqual("second", self.pe("show", f"{self.second}:Base.java")) + self.assertEqual("second", self.local("show", f"{self.second}:Base.java")) def test_every_run_fetches_the_current_tip(self): self.assertEqual(self.second, self.fetch("lts-4.2")) @@ -440,33 +577,39 @@ class FetchTests(unittest.TestCase): class CheckCommandTests(unittest.TestCase): + LINES = "".join(f"line {index}\n" for index in range(10)) + def setUp(self): self.repo = temporary_directory(self) - self.git = git = GitFixture(self.repo, "lts-4.2") - self.body = "new CE feature implementation\n" * 20 - git.write("Base.java", "base implementation\n") - git.commit("release base") - git("branch", "pe") - git("checkout", "-b", "fix/my-fix") - git.write("Feature.java", self.body) - git.write("Deleted.java", "historical CE feature source\n") - git.commit("CE fix sources") - git("rm", "Deleted.java") - self.feature = git.commit("remove temporary source") - git("checkout", "-b", "unrelated", "lts-4.2") - git.write("Unrelated.java", "unrelated source\n") - git.commit("unrelated source") - git("checkout", "pe") - git.write("Renamed.java", fixture("pe-only") + self.body) - git.write("Deleted.java", fixture("pe-only") + "historical CE feature source\n") - git.write("Local.java", fixture("pe-only") + "unrelated source\n") - git.write("Swapped.java", fixture("apache") + "swapped source\n") + self.git = git = GitFixture(self.repo, "master") + self.body = "CE source implementation\n" * 20 + git.write(".gitignore", "target/\n") for category, name in p.TEMPLATES.items(): git.write(name, f"fixture {category}\n") git.write(p.CURATIONS, '{"schemaVersion": 1, "curations": []}') + git.write("Base.java", fixture("apache") + "base implementation\n") + git.write("Changed.java", fixture("apache") + "CE implementation\n") + git.write("Merged.java", fixture("apache") + self.LINES) + git.write("Source.java", fixture("apache") + self.body) + self.base = git.commit("CE base") + git("checkout", "-b", "lts-4.3") + git.write("Merged.java", fixture("apache") + self.LINES.replace("line 9", "lts fix")) + git.write("Fixed.java", fixture("apache") + "lts addition\n") + self.fix = git.commit("CE fix") + git("checkout", "master") + git.write("Deleted.java", fixture("apache") + "removed CE source\n") + self.addition = git.commit("CE addition") + git.write("Merged.java", fixture("apache") + self.LINES.replace("line 0", "master change")) + git("rm", "-q", "Deleted.java") + self.last = git.commit("last Apache commit") + git.write("Changed.java", fixture("ce-modified") + "CE implementation\nTB change\n") + git.write("New.java", fixture(p.NON_CE) + "TB feature\n") + self.relicensing = git.commit("relicensing") + git("merge", "--no-ff", "lts-4.3", "-m", "integrate CE fix") + self.scope = ["Base.java", "Changed.java", "Fixed.java", "Merged.java", "New.java", "Source.java"] self.output = self.repo / "target/report.json" - def check(self, ref, scope, fix=False): + def check(self, *args, scope=None): def recognized(content): for header in p.TEMPLATES: if content.startswith(fixture(header).encode()): @@ -483,30 +626,134 @@ class CheckCommandTests(unittest.TestCase): def strip_headers(tool): tool.removed = {key: split(body)[0] for key, body in tool.contents.items()} tool.stacked = set() - return {key: p.comparison_hash(split(body)[1]) for key, body in tool.contents.items()} + for key, body in list(tool.contents.items()): + tool.write(key, split(body)[1]) + return {key: p.comparison_hash(body) for key, body in tool.contents.items()} def restamp(tool, expected): for key, header in expected.items(): (tool.root / tool.paths[key]).write_bytes(fixture(header).encode() + split(tool.contents[key])[1]) return {key: (tool.root / tool.paths[key]).read_bytes() for key in expected}, {} + stderr = io.StringIO() with (patch.object(p.Path, "cwd", return_value=self.repo), + patch.object(p, "RELICENSING_COMMIT", self.relicensing), patch.object(p, "read_plugin", return_value=fixture_plugin()), - patch.object(p, "discover_scope", return_value=p.Scope(scope, [], [], 0)), + patch.object(p, "discover_scope", return_value=p.Scope(scope or self.scope, [], [], 0)), patch.object(p.Mycila, "current_headers", current_headers), patch.object(p.Mycila, "strip_headers", strip_headers), patch.object(p.Mycila, "restamp", restamp), - redirect_stdout(io.StringIO()), redirect_stderr(io.StringIO())): - code = p.main(["check", "--ce-ref", ref, "--ce-remote", str(self.repo), "--output", str(self.output)] - + (["--fix"] if fix else [])) - return code, json.loads(self.output.read_text()) + redirect_stdout(io.StringIO()), redirect_stderr(stderr)): + code = p.main(["check", "--output", str(self.output), *args]) + report = json.loads(self.output.read_text()) if self.output.exists() else None + return code, report, stderr.getvalue() - def test_matching_mainline_passes(self): - code, report = self.check("lts-4.2", ["Renamed.java", "Deleted.java", "Local.java"]) + def rows(self, report): + return {row["path"]: row for row in report["files"]} + + def test_relicensed_branch_passes(self): + code, report, _ = self.check() self.assertEqual(0, code) - self.assertEqual({"match": 3}, report["summary"]) - self.assertEqual({"remote": str(self.repo), "input": "lts-4.2", "commit": self.git("rev-parse", "lts-4.2")}, - report["ceComparison"]) + self.assertEqual({"match": 6}, report["summary"]) + bases = sorted([self.fix, self.last]) + self.assertEqual({"relicensingCommit": self.relicensing, "bases": bases}, report["ce"]) + rows = self.rows(report) + self.assertEqual({"Base.java": "apache", "Changed.java": "ce-modified", "Fixed.java": "apache", + "Merged.java": "apache", "New.java": p.NON_CE, "Source.java": "apache"}, + {name: row["expectedHeader"] for name, row in rows.items()}) + self.assertEqual({"path": "Merged.java", "merge": bases, "base": self.base}, rows["Merged.java"]["identicalTo"]) + self.assertEqual({"path": "Fixed.java", "ref": self.fix, "blob": self.git("rev-parse", f"{self.fix}:Fixed.java")}, + rows["Fixed.java"]["identicalTo"]) + + def test_fix_restamps_decided_headers_only(self): + self.git.write("Base.java", FOREIGN_LINE.decode() + "base implementation\n") + self.git.write("New.java", fixture("apache") + "TB feature\n") + shortened = self.body.replace("CE source implementation\n", "", 1) + self.git.write("Source.java", fixture("apache") + shortened) + code, report, _ = self.check() + self.assertEqual(1, code) + self.assertEqual({"match": 3, "mismatch": 3}, report["summary"]) + rows = self.rows(report) + self.assertEqual((p.FOREIGN, "apache"), (rows["Base.java"]["currentHeader"], rows["Base.java"]["expectedHeader"])) + self.assertEqual(("apache", p.NON_CE), (rows["New.java"]["currentHeader"], rows["New.java"]["expectedHeader"])) + self.assertEqual(("apache", "ce-modified"), + (rows["Source.java"]["currentHeader"], rows["Source.java"]["expectedHeader"])) + + code, report, _ = self.check("--fix") + + self.assertEqual(1, code) + self.assertEqual(["New.java", "Source.java"], report["restamped"]) + self.assertEqual({"match": 5, "mismatch": 1}, report["summary"]) + self.assertEqual(fixture(p.NON_CE) + "TB feature\n", (self.repo / "New.java").read_text()) + self.assertEqual(fixture("ce-modified") + shortened, (self.repo / "Source.java").read_text()) + self.assertEqual(FOREIGN_LINE.decode() + "base implementation\n", (self.repo / "Base.java").read_text()) + code, report, _ = self.check("--fix") + self.assertEqual([], report["restamped"]) + self.assertEqual({"match": 5, "mismatch": 1}, report["summary"]) + + def test_ce_evidence_for_new_paths_needs_a_decision(self): + self.git.write("Copy.java", fixture(p.NON_CE) + self.body) + self.git.write("Deleted.java", fixture(p.NON_CE) + "removed CE source\n") + code, report, output = self.check(scope=self.scope + ["Copy.java", "Deleted.java"]) + self.assertEqual(1, code) + self.assertEqual({"match": 6, "unresolved": 2}, report["summary"]) + rows = self.rows(report) + self.assertEqual("Source.java", rows["Copy.java"]["copyCandidates"][0]["path"]) + self.assertEqual({"path": "Deleted.java", "ref": self.last + "^1", + "blob": self.git("rev-parse", f"{self.addition}:Deleted.java")}, + rows["Deleted.java"]["historicalCandidate"]) + self.assertIn("Needs a decision (2)\n", output) + + def test_fix_removes_redundant_and_orphaned_curations(self): + self.git.write("Copy.java", fixture(p.NON_CE) + self.body) + + def curation(name, header): + return dict(path=name, header=header, reason="Reviewed", + contentHash=p.raw_hash((self.repo / name).read_bytes())) + + needed, redundant = curation("Copy.java", p.NON_CE), curation("New.java", p.NON_CE) + orphaned = dict(path="Gone.java", header=p.NON_CE, reason="Reviewed", contentHash=p.raw_hash(b"gone")) + self.git.write(p.CURATIONS, json.dumps(dict(schemaVersion=1, curations=[needed, redundant, orphaned]), + indent=2) + "\n") + scope = self.scope + ["Copy.java"] + code, report, output = self.check(scope=scope) + self.assertEqual(1, code) + self.assertEqual({"match": 7}, report["summary"]) + self.assertEqual(["New.java"], report["redundantCurations"]) + self.assertEqual([dict(path="Gone.java", status="stale-curation", reason="file is no longer in scope")], + report["curationIssues"]) + self.assertIn("Redundant curations (1)\n", output) + + code, report, output = self.check("--fix", scope=scope) + + self.assertEqual(0, code) + self.assertEqual([{"path": "Gone.java", "reason": "file is no longer in scope"}, + {"path": "New.java", "reason": "the check decides the same header by itself"}], + report["removedCurations"]) + self.assertEqual(([], []), (report["redundantCurations"], report["curationIssues"])) + self.assertEqual(json.dumps(dict(schemaVersion=1, curations=[needed]), indent=2) + "\n", + (self.repo / p.CURATIONS).read_text()) + self.assertIn("Removed curations (2)\n", output) + code, report, _ = self.check("--fix", scope=scope) + self.assertEqual((0, []), (code, report["removedCurations"])) + + def test_missing_relicensing_commit_fails_before_the_scan(self): + self.relicensing = "0" * 40 + code, report, output = self.check() + self.assertEqual((2, None), (code, report)) + self.assertIn("Resolving Git history ... failed\n", output) + self.assertIn("Pass --ce-ref", output) + + def test_ce_ref_mode_compares_against_the_merged_ce_commit(self): + code, report, output = self.check("--ce-ref", "lts-4.3", "--ce-remote", str(self.repo)) + self.assertEqual(1, code) + self.assertEqual({"remote": str(self.repo), "ref": "lts-4.3", "commit": self.fix, "bases": [self.fix]}, + report["ce"]) + rows = self.rows(report) + self.assertEqual(("mismatch", "ce-modified"), (rows["Merged.java"]["status"], rows["Merged.java"]["expectedHeader"])) + self.assertEqual({"match": 5, "mismatch": 1}, report["summary"]) + self.assertIn(f" CE ref lts-4.3 → {self.fix[:11]}\n", output) + self.assertIn("Resolving Git history ... done (CE base lts-4.3)\n", output) def test_ce_ref_is_fetched_from_the_public_ce_repository_by_default(self): fetched = [] @@ -520,9 +767,9 @@ class CheckCommandTests(unittest.TestCase): patch.object(p, "read_plugin", return_value=fixture_plugin()), patch.object(p, "discover_scope", return_value=p.Scope([], [], [], 0)), redirect_stdout(io.StringIO()), redirect_stderr(io.StringIO())): - code = p.main(["check", "--ce-ref", "lts-4.2", "--output", str(self.output)]) + code = p.main(["check", "--ce-ref", "lts-4.3", "--output", str(self.output)]) self.assertEqual(0, code) - self.assertEqual([(p.CE_REMOTE, "lts-4.2")], fetched) + self.assertEqual([(p.CE_REMOTE, "lts-4.3")], fetched) def test_unfetchable_ce_ref_fails_before_the_history_walk(self): stderr = io.StringIO() @@ -535,71 +782,6 @@ class CheckCommandTests(unittest.TestCase): self.assertIn(f"Fetching missing from {self.repo} ... failed\n", stderr.getvalue()) self.assertIn(f"Error: cannot fetch 'missing' from {self.repo}.", stderr.getvalue()) - def test_feature_ref_exposes_rename_and_history_candidates(self): - code, report = self.check("fix/my-fix", ["Renamed.java", "Deleted.java", "Local.java"]) - self.assertEqual(1, code) - rows = {row["path"]: row for row in report["files"]} - self.assertEqual("unresolved", rows["Renamed.java"]["status"]) - candidate = rows["Renamed.java"]["candidates"][0] - self.assertEqual(("Feature.java", self.feature), (candidate["path"], candidate["ref"])) - self.assertEqual("unresolved", rows["Deleted.java"]["status"]) - self.assertTrue(rows["Deleted.java"]["historicalCandidates"]) - self.assertEqual("pe-only", rows["Local.java"]["expectedHeader"]) - self.assertEqual({"tip": self.feature, "firstParent": True}, report["ceHistory"]) - - def test_curation_for_deleted_file_fails_the_check(self): - curation = dict(path="Gone.java", contentHash=p.raw_hash(b"gone"), header="pe-only", reason="Reviewed") - self.git.write(p.CURATIONS, json.dumps(dict(schemaVersion=1, curations=[curation]))) - code, report = self.check("lts-4.2", ["Renamed.java", "Deleted.java", "Local.java"]) - self.assertEqual(1, code) - self.assertEqual({"match": 3}, report["summary"]) - self.assertEqual([dict(path="Gone.java", status="stale-curation", reason="file is no longer in scope")], - report["curationIssues"]) - - def test_fix_restamps_decided_headers_only(self): - self.git("merge", "--no-ff", "fix/my-fix", "-m", "integrate CE fix") - self.git.write("Base.java", FOREIGN_LINE.decode() + "base implementation\n") - scope = ["Base.java", "Feature.java", "Renamed.java", "Swapped.java"] - code, report = self.check(self.feature, scope) - self.assertEqual(1, code) - self.assertEqual({"mismatch": 3, "unresolved": 1}, report["summary"]) - self.assertEqual([], report["restamped"]) - rows = {row["path"]: row for row in report["files"]} - self.assertEqual((p.FOREIGN, "apache"), (rows["Base.java"]["currentHeader"], rows["Base.java"]["expectedHeader"])) - self.assertEqual((p.MISSING, "apache"), - (rows["Feature.java"]["currentHeader"], rows["Feature.java"]["expectedHeader"])) - self.assertEqual(("apache", "pe-only"), - (rows["Swapped.java"]["currentHeader"], rows["Swapped.java"]["expectedHeader"])) - - code, report = self.check(self.feature, scope, fix=True) - - self.assertEqual(1, code) - self.assertEqual(["Feature.java", "Swapped.java"], report["restamped"]) - self.assertEqual({"match": 2, "mismatch": 1, "unresolved": 1}, report["summary"]) - rows = {row["path"]: row for row in report["files"]} - self.assertEqual(("match", "apache", p.MISSING), - (rows["Feature.java"]["status"], rows["Feature.java"]["currentHeader"], - rows["Feature.java"]["previousHeader"])) - self.assertEqual(fixture("apache") + self.body, (self.repo / "Feature.java").read_text()) - self.assertEqual(fixture("pe-only") + "swapped source\n", (self.repo / "Swapped.java").read_text()) - self.assertEqual("apache", rows["Swapped.java"]["previousHeader"]) - self.assertEqual("mismatch", rows["Base.java"]["status"]) - self.assertNotIn("previousHeader", rows["Base.java"]) - self.assertEqual(FOREIGN_LINE.decode() + "base implementation\n", (self.repo / "Base.java").read_text()) - self.assertEqual(fixture("pe-only") + self.body, (self.repo / "Renamed.java").read_text()) - code, report = self.check(self.feature, scope, fix=True) - self.assertEqual([], report["restamped"]) - self.assertEqual({"match": 2, "mismatch": 1, "unresolved": 1}, report["summary"]) - - def test_integrated_ce_file_compares_against_shared_ancestor(self): - self.git("merge", "--no-ff", "fix/my-fix", "-m", "integrate CE fix") - _, report = self.check(self.feature, ["Feature.java"]) - self.assertEqual("apache", report["files"][0]["expectedHeader"]) - self.assertEqual(self.feature, report["sharedAncestor"]) - self.git.write("Feature.java", self.body + "PE-specific addition\n") - _, report = self.check(self.feature, ["Feature.java"]) - self.assertEqual("ce-modified", report["files"][0]["expectedHeader"]) - MANAGED_POM = textwrap.dedent("""\ @@ -748,30 +930,30 @@ class MavenTests(unittest.TestCase): header = (repo / template).read_text() for extension in SAMPLE_BODY: for eol in ("\n", "\r\n"): - key = ("pe", category + extension + repr(eol)) + key = ("head", category + extension + repr(eol)) sample = SAMPLE_PREFIX[extension] + commented(header, extension) + SAMPLE_BODY[extension] tool.add(key, "sample." + extension, sample.replace("\n", eol).encode()) expected[key] = p.comparison_hash((SAMPLE_PREFIX[extension] + SAMPLE_BODY[extension]).encode()) - missing = ("pe", "missing") + missing = ("head", "missing") tool.add(missing, "missing.java", b"// Ordinary documentation\nclass Missing {}\n") expected[missing] = p.comparison_hash(b"// Ordinary documentation\nclass Missing {}\n") legacy = ("ce", "legacy") tool.add(legacy, "legacy.java", LEGACY_JAVA) expected[legacy] = p.comparison_hash(b"class Legacy {}\n") - foreign = ("pe", "foreign") + foreign = ("head", "foreign") tool.add(foreign, "foreign.java", FOREIGN_LINE + b"class Foreign {}\n") expected[foreign] = p.comparison_hash(b"class Foreign {}\n") - one_line = ("pe", "one-line") + one_line = ("head", "one-line") tool.add(one_line, "one.sh", b"#!/bin/sh\n# Copyright 2024 The Thingsboard Authors\nset -e\necho x\n") expected[one_line] = p.comparison_hash(b"#!/bin/sh\nset -e\necho x\n") spdx = stamped((repo / p.TEMPLATES["apache"]).read_text(), "java").encode() - stacked = ("pe", "stacked") + stacked = ("head", "stacked") tool.add(stacked, "stacked.java", spdx + LEGACY_JAVA) expected[stacked] = p.comparison_hash(b"class Legacy {}\n") - reversed_stack = ("pe", "reversed") + reversed_stack = ("head", "reversed") tool.add(reversed_stack, "reversed.java", LEGACY_JAVA.replace(b"class Legacy {}\n", spdx + b"class Legacy {}\n")) expected[reversed_stack] = p.comparison_hash(b"class Legacy {}\n") - mentioned = ("pe", "mentioned") + mentioned = ("head", "mentioned") tool.add(mentioned, "mentioned.java", spdx + b"\n" + FOREIGN_LINE + b"class Mentioned {}\n") expected[mentioned] = p.comparison_hash(FOREIGN_LINE + b"class Mentioned {}\n") pairs = {} @@ -780,18 +962,18 @@ class MavenTests(unittest.TestCase): new = stamped((repo / p.TEMPLATES["apache"]).read_text(), extension).encode() old = legacy_file[:-len(body)] for order, content in (("new-old", new + old + body), ("old-new", old + new + body)): - key = ("pe", order + "." + extension) + key = ("head", order + "." + extension) pairs[key] = content tool.add(key, key[1], content) expected[key] = p.comparison_hash(body) header_only = {} for extension in SAMPLE_BODY: - key = ("pe", "only." + extension) - header_only[key] = SAMPLE_PREFIX[extension] + commented((repo / p.TEMPLATES["pe-only"]).read_text(), extension) + key = ("head", "only." + extension) + header_only[key] = SAMPLE_PREFIX[extension] + commented((repo / p.TEMPLATES[p.NON_CE]).read_text(), extension) tool.add(key, "only." + extension, header_only[key].encode()) expected[key] = p.comparison_hash(SAMPLE_PREFIX[extension].encode()) - headers = tool.current_headers([key for key in expected if key[0] == "pe"]) + headers = tool.current_headers([key for key in expected if key[0] == "head"]) recognized = dict(headers) self.assertEqual(p.UNRECOGNIZED, headers.pop(missing)) @@ -803,7 +985,7 @@ class MavenTests(unittest.TestCase): for key in pairs: headers.pop(key) for key in header_only: - self.assertEqual("pe-only", headers.pop(key), key) + self.assertEqual(p.NON_CE, headers.pop(key), key) for key, header in headers.items(): self.assertTrue(key[1].startswith(header), (key, header)) self.assertEqual(expected, tool.strip_headers()) @@ -832,55 +1014,55 @@ class MavenTests(unittest.TestCase): for extension in SAMPLE_BODY: for eol in ("\n", "\r\n"): body = (SAMPLE_PREFIX[extension] + SAMPLE_BODY[extension]).replace("\n", eol) - key = ("pe", "missing-" + category + extension + repr(eol)) + key = ("head", "missing-" + category + extension + repr(eol)) tool.add(key, "sample." + extension, body.encode()) wanted[key] = category expected[key] = (SAMPLE_PREFIX[extension] + stamped(header, extension) + SAMPLE_BODY[extension]).replace("\n", eol).encode() - legacy = ("pe", "legacy") + legacy = ("head", "legacy") tool.add(legacy, "legacy.java", LEGACY_JAVA) wanted[legacy], expected[legacy] = "apache", (stamped(templates["apache"], "java") + "class Legacy {}\n").encode() - confidential = ("pe", "confidential") + confidential = ("head", "confidential") tool.add(confidential, "start.sh", b"#!/bin/bash\n#\n# ThingsBoard, Inc. (\"COMPANY\") CONFIDENTIAL\n#\n" b"# Copyright \xc2\xa9 2016-2026 ThingsBoard, Inc. All Rights Reserved.\n#\n\nset -e\n") - wanted[confidential], expected[confidential] = "pe-only", ("#!/bin/bash\n" + stamped(templates["pe-only"], "sh") + "set -e\n").encode() - header_only = ("pe", "only") + wanted[confidential], expected[confidential] = p.NON_CE, ("#!/bin/bash\n" + stamped(templates[p.NON_CE], "sh") + "set -e\n").encode() + header_only = ("head", "only") tool.add(header_only, "only.java", b"/**\n * Copyright 2024 The Thingsboard Authors\n */\n") wanted[header_only], expected[header_only] = "ce-modified", stamped(templates["ce-modified"], "java").encode() - shebang = ("pe", "shebang") + shebang = ("head", "shebang") tool.add(shebang, "shebang.sh", b"#!/bin/sh\n#\n# Copyright 2024 The Thingsboard Authors\n#\n") - wanted[shebang], expected[shebang] = "pe-only", ("#!/bin/sh\n" + stamped(templates["pe-only"], "sh")).encode() - glued = ("pe", "glued") + wanted[shebang], expected[shebang] = p.NON_CE, ("#!/bin/sh\n" + stamped(templates[p.NON_CE], "sh")).encode() + glued = ("head", "glued") tool.add(glued, "glued.sh", b"#\n# Copyright 2024 The Thingsboard Authors\n#\n# helper\nset -e\n") - wanted[glued] = "pe-only" - doubled = ("pe", "doubled") + wanted[glued] = p.NON_CE + doubled = ("head", "doubled") tool.add(doubled, "doubled.java", LEGACY_JAVA.replace(b"class Legacy {}\n", LEGACY_JAVA)) - wanted[doubled], expected[doubled] = "pe-only", (stamped(templates["pe-only"], "java") + "class Legacy {}\n").encode() - damaged = ("pe", "damaged") + wanted[doubled], expected[doubled] = p.NON_CE, (stamped(templates[p.NON_CE], "java") + "class Legacy {}\n").encode() + damaged = ("head", "damaged") tool.add(damaged, "damaged.java", stamped(templates["apache"], "java").replace("Apache-2.0", "Apache-2.0 test").encode() + b"class Damaged {}\n") wanted[damaged], expected[damaged] = "apache", (stamped(templates["apache"], "java") + "class Damaged {}\n").encode() - truncated = ("pe", "truncated") + truncated = ("head", "truncated") tool.add(truncated, "truncated.java", b"// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors\nclass Truncated {}\n") wanted[truncated], expected[truncated] = "apache", (stamped(templates["apache"], "java") + "class Truncated {}\n").encode() - vendored = ("pe", "vendored") + vendored = ("head", "vendored") tool.add(vendored, "vendored.java", LEGACY_JAVA.replace(b"class Legacy {}\n", FOREIGN_LINE + b"// MIT\nclass Legacy {}\n")) - wanted[vendored] = "pe-only" + wanted[vendored] = p.NON_CE spdx = stamped(templates["apache"], "java").encode() - stacked = ("pe", "stacked") + stacked = ("head", "stacked") tool.add(stacked, "stacked.java", spdx + LEGACY_JAVA) wanted[stacked], expected[stacked] = "ce-modified", (stamped(templates["ce-modified"], "java") + "class Legacy {}\n").encode() - reversed_stack = ("pe", "reversed") + reversed_stack = ("head", "reversed") tool.add(reversed_stack, "reversed.java", LEGACY_JAVA.replace(b"class Legacy {}\n", spdx + b"\nclass Legacy {}\n")) wanted[reversed_stack], expected[reversed_stack] = "apache", (stamped(templates["apache"], "java") + "class Legacy {}\n").encode() - mentioned = ("pe", "mentioned") + mentioned = ("head", "mentioned") tool.add(mentioned, "mentioned.java", spdx + b"\n" + FOREIGN_LINE + b"class Mentioned {}\n") - wanted[mentioned] = "pe-only" + wanted[mentioned] = p.NON_CE for extension, legacy_file, body in (("ts", LEGACY_TS, b"export const legacy = 1;\n"), ("xml", LEGACY_XML, b"\n")): new = stamped(templates["apache"], extension).encode() old = legacy_file[:-len(body)] for order, content in (("new-old", new + old + body), ("old-new", old + new + body)): - key = ("pe", order + "." + extension) + key = ("head", order + "." + extension) tool.add(key, key[1], content) wanted[key] = "ce-modified" expected[key] = stamped(templates["ce-modified"], extension).encode() + body diff --git a/transport/coap/pom.xml b/transport/coap/pom.xml index 4a0ca5faaa..61002add66 100644 --- a/transport/coap/pom.xml +++ b/transport/coap/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.transport diff --git a/transport/http/pom.xml b/transport/http/pom.xml index c5024508de..744cc2a956 100644 --- a/transport/http/pom.xml +++ b/transport/http/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.transport diff --git a/transport/lwm2m/pom.xml b/transport/lwm2m/pom.xml index 59ab73c973..45767f145f 100644 --- a/transport/lwm2m/pom.xml +++ b/transport/lwm2m/pom.xml @@ -1,7 +1,8 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.transport diff --git a/transport/mqtt/pom.xml b/transport/mqtt/pom.xml index ad844ca03c..8654ddf92b 100644 --- a/transport/mqtt/pom.xml +++ b/transport/mqtt/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport org.thingsboard.transport diff --git a/transport/pom.xml b/transport/pom.xml index 1650162ba6..55e9390896 100644 --- a/transport/pom.xml +++ b/transport/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard transport diff --git a/transport/snmp/pom.xml b/transport/snmp/pom.xml index 0ee182c3a2..38d689872f 100644 --- a/transport/snmp/pom.xml +++ b/transport/snmp/pom.xml @@ -1,7 +1,8 @@ org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT transport diff --git a/ui-ngx/package.json b/ui-ngx/package.json index 29375bfb2b..a11a1c4221 100644 --- a/ui-ngx/package.json +++ b/ui-ngx/package.json @@ -1,6 +1,6 @@ { "name": "thingsboard", - "version": "4.4.0", + "version": "4.4.0.1", "scripts": { "ng": "ng", "start": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng serve --configuration development --host 0.0.0.0 --open", diff --git a/ui-ngx/pom.xml b/ui-ngx/pom.xml index 735ef11ee4..a83bbd7864 100644 --- a/ui-ngx/pom.xml +++ b/ui-ngx/pom.xml @@ -10,7 +10,7 @@ 4.0.0 org.thingsboard - 4.4.0-SNAPSHOT + 4.4.0.1-SNAPSHOT thingsboard ui-ngx diff --git a/ui-ngx/src/app/core/http/iot-hub-api.service.ts b/ui-ngx/src/app/core/http/iot-hub-api.service.ts index 99f5d5b716..439976d6c5 100644 --- a/ui-ngx/src/app/core/http/iot-hub-api.service.ts +++ b/ui-ngx/src/app/core/http/iot-hub-api.service.ts @@ -7,7 +7,11 @@ import { Store } from '@ngrx/store'; import { Observable } from 'rxjs'; import { PageData } from '@shared/models/page/page-data'; import { PageLink } from '@shared/models/page/page-link'; -import { MpItemVersionQuery, MpItemVersionView } from '@shared/models/iot-hub/iot-hub-version.models'; +import { + MpItemVersionQuery, + MpItemVersionQueryOptions, + MpItemVersionView +} from '@shared/models/iot-hub/iot-hub-version.models'; import { CreatorView } from '@shared/models/iot-hub/iot-hub-creator.models'; import { IotHubInstalledItem, InstallItemVersionResult, InstallPlan, InstallPlanResult, UpdateItemVersionResult, ItemPublishedVersionInfo } from '@shared/models/iot-hub/iot-hub-installed-item.models'; import { ItemType, ItemTypeFilterInfo, WidgetCategory } from '@shared/models/iot-hub/iot-hub-item.models'; @@ -70,36 +74,47 @@ export class IotHubApiService { } public getPublishedVersions(query: MpItemVersionQuery, config?: IotHubRequestConfig): Observable> { - if (query.options.tbVersion == null) { - query.options.tbVersion = tbVersionToInt(env.tbVersion); - } - if (query.options.ceOnly == null) { - query.options.ceOnly = false; - } + this.applyPlatformFilters(query.options); return this.http.get>( `${this.baseUrl}/api/versions/published${query.toQuery()}`, { params: this.buildParams(config) } ); } + /** What this platform can install: items of every edition, nothing built for a newer ThingsBoard. */ + private platformScope(): { ceOnly: boolean; tbVersion: number } { + return { ceOnly: false, tbVersion: tbVersionToInt(env.tbVersion) }; + } + + /** Fills in the platform scope wherever the caller did not set it. */ + private applyPlatformFilters(options: MpItemVersionQueryOptions): void { + const scope = this.platformScope(); + options.tbVersion ??= scope.tbVersion; + options.ceOnly ??= scope.ceOnly; + } + + private platformScopeParams(): string[] { + const scope = this.platformScope(); + return [`ceOnly=${scope.ceOnly}`, `tbVersion=${scope.tbVersion}`]; + } + public getFilterInfo(itemType: ItemType, config?: IotHubRequestConfig): Observable { - const url = `${this.baseUrl}/api/item-listing/filterInfo/${itemType}` - + `?ceOnly=false&tbVersion=${tbVersionToInt(env.tbVersion)}`; + const url = `${this.baseUrl}/api/item-listing/filterInfo/${itemType}?${this.platformScopeParams().join('&')}`; return this.http.get(url, { params: this.buildParams(config) }); } - public getWidgetCategories(textSearch?: string, scadaFirst?: boolean, + public getWidgetCategories(textSearch?: string, scadaFirst?: boolean, creatorVerified?: boolean, config?: IotHubRequestConfig): Observable { - const queryParams: string[] = [ - `ceOnly=false`, - `tbVersion=${tbVersionToInt(env.tbVersion)}` - ]; + const queryParams: string[] = this.platformScopeParams(); if (textSearch?.trim()) { queryParams.push(`textSearch=${encodeURIComponent(textSearch.trim())}`); } if (scadaFirst != null) { queryParams.push(`scadaFirst=${scadaFirst}`); } + if (creatorVerified) { + queryParams.push(`creatorVerified=true`); + } const url = `${this.baseUrl}/api/item-listing/widgetCategories?${queryParams.join('&')}`; return this.http.get(url, { params: this.buildParams(config) }); } @@ -133,7 +148,7 @@ export class IotHubApiService { public getListingItemVersion(slug: string, config?: IotHubRequestConfig): Observable { const queryParams = [ 'ce=false', - `tbVersion=${tbVersionToInt(env.tbVersion)}` + `tbVersion=${this.platformScope().tbVersion}` ]; return this.http.get( `${this.baseUrl}/api/listings/public/by-slug/${encodeURIComponent(slug)}/item-version?${queryParams.join('&')}`, diff --git a/ui-ngx/src/app/core/http/white-labeling.service.ts b/ui-ngx/src/app/core/http/white-labeling.service.ts index 8441a3356e..456d7dfe35 100644 --- a/ui-ngx/src/app/core/http/white-labeling.service.ts +++ b/ui-ngx/src/app/core/http/white-labeling.service.ts @@ -210,7 +210,7 @@ export class WhiteLabelingService { } public isPrimaryColorPanels(): boolean { - return this.getCurrentWlParams() ? this.getCurrentWlParams().primaryColorPanels : false; + return !!this.getCurrentWlParams()?.primaryColorPanels; } public isPrimaryColorPanels$(): Observable { diff --git a/ui-ngx/src/app/core/services/dashboard-utils.service.ts b/ui-ngx/src/app/core/services/dashboard-utils.service.ts index 8afacfcc9a..43e7754e58 100644 --- a/ui-ngx/src/app/core/services/dashboard-utils.service.ts +++ b/ui-ngx/src/app/core/services/dashboard-utils.service.ts @@ -19,6 +19,8 @@ import { DashboardState, DashboardStateLayouts, GridSettings, + htmlPageDefaultConfig, + htmlPageWidgetId, LayoutType, WidgetLayout } from '@shared/models/dashboard.models'; @@ -29,8 +31,10 @@ import { isDefinedAndNotNull, isNotEmptyStr, isString, - isUndefined + isUndefined, + mergeDeep } from '@core/utils'; +import { htmlContainerDefaultSettings, HtmlContainerWidgetSettings } from '@shared/models/html-container.models'; import { Datasource, datasourcesHasAggregation, @@ -458,7 +462,7 @@ export class DashboardUtilsService { }; } - private createDefaultGridSettings(): GridSettings { + public createDefaultGridSettings(): GridSettings { return { layoutType: LayoutType.default, backgroundColor: '#eeeeee', @@ -559,6 +563,9 @@ export class DashboardUtilsService { if (!layout.gridSettings) { layout.gridSettings = this.createDefaultGridSettings(); } + if (!layout.widgets) { + layout.widgets = {}; + } if ((layout.gridSettings as any).margins && (layout.gridSettings as any).margins.length === 2) { layout.gridSettings.margin = (layout.gridSettings as any).margins[0]; delete (layout.gridSettings as any).margins; @@ -650,11 +657,11 @@ export class DashboardUtilsService { const layout: DashboardLayout = state.layouts[l]; if (layout) { result[l]= { - default: this.getBreakpointLayoutData(layout) + default: this.getBreakpointLayoutData(layout, targetState) }; if (layout.breakpoints) { for (const breakpoint of Object.keys(layout.breakpoints)) { - result[l][breakpoint] = this.getBreakpointLayoutData(layout.breakpoints[breakpoint]); + result[l][breakpoint] = this.getBreakpointLayoutData(layout.breakpoints[breakpoint], targetState); } } } @@ -665,17 +672,56 @@ export class DashboardUtilsService { } } - private getBreakpointLayoutData(layout: DashboardLayout): BreakpointLayoutInfo { + private getBreakpointLayoutData(layout: DashboardLayout, stateId: string): BreakpointLayoutInfo { const result: BreakpointLayoutInfo = { widgetIds: [], widgetLayouts: {}, gridSettings: {} }; - for (const id of Object.keys(layout.widgets)) { - result.widgetIds.push(id); + if (layout.gridSettings?.layoutType === LayoutType.html) { + result.gridSettings = { + layoutType: LayoutType.html, + autoFillHeight: true, + mobileAutoFillHeight: true, + columns: 1, + minColumns: 1, + margin: 0, + outerMargin: false + }; + // Stable per state: an unchanged page keeps its rendered instance, a changed one is re-rendered. + const widgetId = htmlPageWidgetId(stateId); + const config = mergeDeep({}, + htmlPageDefaultConfig, + { + settings: layout.gridSettings?.htmlPageConfig?.settings || mergeDeep({} as HtmlContainerWidgetSettings, htmlContainerDefaultSettings), + actions: layout.gridSettings?.htmlPageConfig?.actions + } + ); + result.widget = { + id: widgetId, + col: 0, + row: 0, + sizeX: 1, + sizeY: 1, + typeFullFqn: 'system.html_container', + type: widgetType.static, + config + }; + result.widgetLayouts[widgetId] = { + col: 0, + row: 0, + sizeX: 1, + sizeY: 1, + resizable: false, + mobileOrder: 0 + }; + } else { + for (const id of Object.keys(layout.widgets)) { + result.widgetIds.push(id); + } + result.widgetLayouts = layout.widgets; + result.gridSettings = layout.gridSettings; } - result.widgetLayouts = layout.widgets; - result.gridSettings = layout.gridSettings; return result; } @@ -691,11 +737,16 @@ export class DashboardUtilsService { } public isEmptyDashboard(dashboard: Dashboard): boolean { - if (dashboard?.configuration?.widgets) { - return Object.keys(dashboard?.configuration?.widgets).length === 0; - } else { - return true; + if (dashboard?.configuration?.widgets && Object.keys(dashboard.configuration.widgets).length) { + return false; } + // An HTML page has content but no stored widgets: its widget is virtual. + return !Object.values(dashboard?.configuration?.states || {}).some(state => this.isHtmlPageState(state)); + } + + // A state whose widget grid is replaced by an HTML page: widgets cannot be added to it. + public isHtmlPageState(state: DashboardState): boolean { + return state?.layouts?.main?.gridSettings?.layoutType === LayoutType.html; } public addWidgetToLayout(dashboard: Dashboard, @@ -1273,7 +1324,11 @@ export class DashboardUtilsService { if (layoutInfo.gridSettings) { layout.layoutCtx.gridSettings = layoutInfo.gridSettings; } - layout.layoutCtx.widgets.setWidgetIds(layoutInfo.widgetIds); + if (layoutInfo.widget) { + layout.layoutCtx.widgets.setWidget(layoutInfo.widget); + } else { + layout.layoutCtx.widgets.setWidgetIds(layoutInfo.widgetIds); + } layout.layoutCtx.widgetLayouts = layoutInfo.widgetLayouts; if (layout.show && layout.layoutCtx.ctrl) { layout.layoutCtx.ctrl.reload(); diff --git a/ui-ngx/src/app/core/services/resources.service.ts b/ui-ngx/src/app/core/services/resources.service.ts index 52459d5c88..46c020ca30 100644 --- a/ui-ngx/src/app/core/services/resources.service.ts +++ b/ui-ngx/src/app/core/services/resources.service.ts @@ -79,6 +79,23 @@ export const componentTypeBySelector = (modulesWithComponents: ModulesWithCompon return found?.type; } +// The file type of a resource URL: the extension of its last path segment, or the segment itself when it is named +// after the type with an optional version, as in Google Maps' /maps/api/js and Google Fonts' /css and /css2. +const resourceFileType = (url: string, baseUrl: string): string => { + let path: string; + try { + path = new URL(url, baseUrl).pathname; + } catch { + return undefined; + } + const segment = path.substring(path.lastIndexOf('/') + 1).toLowerCase(); + const extensionIndex = segment.lastIndexOf('.'); + if (extensionIndex > -1) { + return segment.substring(extensionIndex + 1); + } + return /^(css|js)\d*$/.exec(segment)?.[1]; +}; + const matchesSelector = (selectors: ɵCssSelectorList, selector: string) => selectors.some(s => s.some(s1 => typeof s1 === 'string' && s1 === selector)); @@ -142,11 +159,7 @@ export class ResourcesService { return this.loadedResources[url].asObservable(); } - let fileType: string; - const match = /[./](css|less|html|htm|js)?(([?#]).*)?$/.exec(url); - if (match !== null) { - fileType = match[1]; - } + const fileType = resourceFileType(url, this.document.baseURI); if (!fileType) { return throwError(() => new Error(`Unable to detect file type from url: ${url}`)); } else if (fileType !== 'css' && fileType !== 'js') { diff --git a/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee.component.html b/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee.component.html index e34ed8c344..6af6ea73ef 100644 --- a/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee.component.html +++ b/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee.component.html @@ -1,10 +1,11 @@ - alarm.assignee diff --git a/ui-ngx/src/app/modules/home/components/alarm/alarm-details-dialog.component.html b/ui-ngx/src/app/modules/home/components/alarm/alarm-details-dialog.component.html index 7ed60e9ccc..37ab23d9ad 100644 --- a/ui-ngx/src/app/modules/home/components/alarm/alarm-details-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/alarm/alarm-details-dialog.component.html @@ -25,11 +25,11 @@
- + alarm.originator - + alarm.severity
@if (alarmFormGroup.get('startTime').value) { - + alarm.start-time } @if (alarmFormGroup.get('duration').value) { - + alarm.duration }
- + alarm.type - + alarm.status diff --git a/ui-ngx/src/app/modules/home/components/alarm/alarm-details-dialog.component.scss b/ui-ngx/src/app/modules/home/components/alarm/alarm-details-dialog.component.scss index 8886910def..e2bfc7e681 100644 --- a/ui-ngx/src/app/modules/home/components/alarm/alarm-details-dialog.component.scss +++ b/ui-ngx/src/app/modules/home/components/alarm/alarm-details-dialog.component.scss @@ -1,22 +1,7 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors -// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 :host ::ng-deep { - .assignee-field { - .mat-form-field-label-wrapper { - overflow: visible; - left: -36px; - } - .user-avatar { - min-width: 28px; - min-height: 28px; - margin-right: 8px; - border-radius: 50%; - font-weight: 700; - color: #fff; - font-size: 13px; - line-height: normal; - } - } .mat-expansion-panel { &.tb-alarm-details { box-shadow: none; diff --git a/ui-ngx/src/app/modules/home/components/attribute/add-widget-to-dashboard-dialog.component.ts b/ui-ngx/src/app/modules/home/components/attribute/add-widget-to-dashboard-dialog.component.ts index 5be02c7796..1173ed0a87 100644 --- a/ui-ngx/src/app/modules/home/components/attribute/add-widget-to-dashboard-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/attribute/add-widget-to-dashboard-dialog.component.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors // SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. // SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 -import { Component, Inject, OnInit, SkipSelf } from '@angular/core'; +import { Component, Inject, SkipSelf } from '@angular/core'; import { ErrorStateMatcher } from '@angular/material/core'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { Store } from '@ngrx/store'; @@ -16,7 +16,7 @@ import { DashboardUtilsService } from '@core/services/dashboard-utils.service'; import { EntityId } from '@app/shared/models/id/entity-id'; import { Widget } from '@app/shared/models/widget.models'; import { DashboardService } from '@core/http/dashboard.service'; -import { forkJoin, Observable, of } from 'rxjs'; +import { EMPTY, forkJoin, Observable, of } from 'rxjs'; import { SelectTargetLayoutDialogComponent } from '@home/components/dashboard/select-target-layout-dialog.component'; import { SelectTargetStateDialogComponent, @@ -28,6 +28,8 @@ import { ItemBufferService } from '@core/services/item-buffer.service'; import { StateObject } from '@core/api/widget-api.models'; import { FiltersInfo } from '@shared/models/query/query.models'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { TranslateService } from '@ngx-translate/core'; +import { ActionNotificationShow } from '@core/notification/notification.actions'; export interface AddWidgetToDashboardDialogData { entityId: EntityId; @@ -44,7 +46,7 @@ export interface AddWidgetToDashboardDialogData { }) export class AddWidgetToDashboardDialogComponent extends DialogComponent - implements OnInit, ErrorStateMatcher { + implements ErrorStateMatcher { addWidgetFormGroup: UntypedFormGroup; @@ -60,7 +62,8 @@ export class AddWidgetToDashboardDialogComponent extends private dashboardUtils: DashboardUtilsService, private dashboardService: DashboardService, private itembuffer: ItemBufferService, - private dialog: MatDialog) { + private dialog: MatDialog, + private translate: TranslateService) { super(store, router, dialogRef); this.addWidgetFormGroup = this.fb.group( @@ -95,9 +98,6 @@ export class AddWidgetToDashboardDialogComponent extends ); } - ngOnInit(): void { - } - isErrorState(control: UntypedFormControl | null, form: FormGroupDirective | NgForm | null): boolean { const originalErrorState = this.errorStateMatcher.isErrorState(control, form); const customErrorState = !!(control && control.invalid && this.submitted); @@ -134,8 +134,17 @@ export class AddWidgetToDashboardDialogComponent extends } private selectTargetState(dashboard: Dashboard): Observable { - const states = dashboard.configuration.states; + // A state with an HTML page has no widget grid to add the widget to. + const states = Object.fromEntries(Object.entries(dashboard.configuration.states) + .filter(([, state]) => !this.dashboardUtils.isHtmlPageState(state))); const stateIds = Object.keys(states); + if (!stateIds.length) { + this.store.dispatch(new ActionNotificationShow({ + message: this.translate.instant('attribute.no-widget-grid-in-dashboard'), + type: 'error' + })); + return EMPTY; + } if (stateIds.length > 1) { return this.dialog.open(SelectTargetStateDialogComponent, { diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html index 445fb2792f..614fb2ab21 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html @@ -298,19 +298,35 @@ } } @if (isEdit) { - - + @if (isHtml) { + + + } @else { + + + } }

{{ translatedDashboardTitle }}

- + dashboard.title
- @if (tbEditWidget.widgetConfig?.hasBasicMode) { + @if (tbEditWidget.widgetConfig?.hasBasicMode && !isHtml) { {{ 'widget.basic-mode' | translate }} {{ 'widget.advanced-mode' | translate }} diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts index 2b27e54fbd..fe1d2663c9 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts @@ -67,6 +67,7 @@ import { EntityService } from '@core/http/entity.service'; import { AliasController } from '@core/api/alias-controller'; import { BehaviorSubject, Observable, of, Subject, Subscription, throwError } from 'rxjs'; import { DashboardUtilsService } from '@core/services/dashboard-utils.service'; +import { HtmlContainerWidgetSettings } from '@shared/models/html-container.models'; import { DashboardService } from '@core/http/dashboard.service'; import { DashboardContextMenuItem, @@ -196,6 +197,10 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC return ((this.hideToolbarValue || this.hideToolbarSetting()) && !this.isEdit) || (this.isEditingWidget || this.isAddingWidget); } + get isHtml(): boolean { + return this.layouts.main?.layoutCtx?.gridSettings?.layoutType === LayoutType.html; + } + @Input() hideMainToolbar = true; @@ -1086,7 +1091,8 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC } let gridSettings: GridSettings = null; const layoutKeys = this.dashboardUtils.isSingleLayoutDashboard(this.dashboard); - if (layoutKeys) { + // An HTML page has no widget grid, so the dialog shows only the dashboard settings. + if (layoutKeys && !this.isHtml) { const layouts = this.dashboardUtils.getDashboardLayoutConfig( this.dashboard.configuration.states[layoutKeys.state].layouts[layoutKeys.layout], this.layouts[layoutKeys.layout].layoutCtx.breakpoint); @@ -1114,6 +1120,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC this.dashboardUtils.updateLayoutSettings(layoutConfig, newGridSettings); this.updateDashboardLayouts(layouts); } + this.cd.markForCheck(); } }); } @@ -1584,13 +1591,22 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC const widget = this.dashboardUtils.prepareWidgetForSaving(deepClone(this.editingWidget)); const widgetLayout = deepClone(this.editingWidgetLayout); const id = this.editingWidgetOriginal.id; - this.dashboardConfiguration.widgets[id] = widget; this.editingWidgetOriginal = widget; this.editingWidgetLayoutOriginal = widgetLayout; - this.editingLayoutCtx.widgetLayouts[widget.id] = widgetLayout; - setTimeout(() => { - this.editingLayoutCtx.ctrl.highlightWidget(widget.id, 0); - }, 0); + if (this.isHtml) { + const state = this.dashboardConfiguration.states[this.dashboardCtx.state]; + state.layouts.main.gridSettings.htmlPageConfig = { + settings: widget.config.settings as HtmlContainerWidgetSettings, + actions: widget.config.actions + }; + this.updateLayouts(); + } else { + this.dashboardConfiguration.widgets[id] = widget; + this.editingLayoutCtx.widgetLayouts[widget.id] = widgetLayout; + setTimeout(() => { + this.editingLayoutCtx.ctrl.highlightWidget(widget.id, 0); + }, 0); + } } onEditWidgetClosed() { @@ -1618,31 +1634,22 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC if (this.editingWidgetOriginal === widget) { this.onEditWidgetClosed(); } else { - const transition = !this.forceDashboardMobileMode; - this.editingWidgetOriginal = widget; - this.editingWidgetLayoutOriginal = layoutCtx.widgetLayouts[widget.id]; - this.editingWidget = deepClone(this.editingWidgetOriginal); - this.editingWidgetLayout = deepClone(this.editingWidgetLayoutOriginal); - this.editingLayoutCtx = layoutCtx; - this.editingWidgetSubtitle = this.widgetComponentService.getInstantWidgetInfo(this.editingWidget).widgetName; - this.forceDashboardMobileMode = true; - this.isEditingWidget = true; - this.updateLayoutSizes(); - if (layoutCtx) { - const delayOffset = transition ? 350 : 0; - const delay = transition ? 400 : 300; - setTimeout(() => { - layoutCtx.ctrl.highlightWidget(widget.id, delay); - }, delayOffset); - } + this.prepareWidgetEdit(widget, layoutCtx); } } + editHtmlPage($event: Event) { + $event.stopPropagation(); + const layoutCtx = this.layouts.main?.layoutCtx; + const widget = layoutCtx.widgets.widgetByIndex(0); + this.prepareWidgetEdit(widget, layoutCtx, ''); + } + showLayoutConfigInEdit(layoutCtx: DashboardPageLayoutContext): boolean { - return layoutCtx?.gridSettings?.layoutType === LayoutType.divider || + return layoutCtx?.gridSettings?.layoutType !== LayoutType.html && (layoutCtx?.gridSettings?.layoutType === LayoutType.divider || layoutCtx?.gridSettings?.layoutType === LayoutType.default && (layoutCtx?.breakpoint === 'default' || - layoutCtx?.breakpoint !== 'default' && layoutCtx?.gridSettings?.viewFormat === ViewFormatType.list); + layoutCtx?.breakpoint !== 'default' && layoutCtx?.gridSettings?.viewFormat === ViewFormatType.list)); } replaceReferenceWithWidgetCopy($event: Event, layoutCtx: DashboardPageLayoutContext, widget: Widget) { @@ -1726,14 +1733,14 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC } widgetMouseDown($event: Event, layoutCtx: DashboardPageLayoutContext, widget: Widget) { - if (this.isEdit && !this.isEditingWidget) { + if (this.isEdit && !this.isEditingWidget && !this.isHtml) { layoutCtx.ctrl.selectWidget(widget.id, 0); } } prepareDashboardContextMenu(layoutCtx: DashboardPageLayoutContext): Array { const dashboardContextActions: Array = []; - if (this.isEdit && !this.isEditingWidget && !this.widgetEditMode) { + if (this.isEdit && !this.isEditingWidget && !this.widgetEditMode && !this.isHtml) { dashboardContextActions.push( { action: this.openDashboardSettings.bind(this), @@ -1788,7 +1795,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC prepareWidgetContextMenu(layoutCtx: DashboardPageLayoutContext, widget: Widget, isReference: boolean): Array { const widgetContextActions: Array = []; - if (this.isEdit && !this.isEditingWidget) { + if (this.isEdit && !this.isEditingWidget && !this.isHtml) { widgetContextActions.push( { action: (event, currentWidget) => { @@ -1952,4 +1959,28 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC private getDashboardLogoLink(): UrlTree { return this.forceFullscreen ? null : this.router.createUrlTree([], {relativeTo: this.route}); } + + private prepareWidgetEdit(widget: Widget, layoutCtx: DashboardPageLayoutContext, subtitle?: string) { + const transition = !this.forceDashboardMobileMode; + this.editingWidgetOriginal = widget; + this.editingWidgetLayoutOriginal = layoutCtx.widgetLayouts[widget.id]; + this.editingWidget = deepClone(this.editingWidgetOriginal); + this.editingWidgetLayout = deepClone(this.editingWidgetLayoutOriginal); + this.editingLayoutCtx = layoutCtx; + if (isDefinedAndNotNull(subtitle)) { + this.editingWidgetSubtitle = subtitle; + } else { + this.editingWidgetSubtitle = this.widgetComponentService.getInstantWidgetInfo(this.editingWidget).widgetName; + } + this.forceDashboardMobileMode = true; + this.isEditingWidget = true; + this.updateLayoutSizes(); + if (layoutCtx) { + const delayOffset = transition ? 350 : 0; + const delay = transition ? 400 : 300; + setTimeout(() => { + layoutCtx.ctrl.highlightWidget(widget.id, delay); + }, delayOffset); + } + } } diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.models.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.models.ts index 5cbb4b709b..39207b18b5 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.models.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.models.ts @@ -93,6 +93,8 @@ export class LayoutWidgetsArray implements Iterable { private widgetIds: string[] = []; + private widget: Widget; + private loaded = false; constructor(private dashboardCtx: DashboardContext) { @@ -112,6 +114,13 @@ export class LayoutWidgetsArray implements Iterable { setWidgetIds(widgetIds: string[]) { this.widgetIds = widgetIds; + this.widget = null; + this.loaded = true; + } + + setWidget(widget: Widget) { + this.widget = widget; + this.widgetIds = [this.widget.id]; this.loaded = true; } @@ -130,13 +139,19 @@ export class LayoutWidgetsArray implements Iterable { [Symbol.iterator](): Iterator { let pointer = 0; + const oneWidget = this.widget; const widgetIds = this.widgetIds; const dashboard = this.dashboardCtx.getDashboard(); return { next(value?: any): IteratorResult { if (pointer < widgetIds.length) { const widgetId = widgetIds[pointer++]; - const widget = dashboard.configuration.widgets[widgetId]; + let widget: Widget; + if (oneWidget && oneWidget.id === widgetId) { + widget = oneWidget; + } else { + widget = dashboard.configuration.widgets[widgetId]; + } return { done: false, value: widget @@ -161,7 +176,11 @@ export class LayoutWidgetsArray implements Iterable { } private widgetById(widgetId: string): Widget { - return this.dashboardCtx.getDashboard().configuration.widgets[widgetId]; + if (this.widget && this.widget.id === widgetId) { + return this.widget; + } else { + return this.dashboardCtx.getDashboard().configuration.widgets[widgetId]; + } } } diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.html index b069ec3134..c8ffe55c78 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.html @@ -85,12 +85,12 @@ } @if (selectWidgetMode === 'iotHub' && iotHubSubMode !== 'default') { - @for (option of iotHubSortOptions; track option.value; let i = $index) { - + @for (option of iotHubSortOptions; track option.value) { + } } @@ -462,120 +462,129 @@
} } @else { - - - - {{ 'iot-hub.type' | translate }} - @if (iotHubAppliedWidgetTypes.size) { - {{ iotHubAppliedWidgetTypes.size }} - } - - - @if (iotHubWidgetTypeOptions.length >= 10) { - - } -
- @for (opt of getFilteredIotHubItems(iotHubWidgetTypeOptions, 'widgetType'); track opt.key) { -
- - {{ getIotHubWidgetTypeLabel(opt.key) }} - -
- } -
-
- @if (!hideCategoriesFilterSection) { +
+ + {{ 'iot-hub.verified-creators-only' | translate }} + +
+ @if (iotHubSubMode !== 'default') { - + - {{ 'iot-hub.category' | translate }} - @if (iotHubAppliedCategories.size) { - {{ iotHubAppliedCategories.size }} + {{ 'iot-hub.type' | translate }} + @if (iotHubAppliedWidgetTypes.size) { + {{ iotHubAppliedWidgetTypes.size }} } - @if (iotHubCategoryOptions.length >= 10) { + @if (iotHubWidgetTypeOptions.length >= 10) { } -
- @for (opt of getFilteredIotHubItems(iotHubCategoryOptions, 'category'); track opt.key) { + @for (opt of getFilteredIotHubItems(iotHubWidgetTypeOptions, 'widgetType'); track opt.key) {
- - {{ opt.key }} + + {{ getIotHubWidgetTypeLabel(opt.key) }}
}
- } - - - - - {{ 'iot-hub.use-case' | translate }} - @if (iotHubAppliedUseCases.size) { - {{ iotHubAppliedUseCases.size }} - } - - - @if (iotHubUseCaseOptions.length >= 10) { - - } -
- @for (group of getGroupedIotHubFilterItems(iotHubUseCaseOptions, 'useCase'); track group.label) { - @if (group.label) { -
{{ group.label | translate }}
- } - @for (opt of group.items; track opt.key) { -
- - {{ opt.key }} - + @if (!hideCategoriesFilterSection) { + + + + + {{ 'iot-hub.category' | translate }} + @if (iotHubAppliedCategories.size) { + {{ iotHubAppliedCategories.size }} + } + + + @if (iotHubCategoryOptions.length >= 10) { + } +
+ @for (opt of getFilteredIotHubItems(iotHubCategoryOptions, 'category'); track opt.key) { +
+ + {{ opt.key }} + +
+ } +
+
+ } + + + + + {{ 'iot-hub.use-case' | translate }} + @if (iotHubAppliedUseCases.size) { + {{ iotHubAppliedUseCases.size }} + } + + + @if (iotHubUseCaseOptions.length >= 10) { + } -
- +
+ @for (group of getGroupedIotHubFilterItems(iotHubUseCaseOptions, 'useCase'); track group.label) { + @if (group.label) { +
{{ group.label | translate }}
+ } + @for (opt of group.items; track opt.key) { +
+ + {{ opt.key }} + +
+ } + } +
+ + } }
diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.ts index a20b55f8e8..04c244c481 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-widget-select.component.ts @@ -35,7 +35,14 @@ import { MpItemVersionView, widgetTypeTranslations } from '@shared/models/iot-hub/iot-hub-version.models'; -import { FilterParamInfo, ItemType, WidgetCategory } from '@shared/models/iot-hub/iot-hub-item.models'; +import { + FilterParamInfo, + IOT_HUB_SORT_OPTIONS, + ItemType, + RELEVANCE_SORT_PROPERTY, + SortOption, + WidgetCategory +} from '@shared/models/iot-hub/iot-hub-item.models'; import { IotHubInstalledItem } from '@shared/models/iot-hub/iot-hub-installed-item.models'; import { IotHubApiService } from '@core/http/iot-hub-api.service'; import { IotHubActionsService } from '@home/components/iot-hub/iot-hub-actions.service'; @@ -54,16 +61,13 @@ import { getCurrentAuthUser } from '@core/auth/auth.selectors'; import { Authority } from '@shared/models/authority.enum'; import { WhiteLabelingService } from '@core/http/white-labeling.service'; +/** The Installed list is sorted locally, and only the Hub can rank by relevance. */ +const INSTALLED_SORT_OPTIONS = IOT_HUB_SORT_OPTIONS.filter(o => o.value !== RELEVANCE_SORT_PROPERTY); + type selectWidgetMode = 'installed' | 'iotHub'; type installedSubMode = 'default' | 'allWidgets'; type iotHubSubMode = 'default' | 'allWidgets' | 'installed' | 'category'; -interface WidgetSelectSortOption { - value: string; - label: string; - direction: Direction; -} - const LOGICAL_ALL_WIDGETS = '__logical_all_widgets__'; const LOGICAL_INSTALLED_FROM_IOT_HUB = '__logical_installed_from_iot_hub__'; @@ -111,12 +115,7 @@ export class DashboardWidgetSelectComponent { includeDeprecated = false; searchFocused = false; - iotHubSortOptions: WidgetSelectSortOption[] = [ - { value: 'totalInstallCount', label: 'iot-hub.sort-most-installed', direction: Direction.DESC }, - { value: 'publishedTime', label: 'iot-hub.sort-newest', direction: Direction.DESC }, - { value: 'name', label: 'iot-hub.sort-name', direction: Direction.ASC } - ]; - iotHubSelectedSortIndex = 0; + private iotHubSelectedSortValue = IOT_HUB_SORT_OPTIONS[0].value; @Input() aliasController: IAliasController; @@ -160,6 +159,7 @@ export class DashboardWidgetSelectComponent { this.iotHubAppliedWidgetTypes.clear(); this.iotHubAppliedCategories.clear(); this.iotHubAppliedUseCases.clear(); + this.iotHubVerifiedCreatorsOnly = false; this.iotHubFilterCount = 0; } } @@ -283,6 +283,7 @@ export class DashboardWidgetSelectComponent { iotHubAppliedWidgetTypes = new Set(); iotHubAppliedCategories = new Set(); iotHubAppliedUseCases = new Set(); + iotHubVerifiedCreatorsOnly = false; iotHubWidgetTypeOptions: FilterParamInfo[] = []; iotHubCategoryOptions: FilterParamInfo[] = []; @@ -330,7 +331,7 @@ export class DashboardWidgetSelectComponent { this.iotHubWidgetsFetchFunction = (pageSize, page, filter) => { const search = typeof filter === 'string' ? filter.split('|')[0] : filter; - const sort = this.iotHubSortOptions[this.iotHubSelectedSortIndex]; + const sort = this.iotHubSelectedSort; const sortOrder: SortOrder = { property: sort.value, direction: sort.direction }; const pageLink = new PageLink(pageSize, page, search || null, sortOrder); const effectiveCategories = this.iotHubSelectedCategory @@ -341,7 +342,8 @@ export class DashboardWidgetSelectComponent { categories: effectiveCategories, useCases: this.iotHubAppliedUseCases.size > 0 ? Array.from(this.iotHubAppliedUseCases) : undefined, widgetTypes: this.iotHubAppliedWidgetTypes.size > 0 ? Array.from(this.iotHubAppliedWidgetTypes) : undefined, - scadaFirst: this.scadaFirst ? true : undefined + scadaFirst: this.scadaFirst ? true : undefined, + creatorVerified: this.iotHubVerifiedCreatorsOnly }); return this.iotHubApiService.getPublishedVersions(query, { ignoreLoading: true }); }; @@ -364,7 +366,8 @@ export class DashboardWidgetSelectComponent { this.iotHubDefaultFetchFunction = (pageSize, page, filter) => { const search = typeof filter === 'string' ? filter.split('|')[0] : filter; return this.iotHubApiService.getWidgetCategories(search || undefined, - this.scadaFirst ? true : undefined, { ignoreLoading: true }).pipe( + this.scadaFirst ? true : undefined, + this.iotHubVerifiedCreatorsOnly, { ignoreLoading: true }).pipe( map(categories => ({ data: categories.slice(page * pageSize, page * pageSize + pageSize), totalPages: Math.ceil(categories.length / pageSize), @@ -581,11 +584,19 @@ export class DashboardWidgetSelectComponent { this.onIotHubFiltersChanged(); } + toggleIotHubVerifiedCreators(): void { + this.iotHubVerifiedCreatorsOnly = !this.iotHubVerifiedCreatorsOnly; + this.loadWidgetCategories(); + this.onIotHubFiltersChanged(); + } + clearIotHubFilters(): void { this.iotHubAppliedWidgetTypes.clear(); this.iotHubAppliedCategories.clear(); this.iotHubAppliedUseCases.clear(); + this.iotHubVerifiedCreatorsOnly = false; this.iotHubFilterSearch = {}; + this.loadWidgetCategories(); this.onIotHubFiltersChanged(); } @@ -593,13 +604,27 @@ export class DashboardWidgetSelectComponent { this.iotHubFilterCount = this.iotHubAppliedWidgetTypes.size + (this.iotHubSelectedCategory ? 0 : this.iotHubAppliedCategories.size) + - this.iotHubAppliedUseCases.size; + this.iotHubAppliedUseCases.size + + (this.iotHubVerifiedCreatorsOnly ? 1 : 0); this.reloadIotHubWidgets(); } - onIotHubSortChange(index: number): void { - if (this.iotHubSelectedSortIndex !== index) { - this.iotHubSelectedSortIndex = index; + get iotHubSortOptions(): SortOption[] { + return this.iotHubSubMode === 'installed' ? INSTALLED_SORT_OPTIONS : IOT_HUB_SORT_OPTIONS; + } + + /** The chosen sort, or the list's first option where the chosen one is not offered. */ + get iotHubSelectedSort(): SortOption { + const options = this.iotHubSortOptions; + return options.find(o => o.value === this.iotHubSelectedSortValue) ?? options[0]; + } + + onIotHubSortChange(option: SortOption): void { + // Store the choice even when it is already the effective sort (the Installed list's fallback + // for relevance), so it survives a switch back to the IoT Hub list; reload only on a change. + const effective = this.iotHubSelectedSort.value; + this.iotHubSelectedSortValue = option.value; + if (effective !== option.value) { this.installedWidgetVersions = null; this.reloadIotHubWidgets(); } @@ -609,6 +634,9 @@ export class DashboardWidgetSelectComponent { if (this.selectWidgetMode === 'installed') { return (this.filterWidgetTypes?.length ?? 0) + (this.includeDeprecated ? 1 : 0); } + if (this.iotHubSubMode === 'default') { + return this.iotHubVerifiedCreatorsOnly ? 1 : 0; + } return this.iotHubFilterCount; } @@ -618,7 +646,8 @@ export class DashboardWidgetSelectComponent { } return this.iotHubAppliedWidgetTypes.size > 0 || this.iotHubAppliedCategories.size > 0 - || this.iotHubAppliedUseCases.size > 0; + || this.iotHubAppliedUseCases.size > 0 + || this.iotHubVerifiedCreatorsOnly; } clearAllFilters(): void { @@ -657,7 +686,8 @@ export class DashboardWidgetSelectComponent { isFilterVisible(): boolean { if (this.selectWidgetMode === 'iotHub') { - return this.iotHubSubMode !== 'default'; + // The category landing honours only the verified filter, so the button stays while it is on + return this.iotHubSubMode !== 'default' || this.iotHubVerifiedCreatorsOnly; } return this.installedSubMode === 'allWidgets' || this.widgetsBundle !== null; } @@ -869,6 +899,9 @@ export class DashboardWidgetSelectComponent { if (this.iotHubAppliedUseCases.size > 0) { filtered = filtered.filter(v => v.useCases?.some(u => this.iotHubAppliedUseCases.has(u))); } + if (this.iotHubVerifiedCreatorsOnly) { + filtered = filtered.filter(v => v.creatorVerified); + } filtered = this.sortInstalledVersions(filtered); const start = page * pageSize; const data = filtered.slice(start, start + pageSize); @@ -876,7 +909,7 @@ export class DashboardWidgetSelectComponent { } private sortInstalledVersions(versions: MpItemVersionView[]): MpItemVersionView[] { - const sort = this.iotHubSortOptions[this.iotHubSelectedSortIndex]; + const sort = this.iotHubSelectedSort; const sign = sort.direction === Direction.ASC ? 1 : -1; const copy = [...versions]; copy.sort((a, b) => { diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.html index 5284c797f1..c3537a8ce9 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.html @@ -60,7 +60,7 @@ [aliasController]="dashboardCtx.aliasController" [stateController]="dashboardCtx.stateController" [dashboardTimewindow]="dashboardCtx.dashboardTimewindow" - [isEdit]="isEdit" + [isEdit]="isEdit && !isHtml" [isEditingWidget]="isEditingWidget" [autofillHeight]="autoFillHeight" [mobileAutofillHeight]="mobileAutoFillHeight" @@ -68,9 +68,9 @@ [isMobile]="isMobileValue" [isMobileDisabled]="isMobileDisabled" [disableWidgetInteraction]="isEdit" - [isEditActionEnabled]="isEdit && !isEditingWidget" - [isExportActionEnabled]="isEdit && !widgetEditMode && !isEditingWidget" - [isRemoveActionEnabled]="isEdit && !widgetEditMode && !isEditingWidget" + [isEditActionEnabled]="isEdit && !isEditingWidget && !isHtml" + [isExportActionEnabled]="isEdit && !widgetEditMode && !isEditingWidget && !isHtml" + [isRemoveActionEnabled]="isEdit && !widgetEditMode && !isEditingWidget && !isHtml" [callbacks]="this" [ignoreLoading]="layoutCtx.ignoreLoading" [parentDashboard]="parentDashboard" diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.ts index 7fcb115bdf..a622a8004a 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/dashboard-layout.component.ts @@ -61,16 +61,34 @@ export class DashboardLayoutComponent extends PageComponent implements ILayoutCo return this.layoutCtx.gridSettings.layoutType === LayoutType.scada; } + get isHtml(): boolean { + return this.layoutCtx.gridSettings.layoutType === LayoutType.html; + } + + // The HTML page layout has no widget grid: its only widget is virtual and is not stored in the layout, + // so widgets cannot be copied from it, pasted into it, cut from it or referenced. + get widgetLayoutEditable(): boolean { + return this.isEdit && !this.isEditingWidget && !this.widgetEditMode && !this.isHtml; + } + + get disableMargins(): boolean { + return this.isScada || this.isHtml; + } + get outerMargin(): boolean { - return this.isScada ? false : this.layoutCtx.gridSettings.outerMargin; + return this.disableMargins ? false : this.layoutCtx.gridSettings.outerMargin; } get margin(): number { - return this.isScada ? 0 : this.layoutCtx.gridSettings.margin; + return this.disableMargins ? 0 : this.layoutCtx.gridSettings.margin; } get autoFillHeight(): boolean { - return (this.isEdit || this.isScada) ? false : this.layoutCtx.gridSettings.autoFillHeight; + if (this.isHtml) { + return true; + } else { + return (this.isEdit || this.isScada) ? false : this.layoutCtx.gridSettings.autoFillHeight; + } } get mobileAutoFillHeight(): boolean { @@ -87,7 +105,7 @@ export class DashboardLayoutComponent extends PageComponent implements ILayoutCo } get isMobileDisabled(): boolean { - return this.widgetEditMode || this.isScada || (this.layoutCtx.breakpoint !== 'default' && !this.isMobileValue); + return this.widgetEditMode || this.isScada || this.isHtml || (this.layoutCtx.breakpoint !== 'default' && !this.isMobileValue); } get mobielRowHeigth(): number { @@ -162,7 +180,7 @@ export class DashboardLayoutComponent extends PageComponent implements ILayoutCo private initHotKeys(): void { this.hotKeys.push( new Hotkey(['ctrl+c', 'meta+c'], (event: KeyboardEvent) => { - if (this.isEdit && !this.isEditingWidget && !this.widgetEditMode) { + if (this.widgetLayoutEditable) { const widget = this.dashboard.getSelectedWidget(); if (widget) { event.preventDefault(); @@ -176,7 +194,7 @@ export class DashboardLayoutComponent extends PageComponent implements ILayoutCo ); this.hotKeys.push( new Hotkey(['ctrl+r', 'meta+r'], (event: KeyboardEvent) => { - if (this.isEdit && !this.isEditingWidget && !this.widgetEditMode) { + if (this.widgetLayoutEditable) { const widget = this.dashboard.getSelectedWidget(); if (widget) { event.preventDefault(); @@ -190,7 +208,7 @@ export class DashboardLayoutComponent extends PageComponent implements ILayoutCo ); this.hotKeys.push( new Hotkey(['ctrl+v', 'meta+v'], (event: KeyboardEvent) => { - if (this.isEdit && !this.isEditingWidget && !this.widgetEditMode) { + if (this.widgetLayoutEditable) { if (this.itembuffer.hasWidget()) { event.preventDefault(); this.pasteWidget(event); @@ -203,7 +221,7 @@ export class DashboardLayoutComponent extends PageComponent implements ILayoutCo ); this.hotKeys.push( new Hotkey(['ctrl+i', 'meta+i'], (event: KeyboardEvent) => { - if (this.isEdit && !this.isEditingWidget && !this.widgetEditMode) { + if (this.widgetLayoutEditable) { if (this.itembuffer.canPasteWidgetReference(this.dashboardCtx.getDashboard(), this.dashboardCtx.state, this.layoutCtx.id, this.layoutCtx.breakpoint)) { event.preventDefault(); @@ -217,7 +235,7 @@ export class DashboardLayoutComponent extends PageComponent implements ILayoutCo ); this.hotKeys.push( new Hotkey(['ctrl+x', 'meta+x'], (event: KeyboardEvent) => { - if (this.isEdit && !this.isEditingWidget && !this.widgetEditMode) { + if (this.widgetLayoutEditable) { const widget = this.dashboard.getSelectedWidget(); if (widget) { event.preventDefault(); diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.html b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.html index c89865433e..79deeb7399 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.html @@ -29,7 +29,7 @@
- @if (!isDividerLayout) { + @if (isBreakpointsLayout) {
@@ -85,11 +85,10 @@ add
- } @else { + } @else if (isDividerLayout) {
+ formControlName="type"> {{ 'layout.percentage-width' | translate }} @@ -125,7 +124,7 @@ - {{ (isDividerLayout ? 'layout.left' : 'layout.main') | translate }} + {{ 'layout.left' | translate }} @if (showPreviewInputs('main')) { @@ -140,7 +139,55 @@ required> } @if (layoutsFormGroup.get('type').value === layoutWidthType.FIXED && - layoutsFormGroup.get('fixedLayout').value === 'main') { + layoutsFormGroup.get('fixedLayout').value === 'main') { + + } +
+ } +
+
+ + + @if (showPreviewInputs('right')) { +
+ @if (layoutsFormGroup.get('type').value !== layoutWidthType.FIXED) { + + } + @if (layoutsFormGroup.get('type').value === layoutWidthType.FIXED) { }
- @if (isDividerLayout) { -
- - - @if (showPreviewInputs('right')) { -
- @if (layoutsFormGroup.get('type').value !== layoutWidthType.FIXED) { - - } - @if (layoutsFormGroup.get('type').value === layoutWidthType.FIXED) { - - } -
- } -
- }
- @if (isDividerLayout) { -
- @if (layoutsFormGroup.get('type').value === layoutWidthType.PERCENTAGE) { - - - } - @if (layoutsFormGroup.get('type').value !== layoutWidthType.PERCENTAGE) { - - - } -
- - -
+
+ @if (layoutsFormGroup.get('type').value === layoutWidthType.PERCENTAGE) { + + + } + @if (layoutsFormGroup.get('type').value !== layoutWidthType.PERCENTAGE) { + + + } +
+ +
- } +
+
+ } @else if (isHtmlLayout) { +
+
{{ 'dashboard.html-page' | translate }}
} diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.ts index fe67491ca9..2ef1094d10 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/layout/manage-dashboard-layouts-dialog.component.ts @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors -// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 import { Component, Inject, OnDestroy, SkipSelf, ViewChild } from '@angular/core'; import { ErrorStateMatcher } from '@angular/material/core'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -23,6 +24,7 @@ import { DashboardLayoutId, DashboardStateLayouts, LayoutDimension, + HtmlPageConfig, LayoutType, layoutTypes, layoutTypeTranslationMap, @@ -74,6 +76,11 @@ export class ManageDashboardLayoutsDialogComponent extends DialogComponent { + if (value !== LayoutType.html && this.layouts.main.gridSettings.htmlPageConfig) { + // Leaving the HTML page: start the widget grid from the defaults right away, so that layout settings + // and new breakpoints copied from the main layout are based on them. + this.layouts.main.gridSettings = this.dashboardUtils.createDefaultGridSettings(); + } + }) + ); + this.subscriptions.push( this.layoutsFormGroup.get('type').valueChanges.subscribe( (value) => { @@ -184,7 +203,7 @@ export class ManageDashboardLayoutsDialogComponent extends DialogComponent { + if (res) { + this.applyLayouts(); + } + }); + } else { + this.applyLayouts(); + } + } + + private applyLayouts(): void { const layoutType = this.layoutsFormGroup.value.layoutType; this.layouts.main.gridSettings.layoutType = layoutType; - if (!this.isDividerLayout) { - delete this.layouts.right; + delete this.layouts.main.gridSettings.layoutDimension; + if (this.isBreakpointsLayout) { if (this.layouts.main.breakpoints) { for (const breakpoint of Object.values(this.layouts.main.breakpoints)) { breakpoint.gridSettings.layoutType = layoutType; @@ -287,13 +324,10 @@ export class ManageDashboardLayoutsDialogComponent extends DialogComponent(); + const layouts = [this.layouts.main, ...Object.values(this.layouts.main?.breakpoints || {})]; + if (this.initialLayoutType === LayoutType.divider) { + layouts.push(this.layouts.right); + } + for (const layout of layouts) { + Object.keys(layout?.widgets || {}).forEach(id => widgetIds.add(id)); + } + return widgetIds.size; + } + + get isHtmlLayout(): boolean { + return this.layoutsFormGroup.get('layoutType').value === LayoutType.html; + } + + get isBreakpointsLayout(): boolean { + return [LayoutType.default, LayoutType.scada].includes(this.layoutsFormGroup.get('layoutType').value); + } + addBreakpoint() { this.dialog.open(AddNewBreakpointDialogComponent, { diff --git a/ui-ngx/src/app/modules/home/components/entity/entity-chips.component.html b/ui-ngx/src/app/modules/home/components/entity/entity-chips.component.html index 8c370cdd5d..cf3970ef5d 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entity-chips.component.html +++ b/ui-ngx/src/app/modules/home/components/entity/entity-chips.component.html @@ -1,11 +1,12 @@ @for (subEntity of subEntities; track subEntity) { - {{ subEntity.name | customTranslate }} diff --git a/ui-ngx/src/app/modules/home/components/entity/entity-chips.component.scss b/ui-ngx/src/app/modules/home/components/entity/entity-chips.component.scss index ee4b487f32..045156fad3 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entity-chips.component.scss +++ b/ui-ngx/src/app/modules/home/components/entity/entity-chips.component.scss @@ -1,11 +1,15 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors -// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 :host { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; + width: 0; + min-width: 100%; a.tb-entity-chip { + max-width: 100%; padding: 4px 8px; border-radius: 12px; line-height: 16px; diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/_iot-hub-common.scss b/ui-ngx/src/app/modules/home/components/iot-hub/_iot-hub-common.scss index 25c2092de0..3c0e06d114 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/_iot-hub-common.scss +++ b/ui-ngx/src/app/modules/home/components/iot-hub/_iot-hub-common.scss @@ -119,3 +119,33 @@ pointer-events: none; } } + +// Scroll area whose thumb shows only while the container is hovered (the filter panels'). +@mixin tb-iot-hub-hover-scrollbar { + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-track { + background-color: transparent; + } + + &::-webkit-scrollbar-thumb { + background-color: transparent; + border-radius: 3px; + } + + &:hover { + &::-webkit-scrollbar-track { + background-color: rgba(0, 0, 0, 0.04); + } + + &::-webkit-scrollbar-thumb { + background-color: rgba(0, 0, 0, 0.2); + + &:hover { + background-color: rgba(0, 0, 0, 0.35); + } + } + } +} diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.html b/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.html index bea4732b05..3bc2fbcbd4 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.html @@ -199,7 +199,8 @@
+ labelPosition="bottom" + (selectionChange)="onStepSelectionChange($event)"> done diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts index 554e09a210..ee4a325742 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/iot-hub/device-install-dialog/device-install-dialog.component.ts @@ -9,6 +9,7 @@ import { AppState } from '@core/core.state'; import { DialogComponent } from '@shared/components/dialog.component'; import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { MatStepper } from '@angular/material/stepper'; +import { StepperSelectionEvent } from '@angular/cdk/stepper'; import { firstValueFrom } from 'rxjs'; import { TranslateService } from '@ngx-translate/core'; import { PageLink } from '@shared/models/page/page-link'; @@ -252,10 +253,7 @@ export class TbDeviceInstallDialogComponent extends DialogComponent { - this.stepper?.next(); - this.onStepActivated(); - }, 0); + setTimeout(() => this.stepper?.next(), 0); return; } this.startWizard(); @@ -306,12 +304,9 @@ export class TbDeviceInstallDialogComponent extends DialogComponent
+ + {{ 'iot-hub.verified-creators-only' | translate }} + +
+ @if (!fixedSubType && subtypeOptions.length > 0 && activeType !== ItemType.ALARM_RULE) { @@ -43,8 +50,8 @@ }
} -
@for (opt of getFilteredItems(subtypeOptions, 'subtype'); track opt.key) { } -
@for (group of getGroupedFilterItems(vendorOptions, 'vendor'); track group.label) { @if (group.label) { @@ -114,8 +121,8 @@ }
} -
@for (ht of getFilteredItems(hardwareTypeOptions, 'hardwareType'); track ht.key) { } -
@for (group of getFilteredConnectivityGroups('connectivity'); track group.group) {
{{ group.group }}
@@ -182,8 +189,8 @@ }
} -
@for (cat of getFilteredItems(categoryOptions, 'category'); track cat.key) { } -
@for (group of getGroupedFilterItems(useCaseOptions, 'useCase'); track group.label) { @if (group.label) { @@ -253,6 +260,12 @@
+ @if (verifiedCreatorsOnly) { + + {{ 'iot-hub.verified-creators-only' | translate }} + close + + } @for (key of getActiveSubtypesArray(); track key) { {{ getSubtypeLabel(key) }} @@ -305,6 +318,8 @@
+
{{ 'iot-hub.filter' | translate }}
+
@@ -347,6 +362,12 @@ @if (hasActiveDropdownFilters()) { + @if (verifiedCreatorsOnly) { + + {{ 'iot-hub.verified-creators-only' | translate }} + close + + } @for (key of getActiveSubtypesArray(); track key) { {{ getSubtypeLabel(key) }} diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.scss b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.scss index a98019cd2c..1b8fa45c82 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.scss +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.scss @@ -98,6 +98,17 @@ } } +.tb-iot-hub-filters-header { + padding: 16px 16px 12px 56px; + font-size: 18px; + font-weight: 500; + color: rgba(0, 0, 0, 0.87); +} + +.tb-iot-hub-filters-desktop .tb-iot-hub-filters-inner { + padding-top: 8px; +} + .tb-iot-hub-filters-wrapper { position: sticky; max-height: calc(100vh - var(--mat-toolbar-standard-height, 64px)); @@ -168,6 +179,10 @@ padding: 0; } + .tb-iot-hub-filter-standalone { + margin-left: 13px; + } + .tb-iot-hub-filter-panel.mat-expansion-panel { .mat-expansion-panel-header { padding-left: 24px; @@ -200,6 +215,21 @@ background: rgba(0, 0, 0, 0.12); } +// 56px section-title inset minus the checkbox's own 11px +.tb-iot-hub-filter-standalone { + margin-left: 45px; +} + +.tb-iot-hub-filter-panel.mat-expansion-panel mat-checkbox, +.tb-iot-hub-filter-standalone { + display: block; + overflow: hidden; + + &:hover { + background: rgba(0, 0, 0, 0.04); + } +} + // Filter expansion panels — Design: no shadow, pl-40 for content .tb-iot-hub-filter-panel.mat-expansion-panel { box-shadow: none; @@ -222,15 +252,6 @@ padding: 0 8px 0 0; } - mat-checkbox { - display: block; - overflow: hidden; - - &:hover { - background: rgba(0, 0, 0, 0.04); - } - } - .tb-iot-hub-filter-items { padding-left: 44px; max-height: 340px; diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts index 019faf750a..ed5a1e90b1 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-browse.component.ts @@ -4,23 +4,29 @@ import { AfterViewInit, Component, ElementRef, EventEmitter, Input, NgZone, OnDe import { Subject } from 'rxjs'; import { debounceTime, takeUntil } from 'rxjs/operators'; import { PageLink } from '@shared/models/page/page-link'; -import { Direction, SortOrder } from '@shared/models/page/sort-order'; +import { SortOrder } from '@shared/models/page/sort-order'; import { PageData } from '@shared/models/page/page-data'; import { MpItemVersionQuery, MpItemVersionView } from '@shared/models/iot-hub/iot-hub-version.models'; -import { ItemType, FilterParamInfo, CREATOR_VISIBLE_ITEM_TYPES } from '@shared/models/iot-hub/iot-hub-item.models'; +import { + CREATOR_VISIBLE_ITEM_TYPES, + FilterParamInfo, + IOT_HUB_SORT_OPTIONS, + isCompactItemType, + ItemType +} from '@shared/models/iot-hub/iot-hub-item.models'; import { widgetTypeTranslations, cfTypeTranslations, ruleChainTypeTranslations } from '@shared/models/iot-hub/iot-hub-version.models'; import { IotHubInstalledItem, DeviceInstalledItemDescriptor } from '@shared/models/iot-hub/iot-hub-installed-item.models'; import { IotHubApiService } from '@core/http/iot-hub-api.service'; import { TranslateService } from '@ngx-translate/core'; import { ActivatedRoute, Router } from '@angular/router'; import { IotHubActionsService } from '@home/components/iot-hub/iot-hub-actions.service'; -import { filterIotHubItemsBySearch, groupIotHubFilterItems, IotHubFilterGroup } from '@home/components/iot-hub/iot-hub-utils'; - -interface SortOption { - value: string; - label: string; - direction: Direction; -} +import { + filterIotHubItemsBySearch, + groupIotHubFilterItems, + IOT_HUB_FILTER_SCROLL_THRESHOLD, + IotHubFilterGroup, + measureGridColumns +} from '@home/components/iot-hub/iot-hub-utils'; @Component({ selector: 'tb-iot-hub-browse', @@ -34,7 +40,6 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy private static typeTabLabel(t: ItemType): string { switch (t) { case ItemType.WIDGET: return 'item.type-widget-plural'; - case ItemType.DASHBOARD: return 'item.type-dashboard-plural'; case ItemType.SOLUTION_TEMPLATE: return 'item.type-solution-template-plural'; case ItemType.CALCULATED_FIELD: return 'item.type-calculated-field-plural'; case ItemType.ALARM_RULE: return 'item.type-alarm-rule-plural'; @@ -44,6 +49,7 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy } readonly ItemType = ItemType; + readonly scrollThreshold = IOT_HUB_FILTER_SCROLL_THRESHOLD; @Input() creatorId: string; @Input() embedded = false; @@ -79,15 +85,12 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy } get isCompactType(): boolean { - return this._activeType === ItemType.CALCULATED_FIELD - || this._activeType === ItemType.ALARM_RULE - || this._activeType === ItemType.RULE_CHAIN; + return isCompactItemType(this._activeType); } get searchPlaceholderKey(): string { switch (this._activeType) { case ItemType.WIDGET: return 'iot-hub.search-widgets'; - case ItemType.DASHBOARD: return 'iot-hub.search-dashboards'; case ItemType.SOLUTION_TEMPLATE: return 'iot-hub.search-solution-templates'; case ItemType.CALCULATED_FIELD: return 'iot-hub.search-calculated-fields'; case ItemType.ALARM_RULE: return 'iot-hub.search-alarm-rules'; @@ -130,12 +133,9 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy activeConnectivity = new Set(); activeHardwareTypes = new Set(); activeVendors = new Set(); + verifiedCreatorsOnly = false; - sortOptions: SortOption[] = [ - { value: 'totalInstallCount', label: 'iot-hub.sort-most-installed', direction: Direction.DESC }, - { value: 'publishedTime', label: 'iot-hub.sort-newest', direction: Direction.DESC }, - { value: 'name', label: 'iot-hub.sort-name', direction: Direction.ASC } - ]; + readonly sortOptions = IOT_HUB_SORT_OPTIONS; typeTabs: { type: ItemType; label: string }[] = CREATOR_VISIBLE_ITEM_TYPES.map(t => ({ type: t, @@ -222,17 +222,7 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy if (!el) { return this.probeCols; } - // Force layout so `grid-template-columns` resolves to pixel tracks, not `repeat(...)`. - void el.offsetWidth; - const tracks = getComputedStyle(el).gridTemplateColumns; - if (!tracks || tracks === 'none') { - return 1; - } - if (tracks.startsWith('repeat(')) { - const match = tracks.match(/^repeat\(\s*(\d+)\s*,/); - return match ? parseInt(match[1], 10) : 1; - } - return Math.max(1, tracks.trim().split(/\s+/).filter(t => t.length > 0).length); + return measureGridColumns(el); } private adjustPageSize(): void { @@ -398,6 +388,12 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy this.loadItems(); } + onVerifiedCreatorsToggle(): void { + this.verifiedCreatorsOnly = !this.verifiedCreatorsOnly; + this.pageIndex = 0; + this.loadItems(); + } + isVendorActive(vendor: string): boolean { return this.activeVendors.has(vendor); } @@ -501,12 +497,14 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy this.activeConnectivity.clear(); this.activeHardwareTypes.clear(); this.activeVendors.clear(); + this.verifiedCreatorsOnly = false; } get activeFilterCount(): number { const subtypeCount = this.fixedSubType ? this.getActiveSubtypesArray().length : (this.getActiveSubtypes()?.size || 0); return subtypeCount + this.activeCategories.size + this.activeUseCases.size + - this.activeConnectivity.size + this.activeHardwareTypes.size + this.activeVendors.size; + this.activeConnectivity.size + this.activeHardwareTypes.size + this.activeVendors.size + + (this.verifiedCreatorsOnly ? 1 : 0); } hasActiveDropdownFilters(): boolean { @@ -514,7 +512,7 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy return this.activeCategories.size > 0 || this.activeUseCases.size > 0 || subtypeCount > 0 || this.activeConnectivity.size > 0 || this.activeHardwareTypes.size > 0 || - this.activeVendors.size > 0; + this.activeVendors.size > 0 || this.verifiedCreatorsOnly; } hasActiveFilters(): boolean { @@ -524,7 +522,6 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy getTitle(): string { switch (this.activeType) { case ItemType.WIDGET: return 'iot-hub.title-widgets'; - case ItemType.DASHBOARD: return 'iot-hub.title-dashboards'; case ItemType.SOLUTION_TEMPLATE: return 'iot-hub.title-solution-templates'; case ItemType.CALCULATED_FIELD: return 'iot-hub.title-calculated-fields'; case ItemType.ALARM_RULE: return 'iot-hub.title-alarm-rules'; @@ -703,7 +700,8 @@ export class TbIotHubBrowseComponent implements OnInit, AfterViewInit, OnDestroy ruleChainTypes: this.activeRuleChainTypes.size > 0 ? Array.from(this.activeRuleChainTypes) : undefined, hardwareTypes: this.activeHardwareTypes.size > 0 ? Array.from(this.activeHardwareTypes) : undefined, connectivity: this.activeConnectivity.size > 0 ? Array.from(this.activeConnectivity) : undefined, - vendors: this.activeVendors.size > 0 ? Array.from(this.activeVendors) : undefined + vendors: this.activeVendors.size > 0 ? Array.from(this.activeVendors) : undefined, + creatorVerified: this.verifiedCreatorsOnly }); this.iotHubApiService.getPublishedVersions( query, diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-components.module.ts b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-components.module.ts index 78b1742ea0..ea754e42f9 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-components.module.ts +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-components.module.ts @@ -15,6 +15,7 @@ import { TbIotHubUnpublishedWarningDialogComponent } from './iot-hub-unpublished import { TbDeviceInstallDialogComponent } from './device-install-dialog/device-install-dialog.component'; import { InstallFormRendererComponent } from './device-install-dialog/install-form-renderer/install-form-renderer.component'; import { TbIotHubSearchComponent } from './iot-hub-search.component'; +import { TbIotHubFacetListComponent } from './iot-hub-facet-list.component'; import { TbIotHubInstalledItemsTableComponent } from './iot-hub-installed-items-table.component'; import { TbIotHubInstalledItemsDialogComponent } from './iot-hub-installed-items-dialog.component'; import { TbIotHubSelectCfEntityDialogComponent } from './iot-hub-select-cf-entity-dialog.component'; @@ -36,6 +37,7 @@ import { IotHubItemLinkModule } from './iot-hub-item-link-card/iot-hub-item-link TbIotHubUnpublishedWarningDialogComponent, TbDeviceInstallDialogComponent, TbIotHubSearchComponent, + TbIotHubFacetListComponent, TbIotHubInstalledItemsTableComponent, TbIotHubInstalledItemsDialogComponent, TbIotHubSelectCfEntityDialogComponent, @@ -63,6 +65,7 @@ import { IotHubItemLinkModule } from './iot-hub-item-link-card/iot-hub-item-link TbIotHubUnpublishedWarningDialogComponent, TbDeviceInstallDialogComponent, TbIotHubSearchComponent, + TbIotHubFacetListComponent, TbIotHubInstalledItemsTableComponent, TbIotHubInstalledItemsDialogComponent, TbIotHubSelectCfEntityDialogComponent, diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-facet-list.component.html b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-facet-list.component.html new file mode 100644 index 0000000000..4683eb2d65 --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-facet-list.component.html @@ -0,0 +1,31 @@ + + + + {{ label | translate }} + + + @if (searchable) { + + } + +
+ @for (key of visibleOptions; track key) { + + {{ labelFor(key) }} + + } +
+
diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-facet-list.component.scss b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-facet-list.component.scss new file mode 100644 index 0000000000..6f41a53bc8 --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-facet-list.component.scss @@ -0,0 +1,63 @@ +// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors +// SPDX-License-Identifier: Apache-2.0 +@import "./iot-hub-common"; + +// Matches the type pages' filter panel, minus its rail indent. +.tb-iot-hub-facet-panel.mat-expansion-panel { + box-shadow: none; + border-radius: 0; + background: transparent; + + // Text is indented by --tb-facet-indent (set by the host); the rules between facets are not. + .mat-expansion-panel-header { + padding: 8px 16px 8px var(--tb-facet-indent, 16px); + height: 48px; + min-height: 48px; + } + + ::ng-deep .mat-expansion-panel-header-title { + font-size: 14px; + font-weight: 500; + color: rgba(0, 0, 0, 0.87); + } + + ::ng-deep .mat-expansion-panel-body { + padding: 0 8px 8px var(--tb-facet-indent, 16px); + } + + mat-checkbox { + display: block; + overflow: hidden; + + &:hover { + background: rgba(0, 0, 0, 0.04); + } + } + + .tb-iot-hub-facet-items { + // Capped only when long enough to scroll. + &.scrollable { + max-height: 280px; + overflow-y: auto; + } + + @include tb-iot-hub-hover-scrollbar; + } + + .tb-iot-hub-facet-search { + @include tb-iot-hub-search-container; + margin: 4px 8px 8px 0; + + mat-icon { + @include tb-iot-hub-search-icon(rgba(0, 0, 0, 0.54)); + } + + input { + @include tb-iot-hub-search-input-text(0.2px); + } + + .tb-iot-hub-facet-search-clear.mat-mdc-icon-button { + @include tb-iot-hub-search-clear; + } + } +} diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-facet-list.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-facet-list.component.ts new file mode 100644 index 0000000000..a1c11f500f --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-facet-list.component.ts @@ -0,0 +1,60 @@ +// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors +// SPDX-License-Identifier: Apache-2.0 +import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'; +import { filterByLabel, IOT_HUB_FILTER_SCROLL_THRESHOLD } from '@home/components/iot-hub/iot-hub-utils'; + +/** + * One checkbox facet of a filter panel: a title, the option keys, and the set of keys currently + * selected. Presentational only - the host decides what a toggle means. + */ +@Component({ + selector: 'tb-iot-hub-facet-list', + standalone: false, + templateUrl: './iot-hub-facet-list.component.html', + styleUrls: ['./iot-hub-facet-list.component.scss'] +}) +export class TbIotHubFacetListComponent implements OnChanges { + + /** Translation key for the facet's heading. */ + @Input() label: string; + + @Input() options: string[] = []; + + /** Keys the host has selected. The host hands over a new Set on every toggle. */ + @Input() selected = new Set(); + + /** Turns an option key into what the user reads. */ + @Input() labelFor: (key: string) => string = (key) => key; + + @Input() expanded = true; + + @Output() toggled = new EventEmitter(); + + search = ''; + searchable = false; + visibleOptions: string[] = []; + scrollable = false; + + ngOnChanges(): void { + this.searchable = this.options.length > IOT_HUB_FILTER_SCROLL_THRESHOLD; + this.applySearch(); + } + + onSearchChange(search: string): void { + this.search = search; + this.applySearch(); + } + + isSelected(key: string): boolean { + return this.selected.has(key); + } + + onToggle(key: string): void { + this.toggled.emit(key); + } + + private applySearch(): void { + this.visibleOptions = filterByLabel(this.options, this.search, this.labelFor); + this.scrollable = this.visibleOptions.length > IOT_HUB_FILTER_SCROLL_THRESHOLD; + } +} diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-installed-items-table.component.scss b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-installed-items-table.component.scss index 78c5d11dfd..9f304d2751 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-installed-items-table.component.scss +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-installed-items-table.component.scss @@ -116,7 +116,6 @@ .tb-type-calc-field { color: #3db5e0; background: rgba(61, 181, 224, 0.06); } .tb-type-alarm-rule { color: #d7702f; background: rgba(215, 112, 47, 0.06); } .tb-type-rule-chain { color: #aa5be3; background: rgba(170, 91, 227, 0.06); } -.tb-type-dashboard { color: #607d8b; background: rgba(96, 125, 139, 0.06); } // "vX.X.X Available" button — Design: border rgba(0,0,0,0.12), rounded-4, px-12 py-6, gap-8 .tb-installed-version-btn { diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-installed-items-table.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-installed-items-table.component.ts index a1206c4f1b..f3e692e704 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-installed-items-table.component.ts +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-installed-items-table.component.ts @@ -158,7 +158,6 @@ export class TbIotHubInstalledItemsTableComponent implements OnInit, OnChanges, getItemTypeChipClass(itemType: string): string { switch (itemType) { case 'WIDGET': return 'tb-type-widget'; - case 'DASHBOARD': return 'tb-type-dashboard'; case 'CALCULATED_FIELD': return 'tb-type-calc-field'; case 'ALARM_RULE': return 'tb-type-alarm-rule'; case 'RULE_CHAIN': return 'tb-type-rule-chain'; diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.html b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.html index 6015a689a6..d1ff08ba3a 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.html +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.html @@ -71,14 +71,15 @@ }
} @else { - +
@if (getPreviewUrl(); as previewUrl) { } @else {
- {{ getPlaceholderIcon() }} + + {{ getPlaceholderIcon() }}
}
diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.ts index 972e20c6bb..7dbe4d066e 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.ts +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { Component, EventEmitter, Input, Output } from '@angular/core'; import { MpItemVersionView, cfTypeTranslations, cfTypeIcons, ruleChainTypeTranslations, widgetTypeTranslations } from '@shared/models/iot-hub/iot-hub-version.models'; -import { getItemTypeIcon, ItemType } from '@shared/models/iot-hub/iot-hub-item.models'; +import { getItemTypeIcon, isCompactItemType, ItemType } from '@shared/models/iot-hub/iot-hub-item.models'; import { IotHubInstalledItem } from '@shared/models/iot-hub/iot-hub-installed-item.models'; import { TranslateService } from '@ngx-translate/core'; import { IotHubApiService } from '@core/http/iot-hub-api.service'; @@ -23,6 +23,11 @@ export class TbIotHubItemCardComponent { @Input() showTypeChip = true; @Input() showSubtype = false; @Input() mode: 'default' | 'add' = 'default'; + /** + * `auto`: compact row for the types with nothing to preview (single-type grids widen their + * cells for it). `preview`: the tall card for every type, for grids that mix types. + */ + @Input() layout: 'auto' | 'preview' = 'auto'; @Output() cardClick = new EventEmitter(); @Output() creatorClick = new EventEmitter(); @Output() installClick = new EventEmitter(); @@ -47,9 +52,10 @@ export class TbIotHubItemCardComponent { } isCompactLayout(): boolean { - return this.item.type === ItemType.CALCULATED_FIELD - || this.item.type === ItemType.ALARM_RULE - || this.item.type === ItemType.RULE_CHAIN; + if (this.layout === 'preview') { + return false; + } + return isCompactItemType(this.item.type); } getPreviewUrl(): string | null { diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.html b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.html index 81eac5a956..d544727d91 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.html @@ -13,7 +13,7 @@
}
- {{ item.name }} + {{ itemTitle }}
{{ getTypeIcon() }} @@ -75,7 +75,7 @@
@if (isCompactLayout()) { - +
@if (item.description) { @@ -86,11 +86,15 @@
} @else { - +
- @if (item.type === ItemType.SOLUTION_TEMPLATE && carouselImages.length > 1) { + [class.dlg-preview-carousel]="carouselImages.length > 1" + tbPhotoSwipeGallery galleryChildrenSelector=".dlg-carousel-item, .dlg-preview-img" + (lightboxOpened)="lightboxOpen = true" + (slideChanged)="carouselIndex = $event" + (lightboxClosed)="lightboxOpen = false"> + @if (carouselImages.length > 1) {
} @else { - @if (getPreviewUrl(); as url) { + @if (carouselImages[0]; as url) { } @else {
@@ -156,7 +160,7 @@
-
+
@if (showCreator) {
{{ 'iot-hub.creator' | translate }} diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.scss b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.scss index f7ba6a277c..3b52a022c8 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.scss +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.scss @@ -145,6 +145,10 @@ &.dlg-preview-carousel { aspect-ratio: 1.5; } + + img { + cursor: zoom-in; + } } .dlg-preview-img { diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.ts index eb85499d51..927c5cc971 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-detail-dialog.component.ts @@ -7,7 +7,7 @@ import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { DialogComponent } from '@shared/components/dialog.component'; import { MpItemVersionView, cfTypeTranslations, cfTypeIcons, ruleChainTypeTranslations, widgetTypeTranslations, NodeInfo } from '@shared/models/iot-hub/iot-hub-version.models'; -import { getItemTypeIcon, ItemType, itemTypeTranslations } from '@shared/models/iot-hub/iot-hub-item.models'; +import { getItemTypeIcon, isCompactItemType, ItemType, itemTypeTranslations } from '@shared/models/iot-hub/iot-hub-item.models'; import { getInstalledItemUrl, IotHubInstalledItem } from '@shared/models/iot-hub/iot-hub-installed-item.models'; import { IotHubApiService } from '@core/http/iot-hub-api.service'; import { TranslateService } from '@ngx-translate/core'; @@ -49,6 +49,8 @@ export class TbIotHubItemDetailDialogComponent extends DialogComponent r.type === 'SCREENSHOT'); - const allResources = screenshotResources.length > 0 - ? screenshotResources - : this.item.resources.filter(r => r.type === 'ICON'); - this.carouselImages = allResources.map(r => - this.iotHubApiService.resolveResourceUrl(`/api/resources/${r.id}`) - ); + const urls: string[] = []; + const previewUrl = this.getPreviewUrl(); + if (previewUrl) { + urls.push(previewUrl); + } + // Skip the screenshot the preview already shows; by id, since item.image may carry a suffix + const previewResourceId = this.item.image?.match(/\/api\/resources\/([^/?#]+)/)?.[1]; + for (const resource of this.item.resources || []) { + if (resource.type === 'SCREENSHOT' && resource.id !== previewResourceId) { + urls.push(this.resourceUrl(resource.id)); + } + } + if (!urls.length) { + // Same order as resolveIotHubItemImageUrl: image, screenshot, then a single icon stand-in + const icon = this.item.resources?.find(resource => resource.type === 'ICON'); + if (icon) { + urls.push(this.resourceUrl(icon.id)); + } + } + this.carouselImages = urls; + } + + private resourceUrl(id: string): string { + return this.iotHubApiService.resolveResourceUrl(`/api/resources/${id}`); } private loadReadme(): void { diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-markdown.component.html b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-markdown.component.html index b135ff5eb9..4c09437c94 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-markdown.component.html +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-markdown.component.html @@ -4,7 +4,9 @@ SPDX-License-Identifier: Apache-2.0 --> -: the ${images.gallery(...)} block (it runs its own gallery), the code block +// clipboard icon and an item link card's thumbnail. Images inside a link are excluded too: the +// lightbox preventDefaults the click, which would swallow the navigation. +const README_GALLERY_SELECTOR = + 'img:not(.tb-gallery-images img):not(.clipboard-btn img):not(tb-iot-hub-item-link-card img):not(a img)'; +const README_GALLERY_IMAGE_CLASS = 'tb-readme-gallery-image'; + @Component({ selector: 'tb-iot-hub-markdown', standalone: false, @@ -61,6 +69,8 @@ export class TbIotHubMarkdownComponent implements OnInit, OnChanges { readonly itemLinkCompileModules: Type[] = [IotHubItemLinkModule]; + readonly readmeGallerySelector = README_GALLERY_SELECTOR; + constructor( private iotHubApiService: IotHubApiService, private elementRef: ElementRef @@ -86,6 +96,8 @@ export class TbIotHubMarkdownComponent implements OnInit, OnChanges { onReady() { const container = this.elementRef.nativeElement; + container.querySelectorAll(README_GALLERY_SELECTOR) + .forEach(image => image.classList.add(README_GALLERY_IMAGE_CLASS)); this.ready.emit(container); } diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.html b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.html index 76d5079329..794d6a843c 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.html +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.html @@ -4,14 +4,26 @@ SPDX-License-Identifier: Apache-2.0 --> -
+
{{ 'iot-hub.results-count' | translate:{ count: totalElements } }}
- -
+ + + + +
+ @if (showFilters) { + + }
-
+
{{ 'iot-hub.results-count' | translate:{ count: totalElements } }} @@ -76,62 +88,98 @@
-
- -
- - @if (hasError) { -
-
-

{{ 'iot-hub.network-server-unavailable' | translate }}

-

{{ 'iot-hub.network-server-unavailable-text' | translate }}

- -
+ + +
+ @if (activeFilterCount > 0) { + } - - - @if (!hasError && totalElements === 0 && searchText?.trim()) { -
-
-

{{ 'iot-hub.no-items-found' | translate }}

-

{{ 'iot-hub.try-adjusting-search' | translate }}

-
+ + + @if (categoryOptions.length > 0) { + + + } + @if (useCaseOptions.length > 0) { + + + } +
+
- - @if (resultGroups.length > 0) { -
- @for (group of resultGroups; track group.type) { -
- - - -
- @for (item of group.items; track item.id) { - - - } -
-
- } -
+
+ + +
+ @if (showFilters) { + } + +
+ + @if (hasError) { +
+
+

{{ 'iot-hub.network-server-unavailable' | translate }}

+

{{ 'iot-hub.network-server-unavailable-text' | translate }}

+ +
+ } + + + @if (!hasError && totalElements === 0 && searchText?.trim()) { +
+
+

{{ 'iot-hub.no-items-found' | translate }}

+

{{ 'iot-hub.try-adjusting-search' | translate }}

+
+ } + + + @if (results.length > 0) { +
+ @for (item of results; track item.id) { + + + } +
+ } +
diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.scss b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.scss index 86d03379ba..ab17676478 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.scss +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.scss @@ -9,6 +9,13 @@ flex-direction: column; } +// Full bleed: content rows pad themselves in by --tb-search-side-pad; the divider and the filter +// rail reach the edge. +.tb-search-pad { + padding-left: var(--tb-search-side-pad, 0px); + padding-right: var(--tb-search-side-pad, 0px); +} + .tb-search-results-count-mobile { display: none; margin-left: auto; @@ -144,69 +151,113 @@ overflow: auto; } -// Categories / sections -.tb-search-categories { - display: flex; - flex-direction: column; - gap: 48px; +// Card grid +.tb-search-card-grid { + display: grid; + grid-template-columns: repeat(5, 1fr); + gap: 20px; + + // Zero-height probe for the column count; needs display: grid and a width to resolve tracks. + &.tb-search-card-grid-probe { + width: 100%; + height: 0; + gap: 0; + overflow: hidden; + visibility: hidden; + pointer-events: none; + } } -// Section header -.tb-search-section-header { - font-size: 18px; - font-weight: 500; - line-height: 24px; - color: rgba(0, 0, 0, 0.87); - padding: 0; - margin-bottom: 12px; +// Filter button, with the active count +.tb-search-filter-btn { + flex-shrink: 0; +} + +.tb-search-filter-count { + margin-left: 6px; + min-width: 18px; + height: 18px; + padding: 0 5px; + border-radius: 9px; + background: rgba(0, 0, 0, 0.08); + font-size: 12px; + line-height: 18px; + font-variant-numeric: tabular-nums; +} - mat-icon { - font-size: 24px; - width: 24px; - height: 24px; +// Facet sidebar beside the grid. Both columns scroll inside the given height, so neither grows +// past the card. +.tb-search-layout { + display: flex; + gap: 24px; + height: 100%; + min-height: 0; + + .tb-results-container { + flex: 1; + min-width: 0; + // Only on the right: the gap to the rail already separates it on the left. + padding-right: var(--tb-search-side-pad, 0px); } } -// Card grid -.tb-search-card-grid { - display: grid; - grid-template-columns: repeat(5, 1fr); - gap: 20px; +.tb-search-facets-desktop { + width: 232px; + flex-shrink: 0; + border-right: 1px solid rgba(0, 0, 0, 0.12); - &.tb-search-card-grid-compact { - grid-template-columns: repeat(3, 1fr); + // Starts at the card's edge so the rules across it reach it; each facet indents its own text. + --tb-facet-indent: var(--tb-search-side-pad, 16px); + + align-self: stretch; + height: 100%; + overflow-y: auto; + padding-top: 20px; + + @include tb-iot-hub-hover-scrollbar; +} + +// The close button and heading belong to the narrow layout only. +.tb-search-facets-header { + display: none; + height: 48px; + font-size: 16px; + font-weight: 500; +} + +.tb-search-facets { + display: flex; + flex-direction: column; + padding-bottom: 24px; + + // A flush rule between filter sections, as on the type pages. + tb-iot-hub-facet-list + tb-iot-hub-facet-list { + border-top: 1px solid rgba(0, 0, 0, 0.12); } } +.tb-search-facets-clear { + align-self: flex-start; + margin-left: calc(var(--tb-facet-indent, 16px) - 16px); +} + // Responsive @media #{$mat-gt-xxl} { .tb-search-card-grid { grid-template-columns: repeat(6, 1fr); - - &.tb-search-card-grid-compact { - grid-template-columns: repeat(4, 1fr); - } } } @media #{$mat-lt-xl} { .tb-search-card-grid { grid-template-columns: repeat(4, 1fr); - - &.tb-search-card-grid-compact { - grid-template-columns: repeat(3, 1fr); - } } } @media #{$mat-lt-xmd} { .tb-search-card-grid { grid-template-columns: repeat(3, 1fr); - - &.tb-search-card-grid-compact { - grid-template-columns: repeat(2, 1fr); - } } } @@ -229,10 +280,6 @@ .tb-search-card-grid { grid-template-columns: repeat(2, 1fr); - - &.tb-search-card-grid-compact { - grid-template-columns: repeat(1, 1fr); - } } } @@ -269,3 +316,36 @@ margin-left: 0; } } + +// Below this width the sidebar collapses and the Filter button opens it above the results. +@media #{$mat-lt-lg} { + .tb-search-layout { + flex-direction: column; + } + + .tb-search-facets-desktop { + display: none; + // Above the results it is content, not a rail, so it is padded in like the rows above. + width: 100%; + height: auto; + max-height: 60vh; + border-right: none; + border-bottom: 1px solid rgba(0, 0, 0, 0.12); + padding-right: 0; + + &.opened { + display: block; + } + } + + .tb-search-facets-header { + display: flex; + } +} + +// The sidebar is shown, so there is nothing for the button to open. +@media #{$mat-gt-md} { + .tb-search-filter-btn { + display: none; + } +} diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.ts index 43c22b1493..d9b980b1fd 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.ts +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-search.component.ts @@ -1,33 +1,29 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors // SPDX-License-Identifier: Apache-2.0 -import { Component, OnInit, OnDestroy, Input, Output, EventEmitter } from '@angular/core'; +import { Component, OnInit, OnDestroy, Input, Output, EventEmitter, ViewChild, ElementRef, NgZone } from '@angular/core'; import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; -import { forkJoin, Subject, Subscription } from 'rxjs'; -import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; +import { forkJoin, of, Subject, Subscription } from 'rxjs'; +import { catchError, debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators'; import { PageLink } from '@shared/models/page/page-link'; -import { Direction, SortOrder } from '@shared/models/page/sort-order'; +import { SortOrder } from '@shared/models/page/sort-order'; import { MpItemVersionQuery, MpItemVersionView } from '@shared/models/iot-hub/iot-hub-version.models'; -import { ItemType, itemTypeTranslations } from '@shared/models/iot-hub/iot-hub-item.models'; +import { PageData } from '@shared/models/page/page-data'; +import { + CROSS_TYPE_ITEM_TYPES, + FilterParamInfo, + IOT_HUB_SORT_OPTIONS, + ItemType, + itemTypeTranslations +} from '@shared/models/iot-hub/iot-hub-item.models'; import { IotHubInstalledItem } from '@shared/models/iot-hub/iot-hub-installed-item.models'; import { IotHubApiService } from '@core/http/iot-hub-api.service'; import { IotHubActionsService } from './iot-hub-actions.service'; +import { measureGridColumns } from './iot-hub-utils'; -interface SearchResultGroup { - type: ItemType; - items: MpItemVersionView[]; -} - -interface SortOption { - value: string; - label: string; - direction: Direction; -} - -const TYPE_ORDER: ItemType[] = [ - ItemType.DEVICE, ItemType.SOLUTION_TEMPLATE, ItemType.WIDGET, - ItemType.CALCULATED_FIELD, ItemType.ALARM_RULE, ItemType.RULE_CHAIN -]; +/** A page is whole rows of the grid, and never fewer than MIN_PAGE_SIZE cards. */ +const ROWS_PER_PAGE = 3; +const MIN_PAGE_SIZE = 12; @Component({ selector: 'tb-iot-hub-search', @@ -37,32 +33,50 @@ const TYPE_ORDER: ItemType[] = [ }) export class TbIotHubSearchComponent implements OnInit, OnDestroy { - readonly ItemType = ItemType; - @Input() searchText = ''; @Input() creatorId: string; @Input() showCreator = true; + /** Off on the creator profile, which is already scoped to one creator. */ + @Input() showFilters = true; @Output() searchTextChange = new EventEmitter(); get searchPlaceholderKey(): string { return this.creatorId ? 'iot-hub.search-published-items' : 'iot-hub.search'; } - resultGroups: SearchResultGroup[] = []; + results: MpItemVersionView[] = []; totalElements = 0; isLoading = false; hasError = false; private retryTimer: any = null; - pageSize = 15; pageIndex = 0; - pageSizeOptions = [15, 30, 60]; - sortOptions: SortOption[] = [ - { value: 'totalInstallCount', label: 'iot-hub.sort-most-installed', direction: Direction.DESC }, - { value: 'publishedTime', label: 'iot-hub.sort-newest', direction: Direction.DESC }, - { value: 'name', label: 'iot-hub.sort-name', direction: Direction.ASC } - ]; + /** A hidden element carrying the real grid's classes, so the column count comes from the CSS. */ + @ViewChild('cardGridProbe', { static: true }) cardGridProbe!: ElementRef; + cols = 5; + pageSize = MIN_PAGE_SIZE; + private resizeObserver?: ResizeObserver; + private resizeSubject = new Subject(); + private resizeSubscription?: Subscription; + + get pageSizeOptions(): number[] { + const base = Math.max(MIN_PAGE_SIZE, this.cols * ROWS_PER_PAGE); + return [base, base * 2, base * 4]; + } + + // Filter panel state. An empty set means "no filter". + + /** Narrow widths only: the facet panel is a block above the results, not a sidebar. */ + filtersOpen = false; + readonly typeOptions: string[] = CROSS_TYPE_ITEM_TYPES; + categoryOptions: string[] = []; + useCaseOptions: string[] = []; + activeTypes = new Set(); + activeCategories = new Set(); + activeUseCases = new Set(); + + readonly sortOptions = IOT_HUB_SORT_OPTIONS; selectedSortIndex = 0; installedWidgets: IotHubInstalledItem[] = []; @@ -74,16 +88,30 @@ export class TbIotHubSearchComponent implements OnInit, OnDestroy { private searchSubject = new Subject(); private searchSubscription: Subscription; + /** Every reload goes through here, so a newer request cancels an older one still in flight. */ + private loadSubject = new Subject(); + private loadSubscription: Subscription; constructor( private router: Router, private translate: TranslateService, private iotHubApiService: IotHubApiService, - private iotHubActions: IotHubActionsService + private iotHubActions: IotHubActionsService, + private zone: NgZone ) {} ngOnInit(): void { + this.measureCols(); + this.observeGridWidth(); + if (this.showFilters) { + this.loadFilterInfo(); + } this.loadInstalledItems(); + this.loadSubscription = this.loadSubject.pipe( + switchMap(() => this.fetchResults(this.searchText || '').pipe( + catchError(() => of(null)) + )) + ).subscribe(result => this.applyResult(result)); this.searchSubscription = this.searchSubject.pipe( debounceTime(300), distinctUntilChanged() @@ -96,6 +124,125 @@ export class TbIotHubSearchComponent implements OnInit, OnDestroy { ngOnDestroy(): void { this.searchSubscription?.unsubscribe(); + this.loadSubscription?.unsubscribe(); + this.resizeSubscription?.unsubscribe(); + this.resizeObserver?.disconnect(); + } + + // Filters + + getTypeLabel = (key: string): string => { + const translationKey = itemTypeTranslations.get(key as ItemType); + return translationKey ? this.translate.instant(translationKey + '-plural') : key; + }; + + onTypeToggle(key: string): void { + this.activeTypes = this.toggled(this.activeTypes, key); + this.reloadFromFirstPage(); + } + + onCategoryToggle(key: string): void { + this.activeCategories = this.toggled(this.activeCategories, key); + this.reloadFromFirstPage(); + } + + onUseCaseToggle(key: string): void { + this.activeUseCases = this.toggled(this.activeUseCases, key); + this.reloadFromFirstPage(); + } + + get activeFilterCount(): number { + return this.activeTypes.size + this.activeCategories.size + this.activeUseCases.size; + } + + clearFilters(): void { + if (this.activeFilterCount === 0) { + return; + } + this.activeTypes = new Set(); + this.activeCategories = new Set(); + this.activeUseCases = new Set(); + this.reloadFromFirstPage(); + } + + /** A new Set rather than a mutation, so the facet list's @Input sees the change. */ + private toggled(set: Set, key: string): Set { + const next = new Set(set); + if (!next.delete(key)) { + next.add(key); + } + return next; + } + + private reloadFromFirstPage(): void { + this.pageIndex = 0; + this.loadResults(); + } + + /** + * filterInfo answers per item type, so the six answers are merged. Each request has its own + * catchError: one type failing costs that type's options, not the panel. + */ + private loadFilterInfo(): void { + const config = { ignoreLoading: true, ignoreErrors: true }; + forkJoin( + CROSS_TYPE_ITEM_TYPES.map(type => + this.iotHubApiService.getFilterInfo(type, config).pipe(catchError(() => of(null))) + ) + ).subscribe({ + next: infos => { + this.categoryOptions = this.mergeFacet(infos.map(i => i?.categories)); + this.useCaseOptions = this.mergeFacet(infos.map(i => i?.useCases)); + } + }); + } + + /** Keys that have items in any of the per-type answers, sorted. */ + private mergeFacet(lists: (FilterParamInfo[] | undefined)[]): string[] { + const keys = new Set(); + for (const list of lists) { + for (const option of list || []) { + if (option.totalItems > 0) { + keys.add(option.key); + } + } + } + return [...keys].sort((a, b) => a.localeCompare(b)); + } + + // Column count -> page size + + private observeGridWidth(): void { + const el = this.cardGridProbe?.nativeElement; + if (!el || typeof ResizeObserver === 'undefined') { + return; + } + this.resizeSubscription = this.resizeSubject.pipe(debounceTime(150)).subscribe(() => { + const before = this.pageSizeOptions[0]; + // Keep the same first item in view, not the same page number. + const firstItem = this.pageIndex * this.pageSize; + this.measureCols(); + if (this.pageSizeOptions[0] === before) { + return; + } + this.pageSize = this.pageSizeOptions[0]; + this.pageIndex = Math.floor(firstItem / this.pageSize); + this.loadResults(); + }); + // zone.js does not patch ResizeObserver; without zone.run the reload would not render. + this.resizeObserver = new ResizeObserver(() => this.zone.run(() => this.resizeSubject.next())); + this.resizeObserver.observe(el); + } + + private measureCols(): void { + const el = this.cardGridProbe?.nativeElement; + if (!el) { + return; + } + this.cols = measureGridColumns(el); + if (!this.pageSizeOptions.includes(this.pageSize)) { + this.pageSize = this.pageSizeOptions[0]; + } } onSearchInput(): void { @@ -158,35 +305,6 @@ export class TbIotHubSearchComponent implements OnInit, OnDestroy { this.loadResults(); } - // Type helpers - isCompactType(type: ItemType): boolean { - return type === ItemType.CALCULATED_FIELD - || type === ItemType.ALARM_RULE - || type === ItemType.RULE_CHAIN; - } - - getTypeLabel(type: ItemType): string { - const key = itemTypeTranslations.get(type); - return key ? this.translate.instant(key + '-plural') : type; - } - - getTypeRoute(type: ItemType): string { - switch (type) { - case ItemType.WIDGET: return 'widgets'; - case ItemType.SOLUTION_TEMPLATE: return 'solution-templates'; - case ItemType.CALCULATED_FIELD: return 'calculated-fields'; - case ItemType.ALARM_RULE: return 'alarm-rules'; - case ItemType.RULE_CHAIN: return 'rule-chains'; - case ItemType.DEVICE: return 'devices'; - default: return 'widgets'; - } - } - - navigateToType(type: ItemType): void { - const search = this.searchText?.trim() || undefined; - void this.router.navigate(['/iot-hub', this.getTypeRoute(type)], { queryParams: { search } }); - } - // Installed items getInstalledItem(item: MpItemVersionView): IotHubInstalledItem | undefined { switch (item.type) { @@ -270,52 +388,39 @@ export class TbIotHubSearchComponent implements OnInit, OnDestroy { clearTimeout(this.retryTimer); this.retryTimer = null; } + // hasError stays as-is until a request succeeds. this.isLoading = true; - // hasError stays as-is until the request actually succeeds - // (cleared in the `next` callback below). - this.fetchResults(this.searchText || '').subscribe({ - next: result => { - this.applyResults(result.data, result.totalElements); - this.hasError = false; - }, - error: () => { - this.isLoading = false; - this.hasError = true; - this.resultGroups = []; - this.totalElements = 0; - } - }); + this.loadSubject.next(); + } + + /** A null result is a failed request. */ + private applyResult(result: PageData | null): void { + this.isLoading = false; + if (result) { + this.totalElements = result.totalElements; + this.results = result.data; + this.hasError = false; + } else { + this.hasError = true; + this.results = []; + this.totalElements = 0; + } } private fetchResults(text: string) { const sort = this.sortOptions[this.selectedSortIndex]; const sortOrder: SortOrder = { property: sort.value, direction: sort.direction }; const pageLink = new PageLink(this.pageSize, this.pageIndex, text.trim() || null, sortOrder); - const query = new MpItemVersionQuery(pageLink, { creatorId: this.creatorId || undefined }); + const query = new MpItemVersionQuery(pageLink, { + creatorId: this.creatorId || undefined, + // No type selected means every type the platform surfaces (the Hub also holds dashboards). + types: this.activeTypes.size ? [...this.activeTypes] : CROSS_TYPE_ITEM_TYPES, + categories: this.activeCategories.size ? [...this.activeCategories] : undefined, + useCases: this.activeUseCases.size ? [...this.activeUseCases] : undefined + }); return this.iotHubApiService.getPublishedVersions(query, { ignoreLoading: true, ignoreErrors: true }); } - private applyResults(data: MpItemVersionView[], totalElements: number): void { - this.totalElements = totalElements; - this.resultGroups = this.groupResults(data); - this.isLoading = false; - } - - private groupResults(items: MpItemVersionView[]): SearchResultGroup[] { - const groupMap = new Map(); - for (const item of items) { - let list = groupMap.get(item.type); - if (!list) { - list = []; - groupMap.set(item.type, list); - } - list.push(item); - } - return TYPE_ORDER - .filter(type => groupMap.has(type)) - .map(type => ({ type, items: groupMap.get(type) })); - } - private loadInstalledItems(): void { const config = { ignoreLoading: true }; const pageLink = new PageLink(10000, 0); diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-update-dialog.component.html b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-update-dialog.component.html index 9d968a6201..3373776563 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-update-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-update-dialog.component.html @@ -8,11 +8,11 @@ @switch (state) { @case ('confirm') {

{{ 'iot-hub.update-confirm-title' | translate:{ name: data.itemName } }}

-

{{ 'iot-hub.update-desc' | translate }}

+

{{ updateDescKey | translate }}

} @case ('updating') {

{{ 'iot-hub.update-confirm-title' | translate:{ name: data.itemName } }}

-

{{ 'iot-hub.update-desc' | translate }}

+

{{ updateDescKey | translate }}

} @case ('success') {

{{ 'iot-hub.update-success-title' | translate }}

diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-update-dialog.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-update-dialog.component.ts index d47c2f8ada..54dd8a803d 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-update-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-update-dialog.component.ts @@ -59,6 +59,17 @@ export class TbIotHubUpdateDialogComponent extends DialogComponent(items: T[], search: string, labelOf: (item: T) => string): T[] { + const normalized = (search || '').trim().toLowerCase(); if (!normalized) { return items; } - return items.filter(item => item.key.toLowerCase().includes(normalized)); + return items.filter(item => labelOf(item).toLowerCase().includes(normalized)); +} + +export function filterIotHubItemsBySearch(items: FilterParamInfo[], search: string): FilterParamInfo[] { + return filterByLabel(items, search, item => item.key); +} + +/** Column count of a CSS grid, from its computed tracks (`repeat(...)` before first layout). */ +export function measureGridColumns(el: HTMLElement): number { + void el.offsetWidth; + const tracks = getComputedStyle(el).gridTemplateColumns; + if (!tracks || tracks === 'none') { + return 1; + } + if (tracks.startsWith('repeat(')) { + const match = tracks.match(/^repeat\(\s*(\d+)\s*,/); + return match ? parseInt(match[1], 10) : 1; + } + return Math.max(1, tracks.trim().split(/\s+/).filter(t => t.length > 0).length); } export function groupIotHubFilterItems(items: FilterParamInfo[], search: string): IotHubFilterGroup[] { diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/comparison-keys-table.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/comparison-keys-table.component.html deleted file mode 100644 index 12bc46fef7..0000000000 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/chart/comparison-keys-table.component.html +++ /dev/null @@ -1,8 +0,0 @@ - ---> diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/html/html-container-basic-config.component.ts b/ui-ngx/src/app/modules/home/components/widget/config/basic/html/html-container-basic-config.component.ts index 7d94cb146d..1d9b03cd36 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/html/html-container-basic-config.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/html/html-container-basic-config.component.ts @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors -// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 import { Component, HostBinding } from '@angular/core'; import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { Store } from '@ngrx/store'; @@ -7,10 +8,7 @@ import { AppState } from '@core/core.state'; import { BasicWidgetConfigComponent } from '@home/components/widget/config/widget-config.component.models'; import { WidgetConfigComponentData } from '@home/models/widget-component.models'; import { WidgetConfigComponent } from '@home/components/widget/widget-config.component'; -import { - htmlContainerDefaultSettings, - HtmlContainerWidgetSettings -} from '@home/components/widget/lib/html/html-container-widget.models'; +import { htmlContainerDefaultSettings, HtmlContainerWidgetSettings } from '@shared/models/html-container.models'; @Component({ selector: 'tb-html-container-basic-config', diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/html/html-container-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/html/html-container-widget.component.ts index 5e3e5bd125..29e56a8c38 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/html/html-container-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/html/html-container-widget.component.ts @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors -// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 import { ChangeDetectorRef, Component, ComponentRef, @@ -16,9 +17,6 @@ import { } from '@angular/core'; import { WidgetContext } from '@home/models/widget-component.models'; import { - htmlContainerDefaultSettings, - HtmlContainerWidgetSettings, - HtmlContainerWidgetType, WidgetContainerAngularFunction, WidgetContainerPlainFunction } from '@home/components/widget/lib/html/html-container-widget.models'; @@ -40,6 +38,11 @@ import { import { MODULES_MAP } from '@shared/models/constants'; import { IModulesMap } from '@modules/common/modules-map.models'; import { TbAnchorComponent } from '@shared/components/tb-anchor.component'; +import { + htmlContainerDefaultSettings, + HtmlContainerWidgetSettings, + HtmlContainerWidgetType +} from '@shared/models/html-container.models'; @Component({ selector: 'tb-html-container-widget', diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/html/html-container-widget.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/html/html-container-widget.models.ts index d8cb440887..fbcc4309ca 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/html/html-container-widget.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/html/html-container-widget.models.ts @@ -1,31 +1,13 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors -// SPDX-License-Identifier: Apache-2.0 -import { TbFunction } from '@shared/models/js-function.models'; +// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 import { WidgetContext } from '@home/models/widget-component.models'; import { TbEditorCompleter, TbEditorCompletions } from '@shared/models/ace/completion.models'; import { widgetContextCompletions } from '@shared/models/ace/widget-completion.models'; -import { WidgetResource } from '@shared/models/widget.models'; -export enum HtmlContainerWidgetType { - PLAIN = 'PLAIN', - ANGULAR = 'ANGULAR' -} - -export interface HtmlContainerWidgetSettings { - type: HtmlContainerWidgetType; - html: string; - css: string; - js: TbFunction; - resources: WidgetResource[]; -} - -export const htmlContainerDefaultSettings: HtmlContainerWidgetSettings = { - type: HtmlContainerWidgetType.PLAIN, - html: '', - css: '', - js: '', - resources: [], -}; +// Moved to @shared/models/html-container.models (the HTML page layout uses them too); re-exported for existing imports. +export { HtmlContainerWidgetType, htmlContainerDefaultSettings } from '@shared/models/html-container.models'; +export type { HtmlContainerWidgetSettings } from '@shared/models/html-container.models'; export type WidgetContainerPlainFunction = (ctx: WidgetContext, container: HTMLElement) => void; export type WidgetContainerAngularFunction = (ctx: WidgetContext) => void; diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/custom-sample-html.raw b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/custom-sample-html.raw index 734773eb87..e7315360f8 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/custom-sample-html.raw +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/custom-sample-html.raw @@ -6,7 +6,7 @@ - + @@ -198,7 +198,7 @@ - + diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/mobile-action-editor.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/mobile-action-editor.models.ts index b36988a635..984f80dd51 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/mobile-action-editor.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/mobile-action-editor.models.ts @@ -37,7 +37,7 @@ const processImageFunctionTemplate: TbFunction = ' imageDialogTemplate =\n' + ' \'
\' +\n' + ' \'
\' +\n' + - ' \'\' +\n' + + ' \'\' +\n' + ' \'

{{title}}

\' +\n' + ' \'\' +\n' + ' \'
\' +\n' + ' \'
\' +\n' + ' \'\' +\n' + - ' \'\' +\n' + + ' \'\' +\n' + ' \'
\' +\n' + ' \'\' +\n' + ' \'
\';\n' + diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/place-map-item-sample-html.raw b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/place-map-item-sample-html.raw index bb36a39986..c229158808 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/place-map-item-sample-html.raw +++ b/ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/place-map-item-sample-html.raw @@ -4,7 +4,7 @@
- +

Add entity

} + @if (resource.AGENT | hasGenericPermission: operation.READ) { + + } @if (resource.DASHBOARD | hasGenericPermission: operation.READ) { } - @@ -72,6 +72,13 @@ + } @else if (searchFailed) { + +
+ cloud_off + {{ 'iot-hub.network-server-unavailable' | translate }} +
+
} @else if (searchResults.length === 0 && searchLoaded) {
@@ -84,39 +91,55 @@
} @else { - @for (group of searchResultGroups; track group.type) { - - @for (item of group.items; track item.id) { - - @if (isCompactType(item.type)) { -
- {{ getCompactIcon(item) }} -
- } @else { -
- @if (getItemImage(item); as imgUrl) { - + @for (item of searchResults; track item.id) { + + +
+ @if (isCompactType(item.type)) { +
+ {{ getCompactIcon(item) }} +
+ } @else if (getItemImage(item); as imgUrl) { + + } @else { + {{ getItemTypeIcon(item.type) }} + } +
+
+ {{ item.name }} + + + {{ getItemTypeIcon(item.type) }} + {{ getItemTypeLabel(item.type) }} + + @if (item.creatorDisplayName) { + + @if (item.creatorVerified) { + verified } @else { - {{ getItemTypeIcon(item.type) }} + person } -
- } -
- {{ item.name }} - - person - {{ item.creatorDisplayName }} + {{ item.creatorDisplayName }} -
-
- } - + } + +
+
} } - + + @if (searchText?.trim(); as query) { + @if (searchTotal > searchResults.length) { + {{ 'iot-hub.see-all-results-for' | translate:{ count: searchTotal, search: query } }} + } @else { + {{ 'iot-hub.see-results-for' | translate:{ search: query } }} + } + } @else { + {{ 'iot-hub.see-all-results' | translate }} + } +
diff --git a/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.scss b/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.scss index e107709bac..ba9ec9461c 100644 --- a/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.scss +++ b/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.scss @@ -221,36 +221,14 @@ 0 114px 46px 0 rgba(0, 0, 0, 0.01), 0 178px 50px 0 rgba(0, 0, 0, 0); - // Section group — 12px gap between groups - .mat-mdc-optgroup + .mat-mdc-optgroup .mat-mdc-optgroup-label { - margin-top: 12px; - } - - // Section title — Design: 14px Medium, 0.25 tracking, black-tertiary, 4px V / 16px H - .mat-mdc-optgroup .mat-mdc-optgroup-label { - padding: 4px 16px; - min-height: 28px; - font-size: 14px; - font-weight: 500; - line-height: 20px; - letter-spacing: 0.25px; - color: rgba(0, 0, 0, 0.54); - white-space: nowrap; - + // Shared by every row; each row kind below is selected by its own class. + .mat-mdc-option { .mdc-list-item__primary-text { - font-size: 14px; - font-weight: 500; - line-height: 20px; - letter-spacing: 0.25px; - color: rgba(0, 0, 0, 0.54); + display: flex; + align-items: center; + gap: 16px; + width: 100%; } - } - - // Item row — Design: 8px V / 16px H, 16px gap, centered - .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple) { - padding: 8px 16px; - min-height: auto; - height: auto; &:hover:not(.mdc-list-item--disabled), &.mat-mdc-option-active:not(.mdc-list-item--disabled) { @@ -260,13 +238,13 @@ .mat-icon, tb-icon { margin-right: 0; } + } - .mdc-list-item__primary-text { - display: flex; - align-items: center; - gap: 16px; - width: 100%; - } + // Item row — Design: 8px V / 16px H, 16px gap, centered + .mat-mdc-option.tb-search-popup-item { + padding: 8px 16px; + min-height: auto; + height: auto; } // Thumbnail — Design: 99px x 56px, 4px radius, 1px border, 4% bg @@ -296,11 +274,11 @@ color: rgba(0, 0, 0, 0.38); } - // Icon square — Design: 56x56, 4.667px radius, colored bg + // Icon tile for an item with no screenshot, centred in the thumbnail frame: 36x36, colored bg .tb-search-popup-icon-square { - width: 56px; - height: 56px; - border-radius: 4.667px; + width: 36px; + height: 36px; + border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; @@ -308,9 +286,9 @@ } .tb-search-popup-icon-inner { - font-size: 28px; - width: 28px; - height: 28px; + font-size: 22px; + width: 22px; + height: 22px; color: white !important; --tb-icon-color: white; } @@ -347,13 +325,63 @@ letter-spacing: 0.25px; color: rgba(0, 0, 0, 0.54); white-space: nowrap; + min-width: 0; mat-icon { + flex-shrink: 0; font-size: 16px; width: 16px; height: 16px; margin-right: 0; color: rgba(0, 0, 0, 0.54); + + // Same teal the IoT Hub item cards give a verified creator. + &.tb-search-popup-verified { + color: #00695c; + } + } + } + + // Shares the meta row with the item type, so a long name is cut rather than overflowing. + .tb-search-popup-author-name { + overflow: hidden; + text-overflow: ellipsis; + } + + // Meta row: the item type, a middle dot, then the author - "Widget · pinkevych.d". + .tb-search-popup-meta { + display: flex; + align-items: center; + gap: 4px; + min-width: 0; + } + + // Item type in its colour, darkened so the paler ones stay legible. + .tb-search-popup-type { + display: flex; + align-items: center; + gap: 4px; + flex-shrink: 0; + font-size: 12px; + font-weight: 500; + line-height: 16px; + letter-spacing: 0.25px; + color: color-mix(in srgb, var(--tb-search-popup-type-color) 75%, #000); + white-space: nowrap; + + tb-icon { + font-size: 14px; + width: 14px; + height: 14px; + line-height: 14px; + color: inherit; + } + + // No author, nothing to separate from. + &:not(:last-child)::after { + content: '·'; + font-weight: 700; + color: rgba(0, 0, 0, 0.54); } } @@ -371,6 +399,7 @@ .tb-search-popup-no-results { pointer-events: none; opacity: 1 !important; + padding: 8px 16px; } .tb-search-popup-no-results-content { @@ -392,26 +421,31 @@ } // Footer — Design: 40px h, 8px V / 16px H, 1px top border, tb-primary text - .tb-search-popup-footer { + .mat-mdc-option.tb-search-popup-footer { position: sticky; bottom: 0; + z-index: 1; border-top: 1px solid rgba(0, 0, 0, 0.12); height: 40px; min-height: 40px; padding: 8px 16px; - display: flex; - align-items: center; - justify-content: flex-start; font-size: 14px; font-weight: 500; line-height: 20px; letter-spacing: 0.25px; color: var(--tb-primary-500); - cursor: pointer; background: white; white-space: nowrap; - &:hover { + .mdc-list-item__primary-text { + justify-content: flex-start; + font: inherit; + letter-spacing: inherit; + color: inherit; + } + + &:hover:not(.mdc-list-item--disabled), + &.mat-mdc-option-active:not(.mdc-list-item--disabled) { background: #f5f5f5; } } diff --git a/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.ts b/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.ts index 0b972f7efc..9db575f2aa 100644 --- a/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.ts +++ b/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.ts @@ -3,14 +3,25 @@ import { Component, OnInit, OnDestroy, ViewChild, ElementRef } from '@angular/core'; import { Router } from '@angular/router'; import { MatAutocompleteTrigger } from '@angular/material/autocomplete'; +import { MatOptionSelectionChange } from '@angular/material/core'; import { BreakpointObserver } from '@angular/cdk/layout'; -import { forkJoin, Subject, Subscription } from 'rxjs'; -import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators'; +import { forkJoin, of, Subject, Subscription } from 'rxjs'; +import { catchError, debounceTime, switchMap } from 'rxjs/operators'; import { MediaBreakpoints } from '@shared/models/constants'; import { PageLink } from '@shared/models/page/page-link'; import { Direction, SortOrder } from '@shared/models/page/sort-order'; +import { PageData } from '@shared/models/page/page-data'; import { MpItemVersionQuery, MpItemVersionView } from '@shared/models/iot-hub/iot-hub-version.models'; -import { getItemTypeIcon, ItemType, itemTypeTranslations } from '@shared/models/iot-hub/iot-hub-item.models'; +import { + CROSS_TYPE_ITEM_TYPES, + getItemTypeColor, + isCompactItemType, + getItemTypeIcon, + ItemType, + itemTypeColors, + itemTypeTranslations, + RELEVANCE_SORT_PROPERTY +} from '@shared/models/iot-hub/iot-hub-item.models'; import { IotHubInstalledItem } from '@shared/models/iot-hub/iot-hub-installed-item.models'; import { IotHubApiService } from '@core/http/iot-hub-api.service'; import { TranslateService } from '@ngx-translate/core'; @@ -32,15 +43,8 @@ interface HeroTypeConfig { icon: string; } -interface SearchResultGroup { - type: ItemType; - items: MpItemVersionView[]; -} - -const SEARCH_GROUP_ORDER: ItemType[] = [ - ItemType.DEVICE, ItemType.SOLUTION_TEMPLATE, ItemType.WIDGET, - ItemType.CALCULATED_FIELD, ItemType.ALARM_RULE, ItemType.RULE_CHAIN -]; +/** Rows the search popup shows: page 0 of the search page's own request. */ +const SEARCH_POPUP_PAGE_SIZE = 10; @Component({ selector: 'tb-iot-hub-home', @@ -51,12 +55,15 @@ const SEARCH_GROUP_ORDER: ItemType[] = [ export class TbIotHubHomeComponent implements OnInit, OnDestroy { readonly ItemType = ItemType; + readonly isCompactType = isCompactItemType; searchText = ''; searchResults: MpItemVersionView[] = []; - searchResultGroups: SearchResultGroup[] = []; + /** Everything the search matched, for the footer's "See all N results". */ + searchTotal = 0; searchLoaded = false; searchLoading = false; + searchFailed = false; @ViewChild(MatAutocompleteTrigger) searchAutoTrigger: MatAutocompleteTrigger; @ViewChild('searchInput', {read: ElementRef}) searchInputRef: ElementRef; private searchSubject = new Subject(); @@ -65,27 +72,27 @@ export class TbIotHubHomeComponent implements OnInit, OnDestroy { heroTypes: HeroTypeConfig[] = [ { - type: ItemType.DEVICE, labelKey: 'item.type-device-plural', color: '#4b63cc', + type: ItemType.DEVICE, labelKey: 'item.type-device-plural', color: itemTypeColors[ItemType.DEVICE], icon: 'assets/iot-hub/hero-device-cluster.svg' }, { - type: ItemType.SOLUTION_TEMPLATE, labelKey: 'item.type-solution-template-plural', color: '#2b6bb4', + type: ItemType.SOLUTION_TEMPLATE, labelKey: 'item.type-solution-template-plural', color: itemTypeColors[ItemType.SOLUTION_TEMPLATE], icon: 'assets/iot-hub/hero-solution-template-cluster.svg' }, { - type: ItemType.WIDGET, labelKey: 'item.type-widget-plural', color: '#2c9755', + type: ItemType.WIDGET, labelKey: 'item.type-widget-plural', color: itemTypeColors[ItemType.WIDGET], icon: 'assets/iot-hub/hero-widget-cluster.svg' }, { - type: ItemType.CALCULATED_FIELD, labelKey: 'item.type-calculated-field-plural', color: '#3cb4e0', + type: ItemType.CALCULATED_FIELD, labelKey: 'item.type-calculated-field-plural', color: itemTypeColors[ItemType.CALCULATED_FIELD], icon: 'assets/iot-hub/hero-calculated-field-cluster.svg' }, { - type: ItemType.ALARM_RULE, labelKey: 'item.type-alarm-rule-plural', color: '#d66f2e', + type: ItemType.ALARM_RULE, labelKey: 'item.type-alarm-rule-plural', color: itemTypeColors[ItemType.ALARM_RULE], icon: 'assets/iot-hub/hero-alarm-rule-cluster.svg' }, { - type: ItemType.RULE_CHAIN, labelKey: 'item.type-rule-chain-plural', color: '#a95ae2', + type: ItemType.RULE_CHAIN, labelKey: 'item.type-rule-chain-plural', color: itemTypeColors[ItemType.RULE_CHAIN], icon: 'assets/iot-hub/hero-rule-chain-cluster.svg' } ]; @@ -153,17 +160,23 @@ export class TbIotHubHomeComponent implements OnInit, OnDestroy { }); this.searchSubscription = this.searchSubject.pipe( debounceTime(300), - distinctUntilChanged(), switchMap(text => { this.searchLoading = true; - const sortOrder: SortOrder = { property: 'totalInstallCount', direction: Direction.DESC }; - const pageLink = new PageLink(10, 0, text.trim() || null, sortOrder); - const query = new MpItemVersionQuery(pageLink); - return this.iotHubApiService.getPublishedVersions(query, { ignoreLoading: true }); + const trimmed = text.trim(); + // One list ranked across every type the platform surfaces. With an empty field relevance + // is served as the install count. + const sortOrder: SortOrder = { property: RELEVANCE_SORT_PROPERTY, direction: Direction.DESC }; + const pageLink = new PageLink(SEARCH_POPUP_PAGE_SIZE, 0, trimmed || null, sortOrder); + const query = new MpItemVersionQuery(pageLink, { types: CROSS_TYPE_ITEM_TYPES }); + // A failure must not end the subscription. + return this.iotHubApiService.getPublishedVersions(query, { ignoreLoading: true }).pipe( + catchError(() => of(null as PageData)) + ); }) - ).subscribe(result => { - this.searchResults = result.data; - this.searchResultGroups = this.groupSearchResults(result.data); + ).subscribe(page => { + this.searchFailed = !page; + this.searchResults = page?.data ?? []; + this.searchTotal = page?.totalElements ?? 0; this.searchLoaded = true; this.searchLoading = false; }); @@ -227,7 +240,26 @@ export class TbIotHubHomeComponent implements OnInit, OnDestroy { setTimeout(() => this.searchAutoTrigger?.openPanel()); } - onSearch(): void { + onRowSelected(event: MatOptionSelectionChange, item: MpItemVersionView): void { + if (event.isUserInput) { + this.openItemDetail(item); + } + } + + onFooterSelected(event: MatOptionSelectionChange): void { + if (event.isUserInput) { + this.seeAllResults(); + } + } + + /** + * Enter in the field opens the search page - unless the autocomplete has just used this press + * to select a highlighted row, which it marks with preventDefault before this handler runs. + */ + onSearchEnter(event: KeyboardEvent): void { + if (event.defaultPrevented || event.isComposing) { + return; + } this.seeAllResults(); } @@ -237,12 +269,6 @@ export class TbIotHubHomeComponent implements OnInit, OnDestroy { void this.router.navigate(['/iot-hub/search'], { queryParams: { search } }); } - isCompactType(type: ItemType): boolean { - return type === ItemType.CALCULATED_FIELD - || type === ItemType.ALARM_RULE - || type === ItemType.RULE_CHAIN; - } - getCompactIcon(item: MpItemVersionView): string { return item.icon || getItemTypeIcon(item.type); } @@ -255,9 +281,13 @@ export class TbIotHubHomeComponent implements OnInit, OnDestroy { return getItemTypeIcon(type); } - getSearchGroupLabel(type: ItemType): string { + getItemTypeColor(type: ItemType): string { + return getItemTypeColor(type); + } + + getItemTypeLabel(type: ItemType): string { const key = itemTypeTranslations.get(type); - return key ? this.translate.instant(key + '-plural') : type; + return key ? this.translate.instant(key) : type; } navigateToBrowse(type: ItemType): void { @@ -276,7 +306,6 @@ export class TbIotHubHomeComponent implements OnInit, OnDestroy { private getTypeRoute(type: ItemType): string { switch (type) { case ItemType.WIDGET: return 'widgets'; - case ItemType.DASHBOARD: return 'dashboards'; case ItemType.SOLUTION_TEMPLATE: return 'solution-templates'; case ItemType.CALCULATED_FIELD: return 'calculated-fields'; case ItemType.ALARM_RULE: return 'alarm-rules'; @@ -523,21 +552,4 @@ export class TbIotHubHomeComponent implements OnInit, OnDestroy { }); } - private groupSearchResults(items: MpItemVersionView[]): SearchResultGroup[] { - const groupMap = new Map(); - for (const item of items) { - if (!SEARCH_GROUP_ORDER.includes(item.type)) { - continue; - } - let list = groupMap.get(item.type); - if (!list) { - list = []; - groupMap.set(item.type, list); - } - list.push(item); - } - return SEARCH_GROUP_ORDER - .filter(type => groupMap.has(type)) - .map(type => ({ type, items: groupMap.get(type) })); - } } diff --git a/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.ts b/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.ts index 20a39dfc11..989b6e1117 100644 --- a/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.ts +++ b/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-items-page.component.ts @@ -29,13 +29,6 @@ const PAGE_CONFIGS: Record = { image: 'assets/iot-hub/items-page-widgets-hero.svg', routeSegment: 'widgets' }, - DASHBOARD: { - type: ItemType.DASHBOARD, - titleKey: 'item.type-dashboard-plural', - descriptionKey: 'iot-hub.items-page-desc-dashboards', - image: 'assets/iot-hub/items-page-dashboards-hero.svg', - routeSegment: 'dashboards' - }, SOLUTION_TEMPLATE: { type: ItemType.SOLUTION_TEMPLATE, titleKey: 'item.type-solution-template-plural', diff --git a/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-routing.module.ts b/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-routing.module.ts index cd75861091..a9f5a47547 100644 --- a/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-routing.module.ts +++ b/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-routing.module.ts @@ -49,19 +49,6 @@ const routes: Routes = [ breadcrumb: { label: 'item.type-widget-plural', icon: 'widgets' } } }, - { - path: 'dashboards', - component: TbIotHubItemsPageComponent, - data: { - auth: [Authority.TENANT_ADMIN], - canActivate: (userPermissionsService: UserPermissionsService): boolean => { - return userPermissionsService.hasGenericPermission(Resource.ALL, Operation.ALL); - }, - title: 'item.type-dashboard-plural', - itemType: 'DASHBOARD', - breadcrumb: { label: 'item.type-dashboard-plural', icon: 'dashboard' } - } - }, { path: 'solution-templates', component: TbIotHubItemsPageComponent, diff --git a/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-search-page.component.scss b/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-search-page.component.scss index 30db866c8a..911b07f18e 100644 --- a/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-search-page.component.scss +++ b/ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-search-page.component.scss @@ -8,12 +8,17 @@ height: 100%; } +// Same frame as the type pages: one even padding on the card, and the search component pulled +// out to the card's edges by the same amount, so the rail, heading and grid line up. +.tb-search-page { + --tb-search-page-pad: 40px; + padding: var(--tb-search-page-pad) var(--tb-search-page-pad) calc(var(--tb-search-page-pad) + 8px); +} // Back button .tb-search-back-btn { align-self: flex-start; - margin-top: 40px; - margin-left: 123px; + margin-left: -8px; } // Title @@ -30,100 +35,24 @@ color: rgba(0, 0, 0, 0.54); } +// Full bleed; it pads its own rows back in through --tb-search-side-pad. tb-iot-hub-search { flex: 1; min-height: 0; - padding-left: 123px; - padding-right: 123px; - - ::ng-deep { - .tb-search-divider { - margin-left: -123px; - margin-right: -123px; - } - - .tb-results-container { - padding-right: 123px; - padding-bottom: 40px; - margin-right: -123px; - } - } -} - -// Responsive -@media #{$mat-lt-xxl} { - .tb-search-back-btn { - margin-left: 40px; - } - - tb-iot-hub-search { - padding-left: 40px; - padding-right: 40px; - - ::ng-deep { - .tb-search-divider { - margin-left: -40px; - margin-right: -40px; - } - - .tb-results-container { - padding-right: 40px; - margin-right: -40px; - } - } - } + --tb-search-side-pad: var(--tb-search-page-pad); + margin-left: calc(-1 * var(--tb-search-page-pad)); + margin-right: calc(-1 * var(--tb-search-page-pad)); } @media #{$mat-lt-lg} { - .tb-search-back-btn { - margin-top: 24px; - margin-left: 24px; - } - - tb-iot-hub-search { - padding-left: 24px; - padding-right: 24px; - - ::ng-deep { - .tb-search-divider { - margin-left: -24px; - margin-right: -24px; - } - - .tb-results-container { - padding-right: 24px; - padding-bottom: 24px; - margin-right: -24px; - } - } + .tb-search-page { + --tb-search-page-pad: 24px; } } @media #{$mat-lt-sm} { .tb-search-page { + --tb-search-page-pad: 16px; gap: 16px; } - - .tb-search-back-btn { - margin-top: 16px; - margin-left: 16px; - } - - tb-iot-hub-search { - padding-left: 16px; - padding-right: 16px; - - ::ng-deep { - .tb-search-divider { - margin-left: -16px; - margin-right: -16px; - } - - .tb-results-container { - padding-right: 16px; - padding-bottom: 16px; - margin-right: -16px; - } - } - } } diff --git a/ui-ngx/src/app/modules/home/pages/reporting/report/manage-report-public-access-modal.component.html b/ui-ngx/src/app/modules/home/pages/reporting/report/manage-report-public-access-modal.component.html index 704b299962..cdaa9654a8 100644 --- a/ui-ngx/src/app/modules/home/pages/reporting/report/manage-report-public-access-modal.component.html +++ b/ui-ngx/src/app/modules/home/pages/reporting/report/manage-report-public-access-modal.component.html @@ -4,7 +4,7 @@ SPDX-License-Identifier: BUSL-1.1 --> - +

{{ 'report.manage-public-access' | translate }}

- +
{:copy-code} diff --git a/ui-ngx/src/assets/help/en_US/widget/action/mobile_process_image_fn.md b/ui-ngx/src/assets/help/en_US/widget/action/mobile_process_image_fn.md index 25df3a7e84..03933ab165 100644 --- a/ui-ngx/src/assets/help/en_US/widget/action/mobile_process_image_fn.md +++ b/ui-ngx/src/assets/help/en_US/widget/action/mobile_process_image_fn.md @@ -56,7 +56,7 @@ function showImageDialog(title, imageUrl) { var imageDialogTemplate = '
' + '
' + - '' + + '' + '

{{title}}

' + '' + '
' + '
' + '' + - '' + + '' + '
' + '' + '
'; diff --git a/ui-ngx/src/assets/help/en_US/widget/action/place_map_item/create_dialog_html.md b/ui-ngx/src/assets/help/en_US/widget/action/place_map_item/create_dialog_html.md index c3a58747e8..bfe48b3fee 100644 --- a/ui-ngx/src/assets/help/en_US/widget/action/place_map_item/create_dialog_html.md +++ b/ui-ngx/src/assets/help/en_US/widget/action/place_map_item/create_dialog_html.md @@ -4,7 +4,7 @@ {:code-style="max-height: 400px;"}
- +

Add entity

@@ -870,13 +870,13 @@ Key selectors: `input[formControlName="name"]`, `mat-slide-toggle[formControlNam
- - + +
``` -Key selectors: `[mat-dialog-content]`, `[mat-dialog-actions]`, `button[type="submit"]`, `mat-toolbar[color="primary"] h2`. +Key selectors: `[mat-dialog-content]`, `[mat-dialog-actions]`, `button[type="submit"]`, `mat-toolbar[color="tb-primary"] h2`. ### Common Material Selector Patterns