Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added extra check and toggle for custom statuses in conversation properties #869

Merged
merged 11 commits into from
Jun 27, 2023

Conversation

aishik-biswas
Copy link
Collaborator

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My commits have standard messages as mentioned in Contributing Guidelines

How Has This Been Tested?

image


.fw-field-editor-status-toggle-item {
display: grid;
font-size: 14px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use scss variables instead of hard-coding the values.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

></fw-input>
</div>
</span>
<span>{toggle}</span>
Copy link
Collaborator

Choose a reason for hiding this comment

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

check if toggle is truthy and then render the <span>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

moved the span to the condition above

@@ -571,6 +571,10 @@ export class FieldEditor {
}
}

if (this.dataProvider.name === 'status') {
Copy link
Contributor

Choose a reason for hiding this comment

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

Checking for hardcode name like "status" will cause issues for other products. Can you add a config value in form-mapper.json which will check if the form builder supports toggle please. Add the name of the filed also in the same config

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

@@ -571,6 +571,10 @@ export class FieldEditor {
}
}

if (this.dataProvider.name === 'status') {
objValues['choices'] = this.dataProvider.choices;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you spread these choices please, just to avoid reference issues, if any

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

@@ -1059,6 +1116,9 @@ export class FieldEditor {
const boolSupportInternalName = objProductConfig.editInternalName;
const strBaseClassName = 'fw-field-editor';
const objFieldBuilder = this.fieldBuilderOptions;

/** Adding extra check for status type */
const isStatusType = objFormValue.name === 'status';
Copy link
Contributor

Choose a reason for hiding this comment

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

Add the name of the field in config as mentioned above and check if builder supports toggle feature

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

check changed

@aishik-biswas aishik-biswas merged commit e4d5d53 into next Jun 27, 2023
@aishik-biswas aishik-biswas deleted the fw-builder-toggle-addition branch June 27, 2023 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants