Example #1
0
Ingredient.prototype.getFullLabel = function () {
    if (this.state) {
        return _.capitalize(this.state) + ' ' + _.startCase(this.name)
    } else {
        return _.startCase(this.name)
    }
}
  render() {
    var halteAsal = this.props.pilihHalteAsal.halteAsal || {};
    var halteTujuan = this.props.pilihHalteTujuan.halteTujuan || {};

    var halteAsalName = halteAsal.halteName || "Pilih asal";
    var halteTujuanName = halteTujuan.halteName || "Pilih tujuan";

    var homeLocationNameAsal =  _.startCase(halteAsalName.toLowerCase());
    var homeLocationNameTujuan = _.startCase(halteTujuanName.toLowerCase());

    return (
      <div className="SectionCariRute">
        <div className="input-box">
          <CariRuteInput 
          	type={"asal"}
          	location={homeLocationNameAsal}
          />
          <CariRuteInput 
          	type={"tujuan"}
          	location={homeLocationNameTujuan}
          />
        </div>
        <Link to="/pilih-rute">
         <RaisedButton label="Cari Rute" primary={true} style={styles.button}/>
        </Link>
        <br /><br />
      </div>
    )
  }
Example #3
0
 _.each(_.keys(flags), function(key) {
     if (flags[key]) {
         messageString += _.startCase(key) + ' [x]  ';
     } else {
         messageString += chalk.gray(_.startCase(key) + ' [ ]  ');
     }
 });
						( { label, code } ) => {
						return sectionItemTemplate(
							{
								statusLabel: `${ startCase( entityName ) } ${ startCase( label ) }`,
								statusCode: code
							}
						);
					} ),
