Skip to content

fix(examples): enhance the SortOrderButton example #587

Open

Description

@braughtg

Description

The SortOrderButton example can be enhanced in several ways:

  1. In the "Component Props" table:
    1. A column labeled "Value" should be added to the right side of the table. The cells in this column should display the current value of the Vue data attribute that is bound to the corresponding prop.
    2. There should be a row for the label prop with a text field that controls the label of the leftmost column. The default value should be letters.
    3. The sortOrder prop row should be labeled only sortOrder.
    4. The controls for sortOrder should be two rows of buttons:
      1. The first row contains buttons for "letters", "numbers", "letters and numbers". The "letters" button should be responsive to changes to the label prop.
      2. The second row contains buttons for "none", "asc" and "desc"
      3. The buttons for the currently applied value should be disabled.
    5. The value for the sortOrder prop should be displayed as a formatted JSON object.
  2. The "Component Event Payloads" table should contain only one row displaying the sort event payload as a formatted JSON object.

Steps to Reproduce

  1. Go to "FD2 Examples" -> "Components" -> "SortOrderButton".
  2. Scroll down to the "Component Props" table.
  3. Observe that there is no "Value" column.
  4. Observe that the sortOrder "Prop" includes additional text.
  5. Observe that the controls for the sortOrder prop are not as indicated.
  6. Scroll down to the "Component Event Payloads" table.
  7. Observe that the table does not contain the single specified sort event and does not display the "Payload" as reqired.

Observed Behavior

The "Component Props" table does not contain a "Value" column that displays the current value bound to the prop, the labeling of the existing row is incorrect, and there are only controls for the sort order, but not the sort column, and there is no control for the label prop.

Image

The "Component Event Payloads:" table includes sortColumn and sortOrder rows rather than the indicated sort event.

Image

Expected Behavior

The "ComponentProps" and "Component Event Payloads" table should behave as described above in the description.

bugInfo.bash Output

git remote -v
-------------
origin	https://github.com/FarmData2/FarmData2.git (fetch)
origin	https://github.com/FarmData2/FarmData2.git (push)
upstream	https://github.com/FarmData2/FarmData2.git (fetch)
upstream	https://github.com/FarmData2/FarmData2.git (push)

git log -1 | head -3
--------------------
commit 11b1bd27e7dc3d287336bdc159caca5ad4bdcb9d
Author: Grant Braught <[email protected]>
Date:   Mon Dec 15 11:34:51 2025 -0500

cat ~/FarmData2/.fd2dev/db.conf
-------------------------------
v3.7.1
db.sample.tar.gz

docker ps (Images and Names)
----------------------------
farmdata2/farmos3:fd2.1 	 fd2_farmos
farmdata2/fd2dev:fd2.13 	 fd2_dev
farmdata2/postgres:fd2.2 	 fd2_postgres

Further Details

  • The code for the SortOrderButton example can be found in modules/farm_fd2_examples/src/entrypoints/sort_order_button/App.vue. A PR for this issue should only modify code in this file.
  • The App.vue files in the comment_box, submit_reset_buttons and tray_size_selector directories in modules/farm_fd2_examples/src/entrypoints will provide helpful examples to work from.
  • You may find it helpful to reference the code for the SortOrderButton component itself, which can be found in components/SortOrderButton/SortOrderButton.vue. Its documentation can be found in the FarmData2 Components documentation.
  • The example for the PicklistBase component includes a control for its invalidFeedbackText prop that may serve as a helpful example for the label control. In addition it uses an HTML <detail> element to display formatted JSON objects that may be helpful for displaying the sortOrder "Value" and the sort "Payload".
  • The following command is used to rebuild the example pages:
    npm run build:examples
    
    • Use SHIFT+reload to reload the example page after rebuilding it to see your changes.

Activity

  1. added
    bug
    enhancement
    good second issue
    and removed
    bug
    on Dec 18, 2025
  2. added
    fd2 examples
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfd2 examplesgood second issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions