How to use the inflected/src/singularize function in inflected

To help you get started, we’ve selected a few inflected examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github omohokcoj / motor-admin / ui / src / data_resources / components / actions.vue View on Github external
edit () {
      if (this.resources.length !== 1) {
        return
      }

      const resourceTitle = `${singularize(this.model.display_name)} #${this.resource.id}`

      this.$Drawer.open(ResourceForm, {
        resource: this.resource,
        action: 'edit',
        resourceName: this.resourceName,
        onClose: () => {
          this.$Drawer.remove()
        },
        onSuccess: (data) => {
          this.$Drawer.remove()
          this.$Message.info(`${resourceTitle} has been updated`)
          this.$emit('finish-action', 'edit')
        }
      }, {
        title: `Edit ${resourceTitle}`,
        className: 'drawer-no-bottom-padding',
github omohokcoj / motor-admin / ui / src / navigation / components / search.vue View on Github external
buildResourceSearchOptions (model) {
      return {
        type: 'resource_search',
        slug: model.slug,
        query: this.cleanedValue,
        value: `${singularize(model.display_name)} "${this.cleanedValue}"`
      }
    },
    onSelect (option) {
github omohokcoj / motor-admin / ui / src / queries / pages / show.vue View on Github external
variables.forEach((variableName) => {
            const variable = {
              name: variableName,
              display_name: titleize(variableName),
              variable_type: 'text'
            }

            const model = modelNameMap[variableName.replace(/_id$/, '')]

            if (model) {
              Object.assign(variable, {
                display_name: singularize(model.display_name),
                reference_resource: model.name,
                variable_type: 'reference'
              })
            }

            this.dataQuery.preferences.variables.push(variable)
          })
        } else {
github omohokcoj / motor-admin / ui / src / data_resources / components / info.vue View on Github external
title () {
      return `${singularize(this.model.display_name)} #${this.resource[this.model.primary_key]}`
    },
    model () {
github omohokcoj / motor-admin / ui / src / data_resources / components / new_button.vue View on Github external
resourceTitle () {
      return singularize(this.model.display_name)
    },
    defaultValues () {