Example #5
0
 }).return(cmoss).map(row => {
   // Any Modifications here
   row.site_use = row.site_use === null ? [] : row.site_use.split(', ');
   row.source = row.source === null ? [] : row.source.split(', ');
   row.address = _.startCase(row.address);
   row.name = _.startCase(row.name);
   return row;
 }).map(row => {
Example #6
0
  constructor: function () {
   generators.Base.apply(this, arguments);
   // This makes `arguments` a required argument.
   this.argument('classedName', { type: String, required: true });
   this.argument('spaceName', { type: String, optional: true, defaults: 'Home' });
   // And you can then access it later on this way; e.g. CamelCased
   this.classedName = _.startCase(this.classedName);
   this.spaceName = _.startCase(this.spaceName);
 },
global.objCTestValue = function (property, layerType, arraysAsStructs, indent) {
    let propertyName = originalPropertyName(property);
    switch (property.type) {
        case 'boolean':
            return property.default ? '@"false"' : '@"true"';
        case 'number':
            return '@"1"';
        case 'formatted':
            // Special 'string' case to handle constant expression text-field that automatically
            // converts Formatted back to string.
            return layerType === 'string' ?
                `@"'${_.startCase(propertyName)}'"` :
                `@"${_.startCase(propertyName)}"`;
        case 'string':
            return `@"'${_.startCase(propertyName)}'"`;
        case 'enum':
            return `@"'${_.last(_.keys(property.values))}'"`;
        case 'color':
            return '@"%@", [MGLColor redColor]';
        case 'array':
            switch (arrayType(property)) {
                case 'dasharray':
                    return '@"{1, 2}"';
                case 'font':
                    return `@"{'${_.startCase(propertyName)}', '${_.startCase(_.reverse(propertyName.split('')).join(''))}'}"`;
                case 'padding': {
                    if (arraysAsStructs) {
                        let iosValue = '[NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(1, 1, 1, 1)]'.indent(indent * 4);
                        let macosValue = '[NSValue valueWithEdgeInsets:NSEdgeInsetsMake(1, 1, 1, 1)]'.indent(indent * 4);
                        return `@"%@",\n#if TARGET_OS_IPHONE\n${iosValue}\n#else\n${macosValue}\n#endif\n${''.indent((indent - 1) * 4)}`;
                    }
                    return '@"{1, 1, 1, 1}"';
                }
                case 'offset':
                case 'translate': {
                    if (arraysAsStructs) {
                        let iosValue = '[NSValue valueWithCGVector:CGVectorMake(1, 1)]'.indent(indent * 4);
                        let macosValue = '[NSValue valueWithMGLVector:CGVectorMake(1, -1)]'.indent(indent * 4);
                        return `@"%@",\n#if TARGET_OS_IPHONE\n${iosValue}\n#else\n${macosValue}\n#endif\n${''.indent((indent - 1) * 4)}`;
                    }
                    return '@"{1, 1}"';
                }
                case 'anchor':
                    return `@"{'top','bottom'}"`;
                default:
                    throw new Error(`unknown array type for ${property.name}`);
            }
        default:
            throw new Error(`unknown type for ${property.name}`);
    }
};
global.mbglTestValue = function (property, layerType) {
    let propertyName = originalPropertyName(property);
    switch (property.type) {
        case 'boolean':
            return property.default ? 'false' : 'true';
        case 'number':
            return '1.0';
        case 'formatted':
        case 'string':
            return `"${_.startCase(propertyName)}"`;
        case 'enum': {
            let type = camelize(originalPropertyName(property));
            if (/-translate-anchor$/.test(originalPropertyName(property))) {
                type = 'TranslateAnchor';
            }
            if (/-(rotation|pitch)-alignment$/.test(originalPropertyName(property))) {
                type = 'Alignment';
            }
            if (/^(text|icon)-anchor$/.test(originalPropertyName(property))) {
                type = 'SymbolAnchor'
            }
            let value = camelize(_.last(_.keys(property.values)));
            if (property['light-property']) {
                return `mbgl::style::Light${type}Type::${value}`;
            }
            return `mbgl::style::${type}Type::${value}`;
        }
        case 'color':
            return '{ 1, 0, 0, 1 }';
        case 'array':
            switch (arrayType(property)) {
                case 'dasharray':
                    return '{1, 2}';
                case 'font':
                    return `{ "${_.startCase(propertyName)}", "${_.startCase(_.reverse(propertyName.split('')).join(''))}" }`;
                case 'padding':
                    return '{ 1, 1, 1, 1 }';
                case 'offset':
                case 'translate':
                    return '{ 1, 1 }';
                case 'anchor':
                    return '{ mbgl::style::SymbolAnchorType::Top, mbgl::style::SymbolAnchorType::Bottom }';
                default:
                    throw new Error(`unknown array type for ${property.name}`);
            }
        default:
            throw new Error(`unknown type for ${property.name}`);
    }
};
Example #9
0
 .reduce((map, block) => {
   if (map[block.superBlock]) {
     map[block.superBlock].blocks.push(block);
   } else {
     map[block.superBlock] = {
       title: _.startCase(block.superBlock),
       order: block.superOrder,
       name: nameify(_.startCase(block.superBlock)),
       dashedName: block.superBlock,
       blocks: [block],
       message: block.superBlockMessage
     };
   }
   return map;
 }, {})
Example #10
0
const renderCollectionView = (req, res) => {
  const collections = collectionBuilder.getCollections()
  const collectionName = req.params.collectionName
  req.breadcrumbs(_.startCase(collectionName))
  res.render('collection-view', {
    title: _.startCase(collectionName),
    subTitle: 'List of all ' + pluralize(_.startCase(collectionName)),
    collections: collections,
    user: req.user,
    collectionName: collectionName,
    currentYear: moment().year(),
    currentPath: req.baseUrl,
    breadcrumbs: req.breadcrumbs(),
  })
}
export function makeUrlHashLink(moduleID, optionKey, displayText, cssClass) {
	const mod = Modules.getUnchecked(moduleID);
	if (!displayText) {
		if (optionKey) {
			displayText = optionKey;
		} else if (mod) {
			displayText = mod.moduleName;
		} else if (moduleID) {
			displayText = moduleID;
		} else {
			displayText = 'Settings';
		}
		displayText = _.startCase(displayText);
	}

	let title = ['RES Settings'];
	if (mod) {
		title.push(mod.moduleName);
	}
	if (optionKey) {
		title.push(optionKey);
	}
	title = title.join(' &gt; ');

	const hash = makeUrlHash(moduleID, optionKey);
	return `<a class="${cssClass || ''}" href="${hash}" title="${title}">${displayText}</a>`;
}
Example #12
0
 fs.readFile(path.join(__dirname, 'users', file), { encoding: 'utf8' }, function(err, data) {
   if (err) throw err;
   var user = JSON.parse(data);
   user.name.full = _.startCase(user.name.first + ' ' + user.name.last);
   users.push(user);
   if (users.length === files.length) res.render('index', { users: users });
 });
Example #13
0
 .map(({ name, onChange, value, pristine }) => {
   const key = kebabCase(name);
   const type = name in types ? types[name] : 'text';
   return (
     <Col key={key} xs={12}>
       <FormGroup>
         {type === 'hidden' ? null : (
           <ControlLabel htmlFor={key}>{startCase(name)}</ControlLabel>
         )}
         <FormControl
           componentClass={type === 'textarea' ? type : 'input'}
           id={key}
           name={name}
           onChange={onChange}
           placeholder={placeholder ? name : ''}
           required={required.includes(name)}
           rows={4}
           type={type}
           value={value}
         />
         {name in errors && !pristine ? (
           <HelpBlock>
             <Alert bsStyle='danger'>{errors[name]}</Alert>
           </HelpBlock>
         ) : null}
       </FormGroup>
     </Col>
   );
 })}
 const bio = _.map(this.props.bio, (val, key) => {
   if (_.isNull(val) || this.UNNEEDED_FIELDS.includes(key)) {
     return null;
   }
   const title = _.startCase(key);
   if (key === 'avatar_url') {
     return (
       <li className="list-group-item" key={key}>
         <img src={val} className="img-rounded img-responsive" />
       </li>
     );
   }
   if (key === 'blog') {
     return (
       <li className="list-group-item" key={key}>
         {title}: <a href={val}>{val}</a>
       </li>
     );
   }
   return (
     <li className="list-group-item" key={key}>
       {title}: {val}
     </li>
   );
 });
Example #15
0
    callback(err, _.map(styles, function(style) {
      var basename = path.basename(style, '.css'),
          name     = _.startCase(basename),
          pathName = path.relative('src', style);

      return { path: pathName, name: name };
    }));
Example #16
0
  renderFilter = (key: string, index: number) => {
    const keys = this.props.targetByAttributes;
    let previousFiltersAreFull = true;
    for (let ii = index - 1; ii >= 0; ii--) {
      previousFiltersAreFull =
        previousFiltersAreFull && this.state.filters[keys[ii]];
    }
    // if we're in the first filter, or if we've made it through all previous filters
    if (previousFiltersAreFull) {
      return (
        <div key={key} style={{ marginBottom: '10px' }}>
          <SweetSelect
            name={`filter-targets-by-attribute-${key}`}
            value={this.valueForSelect(key)}
            options={this.valuesForSelect(key)}
            label={startCase(key)}
            clearable={index > 0}
            onChange={(value: string) => {
              const updatedFilters = { ...this.state.filters, [key]: value };
              const discardFn = (v: string, k: string) =>
                !v || keys.indexOf(k) > index;
              this.updateFilters(omitBy(updatedFilters, discardFn));
            }}
          />
          <div className="clearfix" />
        </div>
      );
    }

    return null;
  };
  renderChildren = (props) => {
    const { component: Children, computedMatch, render } = this.props

    if (render) return render()

    const filename = `${_.startCase(computedMatch.params.name).replace(' ', '')}Layout.js`

    return (
      <div>
        {style}
        <Children {...props} />
        <div style={docsButtonStyle}>
          <Button
            as={NavLink}
            to='/layouts'
            color='teal'
            icon='left arrow'
            content='Layouts'
          />
          <Button
            as={NavLink}
            to={`${repoURL}/blob/master/docs/app/Layouts/${filename}`}
            color='secondary'
            icon='github'
            content='Source'
            target='_blank'
          />
        </div>
      </div>
    )
  }
Example #18
0
  renderCustomLink = (props, linkStyles) => {
    if (props.link.name === 'button.contentType.add') {
      return this.renderAddLink(props, linkStyles);
    }

    const linkName = props.link.source ?  `${props.link.name}&source=${props.link.source}` : props.link.name;
    const temporary = props.link.isTemporary || this.props.modelPage.showButtons && linkName === this.props.match.params.modelName ? <FormattedMessage id="content-type-builder.contentType.temporaryDisplay" /> : '';
    const spanStyle = props.link.isTemporary || this.props.modelPage.showButtons && linkName === this.props.match.params.modelName || isEmpty(temporary) && props.link.source ? styles.leftMenuSpan : '';
    const pluginSource = isEmpty(temporary) && props.link.source ? <FormattedMessage id="content-type-builder.from">{(message) => <span style={{ marginRight: '10px' }}>({message}: {props.link.source})</span>}</FormattedMessage>: '';

    return (
      <li className={linkStyles.pluginLeftMenuLink}>
        <NavLink className={linkStyles.link} to={`/plugins/content-type-builder/models/${props.link.name}${props.link.source ? `&source=${props.link.source}` : ''}`} activeClassName={linkStyles.linkActive}>
          <div>
            <i className={`fa fa-caret-square-o-right`} />
          </div>
          <div className={styles.contentContainer}>

            <span className={spanStyle}>{startCase(props.link.name)}</span>
            <span style={{ marginLeft: '1rem', fontStyle: 'italic' }}>{temporary}{pluginSource}</span>
          </div>
        </NavLink>
      </li>
    );
  }
        function cockpitPropertiesBuilder(params) {
            if (_this.multiInstance) {
                if (!params || !params.instanceName || !_this.configs[params.instanceName]) {
                    throw new Error('No such instance found: ', params);
                }

                const instanceName = params.instanceName;

                let baseUrl = null;
                let resourcesPrefix = null;
                let searcherApiPrefix = '';
                if (!subDomain) {
                    baseUrl = `/${instanceName}`;
                    resourcesPrefix = instanceName;
                    searcherApiPrefix = `/${instanceName}`;
                }

                return _.defaultsDeep(_this.configs[instanceName].cockpitConfig, {
                    multiInstance: _this.multiInstance,
                    instanceName,
                    searcherApi: `${searcherApiPrefix}/searcher/api`,
                    baseUrl,
                    title: `${_.startCase(instanceName)} Cockpit`,
                    resourcesPrefix
                });
            }

            return _.defaultsDeep(_this.configs.default.cockpitConfig, {
                instanceName: 'default',
                searcherApi: '/searcher/api',
                title: 'Cockpit'
            });
        }
Example #20
0
      function(answers) {
        me.project.name = me.project.name || answers.name;
        me.project.description = me.project.description || answers.description || 'TODO: Add a project description';

        // The project's full name includes the npm scope (if any)
        me.project.fullName = me.project.name;

        if (_.contains(me.project.name, '/')) {
          // Remove NPM scope from the project name
          me.project.name = me.project.name.substring(me.project.name.indexOf('/') + 1);
        }

        // Format the project name for humans and for code
        me.project.friendlyName = _.startCase(me.project.name);
        me.project.camelCaseName = _.camelCase(me.project.name);

        // Get the project's author
        me.project.author = me.project.author || {};
        if (_.isString(me.project.author)) {
          me.project.author = {name: me.project.author};
        }
        me.project.author.name = me.project.author.name || answers.authorName || 'John Doe';

        done();
      });
