Skip to content

Instantly share code, notes, and snippets.

View ChadRehmKineticData's full-sized avatar

ChadRehmKineticData

View GitHub Profile
@ChadRehmKineticData
ChadRehmKineticData / help.js
Created September 26, 2017 12:20
A help document for Activity 7.
{ this.state.open ?
(
<CoreFormModal
form="color-select"
kapp="services"
dismissed={this.closeForm}
completed={this.closeForm}
/>
) : <button className="btn btn-default" onClick={this.openForm}>
Open Form
@ChadRehmKineticData
ChadRehmKineticData / ServiceCardBottom.js
Created October 25, 2017 21:51
Reference for React Training. Activity for refactor stateless component
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
export class ServiceCardBottom extends Component { // class that extends component
constructor(props) {
super(props);
this.state = { // initialize state
visable: false,
};
<%@page pageEncoding="UTF-8" contentType="text/html" trimDirectiveWhitespaces="true"%>
<%@include file="../bundle/initialization.jspf" %>
<bundle:layout page="${bundle.path}/layouts/layout.jsp">
<!-- Sets imports js and css specific to the setup pages. -->
<bundle:variable name="head">
<bundle:stylepack>
<bundle:style src="${bundle.location}/setup/setup.css"/>
</bundle:stylepack>
<bundle:scriptpack>
@ChadRehmKineticData
ChadRehmKineticData / super bundle DropDown component
Created April 10, 2018 13:44
Reusable dropdown component for super bundle
import React, { Component } from 'react';
import classNames from 'classnames';
import Autocomplete from 'react-autocomplete';
const handleChange = () => event => {
this.setState({ indexLookup: event.target.value });
if(this.props.onChange === 'function') {
this.props.onChange(event.target.value);
}
}
import React from 'react';
import { KappLink as Link, Icon } from 'common';
export const CategoryCard = props => (
<Link
to={props.path}
className="card c-card"
style={{
backgroundColor: props.category.backgroundColor
? props.category.backgroundColor
export const Category = object => ({
name: object.name,
slug: object.slug,
sortOrder: parseInt(
Utils.getAttributeValue(object, constants.ATTRIBUTE_ORDER, 1000),
10,
),
icon: Utils.getAttributeValue(
object,
import React from 'react';
import { KappLink as Link, Icon } from 'common';
export const ServiceCard = ({ path, form }) => (
<Link to={path} className="card s-card">
<div className="card-title">
<h1>
<Icon image={form.icon} background="blueSlate" />
{form.name}
</h1>
@ChadRehmKineticData
ChadRehmKineticData / gist:d99e9b8166a49932f66a774a190add17
Created May 2, 2018 11:31
Add Approver Icon Add Attribute to Form model
export const Form = object => ({
name: object.name,
slug: object.slug,
description: object.description,
icon: Utils.getAttributeValue(
object,
constants.ATTRIBUTE_ICON,
constants.DEFAULT_FORM_ICON,
),
categories:
@ChadRehmKineticData
ChadRehmKineticData / gist:9a02fd717d4d0f7fdb0c8ed4db3a8908
Created May 2, 2018 11:34
Add Approver Icon Make icon conditional
import React from 'react';
import { KappLink as Link, Icon } from 'common';
export const ServiceCard = ({ path, form }) => (
<Link to={path} className="card s-card">
<div className="card-title">
<h1>
<Icon image={form.icon} background="blueSlate" />
{form.name}
</h1>
@ChadRehmKineticData
ChadRehmKineticData / gist:e22c5caf099c946bd7575c9c2696390a
Created May 2, 2018 11:40
Add approver to form, Replace the div block
import React from 'react';
import { CoreForm } from 'react-kinetic-core';
import {
KappLink as Link,
ErrorNotFound,
ErrorUnauthorized,
ErrorUnexpected,
PageTitle,
} from 'common';
import { SERVICES_KAPP as kappSlug } from '../../constants';