Skip to content

Commit

Permalink
enhanced required attr propagation to multilang fld children
Browse files Browse the repository at this point in the history
  • Loading branch information
mmadariaga committed Jun 29, 2023
1 parent 0369234 commit 5a5c582
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@irontec/ivoz-ui",
"version": "1.0.46",
"version": "1.0.47",
"description": "UI library used in ivozprovider",
"license": "GPL-3.0",
"main": "index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,16 @@ const useFormHandler = (props: UseFormHandlerProps): useFormikType => {

for (const name in allProperties) {
if (name.includes('.')) {
const rootProperty = name.split('.').shift();
if (rootProperty && !visibleFields.includes(rootProperty)) {
const rootPropertyName = name.split('.').shift() || '';
if (!visibleFields.includes(rootPropertyName)) {
continue;
}

const rootProperty = allProperties[rootPropertyName];

if (rootProperty?.required) {
allProperties[name].required = true;
}
} else {
if (!visibleFields.includes(name)) {
continue;
Expand Down
10 changes: 5 additions & 5 deletions library/src/services/entity/EntityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ export default class EntityService<T extends IvozStoreState = IvozStoreState> {

// All API spec properties + properties declared in entity
public getAllProperties(): PropertyList {
const response = this.properties;
const properties = this.entityConfig.properties;
const response = { ...this.properties };
const entityProperties = this.entityConfig.properties;

for (const idx in properties) {
const propertyOverwrite = properties[idx] || {};
const label = properties[idx].label || '';
for (const idx in entityProperties) {
const propertyOverwrite = entityProperties[idx] || {};
const label = entityProperties[idx].label || '';

response[idx] = {
...this.properties[idx],
Expand Down

0 comments on commit 5a5c582

Please sign in to comment.