Example #21
0
const _createRole = roleName => {
  return new Role({
    name: roleName,
    title: startCase(roleName),
    identifier: _getRoleIdentifier(roleName)
  });
};
Example #22
0
 return ['argument', 'aliases', 'types', 'default', 'description'].map(field => {
   const column = { field, name: startCase(field), truncateText: field !== 'description' };
   if (field === 'description') {
     column.width = '50%';
   }
   return column;
 });
Example #23
0
 return breadcrumbs.map((path, index) => {
   return {
     path: path,
     title: _.startCase(path),
     url: urlBase + breadcrumbs.slice(0, index + 1).join('/')
   };
 });
Example #24
0
  render() {
    const pluginSource = this.props.rowItem.source ? <FormattedMessage id="content-type-builder.from">{(message) =><span style={{ fontStyle: 'italic', color: '#787E8F', fontWeight: '500' }}>({message}: {this.props.rowItem.source})</span>}</FormattedMessage> : '';
    const temporary = this.props.rowItem.isTemporary ? <FormattedMessage id="content-type-builder.contentType.temporaryDisplay" /> : '';
    const description = isEmpty(this.props.rowItem.description) ? '-' :  this.props.rowItem.description;
    const spanStyle = this.props.rowItem.isTemporary ? '60%' : '100%';
    const icons = this.props.rowItem.source ? [] : [{ icoType: 'pencil', onClick: this.handleEdit }, { icoType: 'trash', onClick: this.handleShowModalWarning }];

    return (
      <ListRow onClick={this.handleGoTo}>
        <div className={`col-md-4 ${styles.italic} ${styles.nameContainer}`}>
          <i className={`fa ${this.props.rowItem.icon}`} />
          <span style={{ width: spanStyle }}>{startCase(this.props.rowItem.name)} &nbsp;{pluginSource}</span>
          &nbsp;{temporary}
        </div>
        <div className={`col-md-5 text-center ${styles.descriptionContainer}`}>
          <div>
            {description}
          </div>
        </div>
        <div className="col-md-2 text-center">{this.props.rowItem.fields}</div>
        <div className="col-md-1">
          <IcoContainer icons={icons} />
        </div>
        <PopUpWarning
          isOpen={this.state.showWarning}
          toggleModal={this.toggleModalWarning}
          content={{ message: 'content-type-builder.popUpWarning.bodyMessage.contentType.delete' }}
          popUpWarningType={'danger'}
          onConfirm={this.handleDelete}
        />
      </ListRow>
    );
  }
