SFDigitalServices / formio-sfds

The form.io theme for sf.gov
https://formio-sfds.herokuapp.com/
MIT License
15 stars 2 forks source link

Add format=drupal support to /api/strings #229

Closed shawnbot closed 2 years ago

shawnbot commented 2 years ago

This introduces support for the format=drupal query string parameter to /api/strings, which outputs form strings in the shape needed for SG-1712:

{
  "strings": {
    "panel1.title": {
      "value": "Page 1",               // the English value of the string
      "label": "Page 1 (panel title)", // the label to show in Drupal
      "page": 0                        // the index of the page it's on (xref: data.pages[index])
    }
  },
  "pages": [
    {
      "key": "panel1",   // the key of the panel component for this page
      "title": "Page 1", // its English title (for labeling in Drupal)
      "index": 0         // the index (probably redundant)
    }
  ]
}

cc @rloos289 👋

github-actions[bot] commented 2 years ago

Size Change: 0 B

Total Size: 89.7 kB

ℹī¸ View Unchanged | Filename | Size | | :--- | :---: | | `dist/formio-sfds.css` | 13.8 kB | | `dist/formio-sfds.standalone.js` | 69.3 kB | | `dist/portal.js` | 6.65 kB |

compressed-size-action

aekong commented 2 years ago

did a quick test against the deployed heroku app for this pr. looks as expected 👍