Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !37398

Utilities functions mixin

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Mark Otto requested to merge utilities-functions-mixin into main Oct 30, 2022
  • Overview 45
  • Commits 13
  • Pipelines 0
  • Changes 6

Replaces #37114 because I couldn't push to that PR.

Re-opening of #35977 after accidentally closing it on my repo (sorry again for that). @mdo, I hope I didn't lose any of your edits in the process as I've also rebased main to fix conflicts in the docs.

As a reminder of what it was about:

Code for #35945. Just threw some code in to get the shapes of the functions. Still need testing, handling all the cases (values not being maps for example), and docs updates (but I'll do that last once the code is set). The PR adds the following:

  1. functions to get options, a specific option or a specific value for a given utility: a. utilities-get-options b. utilities-get-option c. utilities-get-value
  2. mixins to set options (in bulk or a specific one), new values or remove values for a given utility: a. utilities-set-options (defaults to merging with existing, but can be used to completely override by passing $merge: false, allowing to completely redefine a utility if necessary) b. utilities-set-option (just a thin wrapper on utilities-set-options) c. utilities-add-values d. utilities-remove-values
  3. mixins to add or remove utilities (they don't do as much as the rest, but provide consistency) a. utilities-add b. utilities-remove

Please let me know if there'd be one I missed, or if some are too much (2.b, 3.a. and 3.b for example only bring a consistent API by thinly wrapping other existing functions/mixins)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: utilities-functions-mixin