Example #25
0
    .map(function(style) {
      let basename = path.basename(style, '.css'),
          name     = _.startCase(basename),
          pathName = path.relative('src', style);

      return { path: pathName, name: name };
    });
Example #26
0
  return _.map(styles, function(style) {
    var basename = path.basename(style, '.css'),
        name     = _.startCase(basename),
        pathName = path.join('styles', style);

    return { path: pathName, name: name };
  });
Example #27
0
        configureGlobal: function () {
            // Application name modified, using each technology's conventions
            this.angularAppName = this.getAngularAppName();
            this.camelizedBaseName = _.camelCase(this.baseName);
            this.dasherizedBaseName = _.kebabCase(this.baseName);
            this.lowercaseBaseName = this.baseName.toLowerCase();
            this.humanizedBaseName = _.startCase(this.baseName);
            this.mainClass = this.getMainClassName();

            if (this.prodDatabaseType === 'oracle') {
                // create a folder for users to place ojdbc jar
                this.ojdbcVersion = '7';
                this.libFolder = 'lib/oracle/ojdbc/' + this.ojdbcVersion + '/';
                mkdirp(this.libFolder);
            }

            if (this.databaseType === 'cassandra' || this.databaseType === 'mongodb') {
                this.pkType = 'String';
            } else {
                this.pkType = 'Long';
            }

            this.packageFolder = this.packageName.replace(/\./g, '/');
            this.testDir = constants.SERVER_TEST_SRC_DIR + this.packageFolder + '/';
            if (!this.nativeLanguage) {
                // set to english when translation is set to false
                this.nativeLanguage = 'en';
            }
        },
Example #28
0
 .map((key) => {
     const scale = SCALING_TO_CONFIG[key];
     return {
         name: `${chalk.green(`${_.startCase(key)} Scaling \t\t Number of Tasks: ${scale.fargate.taskCount}`)}\t ${chalk.yellow(`DB Instances: ${scale.database.instances}`)}`,
         value: key,
         short: key
     };
 }).value();
Example #29
0
function addTray(action) {
  _storeState.trays[action.trayId] = {
    name: _.startCase(nameGenerator().spaced),
    trayId: action.trayId,
    url: action.url,
    username: action.username
  }
}
Example #30
0
function getUser (username) {
  var user = JSON.parse(fs.readFileSync(getUserFilePath(username), {encoding: 'utf8'}))
  user.name.full = _.startCase(user.name.first + ' ' + user.name.last)
  _.keys(user.location).forEach(function (key) {
    user.location[key] = _.startCase(user.location[key])
  })
  return user
}