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 layout options for checkboxes and radio(row/column) #8238

Merged
merged 9 commits into from
Mar 25, 2022

Conversation

Ailol
Copy link
Contributor

@Ailol Ailol commented Mar 12, 2022

Description

Due to requests from users of manually deciding for layout style in radio and checkboxes, it now supports
column or row direction. However it does not support multicolumns, but only a single column.

layout option added for radio and checkboxes. App developers can explicitly decide if these items should be laid out on a row, or as a column. The default is still less than 3 options it will be displayed as a row.

{
  "layout": "column" | "row" | undefined
}

LayoutStyle enum is added with Row and Column options. This is to make it easier to extend in the future if we want to introduce f.ex Grid layout.

Fixes

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

@Ailol
Copy link
Contributor Author

Ailol commented Mar 12, 2022

Some code not included

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Mar 12, 2022

This pull request introduces 1 alert when merging 235c6b9 into 439f58b - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@Ailol Ailol reopened this Mar 12, 2022
@Ailol Ailol marked this pull request as ready for review March 13, 2022 17:48
@Ailol Ailol changed the title Added row/column for formlayout in checkboxes and vertical layout option for radio. User can defines check… Added row/column for formlayout for checkboxes and radio Mar 13, 2022
@Ailol Ailol changed the title Added row/column for formlayout for checkboxes and radio Added layout options for checkboxes and radio(row/column) Mar 13, 2022
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Mar 14, 2022

This pull request introduces 1 alert when merging 9f18d7b into 8dcca8f - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@haakemon haakemon requested a review from lorang92 March 25, 2022 11:48
@haakemon
Copy link
Contributor

@lorang92 I think this is ready to go now. WDYT about naming, is it ok? We also discussed using Horizontal and Vertical instead, but I'm not sure whats best.

@haakemon
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@lorang92
Copy link
Contributor

@haakemon code looks great. The naming part is difficult, I'm ok with both suggestions really.

Would be very neat if app developers could configure row/column layout in studio, but maybe that can be done as a separate issue?

And finally, I think we should create a new issue to support column-based options as mentioned by DAT.

Copy link
Contributor

@lorang92 lorang92 left a comment

Choose a reason for hiding this comment

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

Nice! 🥳

@haakemon
Copy link
Contributor

Studio implementation should be a separate issue: #8310
Multi column layout: Altinn/app-frontend-react#126

Ill add some PR's soon with updated docs and updated json schema for this feature.

@haakemon haakemon merged commit 9a96b5e into master Mar 25, 2022
@haakemon haakemon deleted the verticalHorizontal branch March 25, 2022 12:23
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

95.6% 95.6% Coverage
0.0% 0.0% Duplication

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