Skip to content

Commit 1fb80a9

Browse files
TASK-1828883: few minor review fixes
1 parent 18d26c1 commit 1fb80a9

File tree

8 files changed

+16
-18
lines changed

8 files changed

+16
-18
lines changed

core/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/core/components/containers/ModalViewContainer.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ import androidx.compose.runtime.setValue
66
import com.pega.constellation.sdk.kmp.core.api.ComponentContext
77
import com.pega.constellation.sdk.kmp.core.api.ComponentEvent
88
import com.pega.constellation.sdk.kmp.core.api.ComponentId
9+
import com.pega.constellation.sdk.kmp.core.api.HideableComponent
910
import com.pega.constellation.sdk.kmp.core.components.getBoolean
1011
import com.pega.constellation.sdk.kmp.core.components.getJSONArray
1112
import com.pega.constellation.sdk.kmp.core.components.getString
1213
import com.pega.constellation.sdk.kmp.core.components.widgets.AlertBannerComponent
1314
import com.pega.constellation.sdk.kmp.core.internal.ComponentManagerImpl.Companion.getComponentTyped
1415
import kotlinx.serialization.json.JsonObject
1516

16-
class ModalViewContainerComponent(context: ComponentContext) : ContainerComponent(context) {
17-
var visible by mutableStateOf(false)
17+
class ModalViewContainerComponent(context: ComponentContext) : ContainerComponent(context), HideableComponent {
18+
override var visible by mutableStateOf(false)
1819
private set
1920
var title by mutableStateOf("")
2021
private set

core/src/commonMain/kotlin/com/pega/constellation/sdk/kmp/core/components/containers/SimpleTableManual.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ import com.pega.constellation.sdk.kmp.core.api.Component
88
import com.pega.constellation.sdk.kmp.core.api.ComponentContext
99
import com.pega.constellation.sdk.kmp.core.api.ComponentEvent
1010
import com.pega.constellation.sdk.kmp.core.api.ComponentId
11+
import com.pega.constellation.sdk.kmp.core.api.HideableComponent
1112
import com.pega.constellation.sdk.kmp.core.components.getBoolean
1213
import com.pega.constellation.sdk.kmp.core.components.getJSONArray
1314
import com.pega.constellation.sdk.kmp.core.components.getString
1415
import kotlinx.serialization.json.JsonObject
1516
import kotlinx.serialization.json.jsonObject
1617

17-
class SimpleTableManualComponent(context: ComponentContext) : BaseComponent(context) {
18-
var visible by mutableStateOf(false)
18+
class SimpleTableManualComponent(context: ComponentContext) : BaseComponent(context), HideableComponent {
19+
override var visible by mutableStateOf(false)
1920
private set
2021
var label: String by mutableStateOf("")
2122
private set
@@ -48,7 +49,6 @@ class SimpleTableManualComponent(context: ComponentContext) : BaseComponent(cont
4849
return columnsJsonArray.mapWithIndex { getString(it) }
4950
}
5051

51-
5252
private fun getRows(props: JsonObject): List<Row> =
5353
props.getJSONArray("rows").map { jsonElement ->
5454
val rowJsonObject = jsonElement.jsonObject

scripts/dxcomponents/components/containers/root-container.component.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {Utils} from "../../helpers/utils.js";
2-
import {BaseComponent} from "../base.component.js";
1+
import { Utils } from "../../helpers/utils.js";
2+
import { BaseComponent } from "../base.component.js";
33

44
const options = {context: "app"};
55
const TAG = "[RootContainerComponent]";

scripts/dxcomponents/components/containers/templates/field-group-template.component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Utils } from "../../../helpers/utils.js";
22
import { BaseComponent } from "../../base.component.js";
3-
import {evaluateAllowRowAction, getReferenceList} from "./template-utils.js";
3+
import { evaluateAllowRowAction, getReferenceList } from "./template-utils.js";
44

55
export class FieldGroupTemplateComponent extends BaseComponent {
66
jsComponentPConnectData = {};

scripts/dxcomponents/components/containers/templates/simple-table-manual.component.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import {BaseComponent} from "../../base.component.js";
2-
import {Utils} from "../../../helpers/utils.js";
1+
import { BaseComponent } from "../../base.component.js";
32
import {
43
buildFieldsForTable,
54
evaluateAllowRowAction,
@@ -40,7 +39,6 @@ export class SimpleTableManualComponent extends BaseComponent {
4039
constructor(componentsManager, pConn) {
4140
super(componentsManager, pConn);
4241
this.type = "SimpleTableManual";
43-
this.utils = new Utils();
4442
}
4543

4644
init() {
@@ -112,7 +110,7 @@ export class SimpleTableManualComponent extends BaseComponent {
112110
this.referenceListStr = getContext(this.pConn).referenceListStr;
113111
this.props.label = labelProp || propertyLabel;
114112
this.targetClassLabel = targetClassLabel;
115-
this.props.addButtonLabel = targetClassLabel ? `+ Add ${targetClassLabel}` : "+ Add";
113+
this.props.addButtonLabel = targetClassLabel ? `+ Add ${targetClassLabel}` : "+ Add";
116114
this.referenceList = referenceList;
117115
this.contextClass = this.#getContextClass(configProps);
118116

@@ -142,7 +140,7 @@ export class SimpleTableManualComponent extends BaseComponent {
142140

143141
this.props.columnLabels = this.#getColumnLabels(fieldDefs, resolvedFields);
144142

145-
if((!this.#listsEqual(this.prevReferenceList, this.referenceList))) {
143+
if ((!this.#listsEqual(this.prevReferenceList, this.referenceList))) {
146144
this.#buildRows(rawFields, editableMode, conditions.allowDeleteRow, allowRowDelete, conditions.allowEditRow, allowRowEdit);
147145
}
148146
this.prevReferenceList = this.referenceList;

scripts/dxcomponents/components/containers/templates/simple-table.component.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import {Utils} from "../../../helpers/utils.js";
2-
import {BaseComponent} from "../../base.component.js";
3-
import {getContext} from "./template-utils.js";
1+
import { Utils } from "../../../helpers/utils.js";
2+
import { BaseComponent } from "../../base.component.js";
43

54
const TAG = "[SimpleTableComponent]";
65

scripts/dxcomponents/components/containers/templates/template-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export function getContext(thePConn) {
7171
};
7272
}
7373

74-
function updateFieldLabels (fields, configFields, primaryFieldsViewIndex, pConnect, options) {
74+
function updateFieldLabels(fields, configFields, primaryFieldsViewIndex, pConnect, options) {
7575
const labelsOfFields = [];
7676
const { columnsRawConfig = [] } = options;
7777
fields.forEach((field, idx) => {

ui-renderer-cmp/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ kotlin {
3939
implementation(libs.kotlinx.datetime)
4040
implementation(libs.ksoup.http.parser)
4141
implementation(libs.table.m3)
42-
implementation("com.mohamedrejeb.dnd:compose-dnd:0.3.0")
42+
implementation(libs.compose.dnd)
4343
}
4444
}
4545
}

0 commit comments

Comments
 (0)