How to use the inflection.humanize function in inflection

To help you get started, we’ve selected a few inflection 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 iyobo / jollofjs / packages / jollof / lib / admin / client / forms / Create.js View on Github external
render() {
        const { title, children, isLoading, resource, validation } = this.props;
        const basePath = this.getBasePath();
        return (
            
                
                    
                
                } />
                
                    {children}
                
            
        );
    }
}
github marmelab / react-admin / packages / ra-core / src / controller / CreateController.js View on Github external
render() {
        const {
            basePath,
            children,
            isLoading,
            resource,
            translate,
        } = this.props;

        if (!children) return null;

        const resourceName = translate(`resources.${resource}.name`, {
            smart_count: 1,
            _: inflection.humanize(inflection.singularize(resource)),
        });
        const defaultTitle = translate('ra.page.create', {
            name: `${resourceName}`,
        });
        return children({
            isLoading,
            defaultTitle,
            save: this.save,
            resource,
            basePath,
            record: this.record,
            redirect: this.defaultRedirectRoute(),
            translate,
        });
    }
}
github marmelab / react-admin / packages / ra-core / src / ui / CoreEdit.js View on Github external
children,
            record,
            id,
            isLoading,
            resource,
            translate,
            version,
        } = this.props;

        if (!children) return null;

        const basePath = this.getBasePath();

        const resourceName = translate(`resources.${resource}.name`, {
            smart_count: 1,
            _: inflection.humanize(inflection.singularize(resource)),
        });
        const defaultTitle = translate('ra.page.edit', {
            name: `${resourceName}`,
            id,
            record,
        });

        return children({
            isLoading,
            defaultTitle,
            save: this.save,
            resource,
            basePath,
            record,
            redirect: this.defaultRedirectRoute(),
            version,
github Azure / BatchExplorer / src / app / components / gallery / submit / market-application.model.ts View on Github external
private _computeName() {
        this.name = inflection.humanize(inflection.underscore(this.id));
    }
github marmelab / react-admin / packages / react-admin / src / mui / detail / Create.js View on Github external
const {
            actions = ,
            children,
            isLoading,
            resource,
            title,
            translate,
            hasList,
        } = this.props;

        if (!children) return null;
        const basePath = this.getBasePath();

        const resourceName = translate(`resources.${resource}.name`, {
            smart_count: 1,
            _: inflection.humanize(inflection.singularize(resource)),
        });
        const defaultTitle = translate('aor.page.create', {
            name: `${resourceName}`,
        });
        const titleElement = (
            <title title="{title}">
        );

        return (
            &lt;div className="create-page"&gt;
                &lt;Card style={{ opacity: isLoading ? 0.8 : 1 }}&gt;
                    {actions &amp;&amp;
                        React.cloneElement(actions, {
                            basePath,
                            resource,
                            hasList,</title>
github iyobo / jollofjs / packages / jollofjs / lib / admin / client / forms / Edit.js View on Github external
render() {
        const { title, children, id, data, isLoading, resource, hasDelete, hasShow, validation } = this.props;
        const basePath = this.getBasePath();

        return (
            
                
                    {hasShow &amp;&amp; }
                    
                    {hasDelete &amp;&amp; }
                
                } /&gt;
                {data &amp;&amp; 
                    {children}
                }
            
        );
    }
}
github marmelab / react-admin / src / mui / detail / Edit.js View on Github external
hasList,
            id,
            isLoading,
            resource,
            title,
            translate,
            version,
        } = this.props;

        if (!children) return null;

        const basePath = this.getBasePath();

        const resourceName = translate(`resources.${resource}.name`, {
            smart_count: 1,
            _: inflection.humanize(inflection.singularize(resource)),
        });
        const defaultTitle = translate('aor.page.edit', {
            name: `${resourceName}`,
            id,
            data,
        });
        const titleElement = data ? (
            <title title="{title}">
        ) : (
            ''
        );

        return (
            &lt;div className="edit-page"&gt;
                &lt;Card style={{ opacity: isLoading ? 0.8 : 1 }}&gt;
                    {actions &amp;&amp;</title>
github db-migrate / node-db-migrate / lib / skeleton.js View on Github external
function parseTitle(name) {
  var match = name.match(/\d{14}-([^\.]+)/);
  var dashed = match[1];
  return inflection.humanize(dashed, true);
}
github marmelab / react-admin / src / mui / detail / Create.js View on Github external
render() {
        const { actions = , children, isLoading, resource, title, translate } = this.props;
        const basePath = this.getBasePath();

        const resourceName = translate(`resources.${resource}.name`, {
            smart_count: 1,
            _: inflection.humanize(inflection.singularize(resource)),
        });
        const defaultTitle = translate('aor.page.create', {
            name: `${resourceName}`,
        });
        const titleElement = <title title="{title}">;

        return (
            &lt;div className="create-page"&gt;
                &lt;Card style={{ opacity: isLoading ? 0.8 : 1 }}&gt;
                    {actions &amp;&amp; React.cloneElement(actions, {
                        basePath,
                        resource,
                    })}
                    &lt;ViewTitle title={titleElement} /&gt;
                    {React.cloneElement(children, {
                        save: this.save,</title>