path
stringlengths
5
195
repo_name
stringlengths
5
79
content
stringlengths
25
1.01M
packages/base-shell/src/components/AuthorizedRoute.js
TarikHuber/react-most-wanted
import React from 'react' import { Navigate, useLocation } from 'react-router-dom' import { useAuth } from '../providers/Auth' import { useConfig } from '../providers/Config' function AuthorizedRoute({ children }) { const { appConfig } = useConfig() const { auth: authConfig } = appConfig || {} const { signInURL = '/signin' } = authConfig || {} const { auth } = useAuth() const location = useLocation() if (auth.isAuthenticated) { return children } else { return ( <Navigate //to={`${signInURL}?from=${location.pathname}`} to={{ pathname: signInURL, search: `from=${location.pathname}`, state: { from: location }, }} replace /> ) } } export default AuthorizedRoute
examples/js/sort/sort-style-table.js
AllenFang/react-bootstrap-table
/* eslint max-len: 0 */ /* eslint no-unused-vars: 0 */ import React from 'react'; import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'; const products = []; function addProducts(quantity) { const startId = products.length; for (let i = 0; i < quantity; i++) { const id = startId + i; products.push({ id: id, name: 'Item name ' + id, price: 2100 + i }); } } addProducts(5); export default class SortTable extends React.Component { customSortStyle = (order, dataField) => { if (order === 'desc') { return 'sort-desc'; } return 'sort-asc'; } render() { return ( <div> <BootstrapTable ref='table' data={ products }> <TableHeaderColumn dataField='id' isKey dataSort sortHeaderColumnClassName='sorting'>Product ID</TableHeaderColumn> <TableHeaderColumn dataField='name' dataSort sortHeaderColumnClassName={ this.customSortStyle }>Product Name</TableHeaderColumn> <TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn> </BootstrapTable> </div> ); } }
lib/components/tabs.js
whitelynx/hyperterm
import React from 'react'; import Component from '../component'; import {decorate, getTabProps} from '../utils/plugins'; import Tab_ from './tab'; const Tab = decorate(Tab_, 'Tab'); const isMac = /Mac/.test(navigator.userAgent); export default class Tabs extends Component { template(css) { const { tabs = [], borderColor, onChange, onClose } = this.props; const hide = !isMac && tabs.length === 1; return (<nav className={css('nav', hide && 'hiddenNav')}> { this.props.customChildrenBefore } { tabs.length === 1 && isMac ? <div className={css('title')}>{tabs[0].title}</div> : null } { tabs.length > 1 ? [ <ul key="list" className={css('list')} > { tabs.map((tab, i) => { const {uid, title, isActive, hasActivity} = tab; const props = getTabProps(tab, this.props, { text: title === '' ? 'Shell' : title, isFirst: i === 0, isLast: tabs.length - 1 === i, borderColor, isActive, hasActivity, onSelect: onChange.bind(null, uid), onClose: onClose.bind(null, uid) }); return <Tab key={`tab-${uid}`} {...props}/>; }) } </ul>, isMac && <div key="shim" style={{borderColor}} className={css('borderShim')} /> ] : null } { this.props.customChildren } </nav>); } styles() { return { nav: { fontSize: '12px', height: '34px', lineHeight: '34px', verticalAlign: 'middle', color: '#9B9B9B', cursor: 'default', position: 'relative', WebkitUserSelect: 'none', WebkitAppRegion: isMac ? 'drag' : '', top: isMac ? '' : '34px' }, hiddenNav: { display: 'none' }, title: { textAlign: 'center', color: '#fff' }, list: { maxHeight: '34px', display: 'flex', flexFlow: 'row', marginLeft: isMac ? 76 : 0 }, borderShim: { position: 'absolute', width: '76px', bottom: 0, borderColor: '#ccc', borderBottomStyle: 'solid', borderBottomWidth: '1px' } }; } }
src/js/components/icons/base/Note.js
linde12/grommet
// (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP import React, { Component } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import CSSClassnames from '../../../utils/CSSClassnames'; import Intl from '../../../utils/Intl'; import Props from '../../../utils/Props'; const CLASS_ROOT = CSSClassnames.CONTROL_ICON; const COLOR_INDEX = CSSClassnames.COLOR_INDEX; export default class Icon extends Component { render () { const { className, colorIndex } = this.props; let { a11yTitle, size, responsive } = this.props; let { intl } = this.context; const classes = classnames( CLASS_ROOT, `${CLASS_ROOT}-note`, className, { [`${CLASS_ROOT}--${size}`]: size, [`${CLASS_ROOT}--responsive`]: responsive, [`${COLOR_INDEX}-${colorIndex}`]: colorIndex } ); a11yTitle = a11yTitle || Intl.getMessage(intl, 'note'); const restProps = Props.omit(this.props, Object.keys(Icon.propTypes)); return <svg {...restProps} version="1.1" viewBox="0 0 24 24" width="24px" height="24px" role="img" className={classes} aria-label={a11yTitle}><path fill="none" stroke="#000" strokeWidth="2" d="M1,23 L16,23 L23,16 L23,1 L1,1 L1,23 Z M15,23 L15,15 L23,15"/></svg>; } }; Icon.contextTypes = { intl: PropTypes.object }; Icon.defaultProps = { responsive: true }; Icon.displayName = 'Note'; Icon.icon = true; Icon.propTypes = { a11yTitle: PropTypes.string, colorIndex: PropTypes.string, size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge', 'huge']), responsive: PropTypes.bool };
src/parser/paladin/holy/modules/beacons/BeaconHealingDone.js
sMteX/WoWAnalyzer
import React from 'react'; import { Trans } from '@lingui/macro'; import Panel from 'interface/statistics/Panel'; import Analyzer, { SELECTED_PLAYER } from 'parser/core/Analyzer'; import HealingValue from 'parser/shared/modules/HealingValue'; import HealingDone from 'parser/shared/modules/throughput/HealingDone'; import BeaconHealSource from './BeaconHealSource'; import BeaconHealingBreakdown from './BeaconHealingBreakdown'; class BeaconHealingDone extends Analyzer { static dependencies = { beaconHealSource: BeaconHealSource, healingDone: HealingDone, }; _totalBeaconHealing = new HealingValue(); _beaconHealingBySource = {}; constructor(options) { super(options); this.addEventListener(this.beaconHealSource.beacontransfer.by(SELECTED_PLAYER), this._onBeaconTransfer); } _onBeaconTransfer(event) { this._totalBeaconHealing = this._totalBeaconHealing.add(event.amount, event.absorbed, event.overheal); const source = event.originalHeal; const spellId = source.ability.guid; let sourceHealing = this._beaconHealingBySource[spellId]; if (!sourceHealing) { sourceHealing = this._beaconHealingBySource[spellId] = { ability: source.ability, healing: new HealingValue(), }; } sourceHealing.healing = sourceHealing.healing.add(event.amount, event.absorbed, event.overheal); } statistic() { return ( <Panel title={<Trans>Beacon healing sources</Trans>} explanation={( <Trans> Beacon healing is triggered by the <b>raw</b> healing done of your primary spells. This breakdown shows the amount of effective beacon healing replicated by each beacon transfering heal. </Trans> )} position={120} pad={false} > <BeaconHealingBreakdown totalHealingDone={this.healingDone.total} totalBeaconHealing={this._totalBeaconHealing} beaconHealingBySource={this._beaconHealingBySource} fightDuration={this.owner.fightDuration} /> </Panel> ); } } export default BeaconHealingDone;
src/components/Auth/signin.js
gperl27/liftr-v2
import React, { Component } from 'react'; import { reduxForm } from 'redux-form'; import * as actions from '../../actions'; class Signin extends Component { handleFormSubmit({email, password}){ console.log(email, password); // need to do something to log user in this.props.signinUser({ email, password }); } renderAlert(){ if(this.props.errorMessage){ return ( <div className="alert alert-danger"> <strong>Oops!</strong> {this.props.errorMessage} </div> ) } } render() { const { handleSubmit, fields: { email, password }} = this.props; return ( <form onSubmit={handleSubmit(this.handleFormSubmit.bind(this))}> <fieldset className="form-group"> <label>Email: </label> <input {...email} className="form-control" /> </fieldset> <fieldset className="form-group"> <label>Password: </label> <input {...password} type="password" className="form-control" /> </fieldset> {this.renderAlert()} <button action="submit" className="btn btn-primary">Sign in</button> </form> ) } } function mapStateToProps(state){ return { errorMessage: state.auth.error }; } export default reduxForm({ form: 'signin', fields: ['email', 'password'] }, mapStateToProps, actions)(Signin);
src/components/MenuAside.js
Leobuaa/online-disk
import React, { Component } from 'react'; class MenuAside extends Component { constructor(props) { super(props); } isActiveButton(index) { if (index === this.props.menuAside.buttonActiveIndex) { return 'item-active'; } return ''; } render() { const lists = [ { index: 0, name: 'all', icon: 'glyphicon-th-list', 'chinese': '全部', }, { index: 1, name: 'image', icon: 'glyphicon-picture', 'chinese': '图片', }, { index: 2, name: 'doc', icon: 'glyphicon-file', 'chinese': '文档', }, { index: 3, name: 'video', icon: 'glyphicon-facetime-video', 'chinese': '视频', }, { index: 4, name: 'music', icon: 'glyphicon-music', 'chinese': '音乐', }, { index: 5, name: 'trash', icon: 'glyphicon-trash', 'chinese': '回收站', } ]; const menuLists = lists.map((obj) => <button key={obj.name} name={obj.name} type="button" className={'list-group-item list-item ' + this.isActiveButton(obj.index)} onClick={this.props.onMenuAsideButtonClick}> <span className={'glyphicon ' + obj.icon} aria-hidden="true"></span> {obj.chinese} </button> ); return ( <div className="menu-aside-wrapper"> <div className="list-group menu-list" data-active-index={this.props.menuAside.buttonActiveIndex}> {menuLists} </div> </div> ) } } export default MenuAside;
src/svg-icons/editor/drag-handle.js
ruifortes/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let EditorDragHandle = (props) => ( <SvgIcon {...props}> <path d="M20 9H4v2h16V9zM4 15h16v-2H4v2z"/> </SvgIcon> ); EditorDragHandle = pure(EditorDragHandle); EditorDragHandle.displayName = 'EditorDragHandle'; EditorDragHandle.muiName = 'SvgIcon'; export default EditorDragHandle;
src/js/components/icons/base/DocumentVideo.js
kylebyerly-hp/grommet
// (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP import React, { Component } from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import CSSClassnames from '../../../utils/CSSClassnames'; import Intl from '../../../utils/Intl'; import Props from '../../../utils/Props'; const CLASS_ROOT = CSSClassnames.CONTROL_ICON; const COLOR_INDEX = CSSClassnames.COLOR_INDEX; export default class Icon extends Component { render () { const { className, colorIndex } = this.props; let { a11yTitle, size, responsive } = this.props; let { intl } = this.context; const classes = classnames( CLASS_ROOT, `${CLASS_ROOT}-document-video`, className, { [`${CLASS_ROOT}--${size}`]: size, [`${CLASS_ROOT}--responsive`]: responsive, [`${COLOR_INDEX}-${colorIndex}`]: colorIndex } ); a11yTitle = a11yTitle || Intl.getMessage(intl, 'document-video'); const restProps = Props.omit(this.props, Object.keys(Icon.propTypes)); return <svg {...restProps} version="1.1" viewBox="0 0 24 24" width="24px" height="24px" role="img" className={classes} aria-label={a11yTitle}><path fill="none" stroke="#000" strokeWidth="2" d="M4.99787498,6.99999999 L4.99787498,0.999999992 L19.4999998,0.999999992 L22.9999998,4.50000005 L22.9999998,23 L4,23 M18,1 L18,6 L23,6 M3,10 L12,10 L12,19 L3,19 L3,10 Z M12,13 L17,10.5 L17,18.5 L12,16 L12,13 Z"/></svg>; } }; Icon.contextTypes = { intl: PropTypes.object }; Icon.defaultProps = { responsive: true }; Icon.displayName = 'DocumentVideo'; Icon.icon = true; Icon.propTypes = { a11yTitle: PropTypes.string, colorIndex: PropTypes.string, size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large', 'xlarge', 'huge']), responsive: PropTypes.bool };
src/svg-icons/image/crop-free.js
mtsandeep/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let ImageCropFree = (props) => ( <SvgIcon {...props}> <path d="M3 5v4h2V5h4V3H5c-1.1 0-2 .9-2 2zm2 10H3v4c0 1.1.9 2 2 2h4v-2H5v-4zm14 4h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4zm0-16h-4v2h4v4h2V5c0-1.1-.9-2-2-2z"/> </SvgIcon> ); ImageCropFree = pure(ImageCropFree); ImageCropFree.displayName = 'ImageCropFree'; ImageCropFree.muiName = 'SvgIcon'; export default ImageCropFree;
client/views/admin/federationDashboard/FederationDashboardPage.stories.js
VoiSmart/Rocket.Chat
import React from 'react'; import FederationDashboardPage from './FederationDashboardPage'; export default { title: 'admin/federationDashboard/FederationDashboardPage', component: FederationDashboardPage, }; export const Default = () => <FederationDashboardPage />;
frontend/src/components/dialog/list-repo-drafts-dialog.js
miurahr/seahub
import React from 'react'; import PropTypes from 'prop-types'; import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; import { gettext, siteRoot } from '../../utils/constants'; import { seafileAPI } from '../../utils/seafile-api'; import moment from 'moment'; import editorUtilities from '../../utils/editor-utilities'; import toaster from '../../components/toast'; import { Utils } from '../../utils/utils'; import Draft from '../../models/draft'; const propTypes = { repoID: PropTypes.string.isRequired, toggle: PropTypes.func.isRequired, }; class ListRepoDraftsDialog extends React.Component { constructor(props) { super(props); this.state = { drafts: [], }; } componentDidMount() { seafileAPI.listRepoDrafts(this.props.repoID).then(res => { let drafts = res.data.drafts.map(item => { let draft = new Draft(item); return draft; }); this.setState({ drafts: drafts }); }); } onDeleteDraftItem = (draft) => { editorUtilities.deleteDraft(draft.id).then(() => { let drafts = this.state.drafts.filter(item => { return item.id !== draft.id; }); this.setState({drafts: drafts}); let msg = gettext('Successfully deleted draft %(draft)s.'); msg = msg.replace('%(draft)s', draft.draftFilePath); toaster.success(msg); }).catch(() => { let msg = gettext('Failed to delete draft %(draft)s.'); msg = msg.replace('%(draft)s', draft.draftFilePath); toaster.danger(msg); }); } toggle = () => { this.props.toggle(); } render() { return ( <Modal isOpen={true}> <ModalHeader toggle={this.toggle}>{gettext('Drafts')}</ModalHeader> <ModalBody className="dialog-list-container"> <table> <thead> <tr> <th width='50%' className="ellipsis">{gettext('Name')}</th> <th width='20%'>{gettext('Owner')}</th> <th width='20%'>{gettext('Last Update')}</th> <th width='10%'></th> </tr> </thead> <tbody> {this.state.drafts.map((item, index) => { return ( <DraftItem key={index} draftItem={item} onDeleteDraftItem={this.onDeleteDraftItem} /> ); })} </tbody> </table> </ModalBody> <ModalFooter> <Button color="secondary" onClick={this.toggle}>{gettext('Close')}</Button> </ModalFooter> </Modal> ); } } ListRepoDraftsDialog.propTypes = propTypes; export default ListRepoDraftsDialog; const DraftItemPropTypes = { draftItem: PropTypes.object, onDeleteDraftItem: PropTypes.func.isRequired, }; class DraftItem extends React.Component { constructor(props) { super(props); this.state = ({ active: false, }); } onMouseEnter = () => { this.setState({ active: true }); } onMouseLeave = () => { this.setState({ active: false }); } render() { const draftItem = this.props.draftItem; let href = siteRoot + 'drafts/' + draftItem.id + '/'; let className = this.state.active ? 'action-icon sf2-icon-x3' : 'action-icon vh sf2-icon-x3'; return ( <tr onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave}> <td className="name"> <a href={href} target='_blank'>{Utils.getFileName(draftItem.draftFilePath)}</a> </td> <td>{draftItem.ownerNickname}</td> <td>{moment(draftItem.createdStr).fromNow()}</td> <td> <i className={className} onClick={this.props.onDeleteDraftItem.bind(this, draftItem)}></i> </td> </tr> ); } } DraftItem.propTypes = DraftItemPropTypes;
wrappers/html.js
pcm-ca/pcm-ca.github.io
import React from 'react' import Helmet from 'react-helmet' import { config } from 'config' module.exports = React.createClass({ propTypes () { return { router: React.PropTypes.object, } }, render () { const page = this.props.route.page.data return ( <div> <Helmet title={`${config.siteTitle} | ${page.title}`} /> <div dangerouslySetInnerHTML={{ __html: page.body }} /> </div> ) }, })
src/other/DescriptionTeaser.js
ndlib/beehive
import React from 'react' import PropTypes from 'prop-types' import createReactClass from 'create-react-class' const DescriptionTeaser = createReactClass({ displayName: 'Teaser Text', propTypes: { description: PropTypes.string, }, style: function () { return { overflow: 'hidden', textOverflow: 'ellipsis', } }, render: function () { return ( <div className='item-description' dangerouslySetInnerHTML={{ __html: this.props.description }} style={this.style()} /> ) }, }) export default DescriptionTeaser
app/server.js
nurogenic/universal-react-boilerplate
import path from 'path'; import React from 'react'; import Router from 'react-router'; import Hapi from 'hapi'; import _merge from 'lodash.merge'; import routes from './routes.jsx'; import component from './components/Html.jsx'; const server = new Hapi.Server(); server.connection({port: 8000}); server.route({ method: 'GET', path: '/hello', handler: function (request, reply) { reply('don\'t worry, be hapi!'); } }); server.route({ method: 'GET', path: '/js/{param*}', handler: { directory: { path: './public/js', listing: true, index: true } } }); server.route({ method: 'GET', path: '/images/{param*}', handler: { directory: { path: './public/images', listing: true, index: true } } }); server.ext('onPostHandler', (request, replay) => { Router.run(routes, request.url.path, (Handler, state) => { if (!state.routes.length) { return replay.continue(); } let html = React.renderToStaticMarkup(component({ title: 'test', markup: React.renderToString(React.createFactory(Handler)()) })); return replay('<!DOCTYPE html>' + html); }); }); server.start(() => { console.log('Server running at: ' + server.info.uri); });
packages/mineral-ui-icons/src/IconHealing.js
mineral-ui/mineral-ui
/* @flow */ import React from 'react'; import Icon from 'mineral-ui/Icon'; import type { IconProps } from 'mineral-ui/Icon/types'; /* eslint-disable prettier/prettier */ export default function IconHealing(props: IconProps) { const iconProps = { rtl: false, ...props }; return ( <Icon {...iconProps}> <g> <path d="M17.73 12.02l3.98-3.98a.996.996 0 0 0 0-1.41l-4.34-4.34a.996.996 0 0 0-1.41 0l-3.98 3.98L8 2.29a1.001 1.001 0 0 0-1.41 0L2.25 6.63a.996.996 0 0 0 0 1.41l3.98 3.98L2.25 16a.996.996 0 0 0 0 1.41l4.34 4.34c.39.39 1.02.39 1.41 0l3.98-3.98 3.98 3.98c.2.2.45.29.71.29.26 0 .51-.1.71-.29l4.34-4.34a.996.996 0 0 0 0-1.41l-3.99-3.98zM12 9c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-4.71 1.96L3.66 7.34l3.63-3.63 3.62 3.62-3.62 3.63zM10 13c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm2 2c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm2-4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm2.66 9.34l-3.63-3.62 3.63-3.63 3.62 3.62-3.62 3.63z"/> </g> </Icon> ); } IconHealing.displayName = 'IconHealing'; IconHealing.category = 'image';
code/schritte/2-hierarchy/src/GreetingMaster.js
st-he/react-workshop
import React from 'react'; const GreetingMaster = (props) => { const {greetings, onAdd} = props; const body = greetings.map(greeting => <tr key={greeting.id}><td>{greeting.name}</td><td>{greeting.greeting}</td></tr>); return ( <div> <table> <thead> <tr><th>Name</th><th>Greeting</th></tr> </thead> <tbody> {body} </tbody> </table> <button onClick={onAdd}> Add </button> </div> ); }; export default GreetingMaster;
assets/jqwidgets/demos/react/app/tabs/mapinsidetab/app.js
juannelisalde/holter
import React from 'react'; import ReactDOM from 'react-dom'; import JqxTabs from '../../../jqwidgets-react/react_jqxtabs.js'; class App extends React.Component { render() { let initialize = () => { let mapCanvas = document.getElementById('map-canvas'); let mapOptions = { center: new google.maps.LatLng(29.979234, 31.134202), zoom: 17, mapTypeId: google.maps.MapTypeId.ROADMAP } let map = new google.maps.Map(mapCanvas, mapOptions) }; let initTabContent = (tab) => { if (tab === 0) { google.maps.event.addDomListener(window, 'load', initialize); } }; return ( <div> <p style={{ fontFamily: 'Verdana' }}> Great Pyramid of Giza</p> <JqxTabs ref='myTabs' width={600} height={400} initTabContent={initTabContent} > <ul style={{ marginLeft: 20 }}> <li>Map</li> <li>Information</li> </ul> <div> <div id="map-canvas" style={{ width: '100%', height: '100%' }}> </div> </div> <div> The Great Pyramid of Giza (also known as the Pyramid of Khufu or the Pyramid of Cheops) is the oldest and largest of the three pyramids in the Giza Necropolis bordering what is now El Giza, Egypt. It is the oldest of the Seven Wonders of the Ancient World, and the only one to remain largely intact. </div> </JqxTabs> </div> ) } } ReactDOM.render(<App />, document.getElementById('app'));
src/svg-icons/av/radio.js
ichiohta/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let AvRadio = (props) => ( <SvgIcon {...props}> <path d="M3.24 6.15C2.51 6.43 2 7.17 2 8v12c0 1.1.89 2 2 2h16c1.11 0 2-.9 2-2V8c0-1.11-.89-2-2-2H8.3l8.26-3.34L15.88 1 3.24 6.15zM7 20c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm13-8h-2v-2h-2v2H4V8h16v4z"/> </SvgIcon> ); AvRadio = pure(AvRadio); AvRadio.displayName = 'AvRadio'; AvRadio.muiName = 'SvgIcon'; export default AvRadio;
imports/ui/pages/Index.js
KyneSilverhide/expense-manager
import React from 'react'; import Grid from 'material-ui/Grid'; import EventsListDashboard from '../containers/events/EventsListDashboard'; import Debts from '../containers/debts/Debts'; const Index = () => <Grid container direction="row"> <Grid item xs={12} lg={9}> <EventsListDashboard /> </Grid> <Grid item xs={12} lg={3}> <Debts /> </Grid> </Grid>; export default Index;
examples/js/style/tr-class-function-table.js
rolandsusans/react-bootstrap-table
/* eslint max-len: 0 */ /* eslint no-unused-vars: 0 */ import React from 'react'; import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'; const products = []; function addProducts(quantity) { const startId = products.length; for (let i = 0; i < quantity; i++) { const id = startId + i; products.push({ id: id, name: 'Item name ' + id, price: 2100 + i }); } } addProducts(9); function trClassFormat(rowData, rIndex) { return rIndex % 3 === 0 ? 'tr-function-example' : ''; } export default class TrClassStringTable extends React.Component { render() { return ( <BootstrapTable data={ products } trClassName={ trClassFormat }> <TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn> <TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn> <TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn> </BootstrapTable> ); } }
assets/react/source/grid_offset.js
theroyalstudent/unsemantic-100-grid
// Dependencies. import React from 'react' import PropTypes from 'prop-types' // Define class. class GridOffset extends React.Component { // Render method. render () { // Expose UI. return ( <div className='grid-offset'> {this.props.children} </div> ) } } // Validation. GridOffset.propTypes = { children: PropTypes.node } // Export. export default GridOffset
src/mui/detail/Create.js
azureReact/AzureReact
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { Card } from 'material-ui/Card'; import compose from 'recompose/compose'; import inflection from 'inflection'; import ViewTitle from '../layout/ViewTitle'; import Title from '../layout/Title'; import { crudCreate as crudCreateAction } from '../../actions/dataActions'; import DefaultActions from './CreateActions'; import translate from '../../i18n/translate'; import withPermissionsFilteredChildren from '../../auth/withPermissionsFilteredChildren'; class Create extends Component { getBasePath() { const { location } = this.props; return location.pathname .split('/') .slice(0, -1) .join('/'); } defaultRedirectRoute() { const { hasShow, hasEdit } = this.props; if (hasEdit) return 'edit'; if (hasShow) return 'show'; return 'list'; } save = (record, redirect) => { this.props.crudCreate( this.props.resource, record, this.getBasePath(), redirect ); }; render() { const { actions = <DefaultActions />, 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} defaultTitle={defaultTitle} /> ); return ( <div className="create-page"> <Card style={{ opacity: isLoading ? 0.8 : 1 }}> {actions && React.cloneElement(actions, { basePath, resource, hasList, })} <ViewTitle title={titleElement} /> {React.cloneElement(children, { save: this.save, resource, basePath, record: {}, translate, redirect: typeof children.props.redirect === 'undefined' ? this.defaultRedirectRoute() : children.props.redirect, })} </Card> </div> ); } } Create.propTypes = { actions: PropTypes.element, children: PropTypes.element, crudCreate: PropTypes.func.isRequired, isLoading: PropTypes.bool.isRequired, location: PropTypes.object.isRequired, resource: PropTypes.string.isRequired, title: PropTypes.any, translate: PropTypes.func.isRequired, hasList: PropTypes.bool, }; Create.defaultProps = { data: {}, }; function mapStateToProps(state) { return { isLoading: state.admin.loading > 0, }; } const enhance = compose( connect(mapStateToProps, { crudCreate: crudCreateAction }), translate, withPermissionsFilteredChildren ); export default enhance(Create);
src/js/components/Projects/TableRow.js
appdev-academy/appdev.academy-react
import PropTypes from 'prop-types' import React from 'react' import { findDOMNode } from 'react-dom' import { Link } from 'react-router' import { DragSource, DropTarget } from 'react-dnd' import GreenButton from '../Buttons/Green' import OrangeButton from '../Buttons/Orange' const style = { border: '1px dashed gray', padding: '0.5rem 1rem', marginBottom: '.5rem', backgroundColor: 'white', cursor: 'move' } const cardSource = { beginDrag(props) { return { id: props.id, index: props.index } }, endDrag(props, monitor, component) { if (monitor.didDrop()) { let startIndex = props.index let dropIndex = monitor.getItem().index props.moveRow(startIndex, dropIndex) } } } const cardTarget = { hover(props, monitor, component) { // Note: we're mutating the monitor item here! // Generally it's better to avoid mutations, // but it's good here for the sake of performance // to avoid expensive index searches. monitor.getItem().index = props.index } } @DropTarget( "PROJECT_ROW", cardTarget, connect => ({ connectDropTarget: connect.dropTarget() }) ) @DragSource( "PROJECT_ROW", cardSource, (connect, monitor) => ({ connectDragSource: connect.dragSource(), isDragging: monitor.isDragging() }) ) export default class TableRow extends React.Component { static propTypes = { connectDragSource: PropTypes.func.isRequired, connectDropTarget: PropTypes.func.isRequired, index: PropTypes.number.isRequired, isDragging: PropTypes.bool.isRequired, id: PropTypes.any.isRequired, text: PropTypes.string.isRequired, moveRow: PropTypes.func.isRequired } render() { const { text, isDragging, connectDragSource, connectDropTarget } = this.props; const opacity = isDragging ? 0 : 1; let project = this.props.project let publishButton = <GreenButton title='Publish' onClick={ () => { this.props.publishButtonClick(project.id) }} /> if (!project.is_hidden) { publishButton = <OrangeButton title='Hide' onClick={ () => { this.props.hideButtonClick(project.id) }} /> } return connectDragSource(connectDropTarget( <tr key={ project.id }> <td>{ project.id }</td> <td>{ project.title }</td> <td>{ project.slug }</td> <td>{ project.position }</td> <td className='actions left'> <Link className='button blue' to={ `/projects/${project.id}` }>Show</Link> <Link className='button green' to={ `/projects/${project.id}/edit` }>Edit</Link> </td> <td className='actions left'> { publishButton } </td> </tr> )) } }
src/components/Showcase/ShowcaseEndingCard.js
ndlib/beehive
import React from 'react' import PropTypes from 'prop-types' import createReactClass from 'create-react-class' import { Paper } from '@material-ui/core' import SitePathCard from '../Collection/SitePathCard' const ShowcaseEndingCard = createReactClass({ displayName: 'Showcase Ending', propTypes: { siteObject: PropTypes.object.isRequired, }, style: function () { return { display: 'inline-block', verticalAlign: 'middle', position: 'relative', marginLeft: '150px', marginRight: '33vw', height: 'auto', cursor: 'pointer', width: '500px', overflow: 'hidden', marginTop: '12vh', backgroundColor: '#ffffff', } }, render: function () { return ( <Paper style={this.style()}> <SitePathCard siteObject={this.props.siteObject} addNextButton headerTitle='Continue to' fixedSize={false} /> </Paper> ) }, }) export default ShowcaseEndingCard
src/components/post-header.js
Dmidify/mlblog
import React, { Component } from 'react'; import { postsData } from '../sample-data.js'; class PostHeader extends Component { state = { posts: postsData } render() { return ( <header className="intro-header post"> <div className="container"> <div className="row"> <div className="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> <div className="post-heading"> <h1>{this.state.posts[0].title}</h1> <h2 className="subheading">{this.state.posts[0].subtitle}</h2> <span className="meta">Posted by <a href="#">{this.state.posts[0].username}</a> on {this.state.posts[0].datetime}</span> </div> </div> </div> </div> </header> ); } } export default PostHeader;
src/svg-icons/navigation/arrow-upward.js
tan-jerene/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NavigationArrowUpward = (props) => ( <SvgIcon {...props}> <path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"/> </SvgIcon> ); NavigationArrowUpward = pure(NavigationArrowUpward); NavigationArrowUpward.displayName = 'NavigationArrowUpward'; NavigationArrowUpward.muiName = 'SvgIcon'; export default NavigationArrowUpward;
node_modules/bs-recipes/recipes/webpack.react-transform-hmr/app/js/main.js
maxipad37/maxipad37.github.io
import React from 'react'; // It's important to not define HelloWorld component right in this file // because in that case it will do full page reload on change import HelloWorld from './HelloWorld.jsx'; React.render(<HelloWorld />, document.getElementById('react-root'));
scripts/dashboard/components/ProjectForm/ProjectFormServiceList/view.js
vedranjukic/dockerino
import React from 'react' import { Link } from 'react-router' import { Table } from 'react-bootstrap'; function view (props, state) { if (!props.project.services || !props.project.services.length) { return ( <div> No services added. <Link to="/project/addservice">Add service to project</Link> </div> ) } return ( <div> <Table> <thead> <tr> <th>Name</th> <th>Image</th> <th>Actions</th> </tr> </thead> <tbody> { props.project.services.map( service => { return ( <tr key={service.id}> <td>{service.name}</td> <td>{service.image}</td> <td> <a href="#" className="edit">Edit</a> <a href="#" className="remove">Remove</a> </td> </tr> ) }) } </tbody> </Table> <Link to="/project/addservice">Add service to project</Link> </div> ) } export default view
src/svg-icons/communication/swap-calls.js
hwo411/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let CommunicationSwapCalls = (props) => ( <SvgIcon {...props}> <path d="M18 4l-4 4h3v7c0 1.1-.9 2-2 2s-2-.9-2-2V8c0-2.21-1.79-4-4-4S5 5.79 5 8v7H2l4 4 4-4H7V8c0-1.1.9-2 2-2s2 .9 2 2v7c0 2.21 1.79 4 4 4s4-1.79 4-4V8h3l-4-4z"/> </SvgIcon> ); CommunicationSwapCalls = pure(CommunicationSwapCalls); CommunicationSwapCalls.displayName = 'CommunicationSwapCalls'; CommunicationSwapCalls.muiName = 'SvgIcon'; export default CommunicationSwapCalls;
src/components/store_types/store-types-edit.js
Xabadu/VendOS
import React, { Component } from 'react'; import { Link } from 'react-router'; import { connect } from 'react-redux'; import { reduxForm } from 'redux-form'; import { getStoreType, updateStoreType } from '../../actions/store-types'; class StoreTypesEdit extends Component { constructor(props) { super(props); this.state = { success: false }; } componentWillMount() { this.props.getStoreType(this.props.params.id); } onSubmit(props) { this.props.updateStoreType(props, this.props.storeTypeId) .then(() => { this.setState({success: true}); window.scrollTo(0, 0); }); } _successAlert() { if(this.state.success) { return ( <div className="row"> <div className="col-md-12"> <div className="alert alert-success"> El tipo de tienda ha sido editado exitosamente. <Link to='/store_types'>Volver al listado de tipos de tienda.</Link> </div> </div> </div> ); } } render() { const { fields: { name }, handleSubmit } = this.props; return ( <div> <form onSubmit={handleSubmit(this.onSubmit.bind(this))}> <div className="page-breadcrumb"> <ol className="breadcrumb container"> <li><Link to='/'>Inicio</Link></li> <li><a href="#">Tipos de Tienda</a></li> <li className="active">Actualizar Tipo de Tienda</li> </ol> </div> <div className="page-title"> <div className="container"> <h3>Actualizar Tipo de Tienda</h3> </div> </div> <div id="main-wrapper" className="container"> {this._successAlert()} <div className="row"> <div className="col-md-6"> <div className="panel panel-white"> <div className="panel-heading clearfix"> <h4 className="panel-title">Informaci&oacute;n general</h4> </div> <div className="panel-body"> <div className="form-group"> <label for="input-Default" className="control-label">Nombre</label> <input type="text" className={`form-control ${name.touched && name.invalid ? 'b-error' : ''}`} id="input-Default" placeholder="Nombre" {...name} /> <span className="text-danger">{name.touched ? name.error : ''}</span> </div> </div> </div> </div> <div className="col-md-6"> </div> <div className="col-md-6"> </div> <div className="col-md-12"> <div className="panel panel-white"> <div className="panel-body"> <button type="submit" className="btn btn-info left">Actualizar tipo de tienda</button> </div> </div> </div> </div> </div> </form> </div> ); } } function validate(values) { const errors = {}; if(!values.name) { errors.name = 'Ingresa un nombre'; } return errors; } function mapStateToProps(state) { return { initialValues: state.storeTypes.storeTypeDetail, storeTypeId: state.storeTypes.storeTypeId }; } export default reduxForm({ form: 'EditStoreTypeForm', fields: ['name'], validate }, mapStateToProps, { getStoreType, updateStoreType })(StoreTypesEdit);
ui/js/components/ItemContext.js
ericsoderberg/pbc-web
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { loadCategory, unloadCategory } from '../actions'; import PageItem from '../pages/page/PageItem'; import EventItem from '../pages/event/EventItem'; class ItemContext extends Component { componentDidMount() { const { filter } = this.props; if (filter) { this._load(this.props); } } componentWillReceiveProps(nextProps) { const { filter } = nextProps; if (filter && (!this.props.filter || JSON.stringify(filter) !== JSON.stringify(this.props.filter))) { this._load(nextProps); } } componentWillUnmount() { const { dispatch } = this.props; dispatch(unloadCategory('pages')); dispatch(unloadCategory('events')); } _load(props) { const { dispatch, filter } = props; dispatch(loadCategory('pages', { filter: { public: true, ...filter }, select: 'name path', })); dispatch(loadCategory('events', { filter: { public: true, ...filter }, select: 'name path start stop allDay dates', })); } render() { const { align, events, pages } = this.props; const pageItems = (pages || []).map(page => ( <li key={page._id}> <PageItem align={align} item={page} /> </li> )); const eventItems = (events || []).map(event => ( <li key={event._id}> <EventItem align={align} item={event} /> </li> )); return ( <ul className="page-context list"> {pageItems} {eventItems} </ul> ); } } ItemContext.propTypes = { align: PropTypes.oneOf(['start', 'center', 'end']), dispatch: PropTypes.func.isRequired, events: PropTypes.array, filter: PropTypes.object, pages: PropTypes.array, }; ItemContext.defaultProps = { align: 'center', events: undefined, filter: undefined, pages: undefined, }; const select = state => ({ events: (state.events || {}).items, pages: (state.pages || {}).items, }); export default connect(select)(ItemContext);
lib-module-modern-browsers-dev/layout/DefaultLayout.js
turacojs/fody
var _jsxFileName = 'layout/DefaultLayout.jsx', _this = this; import React from 'react'; import { ReactElementType as _ReactElementType, LayoutPropsType as _LayoutPropsType } from '../types'; import { Html, Head, Body } from './index'; import t from 'flow-runtime'; const ReactElementType = t.tdz(function () { return _ReactElementType; }); const LayoutPropsType = t.tdz(function () { return _LayoutPropsType; }); export default (function defaultLayout(_arg) { const _returnType = t.return(t.ref(ReactElementType)); let { helmet, content } = t.ref(LayoutPropsType).assert(_arg); return _returnType.assert(React.createElement( Html, { helmet: helmet, __self: _this, __source: { fileName: _jsxFileName, lineNumber: 5 } }, React.createElement(Head, { helmet: helmet, __self: _this, __source: { fileName: _jsxFileName, lineNumber: 6 } }), React.createElement( Body, { __self: _this, __source: { fileName: _jsxFileName, lineNumber: 7 } }, React.createElement('div', { id: 'app', dangerouslySetInnerHTML: { __html: content }, __self: _this, __source: { fileName: _jsxFileName, lineNumber: 8 } }) ) )); }); //# sourceMappingURL=DefaultLayout.js.map
node_modules/bs-recipes/recipes/webpack.react-transform-hmr/app/js/main.js
joenmarz/joenmarz-yii2-advanced-with-gulp-bootstrap-sass
import React from 'react'; // It's important to not define HelloWorld component right in this file // because in that case it will do full page reload on change import HelloWorld from './HelloWorld.jsx'; React.render(<HelloWorld />, document.getElementById('react-root'));
src/Components/Featured.js
jsmankoo/SPATemplate
import React from 'react'; import {connect} from 'react-redux'; import MediaQuery from 'react-responsive'; import OwlCarousel from './OwlCarousel'; const Featured = ({Properties,Search})=>{ return ( <div className='Featured'> <MediaQuery maxDeviceWidth={767}> <Mobile Properties={Properties} Search={Search} options={{ dots: true, items: 2, singleItem: true, autoPlay: false, navigation: false }} /> </MediaQuery> <MediaQuery minDeviceWidth={768} maxDeviceWidth={1024}> <Tablet Properties={Properties} Search={Search} options={{ dots: true, items: 2, items : 2, itemsTablet : [1024,2], autoPlay: false, navigation: false }} /> </MediaQuery> <MediaQuery minDeviceWidth={1025}> <Desktop Properties={Properties} Search={Search} options={{ dots: true, items: 3, itemsTablet : [1200,3], autoPlay: false, navigation: false }} /> </MediaQuery> </div> ); }; const Mobile = ({Properties,Search,options})=>{ return ( <div className='Mobile'> <div className='Wrapper'> <div className='Headline'> <h2>FEATURED PROPERTIES</h2> </div> <div className='Search'> <a target='_blank' href='//google.com'>SEARCH THE MLS</a> </div> <div className='Properties'> <OwlCarousel className='owl-carousel owl-theme' {...options}> { Properties.map(({Address, Link, Photo, Price}, index)=>( <div className='item' key={index}> <a target='_blank' href={Link.value.url} className='Property'> <div className='Pic' style={{ backgroundImage: `url('${Photo.value.main.url}')`, backgroundSize: 'cover', backgroundPosition: 'center' }}> </div> <div className='Address'>{Address.value}</div> <div className='Price'>{Price.value}</div> </a> </div> )) } </OwlCarousel> </div> </div> </div> ); }; const Tablet = ({Properties,Search,options})=>{ return ( <div className='Tablet'> <div className='Wrapper'> <div className='Headline'> <h2>FEATURED PROPERTIES</h2> <a target='_blank' href={Search}>SEARCH THE MLS</a> </div> <div className='Properties'> <OwlCarousel className='owl-carousel owl-theme' {...options}> { Properties.map(({Address, Link, Photo, Price}, index)=>( <div className='item' key={index}> <a target='_blank' href={Link.value.url} className='Property'> <div className='Pic' style={{ backgroundImage: `url('${Photo.value.main.url}')`, backgroundSize: 'cover', backgroundPosition: 'center' }}> </div> <div className='Address'>{Address.value}</div> <div className='Price'>{Price.value}</div> </a> </div> )) } </OwlCarousel> </div> </div> </div> ); }; const Desktop = ({Properties,Search,options})=>{ return ( <div className='Desktop'> <div className='Wrapper'> <div className='Headline'> <h2>FEATURED PROPERTIES</h2> <a target='_blank' href={Search}>SEARCH THE MLS</a> </div> <div className='Properties'> <OwlCarousel className='owl-carousel owl-theme' {...options}> { Properties.map(({Address, Link, Photo, Price}, index)=>( <div className='item' key={index}> <a target='_blank' href={Link.value.url} className='Property'> <div className='Pic' style={{ backgroundImage: `url('${Photo.value.main.url}')`, backgroundSize: 'cover', backgroundPosition: 'center' }}> </div> <div className='Address'>{Address.value}</div> <div className='Price'>{Price.value}</div> </a> </div> )) } </OwlCarousel> </div> </div> </div> ); }; const mapStateToProps = ({Featured})=>{ return { Properties: Featured.get('Properties').toJS(), Search: Featured.get('Search') }; }; export default connect(mapStateToProps)(Featured);
app/layouts/authenticated.js
meddle0x53/react-webpack-koa-postgres-passport-example
import React, { Component } from 'react'; import { Link, RouteHandler } from 'react-router'; import { Jumbotron, Nav, Row, Col } from 'react-bootstrap'; import { NavItemLink } from 'react-router-bootstrap'; import AuthStore from '../stores/auth'; import SignIn from '../pages/signin'; export default class MainLayout extends Component { static displayName = 'MainLayout'; constructor() { super(); } static willTransitionTo(transition) { if (!AuthStore.isLoggedIn()) { SignIn.attemptedTransition = transition; transition.redirect('sign-in'); } } render() { return ( <div> <div className="container"> <Row> <Col md={2}> <h3>Links</h3> <Nav bsStyle="pills" stacked> <NavItemLink to="index">Index</NavItemLink> <NavItemLink to="null-page">Null</NavItemLink> </Nav> </Col> <Col md={10} className="well"> <RouteHandler /> </Col> </Row> </div> </div> ); } }
src/svg-icons/editor/strikethrough-s.js
ruifortes/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let EditorStrikethroughS = (props) => ( <SvgIcon {...props}> <path d="M7.24 8.75c-.26-.48-.39-1.03-.39-1.67 0-.61.13-1.16.4-1.67.26-.5.63-.93 1.11-1.29.48-.35 1.05-.63 1.7-.83.66-.19 1.39-.29 2.18-.29.81 0 1.54.11 2.21.34.66.22 1.23.54 1.69.94.47.4.83.88 1.08 1.43.25.55.38 1.15.38 1.81h-3.01c0-.31-.05-.59-.15-.85-.09-.27-.24-.49-.44-.68-.2-.19-.45-.33-.75-.44-.3-.1-.66-.16-1.06-.16-.39 0-.74.04-1.03.13-.29.09-.53.21-.72.36-.19.16-.34.34-.44.55-.1.21-.15.43-.15.66 0 .48.25.88.74 1.21.38.25.77.48 1.41.7H7.39c-.05-.08-.11-.17-.15-.25zM21 12v-2H3v2h9.62c.18.07.4.14.55.2.37.17.66.34.87.51.21.17.35.36.43.57.07.2.11.43.11.69 0 .23-.05.45-.14.66-.09.2-.23.38-.42.53-.19.15-.42.26-.71.35-.29.08-.63.13-1.01.13-.43 0-.83-.04-1.18-.13s-.66-.23-.91-.42c-.25-.19-.45-.44-.59-.75-.14-.31-.25-.76-.25-1.21H6.4c0 .55.08 1.13.24 1.58.16.45.37.85.65 1.21.28.35.6.66.98.92.37.26.78.48 1.22.65.44.17.9.3 1.38.39.48.08.96.13 1.44.13.8 0 1.53-.09 2.18-.28s1.21-.45 1.67-.79c.46-.34.82-.77 1.07-1.27s.38-1.07.38-1.71c0-.6-.1-1.14-.31-1.61-.05-.11-.11-.23-.17-.33H21z"/> </SvgIcon> ); EditorStrikethroughS = pure(EditorStrikethroughS); EditorStrikethroughS.displayName = 'EditorStrikethroughS'; EditorStrikethroughS.muiName = 'SvgIcon'; export default EditorStrikethroughS;
src/articles/2018-09-30-Suggestions/index.js
ronaldpereira/WoWAnalyzer
import React from 'react'; import { Link } from 'react-router-dom'; import { Zerotorescue } from 'CONTRIBUTORS'; import RegularArticle from 'interface/news/RegularArticle'; import RandomImageToMakeThisArticleLessBland from './weirdnelfandherfriend.png'; export default ( <RegularArticle title={<>What are <i>YOUR</i> suggestions?</>} publishedAt="2018-09-30" publishedBy={Zerotorescue}> <img src={RandomImageToMakeThisArticleLessBland} alt="" style={{ float: 'right', maxWidth: '50%', marginRight: -22, marginBottom: -15, }} /> We'd love to hear your suggestions. What can we do better? Do you have a grand idea? Is there a spec we should prioritize? Let us know on the new <a href="https://suggestions.wowanalyzer.com/">suggestions board</a>! There you can share your suggestions or give a vote to other people's amazing suggestions. And we'll even put a bounty on the best suggestions using the funds raised with <Link to="/premium">Premium</Link>! </RegularArticle> );
src/components/Header/Header.js
HereIsJohnny/issuetracker
/*! React Starter Kit | MIT License | http://www.reactstarterkit.com/ */ import React, { Component } from 'react'; import styles from './Header.css'; import withStyles from '../../decorators/withStyles'; import Link from '../Link'; import Navigation from '../Navigation'; @withStyles(styles) class Header extends Component { render() { return ( <div className="Header"> <div className="Header-container"> <a className="Header-brand" href="/" onClick={Link.handleClick}> <img className="Header-brandImg" src={require('./logo-small.png')} width="38" height="38" alt="React" /> <span className="Header-brandTxt">Your Company</span> </a> <Navigation className="Header-nav" /> <div className="Header-banner"> <h1 className="Header-bannerTitle">React</h1> <p className="Header-bannerDesc">Complex web apps made easy</p> </div> </div> </div> ); } } export default Header;
src/interface/report/EventParser.js
ronaldpereira/WoWAnalyzer
import React from 'react'; import PropTypes from 'prop-types'; import ExtendableError from 'es6-error'; import { connect } from 'react-redux'; import { getBuild } from 'interface/selectors/url/report'; import sleep from 'common/sleep'; import { captureException } from 'common/errorLogger'; import EventEmitter from 'parser/core/modules/EventEmitter'; import { EventType } from 'parser/core/Events'; const BENCHMARK = false; // Picking a correct batch duration is hard. I tried various durations to get the batch sizes to 1 frame, but that results in a lot of wasted time waiting for the next frame. 30ms (33 fps) as well causes a lot of wasted time. 60ms (16fps) seem to have really low wasted time while not blocking the UI anymore than a user might expect. const MAX_BATCH_DURATION = 66.67; // ms const TIME_AVAILABLE = console.time && console.timeEnd; const bench = id => TIME_AVAILABLE && console.time(id); const benchEnd = id => TIME_AVAILABLE && console.timeEnd(id); export class EventsParseError extends ExtendableError { reason = null; constructor(reason) { super(); this.reason = reason; this.message = `An error occured while parsing events: ${reason.message}`; } } class EventParser extends React.PureComponent { static propTypes = { report: PropTypes.shape({ title: PropTypes.string.isRequired, code: PropTypes.string.isRequired, }).isRequired, fight: PropTypes.shape({ start_time: PropTypes.number.isRequired, end_time: PropTypes.number.isRequired, offset_time: PropTypes.number.isRequired, boss: PropTypes.number.isRequired, phase: PropTypes.string, }).isRequired, player: PropTypes.shape({ name: PropTypes.string.isRequired, id: PropTypes.number.isRequired, guid: PropTypes.number.isRequired, type: PropTypes.string.isRequired, }).isRequired, combatants: PropTypes.arrayOf(PropTypes.shape({ sourceID: PropTypes.number.isRequired, })), applyTimeFilter: PropTypes.func.isRequired, applyPhaseFilter: PropTypes.func.isRequired, parserClass: PropTypes.func.isRequired, build: PropTypes.object, builds: PropTypes.object, characterProfile: PropTypes.object, events: PropTypes.array.isRequired, children: PropTypes.func.isRequired, }; constructor(props) { super(props); this.state = { isLoading: true, progress: 0, parser: null, }; } componentDidMount() { // noinspection JSIgnoredPromiseFromCall this.parse(); } componentDidUpdate(prevProps, prevState, prevContext) { const changed = this.props.report !== prevProps.report || this.props.fight !== prevProps.fight || this.props.player !== prevProps.player || this.props.combatants !== prevProps.combatants || this.props.parserClass !== prevProps.parserClass || this.props.characterProfile !== prevProps.characterProfile || this.props.events !== prevProps.events || this.props.build !== prevProps.build || this.props.builds !== prevProps.builds; if (changed) { this.setState({ isLoading: true, progress: 0, parser: null, }); // noinspection JSIgnoredPromiseFromCall this.parse(); } } makeParser() { const { report, fight, combatants, player, characterProfile, build, builds, parserClass } = this.props; const buildKey = builds && Object.keys(builds).find(b => builds[b].url === build); builds && Object.keys(builds).forEach(key => { builds[key].active = key === buildKey; }); //set current build to undefined if default build or non-existing build selected const parser = new parserClass(report, player, fight, combatants, characterProfile, buildKey && build, builds); parser.applyTimeFilter = this.props.applyTimeFilter; parser.applyPhaseFilter = this.props.applyPhaseFilter; this.setState({ parser, }); return parser; } makeEvents(parser) { let { events } = this.props; // The events we fetched will be all events related to the selected player. This includes the `combatantinfo` for the selected player. However we have already parsed this event when we loaded the combatants in the `initializeAnalyzers` of the CombatLogParser. Loading the selected player again could lead to bugs since it would reinitialize and overwrite the existing entity (the selected player) in the Combatants module. events = events.filter(event => event.type !== EventType.CombatantInfo); //sort now normalized events to avoid new fabricated events like "prepull" casts etc being in incorrect order with casts "kept" from before the filter events = parser.normalize(events).sort((a,b) => a.timestamp - b.timestamp); return events; } async parse() { try { bench('total parse'); bench('initialize'); const parser = this.makeParser(); const events = this.makeEvents(parser); const numEvents = events.length; const eventEmitter = parser.getModule(EventEmitter); benchEnd('initialize'); bench('events'); let eventIndex = 0; while (eventIndex < numEvents) { const start = Date.now(); while (eventIndex < numEvents) { eventEmitter.triggerEvent(events[eventIndex]); eventIndex += 1; if (!BENCHMARK && (Date.now() - start) > MAX_BATCH_DURATION) { break; } } if (!BENCHMARK) { this.setState({ progress: Math.min(1, eventIndex / numEvents), }); // Delay the next iteration until next frame so the browser doesn't appear to be frozen await sleep(0); // eslint-disable-line no-await-in-loop } } parser.finish(); benchEnd('events'); benchEnd('total parse'); this.setState({ isLoading: false, progress: 1, }); } catch (err) { captureException(err); throw new EventsParseError(err); } } render() { return this.props.children(this.state.isLoading, this.state.progress, this.state.parser); } } const mapStateToProps = (state, ownProps) => ({ // Because build comes from the URL we can't use local state build: getBuild(state), }); export default connect(mapStateToProps)(EventParser);
examples/async/containers/Root.js
leeluolee/redux
import React, { Component } from 'react'; import { Provider } from 'react-redux'; import configureStore from '../store/configureStore'; import AsyncApp from './AsyncApp'; const store = configureStore(); export default class Root extends Component { render() { return ( <Provider store={store}> {() => <AsyncApp />} </Provider> ); } }
src/components/iconButton.js
Andrey11/golfmanager
'use strict'; import React, { Component } from 'react'; import { AppRegistry, StyleSheet, TouchableHighlight, Image } from 'react-native'; import styles from '../styles/basestyles.js'; export default class iconButton extends Component { render () { return ( <TouchableHighlight style={this.props.touchableHighlightStyle} underlayColor={this.props.underlayColor} onPress={() => { this.props.onButtonPressed(this.props.pressedParam) }}> <Image style={this.props.imageStyle} source={this.props.iconSource} /> </TouchableHighlight> ); } } AppRegistry.registerComponent('iconButton', () => iconButton);
packages/react-scripts/fixtures/kitchensink/src/features/webpack/ImageInclusion.js
shrynx/react-super-scripts
/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ import React from 'react'; import tiniestCat from './assets/tiniest-cat.jpg'; export default () => <img id="feature-image-inclusion" src={tiniestCat} alt="tiniest cat" />;
example/src/other/SuperButton.js
b6pzeusbc54tvhw5jgpyw8pwz2x6gs/rix-loader
import React from 'react'; import StyleSheet from 'react-inline'; require('requirish')._(module); var appUtil = require('src/appUtil'); //import appUtil from 'src/appUtil'; console.log('SuperButton'); const { oneOf, bool } = React.PropTypes; class SuperButton extends React.Component { render() { return <div className={styles.default}></div>; } } SuperButton.propTypes = { size: oneOf(['large', 'small']), block: bool, busy: bool }; const rixContext = { size: 47 }; const { size } = rixContext; export default SuperButton; export { rixContext }; const styles = StyleSheet.create({ default: { padding: '6px 12px', //fontSize: size, lineHeight: 1.5, cursor: 'pointer', border: '1px solid #2e6da4', borderRadius: 4, color: '#fff', backgroundColor: '#337ab7' } });
public/components/tehtPage/tabsComponents/pohjapiirrokset/Pelastussuunnitelma.js
City-of-Vantaa-SmartLab/kupela
import React from 'react'; import SubitemWrapper from './subcontent/SubitemWrapper'; import { connect } from 'react-redux'; const Pelastussuunnitelma = (props) => <SubitemWrapper {...props} />; const mapStateToProps = ({ pelastussuunnitelmatab }) => ({ pelastussuunnitelmatab }); export default connect(mapStateToProps, null)(Pelastussuunnitelma);
docs/src/PageFooter.js
AlexKVal/react-bootstrap
import React from 'react'; import packageJSON from '../../package.json'; let version = packageJSON.version; if (/docs/.test(version)) { version = version.split('-')[0]; } const PageHeader = React.createClass({ render() { return ( <footer className='bs-docs-footer' role='contentinfo'> <div className='container'> <div className='bs-docs-social'> <ul className='bs-docs-social-buttons'> <li> <iframe className='github-btn' src='https://ghbtns.com/github-btn.html?user=react-bootstrap&repo=react-bootstrap&type=watch&count=true' width={95} height={20} title='Star on GitHub' /> </li> <li> <iframe className='github-btn' src='https://ghbtns.com/github-btn.html?user=react-bootstrap&repo=react-bootstrap&type=fork&count=true' width={92} height={20} title='Fork on GitHub' /> </li> <li> <iframe src="https://platform.twitter.com/widgets/follow_button.html?screen_name=react_bootstrap&show_screen_name=true" width={230} height={20} allowTransparency="true" frameBorder='0' scrolling='no'> </iframe> </li> </ul> </div> <p>Code licensed under <a href='https://github.com/react-bootstrap/react-bootstrap/blob/master/LICENSE' target='_blank'>MIT</a>.</p> <ul className='bs-docs-footer-links muted'> <li>Currently v{version}</li> <li>·</li> <li><a href='https://github.com/react-bootstrap/react-bootstrap/'>GitHub</a></li> <li>·</li> <li><a href='https://github.com/react-bootstrap/react-bootstrap/issues?state=open'>Issues</a></li> <li>·</li> <li><a href='https://github.com/react-bootstrap/react-bootstrap/releases'>Releases</a></li> </ul> </div> </footer> ); } }); export default PageHeader;
example/common/components/Counter.js
modosc/react-responsive-redux
import React from 'react' import PropTypes from 'prop-types' const Counter = ({ increment, incrementIfOdd, incrementAsync, decrement, counter, }) => ( <p> Clicked: {counter} times {' '} <button onClick={increment}>+</button> {' '} <button onClick={decrement}>-</button> {' '} <button onClick={incrementIfOdd}>Increment if odd</button> {' '} <button onClick={() => incrementAsync()}>Increment async</button> </p> ) Counter.propTypes = { counter: PropTypes.number.isRequired, decrement: PropTypes.func.isRequired, increment: PropTypes.func.isRequired, incrementAsync: PropTypes.func.isRequired, incrementIfOdd: PropTypes.func.isRequired, } export default Counter
src/components/Charts/MiniBar/index.js
wu-sheng/sky-walking-ui
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import React from 'react'; import { Chart, Tooltip, Geom } from 'bizcharts'; import autoHeight from '../autoHeight'; import styles from '../index.less'; @autoHeight() export default class MiniBar extends React.Component { render() { const { height, forceFit = true, color = '#1890FF', data = [] } = this.props; const scale = { x: { type: 'cat', }, y: { min: 0, }, }; const padding = [36, 5, 30, 5]; const tooltip = [ 'x*y', (x, y) => ({ name: x, value: y, }), ]; // for tooltip not to be hide const chartHeight = height + 54; return ( <div className={styles.miniChart} style={{ height }}> <div className={styles.chartContent}> <Chart scale={scale} height={chartHeight} forceFit={forceFit} data={data} padding={padding} > <Tooltip showTitle={false} crosshairs={false} /> <Geom type="interval" position="x*y" color={color} tooltip={tooltip} /> </Chart> </div> </div> ); } }
src/components/Dialog/Container.js
STMU1320/dedao-demo
import React from 'react' import { VelocityComponent } from 'velocity-react' import classnames from 'classnames' import styles from './style.less' const dialogMask = 'dialog_mask' class Container extends React.PureComponent { static defaultProps = { maskClosable: true, placement: 'center', className: '', setOverflow: true, mask: 'rgba(0, 0, 0, .2)', visible: false, id: '', duration: 500, }; dialogWrap = null; timer = null; constructor (props) { super(props) this.state = { visible: props.visible, contentVisible: props.visible } } componentWillReceiveProps (nextProps) { const { visible, setOverflow, duration } = nextProps if (this.props.visible !== visible) { if (setOverflow) { document.body.style.overflow = visible ? 'hidden' : 'auto' } if (this.timer) clearTimeout(this.timer) if (visible) { this.setState({ visible: true }) } else { this.timer = setTimeout(() => { this.setState({ visible: false }) }, duration) } this.setState({ contentVisible: visible }) } } componentWillUnmount () { const { setOverflow } = this.props if (setOverflow) { document.body.style.overflow = 'auto' } if (this.timer) clearTimeout(this.timer) this.timer = null } handleWrapClick = e => { const { maskClosable, onClose, duration } = this.props if (maskClosable && e.target.dataset.tag === dialogMask) { this.setState({ contentVisible: false }) if (this.timer) clearTimeout(this.timer) this.timer = setTimeout(() => { onClose && onClose() this.setState({ visible: false }) }, duration) } }; render () { const { children, placement, mask, style, className, id, duration, } = this.props const { visible, contentVisible } = this.state let animation = { opacity: contentVisible ? 1 : 0 } switch (placement) { case 'center': animation = { opacity: contentVisible ? 1 : 0, translateX: '-50%', translateY: contentVisible ? '-50%' : '50%', } break case 'left': animation = { translateY: '-50%', translateX: contentVisible ? '0%' : '-100%', } break case 'right': animation = { translateY: '-50%', translateX: contentVisible ? '0%' : '100%', } break case 'top': animation = { translateX: '-50%', translateY: contentVisible ? '0%' : '-100%', } break case 'bottom': animation = { translateX: '-50%', translateY: contentVisible ? '0%' : '100%', } break case 'leftTop': case 'topLeft': case 'leftBottom': case 'bottomLeft': animation = { translateX: contentVisible ? '0%' : '-100%' } break case 'rightTop': case 'topRight': case 'rightBottom': case 'bottomRight': animation = { translateX: contentVisible ? '0%' : '100%' } break default: break } return ( <div id={id} onClick={this.handleWrapClick} className={classnames(styles.dialog, className)} style={{ ...style, display: visible ? null : 'none' }} > <div className={styles.mask} style={{ background: mask }} data-tag={dialogMask} /> <VelocityComponent component="" animation={duration > 0 && animation} duration={duration} > <div className={classnames(styles.content, styles[placement])}> {children} </div> </VelocityComponent> </div> ) } } export default Container
examples/server/store.js
rackt/redux-simple-router
import React from 'react' import { createStore, combineReducers, compose, applyMiddleware } from 'redux' import { createDevTools } from 'redux-devtools' import LogMonitor from 'redux-devtools-log-monitor' import DockMonitor from 'redux-devtools-dock-monitor' import { routerReducer, routerMiddleware } from 'react-router-redux' export const DevTools = createDevTools( <DockMonitor toggleVisibilityKey="ctrl-h" changePositionKey="ctrl-q"> <LogMonitor theme="tomorrow" preserveScrollTop={false} /> </DockMonitor> ) export function configureStore(history, initialState) { const reducer = combineReducers({ routing: routerReducer }) let devTools = [] if (typeof document !== 'undefined') { devTools = [ DevTools.instrument() ] } const store = createStore( reducer, initialState, compose( applyMiddleware( routerMiddleware(history) ), ...devTools ) ) return store }
src/components/icons/DragHandle.js
niekert/soundify
import React from 'react'; import { string } from 'prop-types'; const DragHandle = ({ fill, ...props }) => <svg fill={fill} height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" {...props} > <defs> <path d="M0 0h24v24H0V0z" id="a" /> </defs> <clipPath id="b"> <use overflow="visible" /> </clipPath> <path d="M20 9H4v2h16V9zM4 15h16v-2H4v2z" /> </svg>; DragHandle.propTypes = { fill: string, }; DragHandle.defaultProps = { fill: 'currentColor', }; export default DragHandle;
src/02-Properties.js
sericaia/react-msf-demos
import React from 'react'; class MyPropertiesExample extends React.Component { render() { return ( <div> <h1>Properties</h1> My favourite dish is {this.props.dish}. </div> ); } } MyPropertiesExample.defaultProps = { dish: 'shrimp with pasta' }; MyPropertiesExample.propTypes = { dish: React.PropTypes.string.isRequired }; class MyVodooComponent extends React.Component { render() { return ( <MyPropertiesExample dish="chicken"/> ); } } export default MyPropertiesExample;
frontend/src/Components/Table/TableRowButton.js
geogolem/Radarr
import React from 'react'; import Link from 'Components/Link/Link'; import TableRow from './TableRow'; import styles from './TableRowButton.css'; function TableRowButton(props) { return ( <Link className={styles.row} component={TableRow} {...props} /> ); } export default TableRowButton;
src/svg-icons/communication/contact-mail.js
manchesergit/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let CommunicationContactMail = (props) => ( <SvgIcon {...props}> <path d="M21 8V7l-3 2-3-2v1l3 2 3-2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2zM8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1zm8-6h-8V6h8v6z"/> </SvgIcon> ); CommunicationContactMail = pure(CommunicationContactMail); CommunicationContactMail.displayName = 'CommunicationContactMail'; CommunicationContactMail.muiName = 'SvgIcon'; export default CommunicationContactMail;
src/pages/repos.js
geekydatamonkey/hjs-gittagger
'use strict'; import React from 'react'; export default React.createClass({ displayName: 'ReposePage', render() { return ( <main class="container"> <h1>Repos Page</h1> <a href="/"> &larr; back to Public</a> </main> ) } });
node_modules/react-native-svg/elements/Rect.js
MisterZhouZhou/ReactNativeLearing
import React from 'react'; import './Path'; // must import Path first, don`t know why. without this will throw an `Super expression must either be null or a function, not undefined` import createReactNativeComponentClass from 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass.js'; import {pathProps, numberProp} from '../lib/props'; import {RectAttributes} from '../lib/attributes'; import extractProps from '../lib/extract/extractProps'; import Shape from './Shape'; export default class extends Shape { static displayName = 'Rect'; static propTypes = { ...pathProps, x: numberProp.isRequired, y: numberProp.isRequired, width: numberProp.isRequired, height: numberProp.isRequired, rx: numberProp, ry: numberProp }; static defaultProps = { x: 0, y: 0, width: 0, height: 0, rx: 0, ry: 0 }; setNativeProps = (...args) => { this.root.setNativeProps(...args); }; render() { let props = this.props; return <RNSVGRect ref={ele => {this.root = ele;}} {...extractProps({ ...props, x: null, y: null }, this)} x={props.x.toString()} y={props.y.toString()} width={props.width.toString()} height={props.height.toString()} rx={props.rx.toString()} ry={props.ry.toString()} />; } } const RNSVGRect = createReactNativeComponentClass({ validAttributes: RectAttributes, uiViewClassName: 'RNSVGRect' });
components/AddIngredient.ios.js
kkwokwai22/snacktime
import React, { Component } from 'react'; import { Text, View, Image, TextInput, ListView, TouchableHighlight, TouchableOpacity, Switch } from 'react-native'; import helpers from '../helpers/helpers.js'; import styles from '../styles.ios.js'; import FoodpairResults from './FoodpairResults.ios.js'; import AddIngredientCamera from './AddIngredientCamera.ios.js'; import { connect } from 'react-redux'; import { showSearch, rendering } from '../actions/addIngredientActions.ios.js'; import { bindActionCreators } from 'redux'; import * as addIngredient from '../actions/addIngredientActions.ios.js'; class AddIngredient extends Component { constructor(props) { super(props); const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); const ingredients = props.currentIngredients || props.ingredients; this.state = { currentIngredients: ds.cloneWithRows(ingredients), ingredientToAdd: '' } } addIngredient() { const ingredients = []; for (let ingredient of this.state.currentIngredients._dataBlob.s1) { ingredients.push(ingredient); } ingredients.push(this.state.ingredientToAdd) const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); this.setState({ currentIngredients: ds.cloneWithRows(ingredients), ingredientToAdd: '' }) this.forceUpdate(); } navigateAddIngredientCamera() { this.props.navigator.push({ component: AddIngredientCamera, passProps: { currentIngredients: this.state.currentIngredients._dataBlob.s1, store: this.props.store } }) } removeIngredient(ingredient) { const ingredients = this.state.currentIngredients._dataBlob.s1; const removeIndex = ingredients.indexOf(ingredient); ingredients.splice(removeIndex, 1); const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); this.setState({ currentIngredients: ds.cloneWithRows(ingredients) }) this.forceUpdate(); } searchMultipleFoodpairs() { this.props.actions.rendering(); helpers.foodpairing.getFoodID(this.state.currentIngredients._dataBlob.s1) .then( resp => { helpers.foodpairing.getMultipleFoodpairings(resp.data) .then( response => { this.props.actions.rendering(); const ingredients = this.state.currentIngredients._dataBlob.s1; this.props.navigator.push({ component: FoodpairResults, passProps: { foodpairs: response.data, ingredients: ingredients } }) }) .catch( error => { console.log('Error ', error); }) }) .catch( err => { console.log('Error: ', err); }) } goBack() { this.props.navigator.pop(); } render() { const { state, actions } = this.props if (state.rendering) { return ( <Image source= {{uri: 'https://media.blueapron.com/assets/loader/pot-loader-6047abec2ec57c18d848f623c036f7fe80236dce689bb48279036c4f914d0c9e.gif'}} style = {styles.loadingGif} /> ) } if (state.showSearch) { return ( <View style={styles.addIngredientsContainer}> <View style={styles.resultsTitle}> <TouchableHighlight style={styles.backButton} onPress={this.goBack.bind(this)}> <Image style={styles.backButtonImage} source={{uri: 'https://cdn0.iconfinder.com/data/icons/vector-basic-tab-bar-icons/48/back_button-128.png'}} /> </TouchableHighlight> <Text style={styles.resultsTitleText}>Current Ingredients</Text> </View> <ListView style={styles.addIngredientListView} dataSource={this.state.currentIngredients} renderRow={(ingredient, i) => ( <View style={styles.addIngredientListItem}> <Text style={styles.addIngredientListItemText}>{ingredient}</Text> <TouchableOpacity style={styles.removeListItem} onPress={this.removeIngredient.bind(this, ingredient)} > <Image style={styles.removeIcon} source={require('../public/removeicon.png')} /> </TouchableOpacity> </View> )} /> <TouchableOpacity style={styles.searchIconContainer} onPress={this.searchMultipleFoodpairs.bind(this)} > <Image style={styles.searchIcon} source={require('../public/searchicon.png')} /> </TouchableOpacity> <View style={styles.addMoreIngredientsContainer}> <View style={styles.searchBarPictureFrame}> <TextInput onSubmitEditing={this.addIngredient.bind(this)} style={styles.addIngredientInput} onChangeText={(ingredientToAdd) => this.setState({ingredientToAdd})} value={this.state.ingredientToAdd} placeholder={'Add ingredient'} /> </View> <Switch onValueChange={actions.showSearch} style={styles.addIngredientSwitch} value={state.showSearch} /> </View> </View> ) } else { return ( <View style={styles.addIngredientsContainer}> <View style={styles.resultsTitle}> <TouchableHighlight style={styles.backButton} onPress={this.goBack.bind(this)}> <Image style={styles.backButtonImage} source={{uri: 'https://cdn0.iconfinder.com/data/icons/vector-basic-tab-bar-icons/48/back_button-128.png'}} /> </TouchableHighlight> <Text style={styles.resultsTitleText}>Current Ingredients</Text> </View> <ListView style={styles.addIngredientListView} dataSource={this.state.currentIngredients} renderRow={(ingredient, i) => ( <View style={styles.addIngredientListItem}> <Text style={styles.addIngredientListItemText}>{ingredient}</Text> <TouchableOpacity style={styles.removeListItem} onPress={this.removeIngredient.bind(this, ingredient)} > <Image style={styles.removeIcon} source={require('../public/removeicon.png')} /> </TouchableOpacity> </View> )} /> <View style={styles.addMoreIngredientsContainer}> <TouchableOpacity style={styles.searchIconContainer} onPress={this.searchMultipleFoodpairs.bind(this)} > <Image style={styles.searchIcon} source={require('../public/searchicon.png')} /> </TouchableOpacity> <TouchableOpacity style={styles.buttonView} onPress={this.navigateAddIngredientCamera.bind(this)}> <Image style={[styles.takePicture]} source={{uri: 'https://s3.amazonaws.com/features.ifttt.com/newsletter_images/2015_February/camera512x512+(1).png'}}/> </TouchableOpacity> <Switch onValueChange={actions.showSearch} style={styles.addIngredientSwitch} value={state.showSearch} /> </View> </View> ) } } } export default connect(state => ({ state: state.addIngredient }), (dispatch) => ({ actions: bindActionCreators(addIngredient.default, dispatch) }) )(AddIngredient);
admin/client/App/screens/List/components/ItemsTable/ItemsTableRow.js
benkroeger/keystone
import React from 'react'; import classnames from 'classnames'; import ListControl from '../ListControl'; import { Columns } from 'FieldTypes'; import { DropTarget, DragSource } from 'react-dnd'; import { setDragBase, resetItems, reorderItems, setRowAlert, moveItem, } from '../../actions'; const ItemsRow = React.createClass({ propTypes: { columns: React.PropTypes.array, id: React.PropTypes.any, index: React.PropTypes.number, items: React.PropTypes.object, list: React.PropTypes.object, // Injected by React DnD: isDragging: React.PropTypes.bool, // eslint-disable-line react/sort-prop-types connectDragSource: React.PropTypes.func, // eslint-disable-line react/sort-prop-types connectDropTarget: React.PropTypes.func, // eslint-disable-line react/sort-prop-types connectDragPreview: React.PropTypes.func, // eslint-disable-line react/sort-prop-types }, renderRow (item) { const itemId = item.id; const rowClassname = classnames({ 'ItemList__row--dragging': this.props.isDragging, 'ItemList__row--selected': this.props.checkedItems[itemId], 'ItemList__row--manage': this.props.manageMode, 'ItemList__row--success': this.props.rowAlert.success === itemId, 'ItemList__row--failure': this.props.rowAlert.fail === itemId, }); // item fields var cells = this.props.columns.map((col, i) => { var ColumnType = Columns[col.type] || Columns.__unrecognised__; var linkTo = !i ? `${Keystone.adminPath}/${this.props.list.path}/${itemId}` : undefined; return <ColumnType key={col.path} list={this.props.list} col={col} data={item} linkTo={linkTo} />; }); // add sortable icon when applicable if (this.props.list.sortable) { cells.unshift(<ListControl key="_sort" type="sortable" dragSource={this.props.connectDragSource} />); } // add delete/check icon when applicable if (!this.props.list.nodelete) { cells.unshift(this.props.manageMode ? ( <ListControl key="_check" type="check" active={this.props.checkedItems[itemId]} /> ) : ( <ListControl key="_delete" onClick={(e) => this.props.deleteTableItem(item, e)} type="delete" /> )); } var addRow = (<tr key={'i' + item.id} onClick={this.props.manageMode ? (e) => this.props.checkTableItem(item, e) : null} className={rowClassname}>{cells}</tr>); if (this.props.list.sortable) { return ( // we could add a preview container/image // this.props.connectDragPreview(this.props.connectDropTarget(addRow)) this.props.connectDropTarget(addRow) ); } else { return (addRow); } }, render () { return this.renderRow(this.props.item); }, }); module.exports = exports = ItemsRow; // Expose Sortable /** * Implements drag source. */ const dragItem = { beginDrag (props) { const send = { ...props }; props.dispatch(setDragBase(props.item, props.index)); return { ...send }; }, endDrag (props, monitor, component) { if (!monitor.didDrop()) { props.dispatch(resetItems(props.id)); return; } const page = props.currentPage; const pageSize = props.pageSize; // If we were dropped onto a page change target, then droppedOn.prevSortOrder etc will be // set by that target, and we should use those values. If we were just dropped onto a new row // then we need to calculate these values ourselves. const droppedOn = monitor.getDropResult(); const prevSortOrder = droppedOn.prevSortOrder || props.sortOrder; // To explain the following line, suppose we are on page 3 and there are 10 items per page. // Previous to this page, there are (3 - 1)*10 = 20 items before us. If we have index 6 // on this page, then we're the 7th item to display (index starts from 0), and so we // want to update the display order to 20 + 7 = 27. const newSortOrder = droppedOn.newSortOrder || (page - 1) * pageSize + droppedOn.index + 1; // If we were dropped on a page change target, then droppedOn.gotToPage will be set, and we should // pass this to reorderItems, which will then change the page for the user. props.dispatch(reorderItems(props.item, prevSortOrder, newSortOrder, Number(droppedOn.goToPage))); }, }; /** * Implements drag target. */ const dropItem = { drop (props, monitor, component) { return { ...props }; }, hover (props, monitor, component) { // reset row alerts if (props.rowAlert.success || props.rowAlert.fail) { props.dispatch(setRowAlert({ reset: true, })); } const dragged = monitor.getItem().index; const over = props.index; // self if (dragged === over) { return; } props.dispatch(moveItem(dragged, over, props)); monitor.getItem().index = over; }, }; /** * Specifies the props to inject into your component. */ function dragProps (connect, monitor) { return { connectDragSource: connect.dragSource(), isDragging: monitor.isDragging(), connectDragPreview: connect.dragPreview(), }; } function dropProps (connect) { return { connectDropTarget: connect.dropTarget(), }; }; exports.Sortable = DragSource('item', dragItem, dragProps)(DropTarget('item', dropItem, dropProps)(ItemsRow));
Example/components/Launch.js
gectorat/react-native-router-flux
import React from 'react'; import {View, Text, StyleSheet} from "react-native"; import Button from "react-native-button"; import {Actions} from "react-native-router-flux"; const styles = StyleSheet.create({ container: { flex: 1, justifyContent: "center", alignItems: "center", backgroundColor: "transparent", borderWidth: 2, borderColor: 'red', } }); class Launch extends React.Component { render(){ return ( <View {...this.props} style={styles.container}> <Text>Launch page</Text> <Button onPress={()=>Actions.login({data:"Custom data", title:"Custom title" })}>Go to Login page</Button> <Button onPress={Actions.register}>Go to Register page</Button> <Button onPress={Actions.register2}>Go to Register page without animation</Button> <Button onPress={()=>Actions.error("Error message")}>Popup error</Button> <Button onPress={Actions.tabbar}>Go to TabBar page</Button> <Button onPress={Actions.switcher}>Go to switcher page</Button> <Button onPress={Actions.pop}>back</Button> </View> ); } } module.exports = Launch;
docs/src/examples/modules/Accordion/index.js
Semantic-Org/Semantic-UI-React
import React from 'react' import Advanced from './Advanced' import Types from './Types' import Variations from './Variations' import Usage from './Usage' const AccordionExamples = () => ( <div> <Types /> <Variations /> <Usage /> <Advanced /> </div> ) export default AccordionExamples
app/main.js
henrikra/gym-diary
import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { createStore, applyMiddleware } from 'redux'; import promise from 'redux-promise'; import { Router } from 'react-router'; import createHistory from 'history/lib/createHashHistory'; import reducers from './reducers'; import routes from './routes'; const history = createHistory({ queryKey: false }); const createStoreWithMiddleware = applyMiddleware(promise)(createStore); ReactDOM.render( <Provider store={createStoreWithMiddleware(reducers)}> <Router history={history} routes={routes} /> </Provider> , document.getElementById('root') );
ui/src/main/js/components/UpdateConfig.js
thinker0/aurora
import React from 'react'; import PanelGroup, { Container, StandardPanelTitle } from 'components/Layout'; import TaskConfig from 'components/TaskConfig'; import UpdateDiff from 'components/UpdateDiff'; import { isNully } from 'utils/Common'; export default function UpdateConfig({ update }) { if (isNully(update.update.instructions.desiredState)) { return null; } else if (update.update.instructions.initialState.length > 0) { return <UpdateDiff update={update} />; } return (<Container> <PanelGroup noPadding title={<StandardPanelTitle title='Update Config' />}> <TaskConfig config={update.update.instructions.desiredState.task} /> </PanelGroup> </Container>); }
mlflow/server/js/src/model-registry/components/ModelVersionPage.js
mlflow/mlflow
import React from 'react'; import { connect } from 'react-redux'; import { getModelVersionApi, updateModelVersionApi, deleteModelVersionApi, transitionModelVersionStageApi, getModelVersionArtifactApi, parseMlModelFile, } from '../actions'; import { getRunApi } from '../../experiment-tracking/actions'; import PropTypes from 'prop-types'; import { getModelVersion, getModelVersionSchemas } from '../reducers'; import { ModelVersionView } from './ModelVersionView'; import { ActivityTypes, MODEL_VERSION_STATUS_POLL_INTERVAL as POLL_INTERVAL } from '../constants'; import Utils from '../../common/utils/Utils'; import { getRunInfo, getRunTags } from '../../experiment-tracking/reducers/Reducers'; import RequestStateWrapper, { triggerError } from '../../common/components/RequestStateWrapper'; import { ErrorView } from '../../common/components/ErrorView'; import { Spinner } from '../../common/components/Spinner'; import { getModelPageRoute, modelListPageRoute } from '../routes'; import { getProtoField } from '../utils'; import { getUUID } from '../../common/utils/ActionUtils'; import _ from 'lodash'; import { PageContainer } from '../../common/components/PageContainer'; export class ModelVersionPageImpl extends React.Component { static propTypes = { // own props history: PropTypes.object.isRequired, match: PropTypes.object.isRequired, // connected props modelName: PropTypes.string.isRequired, version: PropTypes.string.isRequired, modelVersion: PropTypes.object, runInfo: PropTypes.object, runDisplayName: PropTypes.string, getModelVersionApi: PropTypes.func.isRequired, updateModelVersionApi: PropTypes.func.isRequired, transitionModelVersionStageApi: PropTypes.func.isRequired, deleteModelVersionApi: PropTypes.func.isRequired, getRunApi: PropTypes.func.isRequired, apis: PropTypes.object.isRequired, getModelVersionArtifactApi: PropTypes.func.isRequired, parseMlModelFile: PropTypes.func.isRequired, schema: PropTypes.object, }; initGetModelVersionDetailsRequestId = getUUID(); getRunRequestId = getUUID(); updateModelVersionRequestId = getUUID(); transitionModelVersionStageRequestId = getUUID(); getModelVersionDetailsRequestId = getUUID(); initGetMlModelFileRequestId = getUUID(); state = { criticalInitialRequestIds: [ this.initGetModelVersionDetailsRequestId, this.initGetMlModelFileRequestId, ], }; pollingRelatedRequestIds = [this.getModelVersionDetailsRequestId, this.getRunRequestId]; hasPendingPollingRequest = () => this.pollingRelatedRequestIds.every((requestId) => { const request = this.props.apis[requestId]; return Boolean(request && request.active); }); loadData = (isInitialLoading) => { const promises = [this.getModelVersionDetailAndRunInfo(isInitialLoading)]; return Promise.all([promises]); }; pollData = () => { const { modelName, version, history } = this.props; if (!this.hasPendingPollingRequest() && Utils.isBrowserTabVisible()) { return this.loadData().catch((e) => { if (e.getErrorCode() === 'RESOURCE_DOES_NOT_EXIST') { Utils.logErrorAndNotifyUser(e); this.props.deleteModelVersionApi(modelName, version, undefined, true); history.push(getModelPageRoute(modelName)); } else { console.error(e); } }); } return Promise.resolve(); }; // We need to do this because currently the ModelVersionDetailed we got does not contain // experimentId. We need experimentId to construct a link to the source run. This workaround can // be removed after the availability of experimentId. getModelVersionDetailAndRunInfo(isInitialLoading) { const { modelName, version } = this.props; return this.props .getModelVersionApi( modelName, version, isInitialLoading === true ? this.initGetModelVersionDetailsRequestId : this.getModelVersionDetailsRequestId, ) .then(({ value }) => { if (value && !value[getProtoField('model_version')].run_link) { this.props.getRunApi(value[getProtoField('model_version')].run_id, this.getRunRequestId); } }); } // We need this for getting mlModel artifact file, // this will be replaced with a single backend call in the future when supported getModelVersionMlModelFile() { const { modelName, version } = this.props; this.props .getModelVersionArtifactApi(modelName, version) .then((content) => this.props.parseMlModelFile( modelName, version, content.value, this.initGetMlModelFileRequestId, ), ) .catch(() => { // Failure of this call chain should not block the page. Here we remove // `initGetMlModelFileRequestId` from `criticalInitialRequestIds` // to unblock RequestStateWrapper from rendering its content this.setState((prevState) => ({ criticalInitialRequestIds: _.without( prevState.criticalInitialRequestIds, this.initGetMlModelFileRequestId, ), })); }); } handleStageTransitionDropdownSelect = (activity, archiveExistingVersions) => { const { modelName, version } = this.props; const toStage = activity.to_stage; if (activity.type === ActivityTypes.APPLIED_TRANSITION) { this.props .transitionModelVersionStageApi( modelName, version.toString(), toStage, archiveExistingVersions, this.transitionModelVersionStageRequestId, ) .then(this.loadData) .catch(Utils.logErrorAndNotifyUser); } }; handleEditDescription = (description) => { const { modelName, version } = this.props; return this.props .updateModelVersionApi(modelName, version, description, this.updateModelVersionRequestId) .then(this.loadData) .catch(console.error); }; componentDidMount() { this.loadData(true).catch(console.error); this.pollIntervalId = setInterval(this.pollData, POLL_INTERVAL); this.getModelVersionMlModelFile(); } componentWillUnmount() { clearTimeout(this.pollIntervalId); } render() { const { modelName, version, modelVersion, runInfo, runDisplayName, history, schema, } = this.props; return ( <PageContainer> <RequestStateWrapper requestIds={this.state.criticalInitialRequestIds}> {(loading, hasError, requests) => { if (hasError) { clearInterval(this.pollIntervalId); if (Utils.shouldRender404(requests, this.state.criticalInitialRequestIds)) { return ( <ErrorView statusCode={404} subMessage={`Model ${modelName} v${version} does not exist`} fallbackHomePageReactRoute={modelListPageRoute} /> ); } // TODO(Zangr) Have a more generic boundary to handle all errors, not just 404. triggerError(requests); } else if (loading) { return <Spinner />; } else if (modelVersion) { // Null check to prevent NPE after delete operation return ( <ModelVersionView modelName={modelName} modelVersion={modelVersion} runInfo={runInfo} runDisplayName={runDisplayName} handleEditDescription={this.handleEditDescription} deleteModelVersionApi={this.props.deleteModelVersionApi} history={history} handleStageTransitionDropdownSelect={this.handleStageTransitionDropdownSelect} schema={schema} /> ); } return null; }} </RequestStateWrapper> </PageContainer> ); } } const mapStateToProps = (state, ownProps) => { const modelName = decodeURIComponent(ownProps.match.params.modelName); const { version } = ownProps.match.params; const modelVersion = getModelVersion(state, modelName, version); const schema = getModelVersionSchemas(state, modelName, version); let runInfo = null; if (modelVersion && !modelVersion.run_link) { runInfo = getRunInfo(modelVersion && modelVersion.run_id, state); } const tags = runInfo && getRunTags(runInfo.getRunUuid(), state); const runDisplayName = tags && Utils.getRunDisplayName(tags, runInfo.getRunUuid()); const { apis } = state; return { modelName, version, modelVersion, schema, runInfo, runDisplayName, apis, }; }; const mapDispatchToProps = { getModelVersionApi, updateModelVersionApi, transitionModelVersionStageApi, getModelVersionArtifactApi, parseMlModelFile, deleteModelVersionApi, getRunApi, }; export const ModelVersionPage = connect(mapStateToProps, mapDispatchToProps)(ModelVersionPageImpl);
src/NavbarBrand.js
egauci/react-bootstrap
import React from 'react'; import classNames from 'classnames'; import tbsUtils from './utils/bootstrapUtils'; class NavbarBrand extends React.Component { render() { const {className, children, ...props} = this.props; let { $bs_navbar_bsClass: bsClass = 'navbar' } = this.context; let brandClasses = tbsUtils.prefix({ bsClass }, 'brand'); if (React.isValidElement(children)) { return React.cloneElement(children, { className: classNames( children.props.className, className, brandClasses ) }); } return ( <span {...props} className={classNames(className, brandClasses)}> {children} </span> ); } } NavbarBrand.contextTypes = { $bs_navbar_bsClass: React.PropTypes.string }; export default NavbarBrand;
admin/client/App/shared/CreateForm.js
brianjd/keystone
/** * The form that's visible when "Create <ItemName>" is clicked on either the * List screen or the Item screen */ import React from 'react'; import assign from 'object-assign'; import vkey from 'vkey'; import AlertMessages from './AlertMessages'; import { Fields } from 'FieldTypes'; import InvalidFieldType from './InvalidFieldType'; import { Button, Form, Modal } from '../elemental'; const CreateForm = React.createClass({ displayName: 'CreateForm', propTypes: { err: React.PropTypes.object, isOpen: React.PropTypes.bool, list: React.PropTypes.object, onCancel: React.PropTypes.func, onCreate: React.PropTypes.func, }, getDefaultProps () { return { err: null, isOpen: false, }; }, getInitialState () { // Set the field values to their default values when first rendering the // form. (If they have a default value, that is) var values = {}; Object.keys(this.props.list.fields).forEach(key => { var field = this.props.list.fields[key]; var FieldComponent = Fields[field.type]; values[field.path] = FieldComponent.getDefaultValue(field); }); return { values: values, alerts: {}, }; }, componentDidMount () { document.body.addEventListener('keyup', this.handleKeyPress, false); }, componentWillUnmount () { document.body.removeEventListener('keyup', this.handleKeyPress, false); }, handleKeyPress (evt) { if (vkey[evt.keyCode] === '<escape>') { this.props.onCancel(); } }, // Handle input change events handleChange (event) { var values = assign({}, this.state.values); values[event.path] = event.value; this.setState({ values: values, }); }, // Set the props of a field getFieldProps (field) { var props = assign({}, field); props.value = this.state.values[field.path]; props.values = this.state.values; props.onChange = this.handleChange; props.mode = 'create'; props.key = field.path; return props; }, // Create a new item when the form is submitted submitForm (event) { event.preventDefault(); const createForm = event.target; const formData = new FormData(createForm); this.props.list.createItem(formData, (err, data) => { if (data) { if (this.props.onCreate) { this.props.onCreate(data); } else { // Clear form this.setState({ values: {}, alerts: { success: { success: 'Item created', }, }, }); } } else { if (!err) { err = { error: 'connection error', }; } // If we get a database error, show the database error message // instead of only saying "Database error" if (err.error === 'database error') { err.error = err.detail.errmsg; } this.setState({ alerts: { error: err, }, }); } }); }, // Render the form itself renderForm () { if (!this.props.isOpen) return; var form = []; var list = this.props.list; var nameField = this.props.list.nameField; var focusWasSet; // If the name field is an initial one, we need to render a proper // input for it if (list.nameIsInitial) { var nameFieldProps = this.getFieldProps(nameField); nameFieldProps.autoFocus = focusWasSet = true; if (nameField.type === 'text') { nameFieldProps.className = 'item-name-field'; nameFieldProps.placeholder = nameField.label; nameFieldProps.label = ''; } form.push(React.createElement(Fields[nameField.type], nameFieldProps)); } // Render inputs for all initial fields Object.keys(list.initialFields).forEach(key => { var field = list.fields[list.initialFields[key]]; // If there's something weird passed in as field type, render the // invalid field type component if (typeof Fields[field.type] !== 'function') { form.push(React.createElement(InvalidFieldType, { type: field.type, path: field.path, key: field.path })); return; } // Get the props for the input field var fieldProps = this.getFieldProps(field); // If there was no focusRef set previously, set the current field to // be the one to be focussed. Generally the first input field, if // there's an initial name field that takes precedence. if (!focusWasSet) { fieldProps.autoFocus = focusWasSet = true; } form.push(React.createElement(Fields[field.type], fieldProps)); }); return ( <Form layout="horizontal" onSubmit={this.submitForm}> <Modal.Header text={'Create a new ' + list.singular} showCloseButton /> <Modal.Body> <AlertMessages alerts={this.state.alerts} /> {form} </Modal.Body> <Modal.Footer> <Button color="success" type="submit" data-button-type="submit"> Create </Button> <Button variant="link" color="cancel" data-button-type="cancel" onClick={this.props.onCancel} > Cancel </Button> </Modal.Footer> </Form> ); }, render () { return ( <Modal.Dialog isOpen={this.props.isOpen} onClose={this.props.onCancel} backdropClosesModal > {this.renderForm()} </Modal.Dialog> ); }, }); module.exports = CreateForm;
pootle/static/js/auth/components/SocialAuthError.js
Avira/pootle
/* * Copyright (C) Pootle contributors. * * This file is a part of the Pootle project. It is distributed under the GPL3 * or later license. See the LICENSE file for a copy of the license and the * AUTHORS file for copyright and authorship information. */ 'use strict'; import React from 'react'; import { PureRenderMixin } from 'react/addons'; import AuthContent from './AuthContent'; let SocialAuthError = React.createClass({ mixins: [PureRenderMixin], propTypes: { socialError: React.PropTypes.object, }, /* Layout */ render() { let errorMsg; if (this.props.socialError) { errorMsg = interpolate( gettext('An error occurred while attempting to sign in via %s.'), [this.props.socialError.provider] ); } else { errorMsg = gettext('An error occurred while attempting to sign in via your social account.'); } let errorFace = { fontSize: '400%', marginBottom: '0.5em', }; return ( <AuthContent> <h2 style={errorFace}>{`{õ_õ}`}</h2> <p>{errorMsg}</p> {this.props.socialError && <p>{`${this.props.socialError.exception.name}: ${this.props.socialError.exception.msg} `}</p> } {this.props.socialError && <a href={this.props.socialError.retry_url}> {gettext('Try again')} </a> } </AuthContent> ); } }); export default SocialAuthError;
docs/src/pages/layout/hidden/GridIntegration.js
dsslimshaddy/material-ui
// @flow weak import React from 'react'; import PropTypes from 'prop-types'; import compose from 'recompose/compose'; import { withStyles } from 'material-ui/styles'; import Paper from 'material-ui/Paper'; import Grid from 'material-ui/Grid'; import withWidth from 'material-ui/utils/withWidth'; import Typography from 'material-ui/Typography'; const styles = theme => ({ root: { flexGrow: 1, paddingTop: 42, position: 'relative', }, paper: { padding: 16, textAlign: 'center', color: theme.palette.text.secondary, minHeight: 54, }, typography: { position: 'absolute', left: 0, top: 0, padding: 5, }, }); function GridIntegration(props) { const classes = props.classes; return ( <div className={classes.root}> <Typography type="subheading" className={classes.typography}> Current width: {props.width} </Typography> <Grid container spacing={24}> <Grid item xs hidden={{ xsUp: true }}> <Paper className={classes.paper}>xsUp</Paper> </Grid> <Grid item xs hidden={{ smUp: true }}> <Paper className={classes.paper}>smUp</Paper> </Grid> <Grid item xs hidden={{ mdUp: true }}> <Paper className={classes.paper}>mdUp</Paper> </Grid> <Grid item xs hidden={{ lgUp: true }}> <Paper className={classes.paper}>lgUp</Paper> </Grid> <Grid item xs hidden={{ xlUp: true }}> <Paper className={classes.paper}>xlUp</Paper> </Grid> </Grid> </div> ); } GridIntegration.propTypes = { classes: PropTypes.object.isRequired, width: PropTypes.string, }; export default compose(withStyles(styles), withWidth())(GridIntegration);
src/screens/Shared/SearchFilterModal.js
alphasp/pxview
/* eslint-disable camelcase */ import React, { Component } from 'react'; import { StyleSheet, View, SafeAreaView } from 'react-native'; import { connect } from 'react-redux'; import qs from 'qs'; import { withTheme, Button } from 'react-native-paper'; import { connectLocalization } from '../../components/Localization'; import PXListItem from '../../components/PXListItem'; import SingleChoiceDialog from '../../components/SingleChoiceDialog'; import SearchIllustsBookmarkRangesPickerDialog from '../../components/SearchIllustsBookmarkRangesPickerDialog'; import SearchNovelsBookmarkRangesPickerDialog from '../../components/SearchNovelsBookmarkRangesPickerDialog'; import { SEARCH_TYPES, SEARCH_PERIOD_TYPES, SCREENS, } from '../../common/constants'; import { globalStyles, globalStyleVariables } from '../../styles'; const styles = StyleSheet.create({ listContainer: { flex: 1, }, searchFilterButtonContainer: { padding: 10, }, searchFilterButton: { backgroundColor: globalStyleVariables.PRIMARY_COLOR, padding: 10, alignItems: 'center', }, searchFilterButtonText: { color: '#fff', }, }); class SearchFilterModal extends Component { constructor(props) { super(props); const { searchFilter: { search_target, period, sort, start_date, end_date, bookmark_num_min, bookmark_num_max, bookmarkCountsTag, }, } = props.route.params; this.state = { target: search_target || 'partial_match_for_tags', period: period || SEARCH_PERIOD_TYPES.ALL, bookmarkCountsTag: bookmarkCountsTag || '', sort: sort || 'date_desc', startDate: start_date, endDate: end_date, likes: this.getSelectedLikesFilterValue( bookmark_num_min, bookmark_num_max, ), bookmarkNumMin: bookmark_num_min, bookmarkNumMax: bookmark_num_max, selectedFilterType: null, selectedPickerValue: null, filterList: this.getFilterList(true), }; } getFilterList = (init) => { const { i18n, user, route } = this.props; // const { startDate, endDate } = this.state; const { searchFilter: { start_date, end_date }, searchType, } = route.params; let targetOptions; if (searchType === SEARCH_TYPES.ILLUST) { targetOptions = [ { value: 'partial_match_for_tags', label: i18n.searchTargetTagPartial, }, { value: 'exact_match_for_tags', label: i18n.searchTargetTagExact, }, { value: 'title_and_caption', label: i18n.searchTargetTitleCaption, }, ]; } else { targetOptions = [ { value: 'partial_match_for_tags', label: i18n.searchTargetTagPartial, }, { value: 'exact_match_for_tags', label: i18n.searchTargetTagExact, }, { value: 'text', label: i18n.searchTargetText, }, { value: 'keyword', label: i18n.searchTargetKeyword, }, ]; } const bookmarkCountsTagOptions = [ { value: '', label: i18n.searchBookmarkCountsTagAll, }, { value: '100users入り', label: '100users入り', }, { value: '500users入り', label: '500users入り', }, { value: '1000users入り', label: '1000users入り', }, { value: '5000users入り', label: '5000users入り', }, { value: '10000users入り', label: '10000users入り', }, { value: '30000users入り', label: '30000users入り', }, { value: '50000users入り', label: '50000users入り', }, { value: '100000users入り', label: '100000users入り', }, ]; const extraPeriodOption = {}; if (init) { if (start_date && end_date) { extraPeriodOption.value = SEARCH_PERIOD_TYPES.CUSTOM_DATE; extraPeriodOption.label = `${start_date} - ${end_date}`; } } else if (this.state.startDate && this.state.endDate) { extraPeriodOption.value = SEARCH_PERIOD_TYPES.CUSTOM_DATE; extraPeriodOption.label = `${this.state.startDate} - ${this.state.endDate}`; } let periodOptions = [ { value: SEARCH_PERIOD_TYPES.ALL, label: i18n.searchPeriodAll, }, { value: SEARCH_PERIOD_TYPES.LAST_DAY, label: i18n.searchPeriodLastDay, }, { value: SEARCH_PERIOD_TYPES.LAST_WEEK, label: i18n.searchPeriodLastWeek, }, { value: SEARCH_PERIOD_TYPES.LAST_MONTH, label: i18n.searchPeriodLastMonth, }, { value: SEARCH_PERIOD_TYPES.LAST_HALF_YEAR, label: i18n.searchPeriodLastHalfYear, }, { value: SEARCH_PERIOD_TYPES.LAST_YEAR, label: i18n.searchPeriodLastYear, }, { value: SEARCH_PERIOD_TYPES.DATE, label: i18n.searchPeriodSpecifyDate, }, ]; if (extraPeriodOption.value) { periodOptions = [extraPeriodOption, ...periodOptions]; } const filterOptions = [ { key: 'target', options: targetOptions, }, { key: 'period', options: periodOptions, }, { key: 'bookmarkCountsTag', options: bookmarkCountsTagOptions, }, { key: 'sort', options: [ { value: 'date_desc', label: i18n.searchOrderNewest, }, { value: 'date_asc', label: i18n.searchOrderOldest, }, { value: 'popularity', label: i18n.searchOrderPopularity, }, ], }, ]; if (user.is_premium) { filterOptions.push({ key: 'likes', options: [ { value: null, label: i18n.searchLikesAll, }, ], }); } return filterOptions; }; getSearchTypeName = (type) => { const { i18n } = this.props; switch (type) { case 'target': return i18n.searchTarget; case 'bookmarkCountsTag': return i18n.searchBookmarkCountsTag; case 'period': return i18n.searchPeriod; case 'sort': return i18n.searchOrder; case 'likes': return i18n.searchLikes; default: return ''; } }; getSelectedFilterName = (key, options) => { if (key !== 'likes') { return options.find((o) => o.value === this.state[key]).label; } const { bookmarkNumMin, bookmarkNumMax } = this.state; if (!bookmarkNumMin && !bookmarkNumMax) { const { i18n } = this.props; return i18n.searchLikesAll; } if (!bookmarkNumMax) { return `${bookmarkNumMin}+`; } return `${bookmarkNumMin} - ${bookmarkNumMax}`; }; getSelectedLikesFilterValue = (bookmarkNumMin, bookmarkNumMax) => { if (!bookmarkNumMin && !bookmarkNumMax) { return ''; } if (!bookmarkNumMax) { return `bookmarkNumMin=${bookmarkNumMin}`; } return `bookmarkNumMin=${bookmarkNumMin}&bookmarkNumMax=${bookmarkNumMax}`; }; handleOnPressFilterOption = (filterType) => { const value = this.state[filterType]; this.setState({ selectedFilterType: filterType, selectedPickerValue: value, }); }; handleOnOkPickerDialog = (value) => { const { selectedFilterType, startDate, endDate } = this.state; if (selectedFilterType === 'period') { if (value === SEARCH_PERIOD_TYPES.DATE) { const { navigate } = this.props.navigation; navigate(SCREENS.SearchFilterPeriodDateModal, { onConfirmPeriodDate: this.handleOnConfirmPeriodDate, startDate, endDate, }); this.setState({ selectedFilterType: null, }); } else { this.setState({ [selectedFilterType]: value, selectedPickerValue: value, selectedFilterType: null, startDate: null, endDate: null, }); } } else { const newState = { [selectedFilterType]: value, selectedPickerValue: value, selectedFilterType: null, }; if (selectedFilterType === 'likes') { if (value) { const { bookmarkNumMin, bookmarkNumMax } = qs.parse(value); newState.bookmarkNumMin = bookmarkNumMin; newState.bookmarkNumMax = bookmarkNumMax; } else { newState.bookmarkNumMin = null; newState.bookmarkNumMax = null; } } this.setState(newState); } }; handleOnCancelPickerDialog = () => { this.setState({ selectedFilterType: null, }); }; handleOnConfirmPeriodDate = (startDate, endDate) => { const { goBack } = this.props.navigation; goBack(null); this.setState( { startDate, endDate, }, () => { this.setState({ filterList: this.getFilterList(), period: SEARCH_PERIOD_TYPES.CUSTOM_DATE, selectedPickerValue: SEARCH_PERIOD_TYPES.CUSTOM_DATE, }); }, ); }; handleOnPressApplyFilter = () => { const { navigation: { navigate }, } = this.props; const { target, period, sort, startDate, endDate, bookmarkNumMin, bookmarkNumMax, bookmarkCountsTag, } = this.state; navigate(SCREENS.SearchResult, { target, period, sort, startDate, endDate, bookmarkNumMin, bookmarkNumMax, bookmarkCountsTag, }); }; render() { const { i18n, navigationStateKey, route, theme } = this.props; const { word, searchType } = route.params; const { selectedFilterType, selectedPickerValue, filterList, searchTarget, period, startDate, endDate, } = this.state; return ( <SafeAreaView style={[ globalStyles.container, { backgroundColor: theme.colors.background }, ]} > <View style={styles.listContainer}> {filterList.map((list) => ( <PXListItem key={list.key} title={this.getSearchTypeName(list.key)} description={this.getSelectedFilterName(list.key, list.options)} onPress={() => this.handleOnPressFilterOption(list.key)} /> ))} </View> <View style={styles.searchFilterButtonContainer}> <Button mode="contained" onPress={this.handleOnPressApplyFilter}> {i18n.searchApplyFilter} </Button> </View> {selectedFilterType && selectedFilterType !== 'likes' && ( <SingleChoiceDialog title={this.getSearchTypeName(selectedFilterType)} items={filterList .find((f) => f.key === selectedFilterType) .options.map((option) => ({ value: option.value, label: option.label, }))} visible scrollable selectedItemValue={selectedPickerValue} onPressCancel={this.handleOnCancelPickerDialog} onPressOk={this.handleOnOkPickerDialog} /> )} {selectedFilterType === 'likes' && searchType === SEARCH_TYPES.ILLUST && ( <SearchIllustsBookmarkRangesPickerDialog navigationStateKey={navigationStateKey} word={word} searchOptions={{ search_target: searchTarget, period, start_date: startDate, end_date: endDate, }} selectedItemValue={selectedPickerValue} onPressCancel={this.handleOnCancelPickerDialog} onPressOk={this.handleOnOkPickerDialog} /> )} {selectedFilterType === 'likes' && searchType === SEARCH_TYPES.NOVEL && ( <SearchNovelsBookmarkRangesPickerDialog navigationStateKey={navigationStateKey} word={word} searchOptions={{ search_target: searchTarget, period, start_date: startDate, end_date: endDate, }} selectedItemValue={selectedPickerValue} onPressCancel={this.handleOnCancelPickerDialog} onPressOk={this.handleOnOkPickerDialog} /> )} </SafeAreaView> ); } } export default withTheme( connectLocalization( connect((state, props) => ({ user: state.auth.user, navigationStateKey: props.route.key, }))(SearchFilterModal), ), );
vj4/ui/components/react/DomComponent.js
vijos/vj4
import React from 'react'; import PropTypes from 'prop-types'; export default class DomComponent extends React.PureComponent { componentDidMount() { this.refs.dom.appendChild(this.props.childDom); } componentWillUnmount() { $(this.refs.dom).empty(); } render() { const { childDom, ...rest } = this.props; return ( <div {...rest} ref="dom"></div> ); } } DomComponent.propTypes = { childDom: PropTypes.instanceOf(HTMLElement).isRequired, };
client/main.js
manhhailua/meteor-react-mui-starter-app
/* global document */ import { MuiThemeProvider } from 'material-ui/styles'; import { Meteor } from 'meteor/meteor'; import React from 'react'; import { render } from 'react-dom'; import App from '../imports/ui/components/App'; Meteor.startup(() => { render( <MuiThemeProvider> <App /> </MuiThemeProvider>, document.getElementById('app'), ); });
src/components/CreateUser/index.js
git-okuzenko/react-redux
import React from 'react'; import PropTypes from 'prop-types'; import { Field, reduxForm } from 'redux-form'; import {validate} from '../../utils'; import '../../assets/styles/common/form.scss'; const renderField = (field) => { let {input, label, type, meta: { touched, error }, input: { name }} = field; let renderErrors = () => ( <div className="input-error"> <span className="error">{error}</span> </div> ); return ( <div className="form-group"> <label htmlFor={name}>{label}</label> <input type={type} {...input} className={(touched && error) ? 'form-control invalid': 'form-control'} /> {touched && error ? renderErrors(): null} </div> ); }; let CreateUserForm = ({handleSubmit}) => { let submit = () => { }; return ( <form noValidate autoComplete="off" onSubmit={handleSubmit(submit)}> <Field label="Name" name="name" component={renderField} /> <Field label="Email address" name="email" component={renderField} /> <button type="submit" className="btn btn-primary">Submit</button> </form> ); }; CreateUserForm.propTypes = { handleSubmit: PropTypes.func, pristine: PropTypes.bool, submitting: PropTypes.bool, reset: PropTypes.func }; CreateUserForm = reduxForm({ form: 'addNewUserForm', validate })(CreateUserForm); export default CreateUserForm;
app/javascript/mastodon/features/favourites/index.js
TootCat/mastodon
import React from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import LoadingIndicator from '../../components/loading_indicator'; import { fetchFavourites } from '../../actions/interactions'; import { ScrollContainer } from 'react-router-scroll'; import AccountContainer from '../../containers/account_container'; import Column from '../ui/components/column'; import ColumnBackButton from '../../components/column_back_button'; import ImmutablePureComponent from 'react-immutable-pure-component'; const mapStateToProps = (state, props) => ({ accountIds: state.getIn(['user_lists', 'favourited_by', Number(props.params.statusId)]), }); class Favourites extends ImmutablePureComponent { static propTypes = { params: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, accountIds: ImmutablePropTypes.list, }; componentWillMount () { this.props.dispatch(fetchFavourites(Number(this.props.params.statusId))); } componentWillReceiveProps (nextProps) { if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) { this.props.dispatch(fetchFavourites(Number(nextProps.params.statusId))); } } render () { const { accountIds } = this.props; if (!accountIds) { return ( <Column> <LoadingIndicator /> </Column> ); } return ( <Column> <ColumnBackButton /> <ScrollContainer scrollKey='favourites'> <div className='scrollable'> {accountIds.map(id => <AccountContainer key={id} id={id} withNote={false} />)} </div> </ScrollContainer> </Column> ); } } export default connect(mapStateToProps)(Favourites);
components/CounterApp/CounterApp.js
thiagodebastos/react-future-stack
// @flow import React from 'react'; import Button from '../Button'; type Props = { counterApp: { count: number }, increment: CounterAction, decrement: CounterAction }; const Counter = (props: Props) => <div> Counter: {props.counterApp.count} <br /> <Button onClick={props.increment} primary> + </Button> <Button onClick={props.decrement}> - </Button> </div>; export default Counter;
src/components/BooleanQuestion.js
flexiform/flexiform-fill-ui
/** * Copyright 2016 ReSys OÜ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import React from 'react'; import {connectToAnswer} from '../utils/formUtils'; import Errors from './Errors'; import classnames from 'classnames'; import Item from './Item'; import Label from './Label'; import { injectIntl, FormattedMessage } from 'react-intl'; // Form item for boolean (yes/no) questions class BooleanQuestion extends Item { onChange(value) { this.props.answerQuestion(this.props.question[0], value); } // Keyboard interaction keyPress(event) { let keyCode = event.keyCode; switch (keyCode) { // Space: toggle case 32: this.onChange(!this.props.question[1].get('value')); break; // Y: yes / true case 89: this.onChange(true); break; // N: no / false case 78: this.onChange(false); break; } } render() { let q = this.question; if (!q) { return null; } let rawValue = q.get('value'); let value = null; if (rawValue === true || rawValue === 'true') { value = true; } else if (rawValue === false || rawValue === 'false') { value = false; } return ( <div className={this.getStyles()}> <Label htmlFor={this.getControlId()} required={this.isRequired()}>{q.get('label')}</Label> {this.renderDescription()} <div id={this.getControlId()}> <div className={classnames('dialob-tristate-control')} tabIndex={0} onKeyDown={this.keyPress.bind(this)}> <span className={classnames('dialob-tristate-true', {'dialob-tristate-active': (value === true)})} onClick={this.onChange.bind(this, true)}><FormattedMessage id='yes'/></span> <span className={classnames('dialob-tristate-false', {'dialob-tristate-active': (value === false)})} onClick={this.onChange.bind(this, false)}><FormattedMessage id='no'/></span> </div> </div> <Errors errors={q.get('errors')} /> </div> ); } } export const BooleanQuestionConnected = connectToAnswer(injectIntl(BooleanQuestion)); export { BooleanQuestionConnected as default, BooleanQuestion };
app/components/mapMarker/mapMarkerCalloutView.js
UsabilitySoft/Proximater
import React, { Component } from 'react'; import { AppRegistry, Text, View, Image, Button } from 'react-native'; import { styles } from './styles'; export class MapMarkerCalloutView extends Component { render() { return ( <View style={styles.calloutContainer}> <Text style={styles.calloutText}>You are here (callout view)</Text> </View> ); } }
app/javascript/mastodon/features/ui/components/column.js
tootsuite/mastodon
import React from 'react'; import ColumnHeader from './column_header'; import PropTypes from 'prop-types'; import { debounce } from 'lodash'; import { scrollTop } from '../../../scroll'; import { isMobile } from '../../../is_mobile'; export default class Column extends React.PureComponent { static propTypes = { heading: PropTypes.string, icon: PropTypes.string, children: PropTypes.node, active: PropTypes.bool, hideHeadingOnMobile: PropTypes.bool, }; handleHeaderClick = () => { const scrollable = this.node.querySelector('.scrollable'); if (!scrollable) { return; } this._interruptScrollAnimation = scrollTop(scrollable); } scrollTop () { const scrollable = this.node.querySelector('.scrollable'); if (!scrollable) { return; } this._interruptScrollAnimation = scrollTop(scrollable); } handleScroll = debounce(() => { if (typeof this._interruptScrollAnimation !== 'undefined') { this._interruptScrollAnimation(); } }, 200) setRef = (c) => { this.node = c; } render () { const { heading, icon, children, active, hideHeadingOnMobile } = this.props; const showHeading = heading && (!hideHeadingOnMobile || (hideHeadingOnMobile && !isMobile(window.innerWidth))); const columnHeaderId = showHeading && heading.replace(/ /g, '-'); const header = showHeading && ( <ColumnHeader icon={icon} active={active} type={heading} onClick={this.handleHeaderClick} columnHeaderId={columnHeaderId} /> ); return ( <div ref={this.setRef} role='region' aria-labelledby={columnHeaderId} className='column' onScroll={this.handleScroll} > {header} {children} </div> ); } }
examples/src/components/RemoteSelectField.js
katienreed/react-select
import React from 'react'; import Select from 'react-select'; var RemoteSelectField = React.createClass({ displayName: 'RemoteSelectField', propTypes: { hint: React.PropTypes.string, label: React.PropTypes.string, }, loadOptions (input, callback) { input = input.toLowerCase(); var rtn = { options: [ { label: 'One', value: 'one' }, { label: 'Two', value: 'two' }, { label: 'Three', value: 'three' } ], complete: true }; if (input.slice(0, 1) === 'a') { if (input.slice(0, 2) === 'ab') { rtn = { options: [ { label: 'AB', value: 'ab' }, { label: 'ABC', value: 'abc' }, { label: 'ABCD', value: 'abcd' } ], complete: true }; } else { rtn = { options: [ { label: 'A', value: 'a' }, { label: 'AA', value: 'aa' }, { label: 'AB', value: 'ab' } ], complete: false }; } } else if (!input.length) { rtn.complete = false; } setTimeout(function() { callback(null, rtn); }, 500); }, renderHint () { if (!this.props.hint) return null; return ( <div className="hint">{this.props.hint}</div> ); }, render () { return ( <div className="section"> <h3 className="section-heading">{this.props.label}</h3> <Select asyncOptions={this.loadOptions} className="remote-example" /> {this.renderHint()} </div> ); } }); module.exports = RemoteSelectField;
src/parser/warrior/arms/modules/core/Dots/index.js
FaideWW/WoWAnalyzer
import React from 'react'; import Analyzer from 'parser/core/Analyzer'; import StatisticsListBox, { STATISTIC_ORDER } from 'interface/others/StatisticsListBox'; import DeepWoundsUptime from './DeepWoundsUptime'; import RendUptime from './RendUptime'; class DotUptimeStatisticBox extends Analyzer { static dependencies = { deepwoundsUptime: DeepWoundsUptime, rendUptime: RendUptime, }; constructor(...args) { super(...args); this.active = Object.keys(this.constructor.dependencies) .map(name => this[name].active) .includes(true); } statistic() { return ( <StatisticsListBox position={STATISTIC_ORDER.CORE(3)} title="DoT uptimes" > {Object.keys(this.constructor.dependencies).map(name => { const module = this[name]; if (!module.active) { return null; } return ( <React.Fragment key={name}> {module.subStatistic()} </React.Fragment> ); })} </StatisticsListBox> ); } } export default DotUptimeStatisticBox;
packages/datagrid/stories/DynamicDataGrid.component.js
Talend/ui
import React from 'react'; import random from 'lodash/random'; import { IconsProvider } from '@talend/react-components'; import PropTypes from 'prop-types'; import DataGrid from '../src/components'; import serializer from '../src/components/DatasetSerializer'; import sample from './sample.json'; const ADD_ITEMS_NUMBER = 4; const LOADING_ITEM = { loaded: false, value: {}, }; /** * getRowDataInfos - this function return information about how many row of each type are loaded * * @param {array} rowData array of rowData * @return {object} state of the rowData */ export function getRowDataInfos(rowData) { return rowData.reduce( (acc, item) => { if (item.loading === false && Object.keys(item).length === 2) { // eslint-disable-next-line no-param-reassign acc.notLoaded += 1; } else if (item.loading === true) { // eslint-disable-next-line no-param-reassign acc.loading += 1; } else { // eslint-disable-next-line no-param-reassign acc.loaded += 1; } return acc; }, { loaded: 0, loading: 0, notLoaded: 0, }, ); } function getItemWithRandomValue() { return { loading: false, value: { field2: { value: random(0, 10000000), quality: 1, }, field8: { value: random(0, 10000000), quality: 0, }, field5: { value: random(0, 10000000), quality: -1, }, field4: { value: random(0, 10000000), quality: 1, }, field7: { value: random(0, 10000000), quality: 1, }, field3: { value: random(0, 10000000), quality: 1, }, field1: { value: random(0, 10000000), quality: 1, }, field0: { value: `Aéroport ${random(0, 10000000)}`, quality: 1, }, field9: { value: random(0, 10000000), quality: 1, }, field6: { value: random(0, 10000000), quality: 1, }, }, quality: 1, }; } export default class DynamicDataGrid extends React.Component { static propTypes = {}; constructor() { super(); this.addLoadingsItems = this.addLoadingsItems.bind(this); this.terminateItems = this.terminateItems.bind(this); this.changeColumnQuality = this.changeColumnQuality.bind(this); const datagridSample = { ...sample }; datagridSample.data = new Array(ADD_ITEMS_NUMBER).fill().map(() => ({ ...LOADING_ITEM })); this.state = { sample: datagridSample, loading: true, index: 1 }; setTimeout(this.terminateItems, 1000); } terminateItems() { this.setState(prevState => { const datagridSample = { ...prevState.sample }; datagridSample.data.splice( (prevState.index - 1) * ADD_ITEMS_NUMBER, ADD_ITEMS_NUMBER, ...new Array(ADD_ITEMS_NUMBER).fill().map(getItemWithRandomValue), ); return { sample: datagridSample, loading: !prevState.loading, }; }); } changeColumnQuality() { this.setState(prevState => { const datagridSample = { ...prevState.sample }; datagridSample.data = datagridSample.data.map(rowData => ({ ...rowData, value: { ...rowData.value, field5: { ...rowData.value.field5, quality: rowData.value.field5.quality === 1 ? -1 : 1, }, }, })); return { sample: datagridSample, }; }); } addLoadingsItems() { const datagridSample = { ...this.state.sample }; datagridSample.data = datagridSample.data.concat( new Array(ADD_ITEMS_NUMBER).fill().map(() => ({ ...LOADING_ITEM })), ); this.setState(prevState => ({ index: prevState.index + 1, sample: datagridSample, loading: !prevState.loading, })); setTimeout(this.terminateItems, 1000); } render() { return ( <div style={{ height: '100vh' }}> <input type="button" value={`add ${ADD_ITEMS_NUMBER} items`} onClick={this.addLoadingsItems} disabled={this.state.loading} /> <input type="button" value="change quality for 1 column(#6)" onClick={this.changeColumnQuality} disabled={this.state.loading} /> Number of data : {this.state.sample.data.length} <IconsProvider /> <DataGrid data={this.state.sample} rowSelection="multiple" rowData={null} /> </div> ); } }
blueocean-material-icons/src/js/components/svg-icons/notification/do-not-disturb-alt.js
kzantow/blueocean-plugin
import React from 'react'; import SvgIcon from '../../SvgIcon'; const NotificationDoNotDisturbAlt = (props) => ( <SvgIcon {...props}> <path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zM4 12c0-4.4 3.6-8 8-8 1.8 0 3.5.6 4.9 1.7L5.7 16.9C4.6 15.5 4 13.8 4 12zm8 8c-1.8 0-3.5-.6-4.9-1.7L18.3 7.1C19.4 8.5 20 10.2 20 12c0 4.4-3.6 8-8 8z"/> </SvgIcon> ); NotificationDoNotDisturbAlt.displayName = 'NotificationDoNotDisturbAlt'; NotificationDoNotDisturbAlt.muiName = 'SvgIcon'; export default NotificationDoNotDisturbAlt;
boilerplates/app/src/routes/dashboard/components/completed.js
hexagonframework/antd-admin-cli
import React from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' import { AreaChart, Area, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts' import styles from './completed.less' import { color } from '../../../utils' function Completed ({ data }) { return ( <div className={styles.sales}> <div className={styles.title}>TEAM TOTAL COMPLETED</div> <ResponsiveContainer minHeight={360}> <AreaChart data={data}> <Legend verticalAlign="top" content={prop => { const { payload } = prop return (<ul className={classnames({ [styles.legend]: true, clearfix: true })}> {payload.map((item, key) => <li key={key}><span className={styles.radiusdot} style={{ background: item.color }} />{item.value}</li>)} </ul>) }} /> <XAxis dataKey="name" axisLine={{ stroke: color.borderBase, strokeWidth: 1 }} tickLine={false} /> <YAxis axisLine={false} tickLine={false} /> <CartesianGrid vertical={false} stroke={color.borderBase} strokeDasharray="3 3" /> <Tooltip wrapperStyle={{ border: 'none', boxShadow: '4px 4px 40px rgba(0, 0, 0, 0.05)' }} content={content => { const list = content.payload.map((item, key) => <li key={key} className={styles.tipitem}><span className={styles.radiusdot} style={{ background: item.color }} />{`${item.name}:${item.value}`}</li>) return <div className={styles.tooltip}><p className={styles.tiptitle}>{content.label}</p><ul>{list}</ul></div> }} /> <Area type="monotone" dataKey="Task complete" stroke={color.grass} fill={color.grass} strokeWidth={2} dot={{ fill: '#fff' }} activeDot={{ r: 5, fill: '#fff', stroke: color.green }} /> <Area type="monotone" dataKey="Cards Complete" stroke={color.sky} fill={color.sky} strokeWidth={2} dot={{ fill: '#fff' }} activeDot={{ r: 5, fill: '#fff', stroke: color.blue }} /> </AreaChart> </ResponsiveContainer> </div> ) } Completed.propTypes = { data: PropTypes.array, } export default Completed
examples/huge-apps/routes/Course/routes/Assignments/components/Assignments.js
mattkrick/react-router
import React from 'react' class Assignments extends React.Component { render() { return ( <div> <h3>Assignments</h3> {this.props.children || <p>Choose an assignment from the sidebar.</p>} </div> ) } } module.exports = Assignments
src/components/LikeButton/index.js
khankuan/asset-library-demo
import React from 'react'; import cx from 'classnames'; import Button from '../Button'; import Text from '../Text'; export default class LikeButton extends React.Component { static propTypes = { children: React.PropTypes.node, liked: React.PropTypes.bool, className: React.PropTypes.string, } getClasses() { const liked = this.props.liked; return cx(liked ? 'liked' : 'not-liked', this.props.className); } render() { const liked = this.props.liked; return ( <Button {...this.props} className={ this.getClasses() } type="flat"> <Text bold>{liked ? 'Liked' : 'Like'}</Text> { this.props.children } </Button> ); } }
src/ui/components/ReferenceRoute.js
BE-Webdesign/wp-rest-api-reference
/** * External dependecies. */ import React from 'react' /** * Internal dependecies. */ import EndpointsList from './EndpointsList' const ReferenceRoute = ( route ) => ( <div className="reference-route"> <h2 className="reference-route__title">Route: { route.routeName }</h2> <EndpointsList endpoints={ route.endpoints } /> </div> ) export default ReferenceRoute
src/common/Dialog/DialogContent.js
Syncano/syncano-dashboard
import React from 'react'; export default ({ children }) => ( <div className="col-flex-1"> {children} </div> );
src/components/PageHome.js
dfilipidisz/overwolf-hots-talents
import React from 'react'; class PageHome extends React.Component { render () { return ( <div> page home </div> ); } } export default PageHome;
app/javascript/mastodon/features/ui/components/list_panel.js
danhunsaker/mastodon
import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { fetchLists } from 'mastodon/actions/lists'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import { NavLink, withRouter } from 'react-router-dom'; import Icon from 'mastodon/components/icon'; const getOrderedLists = createSelector([state => state.get('lists')], lists => { if (!lists) { return lists; } return lists.toList().filter(item => !!item).sort((a, b) => a.get('title').localeCompare(b.get('title'))).take(4); }); const mapStateToProps = state => ({ lists: getOrderedLists(state), }); export default @withRouter @connect(mapStateToProps) class ListPanel extends ImmutablePureComponent { static propTypes = { dispatch: PropTypes.func.isRequired, lists: ImmutablePropTypes.list, }; componentDidMount () { const { dispatch } = this.props; dispatch(fetchLists()); } render () { const { lists } = this.props; if (!lists || lists.isEmpty()) { return null; } return ( <div> <hr /> {lists.map(list => ( <NavLink key={list.get('id')} className='column-link column-link--transparent' strict to={`/timelines/list/${list.get('id')}`}><Icon className='column-link__icon' id='list-ul' fixedWidth />{list.get('title')}</NavLink> ))} </div> ); } }
src/svg-icons/navigation/chevron-right.js
ichiohta/material-ui
import React from 'react'; import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; let NavigationChevronRight = (props) => ( <SvgIcon {...props}> <path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/> </SvgIcon> ); NavigationChevronRight = pure(NavigationChevronRight); NavigationChevronRight.displayName = 'NavigationChevronRight'; NavigationChevronRight.muiName = 'SvgIcon'; export default NavigationChevronRight;
app/components/Icons/index.js
Byte-Code/lm-digital-store-private-test
import React from 'react'; import PropTypes from 'prop-types'; import * as conditions from '../../utils/weatherConditions'; import styles from './styles.css'; function sunShowerIcon() { return ( <div className={styles.icon}> <div className={styles.cloud} /> <div className={styles.sun}> <div className={styles.rays} /> </div> <div className={styles.rain} /> </div> ); } function thunderStormIcon() { return ( <div className={styles.icon}> <div className={styles.cloud} /> <div className={styles.lightning}> <div className={styles.bolt} /> <div className={styles.bolt} /> </div> </div> ); } function cloudyIcon() { return ( <div className={styles.icon}> <div className={styles.cloud} /> <div className={styles.cloud} /> </div> ); } function flurriesIcon() { return ( <div className={styles.icon}> <div className={styles.cloud} /> <div className={styles.snow}> <div className={styles.flake} /> <div className={styles.flake} /> </div> </div> ); } function sunnyIcon() { return ( <div className={styles.icon}> <div className={styles.sun}> <div className={styles.rays} /> </div> </div> ); } function rainyIcon() { return ( <div className={styles.icon}> <div className={styles.cloud} /> <div className={styles.rain} /> </div> ); } const IconSelector = ({ weather }) => { switch (weather.toLowerCase()) { case conditions.clearSky: default: return sunnyIcon(); case conditions.fewClouds: case conditions.scatteredClouds: case conditions.brokenClouds: case conditions.mist: return cloudyIcon(); case conditions.showerRain: return rainyIcon(); case conditions.rain: return sunShowerIcon(); case conditions.snow: return flurriesIcon(); case conditions.thunderstorm: return thunderStormIcon(); } }; IconSelector.propTypes = { weather: PropTypes.string.isRequired }; export default IconSelector;
src/Parser/Monk/Mistweaver/Modules/Spells/EssenceFont.js
enragednuke/WoWAnalyzer
import React from 'react'; import SPELLS from 'common/SPELLS'; import SpellLink from 'common/SpellLink'; import Wrapper from 'common/Wrapper'; import Analyzer from 'Parser/Core/Analyzer'; const debug = false; class EssenceFont extends Analyzer { castEF = 0; targetsEF = 0; on_byPlayer_cast(event) { const spellId = event.ability.guid; if (spellId === SPELLS.ESSENCE_FONT.id) { this.castEF += 1; } } on_byPlayer_applybuff(event) { const spellId = event.ability.guid; if (spellId === SPELLS.ESSENCE_FONT_BUFF.id) { this.targetsEF += 1; } } on_byPlayer_refreshbuff(event) { const spellId = event.ability.guid; if (spellId === SPELLS.ESSENCE_FONT_BUFF.id) { this.targetsEF += 1; } } on_finished() { if (debug) { console.log(`EF Casts: ${this.castEF}`); console.log(`EF Targets Hit: ${this.targetsEF}`); console.log(`EF Avg Targets Hit per Cast: ${this.targetsEF / this.castEF}`); } } get avgTargetsHitPerEF() { return (this.targetsEF / this.castEF) || 0; } get suggestionThresholds() { return { actual: this.avgTargetsHitPerEF, isLessThan: { minor: 17, average: 14, major: 12, }, style: 'number', }; } suggestions(when) { when(this.suggestionThresholds).addSuggestion((suggest, actual, recommended) => { return suggest( <Wrapper> You are currently using not utilizing your <SpellLink id={SPELLS.ESSENCE_FONT.id} /> effectively. Each <SpellLink id={SPELLS.ESSENCE_FONT.id} /> cast should hit a total of 18 targets. Either hold the cast til 6 or more targets are injured or move while casting to increase the effective range of the spell. </Wrapper> ) .icon(SPELLS.ESSENCE_FONT.icon) .actual(`${this.avgTargetsHitPerEF.toFixed(2)} average targets hit per cast`) .recommended(`${recommended} targets hit is recommended`); }); } } export default EssenceFont;
src/pages/chart/highCharts/HighMoreComponent.js
zuiidea/antd-admin
import React from 'react' import ReactHighcharts from 'react-highcharts' import HighchartsExporting from 'highcharts-exporting' import HighchartsMore from 'highcharts-more' HighchartsMore(ReactHighcharts.Highcharts) HighchartsExporting(ReactHighcharts.Highcharts) const config = { chart: { polar: true, }, xAxis: { categories: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', ], }, series: [ { data: [ 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, ], }, ], } const HighMoreComponent = () => { return <ReactHighcharts config={config} /> } export default HighMoreComponent
webapp/src/components/Footer/Footer.js
wfriesen/jerryatric
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-2016 Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React, { Component } from 'react'; import s from './Footer.scss'; import withStyles from '../../decorators/withStyles'; import Link from '../Link'; @withStyles(s) class Footer extends Component { render() { return ( <div className={s.root}> <div className={s.container}> <span className={s.text}>© Your Company</span> <span className={s.spacer}>·</span> <a className={s.link} href="/" onClick={Link.handleClick}>Home</a> <span className={s.spacer}>·</span> <a className={s.link} href="/privacy" onClick={Link.handleClick}>Privacy</a> <span className={s.spacer}>·</span> <a className={s.link} href="/not-found" onClick={Link.handleClick}>Not Found</a> </div> </div> ); } } export default Footer;
webpack/containers/Help.js
CDCgov/SDP-Vocabulary-Service
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { setSteps } from '../actions/tutorial_actions'; import { Button } from 'react-bootstrap'; import InfoModal from '../components/InfoModal'; class Help extends Component { constructor(props){ super(props); this.selectTab = this.selectTab.bind(this); this.selectInstruction = this.selectInstruction.bind(this); this.state = { selectedTab: props.location.state ? props.location.state.selectedTab : 'instructions', selectedInstruction: props.location.state ? '' : 'general' }; } selectTab(tabName) { if(tabName === 'instructions'){ this.setState({ selectedTab: tabName, selectedInstruction: 'general' }); } else { this.setState({ selectedTab: tabName, selectedInstruction: '' }); } } selectInstruction(instrName) { this.setState({ selectedTab: 'instructions', selectedInstruction: instrName }); } componentDidMount() { this.props.setSteps([ { title: 'Help', text: 'Click next to see a step by step walkthrough for using this page. To see more detailed information about this application and actions you can take <a class="tutorial-link" href="#help">click here to view the full Help Documentation.</a> Accessible versions of these steps are also duplicated in the help documentation.', selector: '.help-link', position: 'bottom', }, { title: 'Tutorials', text: 'Click any item in this side bar to see instructions on how to perform any of the specified activities.', selector: '.how-to-nav', position: 'right', }]); } generalInstructions() { return( <div className="tab-pane active" id="general" role="tabpanel" aria-hidden={this.state.selectedInstruction !== 'general'} aria-labelledby="general-tab"> <h1 id="general">General</h1> <p><strong>Full help resources:</strong></p> <ul> <li><a href='https://www.cdc.gov/sdp/SDPVocabularyServiceSharedServices.html' target='_blank'>Additional external help resources including a full user guide can be found by clicking here!</a></li> </ul> <p><strong>Navigation and Help Basics:</strong></p> <ul> <li>Use the top bar to log-in or navigate to various pages.</li> <li>Clicking the CDC logo in the top left will return you to the landing page at any time.</li> <li>The footer contains useful links to pages with additional information about the site, including the application version. Please reference this version number in any bug reports.</li> <li>On most pages the top right navigation bar gives a &quot;Help&quot; option. Click on this option to view documentation for various actions or see step-by-step walk throughs on some pages. The step by step walkthroughs are also available below in accessible plain text format.</li> </ul> <p><strong>Page Step By Step Instructions:</strong></p> <ul> <li><a href="#dashboard">Dashboard</a></li> <li><a href="#section-edit">Section Edit Page</a></li> <li><a href="#section-details">Section Details Page</a></li> <li><a href="#question-edit">Question Edit Page</a></li> <li><a href="#question-details">Question Details Page</a></li> <li><a href="#response-set-edit">Response Set Edit Page</a></li> <li><a href="#response-set-details">Response Set Details Page</a></li> <li><a href="#survey-edit">Survey Edit Page</a></li> <li><a href="#survey-details">Survey Details Page</a></li> <li><a href="#help-page-link">Help Page</a></li> <li><a href="#code-system-mappings-tables-edit">Code System Mappings Tables on Edit Page</a></li> </ul> <h2 id="step-by-step">Step-by-Step Walkthroughs by Page</h2> <h3 id="dashboard">Dashboard</h3> <ul> <li>Type in your search term and search across all items by default. Results include items you own and public items.</li> <li>Click on any of the type boxes to highlight them and toggle on filtering by that single item type.</li> <li>Click Advanced Link to see additional filters you can apply to your search.</li> <li>If you already have an account you can log in to unlock more features in the top right of the dashboard page.</li> <li>Click on any of the rows in the My Stuff Analytics panel to filter by items you authored.</li> <li>If you belong to a group you may use the dropdown in the right panel to select a group, this will filter all search results limiting to content owned by that group.</li> <li>Click the create menu and then select an item type to author a new item.</li> <li>Click the alerts dropdown to see any new notifications about your content.</li> <li>Click your e-mail to see various account management options.</li> </ul> <h3 id="section-edit">Section Edit Page</h3> <ul> <li>If you need to create a new question without leaving the the section use this button to author a new question from scratch.</li> <li>Type in your search keywords in the top left search bar to search for questions to add to the section.</li> <li>Click Advanced to see additional filters you can apply to your search.</li> <li>Use these search results to find the question you want to add.</li> <li>Click on the add (+) button to select a question for the section.</li> <li>Edit the various section details on the right side of the page. Select save in the top right of the page when done editing to save a private draft of the content (this content will not be public until it is published).</li> </ul> <h3 id="section-details">Section Details Page</h3> <ul> <li>Use the history side bar to switch between revisions of an item if more than one exists</li> <li>See all of the details including linked items on this section of the page. Use the buttons in the top right to do various actions with the content depending on your user permissions. For full details on what an action does please see the 'Create and Edit Content' section of the <a className="tutorial-link" href="#help">Help Documentation (linked here).</a></li> <li>At the bottom of each details page is a section for public comments. People can view and respond to these comments in threads on public content</li> </ul> <h3 id="question-edit">Question Edit Page</h3> <ul> <li>Use the input fields to edit content of the question. If the response type is open choice this panel will also give you the option to associate response sets with this quesiton at creation time</li> <li>Click the search icon to search for and add coded concepts to the question</li> <li>Alternatively, you can manually add a code system mapping - click the plus sign to add additional code system mapping to associate with the question</li> <li>The Concept Name field is what the user will see on the page</li> <li>Optionally, you can enter a code and a code system for the mapping you are adding if it belongs to an external system (such as LOINC or SNOMED)</li> <li>Click save to save a private draft of the edited content</li> </ul> <h3 id="question-details">Question Details Page</h3> <ul> <li>Use the history side bar to switch between revisions of an item if more than one exists</li> <li>See all of the details including linked items on this section of the page. Use the buttons in the top right to do various actions with the content depending on your user permissions. For full details on what an action does please see the "Create and Edit Content" section of the <a className="tutorial-link" href="#help">Help Documentation (linked here).</a></li> <li>At the bottom of each details page is a section for public comments. People can view and respond to these comments in threads on public content</li> </ul> <h3 id="response-set-edit">Response Set Edit Page</h3> <ul> <li>Use the input fields to edit content of the response set</li> <li>Click the search icon to search for and add coded responses to the response set</li> <li>Alternatively, you can manually add a response - click the plus sign to add additional responses to associate with the response set</li> <li>The Display Name field is what the user will see on the page</li> <li>Optionally, you can enter a code and a code system for the response you are adding if it belongs to an external system (such as LOINC or SNOMED)</li> <li>Click save to save a private draft of the edited content (this content will not be public until it is published)</li> </ul> <h3 id="response-set-details">Response Set Details Page</h3> <ul> <li>Use the history side bar to switch between revisions of an item if more than one exists</li> <li>See all of the details including linked items on this section of the page. Use the buttons in the top right to do various actions with the content depending on your user permissions. For full details on what an action does please see the "Create and Edit Content" section of the <a className="tutorial-link" href="#help">Help Documentation (linked here).</a></li> <li>At the bottom of each details page is a section for public comments. People can view and respond to these comments in threads on public content</li> </ul> <h3 id="survey-edit">Survey Edit Page</h3> <ul> <li>Type in your search keywords here to search for sections to add to the survey</li> <li>Click Advanced to see additional filters you can apply to your search</li> <li>Use these search results to find the section you want to add</li> <li>Click on the add button to select a section for the survey</li> <li>Edit the various survey details on the right side of the page. Select save in the top right of the page when done editing to save a private draft of the content (this content will not be public until it is published)</li> </ul> <h3 id="survey-details">Survey Details Page</h3> <ul> <li>Use the history side bar to switch between revisions of an item if more than one exists</li> <li>See all of the details including linked items on this section of the page. Use the buttons in the top right to do various actions with the content depending on your user permissions. For full details on what an action does please see the "Create and Edit Content" section of the <a className="tutorial-link" href="#help">Help Documentation (linked here).</a></li> <li>At the bottom of each details page is a section for public comments. People can view and respond to these comments in threads on public content</li> </ul> <h3 id="help-page-link">Help Page</h3> <ul> <li>Click any item in the left side bar to see instructions on how to perform any of the specified activities</li> </ul> <h3 id="code-system-mappings-tables-edit">Code System Mappings Tables on Edit Pages</h3> <ul> <li>Click the info (i) icon, or go to the Code System Mappings tab in the help documentation to see more information and examples on how to get the most out of code mappings.</li> </ul> </div> ); } accountInstructions() { return( <div className="tab-pane" id="manage-account" role="tabpanel" aria-hidden={this.state.selectedInstruction !== 'manage-account'} aria-labelledby="manage-account-tab"> <h1 id="account-management">Account Management</h1> <p><strong>Options:</strong></p> <ul> <li><a href="#logging-in">Logging In</a></li> <li><a href="#logging-out">Logging Out</a></li> <li><a href="#trouble">Trouble Logging In</a></li> </ul> <h2 className="help-section-subtitle" id="logging-in">Logging In</h2> <p>If you already have an account simply click the log-in link in the blue navigation bar in the top right of the screen. You should then be redirected to Secure Access Management Services (SAMS) to login* with your credentials. If you do not see a log-in button the browser may be logged in from a previous session. In that case see how to log out below.</p> <p id="trouble"><strong>*Trouble logging in:</strong> If you receive an error message after entering your credentials into SAMS, please email [email protected] to request Surveillance Data Platform Vocabulary Service SAMS Activity Group membership.</p> <h2 className="help-section-subtitle" id="logging-out">Logging Out</h2> <p>On any page you should be able to log-out by first clicking the e-mail in the top-right corner of the navigation bar, then selecting log-out from the drop-down menu that will appear. The page should refresh automatically.</p> </div> ); } searchInstructions() { return( <div className="tab-pane" id="search" role="tabpanel" aria-hidden={this.state.selectedInstruction !== 'search'} aria-labelledby="search-tab"> <h1 id="search-functionality">Search Functionality</h1> <p><strong>Features:</strong></p> <ul> <li><a href="#advanced-search">Advanced search</a></li> <li><a href="#basic-search">Basic search</a></li> <li><a href="#filtering-by-type">Filtering by type</a></li> <li><a href="#see-content-you-own">See content you own</a></li> <li><a href="#advanced-filtering">Advanced filtering</a></li> </ul> <h2 className="help-section-subtitle" id="advanced-search">Advanced Search</h2> <p>The application uses a search engine called Elasticsearch. Features of this search engine include filters in the "Advanced" search pop-up, fuzzy matching on queries that are close matches to the search terms, better weighted results, and the curation wizard.</p> <p>If a warning symbol appears next to the "Advanced" search link or you see an error message in the advanced search pop-up, the advanced search engine (Elasticsearch) is down. The advanced features, including filters and fuzzy matching, will not work while the engine is down. Please check back later or contact your system administrator at <a href="mailto:[email protected]">[email protected]</a> if the issue is persistent.</p> <h2 className="help-section-subtitle" id="basic-search">Basic Search</h2> <p>On the dashboard there is a search bar that can be used to find questions, response sets, sections, and surveys. Typing in search terms that might be found in the name, description, author e-mail, and various other relevant fields on the items.</p> <h2 className="help-section-subtitle" id="filtering-by-type">Filtering by Type</h2> <p>You can filter a search by the type of content by clicking on the analytics icons immediately below the search bar on the dashboard page. Clicking on any of those four squares on the top of the page will filter by the type specified in the square and highlight the square. Once a filter is applied you can click on the &#39;clear filter&#39; link that will appear under the icons on the dashboard.</p> <h2 className="help-section-subtitle" id="see-content-you-own">See Content You Own</h2> <p>Similar to searching by type (described above) when you are logged in to an account the dashboard will have a &quot;My Stuff&quot; section displayed on the right side of the dashboard. Clicking on any of the icons or the filter link in that panel will highlight the filter applied in blue and filter any searches down to only return private drafts and public published content that you own.</p> <h2 className="help-section-subtitle" id="see-content-your-groups-own">See Content Your Groups Own</h2> <p>Similar to searching by content you own, when you are logged in to an account that is part of an authoring group, the dashboard will have a &quot;Filter by Group&quot; section displayed on the right side of the dashboard. Selecting any of the group names from the dropdown in that panel will filter any searches down to only return content that is assigned to the specified group.</p> <h2 className="help-section-subtitle" id="advanced-filtering">Advanced Filtering</h2> <p>Under the search bars seen across the app there is an &#39;Advanced&#39; link. If you click that link it will pop up a window with additional filters that you can apply. Any filters you select will limit your searches by the selected filters. The window also has a clear filters buttons that will reset back to the default search.</p> </div> ); } viewInstructions() { return( <div className="tab-pane" id="view" role="tabpanel" aria-hidden={this.state.selectedInstruction !== 'view'} aria-labelledby="view-tab"> <h1 id="content-viewing-and-exporting">Content Viewing and Exporting</h1> <p><strong>Options:</strong></p> <ul> <li><a href="#viewing">View Content</a></li> <li><a href="#exporting">Export Content</a></li> </ul> <h2 className="help-section-subtitle" id="viewing">View Content</h2> <ul> <li>On the dashboard and various other places you will see a little summary box, or widget, displaying important information about the search result.</li> <li>Clicking the bottom link on each widget expands a box with additional information about the item.</li> <li>In most places the full details page can be seen by clicking the name / title link of the item.</li> <li>On the edit pages the name link is disabled but you can click the eyeball icon on any of the widgets to navigate to the details page.</li> </ul> <h2 className="help-section-subtitle" id="exporting">Exporting</h2> <p><strong>Epi Info </strong>(Surveys and Sections)</p> <p>On the view pages for surveys and sections there is an action button that exports the current content to Epi Info (XML). To export a survey or section and use it in Epi Info execute the following steps:</p> <ul> <li>Click on the 'Export' button on the Vocabulary service section details page (this will save a .xml file to the folder your browser directs downloads)</li> <li>Open Epi Info</li> <li>Choose the option to 'Create Forms'</li> <li>From the File menu, select 'Get Template'</li> <li>Select the .xml file you downloaded from the vocabulary service, it will be in the folder your browser downloads content into (usually the 'Downloads' folder). Click 'Open'.</li> <li>From the File menu, select 'New Project from Template'</li> <li>After selecting the template that was created from the vocabulary service .xml file, complete the rest of the fields. Click 'Ok'</li> </ul> <p><strong>REDCap </strong>(Surveys and Sections)</p> <p>On the view pages for surveys and sections there is an action button that exports the current section to REDCap. To export a survey or section and use it in REDCap execute the following steps (exact wording may differ slightly based on your version of REDCap):</p> <ul> <li>Click on the 'Export' button on the Vocabulary service survey or section details page and select 'REDCap (XML)' (this will save a .xml file to the folder your browser directs downloads)</li> <li>Open up REDCap</li> <li>Choose the option to create a new project</li> <li>On the project creation page follow the on screen instructions to add a name and various attributes to the new projects</li> <li>Look for an option titled something similar to "Start project from scratch or begin with a template?" and choose the "Upload a REDCap project XML file" option</li> <li>Click the "Choose File" button to select the .xml file you downloaded from the vocabulary service, it will be in the folder your browser downloads content into (usually the 'Downloads' folder)</li> <li>After selecting the .xml file to import and filling out the rest of the fields, click on the Create Project or Start Project button at the bottom of the page</li> </ul> <p><strong>Spreadsheet </strong> (Surveys only)</p> <p>On the view page for surveys there is an action button that exports the current survey to spreadsheet format (xlsx). To export a survey into this format, execute the following steps:</p> <ul><li>Click on the 'Export' button on the Vocabulary service survey or section details page and select 'Spreadsheet (XLSX)' (this will save a .xlsx file to the folder where your browser directs <b>downloads</b>.)</li></ul> <p><strong>PDF </strong> (Surveys and Sections)</p> <p>On the view page for surveys and sections there is an action button that exports the current content to a PDF file. To export a section or survey into this format, execute the following steps:</p> <ul><li>Click on the 'Export' button on the Vocabulary service survey or section details page and select 'Print' (this will save a .pdf file to the folder your browser directs downloads)</li></ul> </div> ); } workflowInstructions() { return( <div className="tab-pane" id="workflow" role="tabpanel" aria-hidden={this.state.selectedInstruction !== 'workflow'} aria-labelledby="workflow-tab"> <h1 id="content-workflow">Workflow Status and Content Stage</h1> <p>SDP-V has workflow statuses and content stages to support different business processes of users.</p> <p><strong>Topics:</strong></p> <ul> <li><a href="#workflow">Workflow Status</a></li> <li><a href="#stage">Content Stage</a></li> </ul> <h2 className="help-section-subtitle" id="workflow">Workflow Status</h2> <p>SDP-V content can be in either a Private or Public workflow status. Workflow status drives visibility rules in SDP-V. Workflow status is displayed as “Visibility” in the UI to clearly communicate to users who can see which content.</p> <ul> <li> <strong>PRIVATE</strong> – When content is created or imported in SDP-V, it is in Private workflow status. Content in this workflow status has restricted visibility based on ownership and role and can be modified until the author or authoring group is ready to publish it (see Public workflow status below). <ul> <li><strong>Visibility: </strong>Content in private workflow status is only visible to the user who authored it, users that belong to a group that the content is added to, and to all Publishers in the system.</li> <li><strong>Ability to Modify Content: </strong>Only the Author or group members may make changes to the private draft content. The private content can be edited as desired until it is ready to be sent to a Publisher for review. SDP-V tracks changes to private draft content on the Change History tab.</li> <li><strong>Content Stages: </strong>Users can use the “draft”, “comment only”, or “trial use” content stages. The “draft” content stage is the default stage; “trial use” and “comment only” are optional content stages for this workflow status. To support multiple business cases, the user may place content in private workflow status into these 3 content stages bi-directionally in any order (e.g., draft, comment only, trial use, comment only) or may only use the "draft" content stage.</li> </ul> </li> <li> <strong>PUBLIC</strong> – Whenever an author or authoring group is ready to share their content publicly, an author must send a request to their program Publisher to change the workflow status in SDP-V. Content must be reviewed and approved by a Publisher in SDP-V to change the workflow status to Public; this action is known as “publishing” is SDP-V. <ul> <li><strong>Visibility: </strong>Public content is visible to everyone who visits the SDP-V website including users without authenticated accounts (publicly available). This allows for authors to share their SDP-V content with a wide public health audience. Once a version is public, it cannot be set back to private. An author can use the content stage attribute to indicate which public version is ready for use versus other stages of maturity (see definitions below).</li> <li><strong>Ability to Modify Content: </strong>Only the Author or group members of public content may choose to revise it. Revising public content results in a new version of the content in private status that can be modified as described above until it is ready to be published publicly. SDP-V maintains a version history for public content so that users can see how content has evolved over time.</li> <li><strong>Content Stages: </strong>Users can use the “published”, “comment only”, or “trial use” content stages. The “published” content stage is the default stage; “trial use” and “comment only” are optional content stages for this workflow status. To support multiple business cases, the user may place content in the public workflow status into these 3 content stages in any order (e.g., comment only, trial use, comment only, published) or may only use the "published" content stage.</li> </ul> </li> </ul> <p><strong>Note:</strong>Content in the public workflow status indicates that a program was ready to share content publicly to promote transparency, harmonization, standardization, and the goals of SDP-V and may not be authoritative. Users interested in using public content are encouraged to reach out to the appropriate program or system with any questions about content and consider the indicated content stage.</p> <h2 className="help-section-subtitle" id="stage">Content Stage</h2> <p>An attribute of the content being presented that represents content maturity. Response sets, questions, sections, and surveys added to SDP-V do not need to advance through each content stage described below before sharing their content publicly (publishing content as described above). The content stage attribute offers users flexibility to accurately communicate the maturity of their content at different stages of the vocabulary life cycle with other users.</p> <ul> <li> <strong>DRAFT</strong> – Content that is being worked on by its Authors and Publisher. It is generally not considered to be “complete” and unlikely ready for comment. Content at this Level should not be used. This is the initial status assigned to newly created content. <ul><li>This content stage can be used for content is that is in private workflow status.</li></ul> </li> <li> <strong>COMMENT ONLY</strong> – Content that is being worked on by its Authors and Publisher. It is generally not considered to be “complete” but is ready for viewing and comment. Content at this Level should not be used. <ul><li>This content stage can be used for content is that is in either private and public workflow status.</li></ul> </li> <li> <strong>TRIAL USE</strong> – Content that the Authors and Publisher believe is ready for User viewing, testing and/or comment. It is generally “complete”, but not final. Content at this Level should not be used to support public health response. <ul><li>This content stage can be used for content that is in either private and public workflow status.</li></ul> </li> <li> <strong>PUBLISHED</strong> – The most recent version of content. It is ready for viewing, downloading, comments, use for public health response. <ul><li>This content stage can be used for content that is in public workflow status.</li></ul> </li> <li> <strong>RETIRED</strong> – Content that is no longer the most recent version (not latest). However, this content could be used with no known risk. <ul><li>This content stage can be used for content that is in public workflow status. Only publishers can move content to this content stage. Authors who would like to retire content should contact their program publisher. Content that is "retired" is hidden from dashboard search results by default unless an advanced filter is toggled to show retired content.</li></ul> </li> <li> <strong>DUPLICATE</strong> – Content that the Author and Publisher believe is a duplicate of other content in the SDP-V repository. Content marked as “Duplicate” should not be used when creating new SDP-V surveys. If content marked as “Duplicate” is used on an existing SDP-V survey, it should be replaced during the next revision. <ul><li>This content stage is assigned whenever users identify duplicate content using the curation wizard. This content stage cannot be assigned by users outside of the curation wizard.</li></ul> </li> </ul> </div> ); } editInstructions() { return( <div className="tab-pane" id="create-and-edit" role="tabpanel" aria-hidden={this.state.selectedInstruction !== 'create-and-edit'} aria-labelledby="create-and-edit-tab"> <h1 id="content-creation-and-editing">Content Creation and Editing</h1> <p><strong>Options:</strong></p> <ul> <li><a href="#create-new-content">Create New Content</a></li> <li><a href="#edit-content">Edit Content</a></li> <li><a href="#revise-content">Revise Content</a></li> <li><a href="#extend-content">Extend Content</a></li> </ul> <h2 className="help-section-subtitle" id="create-new-content">Create New Content</h2> <ul> <li>To start a new private draft of any item click on the &quot;Create&quot; drop down in the top navigation bar on the dashboard.</li> <li>On the creation / editing page change any fields that need to be updated and press save - this saves a private draft of the first version of the new item that will need to get published by a publisher before it will be publicly visible to others.</li> <li>If you try to navigate away before saving the changes a prompt will ask if you want to navigate away without saving or save before you leave.</li> </ul> <h2 className="help-section-subtitle" id="edit-content">Edit Content</h2> <p><strong>Note:</strong> You can only edit your own private content, or content that belongs to a group where you are a member - once your content is made public you will be given the option to create a new revision or extension (a copy with a separate version history) of the content.</p> <ul> <li>When looking at the search result for the item you want to edit click on the menu button in the bottom right and select edit.</li> <li>When on the details page of an item the edit or revise button should appear in the top right above the item information.</li> <li>On the edit page change any fields that need to be updated and press save.</li> </ul> <h2 className="help-section-subtitle" id="revise-content">Revise Content</h2> <p><strong>Note:</strong> You can only revise your own public content, or public content that belongs to a group where you are a member. Saving a revision will save a private draft of that revision until you publish the new version.</p> <ul> <li>When looking at the search result for the item you want to revise click on the menu button in the bottom right and select revise</li> <li>When on the details page of an item the edit or revise button should appear in the top right above the item information</li> <li>On the revision editing page change any fields that need to be updated and press save - this saves a private draft of the new version that will need to get published by a publisher before it will be publicly visible to others.</li> </ul> <h2 className="help-section-subtitle" id="extend-content">Extend Content</h2> <p><strong>Note:</strong> You can only extend public content. Unlike revising, you do not need to own or be part of a group that owns content in order to create an extension (use it as a template with its own version history). Saving an extension will save a private draft that is the first version (new revision history) with a link to the content it was extended from (shown as the parent of the item).</p> <ul> <li>When looking at the search result for the item you want to extend click on the menu button in the bottom right and select extend</li> <li>When on the details page of a public item the extend button should appear in the top right above the item information</li> <li>On the extension editing page change any fields that need to be updated and press save - this saves a private draft of the first version of the extended item that will need to get published by a publisher before it will be publicly visible to others.</li> </ul> </div> ); } curationInstructions() { return ( <div className="tab-pane" id="curation" role="tabpanel" aria-hidden={this.state.selectedInstruction !== 'curation'} aria-labelledby="curation-tab"> <h1 id="curation-wizard">Curation Wizard</h1> <p>Description: The curation wizard shows the user questions and response sets in the SDP-V repository that are similar to content on user’s survey. This feature automates the identification of similar questions and response sets created by other programs to maximize harmonization opportunities within SDP-V before private content is published or during the revision of a public SDP-V survey. The user may select an existing question or response set from the SDP-V repository to replace private draft content on their survey or link public content on their survey to another question or response in the service to indicate to other users what content in the repository is the preferred replacement.</p> <p>Value: These replacements and linkages will help curate and reduce redundancy while promoting reuse. Use of this feature will also enable proper population of system usage statistics in SDP-V to show use of content across CDC programs and systems (e.g., different users must link to the same question in the repository for usage across sections, surveys, programs, and surveillance systems to be transparent in the service). This feature will also help to prevent duplicate questions and response sets from cluttering the repository so that content is easier to search, browse, and use.</p> <p><strong>How to Find Similar Questions and Response Sets in SDP-V (Surveys)</strong></p> <p>The Curation Wizard feature will be available on the Survey Details page if the algorithm detects similar questions and/or response sets from your survey in the SDP-V repository.</p> <p>To start the curation wizard, execute the following steps:</p> <ul> <li> Click on the 'Curate' button on the Survey details page (the number in parentheses indicates the total questions and/or response sets on the survey with similar content in SDP-V detected) <ul> <li> If no similar questions and/or response sets are detected on the survey, then the “Curate” button will not appear to the user. </li> </ul> </li> <li> The Curate Survey Content Page contains two tabs. <ul> <li> The ‘Questions’ tab is the default view and lists all questions on the survey with potential duplicates in the repository (the number in parentheses indicates the total questions on the survey with similar content detected in SDP-V). </li> <li> The ‘Response Sets’ tab lists all response sets on the survey with potential duplicates in the repository (the number in parentheses indicates the total response sets on the survey with similar content detected in SDP-V). </li> </ul> </li> <li> Select ‘View’ to see similar questions or response sets in the SDP-V repository with significant overlap in various fields (at least 75%). <ul> <li>Click on the Section Name hyperlink to view the section details where the potential duplicate questions were identified on the user’s survey</li> </ul> </li> <li> Scroll through ‘Potential Duplicate Questions’ or ‘Potential Duplicate Response Sets’ by using the left and right arrows on the right-side of the screen <ul> <li>Click on the Section Name hyperlink to view the section details where the potential duplicate questions were identified on the user’s survey</li> </ul> </li> <li> Click on the Question Name hyperlink to view the question details of the suggested replacement questions that were identified by the matching algorithm <ul> <li>If the potential duplicate Question or Response Set visibility is “private”: Select ‘Replace’ to mark the private draft question or response set on the user’s survey as a duplicate and replace it with the selected question or response set. A prompt will appear for confirmation of the replacement along with details of the change that states the current question or response set will be replaced everywhere it is used in the vocabulary service and be deleted. This action cannot be undone.</li> <li>If the duplicate Question or Response Set visibility is “public”: A “Link” button appears instead of “Replace”. Selecting “Link” will mark the question or response set as “Duplicate” and move the question or response set to the “Duplicate” content stage. The potential duplicate question or response set details page will provide a link to the question or response set that the author selected (by clicking “Link to”). This action allows authors to indicate which item is a preferred replacement to promote harmonization and reduce redundancy.</li> </ul> </li> </ul> <h2>Curation Wizard ‘Replace’ Function</h2> <p>Whenever a user chooses to replace a private question or response set on their survey with an existing question or response set in SDP-V, only some fields are updated. This is to prevent the user from losing information that has already been entered.</p> <p><strong>Questions</strong></p> <p>Whenever a user replaces a duplicate question on their private survey with a suggested replacement question, the replacement question is linked to the private survey. The following list shows which fields will change:</p> <ul> <li>Question Name</li> <li>Question Description</li> <li>Response Type</li> <li>Question Category</li> <li>Question Subcategory</li> <li>Code Mappings</li> </ul> <p>The following fields and relationships will not change:</p> <ul> <li>Response Set (if choice question)</li> <li>Program Defined Variable Name</li> </ul> <p><strong>Note: </strong>Since there are many valid question and response set pairs, questions and response sets are assessed independently using the curation wizard. For instance, a program can harmonize a question (like ‘How old are you?’) with another program while choosing to use a different valid response set than that same program (like 5-year age categories compared to 10-year age categories).</p> <p><strong>Response Sets</strong></p> <p>Whenever a user replaces a duplicate response set on their private survey with a suggested replacement response set, the replacement response set is linked to the private survey. The following list shows which fields will change:</p> <ul> <li>Response Set Name</li> <li>Response Set Description</li> <li>Responses</li> </ul> <p><strong>Curation Wizard Match Score Algorithm</strong></p> <p>The match score algorithm identifies questions and response sets in the SDP-V repository that are like content on a user’s survey based on a match of at least 75% overlap in the fields.</p> <p>The match score algorithm compares the following fields to find similar questions:</p> <ul> <li>Question Name</li> <li>Question Description</li> <li>Question Category and Subcategory</li> <li>Code Mappings and Code System</li> </ul> <p>The match score algorithm compares the following fields to find similar response sets:</p> <ul> <li>Response Set Name</li> <li>Response Description</li> <li>Responses and Response Code Systems</li> </ul> </div> ); } importInstructions() { return( <div className="tab-pane" id="import" role="tabpanel" aria-hidden={this.state.selectedInstruction !== 'import'} aria-labelledby="import-tab"> <h1 id="import-content">Importing Content</h1> <br/> <ul> <li><a href="#message-mapping-guide">Importing Message Mapping Guide (MMG) Data Elements and Value Sets</a> <ol> <li><a href="#message-mapping-guide-import-MMG">How to Import MMG Content Through SDP-V User Interface</a></li> <li><a href="#message-mapping-import-requirements">MMG Spreadsheet Import Template Content and Formatting Requirements</a></li> <li><a href="#MMG-content-organization">Content Organization: How to Identify Sections, Templates, or Repeating Groups within the MMG Spreadsheet Import Template</a></li> </ol> </li> <li><a href="#generic-spreadsheet-guide">Importing Questions and Response Sets Using SDP-V Generic Import Template</a> <ol> <li><a href="#generic-spreadsheet-import">How to Import Content using the Generic Import Template through the SDP-V User Interface</a></li> <li><a href="#generic-content-organization">Content Organization: How to Identify Sections, Templates, or Repeating Groups within the Generic Spreadsheet Import Template</a></li> <li><a href="#generic-associate-rs">How to Associate Response Sets with Choice Questions on Import</a></li> <li><a href="#generic-local-rs">How to Create User-defined (“Local”) Response Sets Using the SDP-V Import Template</a></li> <li><a href="#generic-add-code-system-mappings">How to Add Multiple Code System Mappings to Content Using the SDP-V Import Template</a></li> </ol> </li> </ul> <h3><p id="message-mapping-guide">Importing Message Mapping Guide (MMG) Data Elements and Value Sets</p></h3> <p>This feature is to support the bulk import of vocabulary content from Nationally Notifiable Disease Message Mapping Guides (MMGs).</p> <h4><strong><p id="message-mapping-guide-import-MMG">How to Import MMG Content Through SDP-V User Interface</p></strong></h4> <p>On the taskbar, there is an action button to create content. To create a SDP-V survey using content from a Message Mapping Guide (MMG) formatted spreadsheet, execute the following steps:</p> <ul> <li>Click on the 'Create' button on the Vocabulary service taskbar and select 'Import Spreadsheet'</li> <li>Select the MMG formatted file you wish to import by clicking 'Choose File' </li> <li>Select ‘MMG Import’ as the format of the file you wish to import </li> </ul> <br/> <h4><p id="message-mapping-import-requirements"><strong>MMG Spreadsheet Import Template Content and Formatting Requirements</strong></p></h4> <p>The following table shows the expected MMG Column Names and how they map to Vocabulary Service. <strong>Each column is necessary for import, even if left blank. Each column should be spelled exactly as appears in quotes in the table below.</strong> </p> <br/> <table className="set-table table"> <caption><strong>Table 1. MMG Import: Required Spreadsheet Column Names and Associated Vocabulary Service Item on Import</strong></caption> <thead> <tr> <th id="mmg-display-name-column">MMG Import Column Name</th> <th id="vocab-service-item-column">Vocabulary Service Item</th> </tr> </thead> <tbody> <tr> <td headers="mmg-display-name-column">'Data Element (DE) Name'</td> <td headers="vocab-service-item-column">Question Name and ‘Concept Name Column’ in Code System Mappings Table on Question Details</td> </tr> <tr> <td headers="mmg-display-name-column">'DE Identifier Sent in HL7 Message'</td> <td headers="vocab-service-item-column">Concept Identifier’ Column in Code System Mappings Tableon Question Details Page*</td> </tr> <tr> <td headers="mmg-display-name-column">'Data Element Description'</td> <td headers="vocab-service-item-column">Question Description</td> </tr> <tr> <td headers="mmg-display-name-column">'DE Code System'</td> <td headers="vocab-service-item-column">‘Code System Identifier’ Column in Code System Mappings Table on Question Details Page *</td> </tr> <tr> <td headers="mmg-display-name-column">'Value Set Name (VADS Hyperlink)'</td> <td headers="vocab-service-item-column"><p>Response Set </p>Note: A data element will be associated with a PHIN VADS value set in SDP-V if a valid PHIN VADS hyperlink is provided in the same row of the SDP-V MMG import spreadsheet. The hyperlink provided in the cell must be in the following format to be recognized by the SDP-V MMG Importer: https://phinvads.cdc.gov/vads/ViewValueSet.action?oid=2.16.840.1.114222.4.11.819. The PHIN VADS URL must end in “oid=identifier” in order to be accurately parsed by the importer. Embedded hyperlinks such as ‘Yes No Indicator (HL7)’ will not be recognized by the importer; this will result in the question not being linked to the appropriate PHIN VADS value set in SDP-V. <br/> If a valid PHIN VADS hyperlink is not provided, the SDP-V MMG importer will look for a tab with the same name as the value in this cell. The value set tab is expected to contain the value set values organized into the following column headers: ‘Concept Code’, ‘Concept Name’, ‘Code System OID’, ‘Code System Name’, and ‘Code System Version’. If a tab with the same name is not found, an error message will be displayed. </td> </tr> <tr> <td headers="mmg-display-name-column">'PHIN Variable Code System' OR 'Local Variable Code System'</td> <td headers="vocab-service-item-column">Program Defined Variable Name associated with a question</td> </tr> <tr> <td headers="mmg-display-name-column">'Data Type'</td> <td headers="vocab-service-item-column">Question Response Type</td> </tr> </tbody> </table><br/> <ul> <li>The content in each tab in the spreadsheet that contains all required columns will be imported and tagged with the 'Tab Name'.</li> <li>If there are multiple spreadsheets that contain all required columns, they will be imported as separate sections on the same SDP-V survey.</li> <li>The user importing content into SDP-V using this template will be assigned as the author of the survey. This SDP-V survey can then be added to a collaborative authoring group in the service to provide access to additional authors. </li> <li>Content will be imported into SDP-V in ‘Private’ workflow status and “Draft” content stage.</li> </ul> <br/> <p><strong>NOTE:</strong> If a required column from the table is missing, the user will receive an error message and the content will not be imported.</p> <br/> <h4 id="MMG-content-organization"><p><strong>Content Organization: How to Identify Sections, Templates, or Repeating Groups within the MMG Spreadsheet Import Template</strong></p></h4> <p> Sections, templates, or repeating groups are created by listing data elements between 'START: insert section name' and 'END: insert section name' rows; the ‘START’ and ‘END’ markers must be in the ‘PHIN Variable’ column. Each row between these markers are imported as data elements within that grouping (called sections in the vocabulary service). Sub-sections or sub-groupings may be created by including additional 'START: ' and 'END: ' markers within a parent section or grouping. </p> <ul> <li>The beginning of a section is indicated by the prefix 'START: ' (including a space after the colon) in the 'PHIN Variable' column</li> <li>The end of a section is indicated by the prefix 'END: '(including a space after the colon) in the 'PHIN Variable' column</li> <li> The text following the 'START: ' and 'END: ' pre-fixes will be imported as the Section Name in the vocabulary service <ul> <li>Example: Data element information in rows between START: Laboratory and END: Laboratory markers will be imported into SDP-V as a group of questions and associated response sets into a Section called “Laboratory”.</li> </ul> </li> <li>The section name following the 'START: ' prefix must exactly match the section name following the 'END: ' prefix in order for the section to be correctly imported. </li> <li>Notes should not be included in the same row as the section name (e.g., after the ‘START:’ or ‘END:’ pre-fixes’)</li> <li>Text following a ‘NOTE:’ pre-fix will not be imported. </li> </ul> <br/> <br/> <h3><p id="generic-spreadsheet-guide">Importing Questions and Response Sets Using SDP-V Generic Import Template</p></h3> <br/> <p>The purpose of this feature is to support the creation of SDP-V surveys by importing large amounts of questions and response sets from existing data dictionaries, surveys, and other formats into the SDP Vocabulary Service (SDP-V) using a spreadsheet template.</p> <br/> <h4><p id="generic-spreadsheet-import"><strong>i. How to Import Content Using the Generic Import Template through the SDP-V User Interface</strong></p></h4> <p>On the taskbar, there is an action button to create content. To create a SDP-V survey using content from the generic SDP-V template formatted spreadsheet, execute the following steps:</p> <ol> <li>Click on the 'Create' button on the Vocabulary service taskbar and select 'Import Spreadsheet'</li> <li>Select the SDP-V template formatted file you wish to import by clicking 'Choose File'</li> <li>Select 'Generic Import' as the format of the file you wish to import</li> </ol> <p>The following tables lists the Generic Import Column Names and the import priority. <strong>Each required column is necessary for import, even if left blank. Each column should be spelled exactly as appears in quotes in the table below.</strong> The generic import column names map directly to the Vocabulary Service items (e.g., 'Question Description' in Generic SDP-V template spreadsheet imported as 'Question Description' in SDP-V). </p> <table className="set-table table"> <caption><strong>Table 2A. SDP-V Generic Import: Spreadsheet Column Names, Priority and Description - Survey Metadata Tab </strong></caption> <thead> <tr> <th id="generic-display-name-column">'Survey Metadata' Tab Column Headers</th> <th id="generic-display-priority">Priority</th> <th id="generic-display-desc">Description</th> </tr> </thead> <tbody> <tr> <td headers="generic-display-name-column">'Survey Name (R)'</td> <td headers="generic-display-priority">Required</td> <td headers="generic-display-desc">The information contained in this column on the 'Survey Metadata' tab is imported as the Survey name</td> </tr> <tr> <td headers="generic-display-name-column">'Survey Description (O)'</td> <td headers="generic-display-priority">Optional</td> <td headers="generic-display-desc">The information contained in this column on the ‘Survey Metadata’ tab is imported as the Survey description. This information can alternatively be added through the SDP-V user interface after import.</td> </tr> <tr> <td headers="generic-display-name-column">‘Survey Keyword Tags (O)’</td> <td headers="generic-display-priority">Optional</td> <td headers="generic-display-desc">Tags are text strings that are either keywords or short phrases created by users to facilitate content discovery, organization, and reuse. For instance, a survey called “Traumatic brain injury” may be tagged with “Concussion” to help other users find that survey who may not think of searching for the term “traumatic brain injury”. Multiple keyword tags can be separated with semicolon. </td> </tr> <tr> <td headers="generic-display-name-column">‘Concept Name (C)’</td> <td headers="generic-display-priority">Conditional</td> <td headers="generic-display-desc">Term from a controlled vocabulary to designate a unit of meaning or idea (e.g., ‘Genus Salmonella (organism)’). A controlled vocabulary includes external code systems, such as LOINC or SNOMED-CT, or internally developed vocabularies such as PHIN VADS. For each row that has data entered in this column, the following additional columns are required: Concept Identifier (C) and Code System Identifier (C). </td> </tr> <tr> <td headers="generic-display-name-column">‘Concept Identifier (C)’</td> <td headers="generic-display-priority">Conditional</td> <td headers="generic-display-desc">This is text or a code used to uniquely identify a concept in a controlled vocabulary (e.g., 27268008). Note that if you have selected a code system mapping that has already been used in SDP-V or is selected from the results from "Search for external coded items", this field will be automatically populated. For each row that has data entered in this column, the following additional columns are required: Concept Name (C) and Code System Identifier (C).</td> </tr> <tr> <td headers="generic-display-name-column">‘Code System Identifier (C)’</td> <td headers="generic-display-priority">Conditional</td> <td headers="generic-display-desc">This is the unique designator for a code system also referred to as a controlled vocabulary, in which concepts and value sets are defined (e.g. 2.16.840.1.113883.6.96). LOINC, SNOMED-CT, and RxNorm are code systems. Note that if you have mapped a code system to a question or response set that has already been mapped in SDP-V or returned from an external code system search, the code system identifier field will be automatically populated. For each row that has data entered in this column, the following additional columns are required: Concept Name (C) and Concept Identifier (C).</td> </tr> <tr> <td headers="generic-display-name-column">‘Code System Mappings Table (O)’</td> <td headers="generic-display-priority">Optional</td> <td headers="generic-display-desc">ONLY use when associating MORE THAN ONE code system mapping per item (e.g., survey, section, or question). A user can create multiple Code System Mappings for a single items (survey, section, question) by creating Code System Mappings tables on separate tabs within the SDP-V generic import spreadsheet. After import, the SDP-V item details page will be populated with values from a code system mappings table where the value in this cell matches the name of a tab in the import spreadsheet with the naming convention "CSM #", where # is a number assigned by the user to identify the mappings table in this template (e.g., CSM 1, CSM 2, CSM 3...). The CSM tab must contain the following headers (described above): Concept Name (R), Concept Identifier (R), and Code System Identifier (R). </td> </tr> </tbody> </table> <table className="set-table table"> <caption><strong>Table 2B. SDP-V Generic Import: Spreadsheet Column Names, Priority and Description - Section Metadata Tab </strong></caption> <thead> <tr> <th id="generic-display-name-column-b">'Section Metadata' Tab Column Headers</th> <th id="generic-display-priority-b">Priority</th> <th id="generic-display-desc-b">Description</th> </tr> </thead> <tbody> <tr> <td headers="generic-display-name-column-b">'Section Name (R)'</td> <td headers="generic-display-priority-b">Required</td> <td headers="generic-display-desc-b">The information contained in this column on the 'Section Metadata' tab is imported as the Section name</td> </tr> <tr> <td headers="generic-display-name-column-b">'Section Description (O)'</td> <td headers="generic-display-priority-b">Optional</td> <td headers="generic-display-desc-b">The information contained in this column on the ‘Section Metadata’ tab is imported as the Section description. This information can alternatively be added through the SDP-V user interface after import.</td> </tr> <tr> <td headers="generic-display-name-column-b">‘Section Keyword Tags’ (O)</td> <td headers="generic-display-priority-b">Optional</td> <td headers="generic-display-desc-b">Tags are text strings that are either keywords or short phrases created by users to facilitate content discovery, organization, and reuse. For instance, a section called “Prescription Drug Misuse and Abuse” may be tagged with “Opioid” to help other users find that section who may not think of searching for the term “prescription drug”. Multiple keyword tags can be separated with semicolon. </td> </tr> <tr> <td headers="generic-display-name-column-b-b">'Concept Name (C)'</td> <td headers="generic-display-priority-b">Conditional</td> <td headers="generic-display-desc-b">Term from a controlled vocabulary to designate a unit of meaning or idea (e.g., ‘Genus Salmonella (organism)’). A controlled vocabulary includes external code systems, such as LOINC or SNOMED-CT, or internally developed vocabularies such as PHIN VADS. For each row that has data entered in this column, the following additional columns are required: Concept Identifier (C) and Code System Identifier (C). </td> </tr> <tr> <td headers="generic-display-name-column-b">'Concept Identifier (C)'</td> <td headers="generic-display-priority-b">Conditional</td> <td headers="generic-display-desc-b">This is text or a code used to uniquely identify a concept in a controlled vocabulary (e.g., 27268008). Note that if you have selected a code system mapping that has already been used in SDP-V or is selected from the results from "Search for external coded items", this field will be automatically populated. For each row that has data entered in this column, the following additional columns are required: Concept Name (C) and Code System Identifier (C).</td> </tr> <tr> <td headers="generic-display-name-column-b">'Code System Identifier (C)'</td> <td headers="generic-display-priority-b">Conditional</td> <td headers="generic-display-desc-b">This is the unique designator for a code system also referred to as a controlled vocabulary, in which concepts and value sets are defined (e.g. 2.16.840.1.113883.6.96). LOINC, SNOMED-CT, and RxNorm are code systems. Note that if you have mapped a code system to a question or response set that has already been mapped in SDP-V or returned from an external code system search, the code system identifier field will be automatically populated. For each row that has data entered in this column, the following additional columns are required: Concept Name (C) and Concept Identifier (C).</td> </tr> <tr> <td headers="generic-display-name-column-b">'Code System Mappings Table (O)'</td> <td headers="generic-display-priority-b">Optional</td> <td headers="generic-display-desc-b">ONLY use when associating MORE THAN ONE code system mapping per item (e.g., survey, section, or question). A user can create multiple Code System Mappings for a single items (survey, section, question) by creating Code System Mappings tables on separate tabs within the SDP-V generic import spreadsheet. After import, the SDP-V item details page will be populated with values from a code system mappings table where the value in this cell matches the name of a tab in the import spreadsheet with the naming convention "CSM #", where # is a number assigned by the user to identify the mappings table in this template (e.g., CSM 1, CSM 2, CSM 3...). The CSM tab must contain the following headers (described above): Concept Name (R), Concept Identifier (R), and Code System Identifier (R). </td> </tr> </tbody> </table> <table className="set-table table"> <caption><strong>Table 2C. SDP-V Generic Import: Spreadsheet Column Names, Priority and Description - Survey Questions Tab </strong></caption> <thead> <tr> <th id="generic-display-name-column-c">'Survey Questions' Tab Column Headers</th> <th id="generic-display-priority-c">Priority</th> <th id="generic-display-desc-c">Description</th> </tr> </thead> <tbody> <tr> <td headers="generic-display-name-column-c">'Question Text (R)'</td> <td headers="generic-display-priority-c">Required</td> <td headers="generic-display-desc-c">Each row between Section ‘START:’ and ‘END’ markers will be imported as questions within that section. Questions must be associated with a section in SDP-V.</td> </tr> <tr> <td headers="generic-display-name-column-c">'Question Description (R)'</td> <td headers="generic-display-priority-c">Required</td> <td headers="generic-display-desc-c">The information contained in this column is imported as the question description.</td> </tr> <tr> <td headers="generic-display-name-column-c">'Question Response Type (R)'</td> <td headers="generic-display-priority-c">Required</td> <td headers="generic-display-desc-c">The information contained in this column is imported as the question response type. <ul> <li>The allowed response types are: Attachment, Boolean, Choice, Date, Date Time, Decimal, Instant, Integer, Open Choice, Quantity, Reference, String, Text, Time, or URL</li> <li>The 14 allowed response types are defined at https://www.hl7.org/fhir/valueset-item-type.html </li> </ul> </td> </tr> <tr> <td headers="generic-display-name-column-c">‘Other Allowed? (O)’</td> <td headers="generic-display-priority-c">Optional</td> <td headers="generic-display-desc-c">This attribute can only be used for Choice type questions and allows users to indicated if “Other” is an allowed response option in addition to the values specified in a defined response set. For choice type questions, allowed values in the import template are "Yes" or "No". If this cell is left blank or “No” is specified, then the “Other allowed?” attribute will be null. If this cell in the import spreadsheet includes the value “Yes”, the “Other allowed?” attribute will be checked on import for the indicated question.</td> </tr> <tr> <td headers="generic-display-name-column-c">'Response Set Name (I)'</td> <td headers="generic-display-priority-c">Informational</td> <td headers="generic-display-desc-c">This column is to help the user of the template catalog the local response set tables that are being created in the Response Set tabs. The information in this column is for workflow purposes only and will not be imported. The Response Set Name will be assigned to local response sets based on values in the response set tables in each response set tab.</td> </tr> <tr> <td headers="generic-display-name-column-c">'Local Response Set Table (C)'</td> <td headers="generic-display-priority-c">Conditional</td> <td headers="generic-display-desc-c">The information contained in this column allows a user to specify a PHIN VADS value set to associate with a question or to create a new response set in SDP-V to be associated with the question on import (referred to as a local response set) if one does not already exist in the repository.<br/> <strong>Associate a question with an existing PHIN VADS value set:</strong> <ul> <li>Enter the PHIN VADS URL in the cell.</li> <li>If you provide a PHIN VADS URL, the value set information will be parsed from PHIN VADS and linked to the appropriate question in SDP-V upon import. The PHIN VADS URL must contain “oid= identifier” in order to be accurately parsed by the importer. </li> <ul> <li>An example of a valid PHIN VADS URL is: https://phinvads.cdc.gov/vads/ViewValueSet.action?oid=2.16.840.1.114222.4.11.7552</li> </ul> <li>Alternatively, PHIN VADS value sets can be found by searching SDP-V and linking them with the question through the user interface after the SDP-V survey has been created on import.</li> <li>If this column is left blank, the content owner will be able to add response set information to questions through the SDP-V user interface after import.</li> </ul> <br/> <strong>Create and associate a local response set on import:</strong> <ul> <li>A local response set will be created on import and associated with the question in the same row where the value in this cell matches the name of a tab in the spreadsheet with the naming convention 'RS ID#', where ID# is a number assigned by the user to identify the response set in this template (e.g., RS 1, RS 2, RS 3...) <ul><li>The RS ID# tab will contain the response set table that will be imported as the response set</li></ul> </li> </ul> Note: A user may create as many local response sets as needed, but it is best practice to check SDP-V for existing response sets before doing so to prevent creating duplicate response sets in SDP-V. </td> </tr> <tr> <td headers="generic-display-name-column-c">'Question Category (O)'</td> <td headers="generic-display-priority-c">Optional</td> <td headers="generic-display-desc-c">The information contained in this column is imported as the Question Category. <ul><li>The following are allowed values: Screening, Clinical, Demographics, Treatment, Laboratory, Epidemiological, Vaccine, or Public Health Emergency Preparedness & Response</li></ul> Note: This information is optional, but it is best practice to complete it since it will help other users find related content within SDP-V.</td> </tr> <tr> <td headers="generic-display-name-column-c">'Question Subcategory (O)'</td> <td headers="generic-display-priority-c">Optional</td> <td headers="generic-display-desc-c">The information contained in this column is imported as the Question Subcategory. <ul> <li>The Question Subcategory field is only valid if the Question Category is either "Epidemiological" or "Emergency Preparedness". <ul> <li>The following are allowed values for "Epidemiological" category: Travel, Contact or Exposure, Drug Abuse, or Sexual Behavior. </li> <li>The following are allowed values for "Emergency Preparedness" category: Managing & Commanding, Operations, Planning/Intelligence, Logistics, and Financial/Administration.</li> </ul> </li> </ul> Note: This information is optional, but it is best practice to complete since it will help other users find related content within SDP-V. </td> </tr> <tr> <td headers="generic-display-name-column-c">'Question Data Collection Method (O)'</td> <td headers="generic-display-priority-c">Optional</td> <td headers="generic-display-desc-c">The purpose of this attribute is to help other authors quickly find questions that were used to collect data from a source in a similar manner (e.g., phone interview vs paper-based survey vs electronic data exchange). The Data Collection Method attribute should represent the manner in which the question is used to collect data in a real-world setting. This is not necessarily the same as how CDC is receiving the data. For instance, a question on a survey may be worded to collect information from respondents over the phone, but respondent information may be sent to CDC in an electronic file; in this case, “Facilitated by Interviewer (Phone)” should be selected as the Data Collection Method rather than “electronic (machine to machine). The allowed values for this attribute are: Electronic (e.g., machine to machine), Record review, Self-administered (Web or Mobile), Self-Administered (Paper), Facilitated by Interviewer (Phone) and Facilitated by Interviewer (In-Person). In the import spreadsheet, one value can be specified. After import, the user can select multiple values in the UI. </td> </tr> <tr> <td headers="generic-display-name-column-c">'Question Content Stage (O)'</td> <td headers="generic-display-priority-c">Optional</td> <td headers="generic-display-desc-c"> An attribute of the content being presented that represents content maturity. The content stage attribute offers users flexibility to accurately communicate the maturity of their content at different stages of the vocabulary life cycle with other users. If this field is left blank, the question will be imported in the “draft” content stage. Users may also select “comment only” or “trial use. Content stages are defined as follows: <br/><strong>DRAFT</strong> – Content that is being worked on by its Authors and Publisher. It is generally not considered to be “complete” and unlikely ready for comment. Content at this Level should not be used. <br/><strong>COMMENT ONLY</strong> – Content that is being worked on by its Authors and Publisher. It is generally not considered to be “complete” but is ready for viewing and comment. Content at this Level should not be used. <br/><strong>TRIAL USE</strong> – Content that the Authors and Publisher believe is ready for User viewing, testing and/or comment. It is generally “complete”, but not final. Content at this Level should not be used to support public health response. </td> </tr> <tr> <td headers="generic-display-name-column-c">'Question Keyword Tags (O)'</td> <td headers="generic-display-priority-c">Optional</td> <td headers="generic-display-desc-c">Tags are text strings that are either keywords or short phrases created by users to facilitate content discovery, organization, and reuse. For instance, a question about “Prescription Drug Misuse and Abuse” may be tagged with “Opioid” to help other users find that question who may not think of searching for the term “prescription drug”. Multiple keyword tags can be separated with semicolon. </td> </tr> <tr> <td headers="generic-display-name-column-c">'Program Defined Variable Name (O)'</td> <td headers="generic-display-priority-c">Optional</td> <td headers="generic-display-desc-c">Program-defined Variable Name is associated with questions at the section level. The purpose of this is to allow each program to use its local program variable names to identify a question, such as those used in data analysis by a program, without changing the properties of the question itself. Since this attribute is not a property of the question, it allows for users across SDP-V to reuse the same questions while allowing programs to meet its use case requirements. </td> </tr> <tr> <td headers="generic-display-name-column-c">'Concept Name (C)'</td> <td headers="generic-display-priority-c">Conditional</td> <td headers="generic-display-desc-c">Term from a controlled vocabulary to designate a unit of meaning or idea (e.g., ‘Genus Salmonella (organism)’). A controlled vocabulary includes external code systems, such as LOINC or SNOMED-CT, or internally developed vocabularies such as PHIN VADS. For each row that has data entered in this column, the following additional columns are required: Concept Identifier (C) and Code System Identifier (C). </td> </tr> <tr> <td headers="generic-display-name-column-c">'Concept Identifier (C)'</td> <td headers="generic-display-priority-c">Conditional</td> <td headers="generic-display-desc-c">This is text or a code used to uniquely identify a concept in a controlled vocabulary (e.g., 27268008). Note that if you have selected a code system mapping that has already been used in SDP-V or is selected from the results from "Search for external coded items", this field will be automatically populated. For each row that has data entered in this column, the following additional columns are required: Concept Name (C) and Code System Identifier (C).</td> </tr> <tr> <td headers="generic-display-name-column-c">'Code System Identifier (C)'</td> <td headers="generic-display-priority-c">Conditional</td> <td headers="generic-display-desc-c">This is the unique designator for a code system also referred to as a controlled vocabulary, in which concepts and value sets are defined (e.g. 2.16.840.1.113883.6.96). LOINC, SNOMED-CT, and RxNorm are code systems. Note that if you have mapped a code system to a question or response set that has already been mapped in SDP-V or returned from an external code system search, the code system identifier field will be automatically populated. For each row that has data entered in this column, the following additional columns are required: Concept Name (C) and Concept Identifier (C).</td> </tr> <tr> <td headers="generic-display-name-column-c">'Code System Mappings Table (O)'</td> <td headers="generic-display-priority-c">Optional</td> <td headers="generic-display-desc-c">The purpose of Tags is to facilitate content discovery and reuse. A user can create tags by creating tags tables on separate tabs within the SDP-V generic import spreadsheet. A question will be tagged with values from a tag table where the value in this cell matches the name of a tab in the spreadsheet with the naming convention "CSM #", where # is a number assigned by the user to identify the tags table in this template (e.g., CSM 1, CSM 2, CSM 3...).</td> </tr> <tr> <td headers="generic-display-name-column-c">'RS Notes (I)'</td> <td headers="generic-display-priority-c">Informational</td> <td headers="generic-display-desc-c">This column is to help the user of the template keep track of actions that may need to be completed after imported, such as the need to extend an existing response set in SDP-V. The information in this column is for workflow purposes and will not be imported.</td> </tr> </tbody> </table><br/> <p>The content in each tab in the spreadsheet that contains all required columns will be imported and tagged with the “Tab Name”. If there are multiple spreadsheets that contain all required columns, they will be imported as separate sections on the same SDP-V survey.</p> <p><strong>NOTE:</strong> If a required column from the table is missing, the user will receive an error message and the content will not be imported.</p> <br/> <h4 id="generic-content-organization"><p><strong>Content Organization: How to Identify Sections, Templates, or Repeating Groups within the Generic Spreadsheet Import Template</strong></p></h4> <p>Sections, templates, or repeating groups are created by listing data elements between 'START: insert section name' and 'END: insert section name' rows. Each row between these markers are imported as data elements within that grouping (called sections in the vocabulary service). Sub-sections or sub-groupings may be created by including additional 'START: ' and 'END: ' markers within a parent section or grouping</p> <ul> <li>The beginning of a section is indicated by the prefix 'START: ' (including a space after the colon)</li> <li>The end of a section is indicated by the prefix 'END: '(including a space after the colon)</li> <li>The text following the 'START: ' and 'END: ' pre-fixes will be imported as the Section Name in the vocabulary service</li> <li>The section name following the 'START: ' prefix must exactly match the section name following the 'END: ' prefix in order for the section to be correctly imported. </li> <li>Notes should not be included in the same row as the section name (e.g., after the ‘START:’ or ‘END:’ pre-fixes’)</li> <li>Text following a ‘NOTE:’ pre-fix will not be imported. </li> </ul> <br/> <h4 id="generic-associate-rs"><strong>How to Associate Response Sets with Choice Questions on Import</strong></h4> <p><strong>There are 3 options for Choice Questions for import into SDP-V:</strong></p> <ol> <li>A PHIN VADS response value can be associated with a question by providing a valid PHIN VADS value set URL <ul> <li>If you provide a PHIN VADS URL, the value set information will be parsed from PHIN VADS and linked to the appropriate question in SDP-V upon import. The PHIN VADS URL must contain “oid= identifier” in order to be accurately parsed by the importer. </li> <li>An example of a valid PHIN VADS URL is: https://phinvads.cdc.gov/vads/ViewValueSet.action?oid=2.16.840.1.114222.4.11.7552</li> </ul> </li> <li>A local response set can be created in the template and associated with the appropriate question on import. </li> <li>The response set information can be left blank and the user can add response information through the SDP-V user interface</li> </ol> <p><strong>BEST PRACTICE:</strong> Check SDP-V for existing response sets before importing local response sets to prevent creating duplicate response sets in SDP-V. The SDP Vocabulary Service imports value sets from PHIN VADS on a weekly basis and other users have added response sets which are available to be reused or extended within SDP-V. Where applicable, existing SDP-V response sets should be reused or extended before creating new ones; this will allow SDP-V to show the relationship between response set and program and surveillance system usage. This will allow other users to see which response sets are most commonly used.</p> <br/> <h4 id="generic-local-rs"><strong>How to Create User-defined (“Local”) Response Sets Using the SDP-V Import Template</strong></h4> <p>A "local" response set is a response set defined within this template and does not already exist in either SDP-V or PHIN VADS. "Local" tells the importer to look for a response set tab within this template for more information.</p> <ol><li><strong>Populate Distinct Response Set Information on Separate Response Set Tabs in the Spreadsheet (Tab naming convention: RS #)</strong></li> <br/> <table className="set-table table"> <caption><strong>Table 3. Response Set Tab Column Listings</strong></caption> <thead> <tr> <th id="generic-rs-name-column">Column Name</th> <th id="generic-rs-description-column">Description</th> </tr> </thead> <tbody> <tr> <td headers="generic-rs-name-column">Response Set Name (R)</td> <td headers="generic-rs-description-column">The information contained in the first cell is imported as the ‘Response Set Name’.</td> </tr> <tr> <td headers="generic-rs-name-column">Response Set Description (O)</td> <td headers="generic-rs-description-column">The information contained in this column is imported as the ‘Response Set Description’ values in the response set table created in SDP-V. </td> </tr> <tr> <td headers="generic-rs-name-column">Display Name (R)</td> <td headers="generic-rs-description-column">The information contained in this column is imported as the ‘Display Name’ values in the response set table created in SDP-V. </td> </tr> <tr> <td headers="generic-rs-name-column">Response (R)</td> <td headers="generic-rs-description-column">The information contained in this column is imported as the ‘Response’ values in the response set table created in SDP-V.</td> </tr> <tr> <td headers="generic-rs-name-column">Code System Identifier (optional)</td> <td headers="generic-rs-description-column">The information contained in this column is imported as the ‘Code System Identifier (optional)’ values in the response set table created in SDP-V.</td> </tr> </tbody> </table> <br/> <li><strong>2. Associate response set table #’s with appropriate question by entering the following values in the same row as the question text:</strong></li> <ul> <li>‘Local Response Set Table (C)’ (column F) – A local response set will be associated with the question in the same row where the value in this cell matches the name of a tab in the spreadsheet with the naming convention RS ID#, where ID# is a number assigned by the user to identify the response set in this template (e.g., RS 1, RS 2, RS 3...) <ul><li>The tab name identifies where the response set table information for a question is located</li></ul> </li> </ul> </ol> <br/> <h4 id="generic-add-code-system-mappings"><strong>How to Add Multiple Code System Mappings to Content Using the SDP-V Import Template</strong></h4> <p> The purpose of Code System Mappings (CSM) is to identify the governed concepts from code systems like LOINC, SNOMED, PHIN VADS, etc that are associated with response sets, questions, sections, or surveys in SDP-V. That is, the Code System Mappings table identifies how content in SDP-V is represented in another code system. <br/> A user can create a single mapping by filling in the Concept Name, Concept Identifier, and Code System Identifier cells on each tab for the respective content (e.g., question, section, or survey). However, in some cases, a user may want to map their content to multiple representations. The SDP-V Generic Importer supports multiple Code Systems Mappings; to import multiple CSM, you will need to create CSM tables on separate tabs within the SDP-V generic import spreadsheet. This feature should only be used when associating MORE THAN ONE code system mapping per item (e.g., survey, section, or question). Alternatively, users can add the CSMs manually through the UI. </p> <ol><li><strong>1. Populate Code System Mappings Tables on Separate Tabs in the Spreadsheet (Tab naming convention: CSM #)</strong></li> <table className="set-table table"> <caption><strong>Table 4. Response Set Tab Column Listings</strong></caption> <thead> <tr> <th id="generic-tag-name-column">Column Name</th> <th id="generic-tag-description-column">Description</th> </tr> </thead> <tbody> <tr> <td headers="generic-tag-name-column">Concept Name (R)</td> <td headers="generic-tag-description-column">Term from a controlled vocabulary to designate a unit of meaning or idea (e.g., ‘Genus Salmonella (organism)’). A controlled vocabulary includes external code systems, such as LOINC or SNOMED-CT, or internally developed vocabularies such as PHIN VADS. For each row that has data entered in this column, the following additional columns are required: Concept Identifier (C) and Code System Identifier (C). </td> </tr> <tr> <td headers="generic-tag-name-column">Concept Identifier (R)</td> <td headers="generic-tag-description-column">This is text or a code used to uniquely identify a concept in a controlled vocabulary (e.g., 27268008). Note that if you have selected a code system mapping that has already been used in SDP-V or is selected from the results from "Search for external coded items", this field will be automatically populated. For each row that has data entered in this column, the following additional columns are required: Concept Name (C) and Code System Identifier (C).</td> </tr> <tr> <td headers="generic-tag-name-column">Code System Identifier (optional)</td> <td headers="generic-tag-description-column">This is the unique designator for a code system also referred to as a controlled vocabulary, in which concepts and value sets are defined (e.g. 2.16.840.1.113883.6.96). LOINC, SNOMED-CT, and RxNorm are code systems. Note that if you have mapped a code system to a question or response set that has already been mapped in SDP-V or returned from an external code system search, the code system identifier field will be automatically populated. For each row that has data entered in this column, the following additional columns are required: Concept Name (C) and Concept Identifier (C).</td> </tr> </tbody> </table> <br/> <li><strong>2. Associate CSM tables #’s with appropriate Question, Section, or Survey by entering the following values in the same row as the mapped content:</strong></li> <ul> <li>‘Code System Mappings Table (O)’– After import, the SDP-V item details page will be populated with values from the code system mappings table where the value in this cell matches the name of a tab in the import spreadsheet with the naming convention "CSM #", where # is a number assigned by the user to identify the mappings table in this template (e.g., CSM 1, CSM 2, CSM 3...). The CSM tab must contain the following headers (described above): Concept Name (R), Concept Identifier (R), and Code System Identifier (R). <ul><li>The tab name identifies where the CMS table information for a particular question, section, or survey is located in the import spreadsheet </li></ul> </li> </ul> </ol> </div> ); } taggingInstructions() { // Need to update this section with single word tagging instructions return( <div className="tab-pane" id="tagging" role="tabpanel" aria-hidden={this.state.selectedInstruction !== 'tagging'} aria-labelledby="tagging-tab"> <h1 id="tagging-content">Keyword Tags</h1> <h2>Purpose</h2> <p>Tags are text strings that are either keywords or short phrases created by users to facilitate content discovery, organization, and reuse. For instance, a survey called “’Traumatic brain injury” may be tagged with “Concussion” to help other users find that survey who may not think of searching for the term “traumatic brain injury”.<br/>The purpose of tags is not to identify unique concept identifiers or code systems associated with specific content. To specify code system mappings for your vocabulary, please see the “Code System Mappings” help documentation for additional information.</p> <p><strong>Mutability: </strong>Since keyword tags should only be used to facilitate content discovery and organization, keyword tags can be changed (added or deleted) at any time by the author to meet user needs and to optimize search results. The history of tags is not saved and a new version of content is not created whenever tags are changed.</p> <p><strong>Discoverability: </strong>Tags are included in the dashboard search algorithm so other users can find content that has been tagged with the same keyword(s) entered in the dashboard search bar. </p> <p><strong>How to add a tag: </strong>Tags are listed near the top of the details page under either the response set, question, section or survey name and version number next to the “Tags:” header. Tags may be added or removed by selecting “Update Tags” on the right-side of the screen across from the “Tags:” header. Tags may be either a single word or a short keyword phrase. After selecting “Update Tags”, a tag may be created by simply typing a keyword or short phrase and hitting the “enter” or “tab” key between tag entries and then selecting “Save”. </p> <p><strong>How to remove a tag: </strong>After a tag is successfully created, the UI will wrap the tag in a green box and an “x” will appear allowing the user to delete the tag in the future. To remove a tag, simply click on the “x” next to tag (within the green wrapping) and then select “Save”. Alternatively, tags can be added or removed on the content edit page.</p> </div> ); } mappingInstructions() { // Need to update this section with single word tagging instructions return( <div className="tab-pane" id="mapping" role="tabpanel" aria-hidden={this.state.selectedInstruction !== 'mapping'} aria-labelledby="mapping-tab"> <h1 id="mapping-content">Code System Mappings Help</h1> <h2>Purpose</h2> <p>The purpose of the Code System Mappings table is to identify the governed concepts from code systems like LOINC, SNOMED, PHIN VADS, etc that are associated with response sets, questions, sections, or surveys in SDP-V. That is, the Code System Mappings table identifies how content in SDP-V is represented in another code system.<br/>The Code System Mappings table should only include mapping to governed concepts. Non-governed concepts or keywords should not be added to the Code System Mappings table. If you would like to add keywords to your response set, question, section, or survey to facilitate content discovery or organization, please see the “Keyword Tags” help documentation for information on how to use the “Tags” feature.</p> <p><strong>Mutability: </strong>Any changes to entries in the Code System Mappings table are versioned since code system mappings are a property of the vocabulary itself. This allows users to update the Code System Mappings while maintaining legacy mappings in older SDP-V content versions if needed.</p> <p><strong>Discoverability: </strong>Code System Mappings table fields are included in the dashboard search algorithm so other users can find questions, sections, and surveys with specific concept names, concept identifiers or code system identifiers in SDP-V. For instance, a user can enter “27268008” into the dashboard search box to find content in SDP-V associated with that concept identifier. </p> <h2>Definitions</h2> <p><strong>Concept Name: </strong>Term from a controlled vocabulary to designate a unit of meaning or idea (e.g., ‘Genus Salmonella (organism)’). A controlled vocabulary includes external code systems, such as LOINC or SNOMED-CT, or internally developed vocabularies such as PHIN VADS.</p> <p><strong>Concept Identifier: </strong>This is text or a code used to uniquely identify a concept in a controlled vocabulary (e.g., 27268008). Note that if you have selected a code system mapping that has already been used in SDP-V or is selected from the results from "Search for external coded items", this field will be automatically populated.</p> <p><strong>Code System Identifier: </strong>This is the unique designator for a code system also referred to as a controlled vocabulary, in which concepts and value sets are defined (e.g. 2.16.840.1.113883.6.96). LOINC, SNOMED-CT, and RxNorm are code systems. Note that if you have mapped a code system to a question or response set that has already been mapped in SDP-V or returned from an external code system search, the code system identifier field will be automatically populated.</p> <h2>Example Code System Mappings Table</h2> <table className="set-table table"> <caption><strong></strong></caption> <thead> <tr> <th id="concept-name">Concept Name</th> <th id="concept-identifier">Concept Identifier</th> <th id="code-sytem-identifier">Code System Identifier</th> </tr> </thead> <tbody> <tr> <td headers="concept-name">Genus Salmonella (organism)</td> <td headers="concept-identifier">27268008</td> <td headers="code-sytem-identifier">2.16.840.1.113883.6.96</td> </tr> <tr> <td headers="concept-name">Genus Campylobacter (organism)</td> <td headers="concept-identifier">35408001</td> <td headers="code-sytem-identifier">2.16.840.1.113883.6.96</td> </tr> </tbody> </table><br/> <p><strong>How to Search for Previously Used Code Mappings</strong><br/>To determine if a code system mapping has been used before in SDP-V, start typing in the concept name column of the table. A drop-down list of all previously used concept names that match the text entered in the field will appear. A user can navigate the list and select a concept name that was previously used. If a concept name is selected from the list, the concept identifier and code system identifier fields will be populated with existing values already entered in SDP-V.</p> <p><strong>How to Search for Code Mappings from an External Code Systems</strong><br/>Rather than requiring you to copy and paste codes from other code systems, SDP-V allows you to search for codes from specific external code systems by clicking on the “Search for external coded items” magnifying glass icon to the right of the code system mappings header. This opens the Search Codes dialog box. You may select a particular code system from the drop-down menu, or enter a search term to search across multiple code systems. This code search functionality searches codes from PHIN VADS. You may add coded values from these search results to the code mappings table by clicking the “Add” selection beside each result.</p> <p><strong>How to Create a New Code System Mapping</strong><br/>A new code system mapping may be created by simply typing a new concept name, concept identifier, and code system identifier. A new code mapping should only be created if an existing code mapping does not meet a user’s needs.</p> </div> ); } commentInstructions() { return( <div className="tab-pane" id="comment" role="tabpanel" aria-hidden={this.state.selectedInstruction !== 'comment'} aria-labelledby="comment-tab"> <h1 id="commenting-on-content">Commenting on Content</h1> <h2 id="public-comments">Public Comments</h2> <p>To post public comments, you must have a user account. Any comments posted will appear as posted “by user name”, where the user name that appears is the First Name and Last Name stored in the user profile.</p> <p><strong>Steps:</strong></p> <ul> <li>Login to SDP-V. </li> <li>Navigate to the details page of the content you wish to post public comments on</li> <li>Scroll down below the descriptive and linked content sections</li> <li>To start a new comment thread fill in the box immediately under the "Public Comments" header</li> <li>To reply to someone else's comment (which will automatically notify the user of your reply) click the "reply" link immediately under the comment</li> </ul> <h2 id="private-comments">Private Comments</h2> <p>Users can post comments about changes made to private draft content if they are either the author or a member of a collaborative authoring group with permission to edit the content. These comments are saved on the Change History tab and log the date and time that the comment was saved and the user who created it. Visibility of the Change History tab is restricted to authors, authoring group members, and publishers (e.g., private comments).</p> <p><strong>Steps:</strong></p> <ul> <li>Login to SDP-V</li> <li>Navigate to the details page of the private draft content you wish to post a private comment</li> <li>Select Edit</li> <li>Type in the “Notes/Comment About Changes Made (Optional)” textbox</li> <li>Click Save</li> <li>Comments will appear on the “Change History” tab on the Details page.</li> </ul> </div> ); } adminInstructions() { return( <div className="tab-pane" id="admin" role="tabpanel" aria-hidden={this.state.selectedInstruction !== 'admin'} aria-labelledby="admin-tab"> <h1 id="admin-panel">Admin Panel</h1> <p><strong>Getting to the panel (requires administrator role):</strong></p> <ul> <li>When logged in to an account with administrator privileges, navigate to the account dropdown (click the email and gear-icon link in the top right of the application)</li> <li>Click the Admin Panel menu item to navigate to the main administration page</li> <li>The page has a number of tabs with different utilities described in detail below</li> </ul> <p><strong>Tabs:</strong></p> <ul> <li><a href="#admin-list">Admin List</a></li> <li><a href="#publisher-list">Publisher List</a></li> <li><a href="#prog-sys-list">Program and System Lists</a></li> <li><a href="#group-list">Group List</a></li> <li><a href="#elasticsearch-admin-tab">Elasticsearch</a></li> </ul> <h2 className="help-section-subtitle" id="admin-list">Admin List</h2> <p>This list will populate with all of the users who have administrative privileges. The admin role allows access to all content and all functionality in the application. To the right of each user name and email is a remove button that will revoke the admin role from that user. The admin role can be granted by typing in the email of a user and clicking the plus button. The user will then appear on the admin list or an error will be displayed explaining any issues with the addition.</p> <h2 className="help-section-subtitle" id="publisher-list">Publisher List</h2> <p>For usage instructions please see the information about the Admin List above. Adding members to this list allows them to see private content they did not author and publish that content to make it public.</p> <h2 className="help-section-subtitle" id="prog-sys-list">Program and System Lists</h2> <p>On the Program List and System List tabs an administrator can see a current list of all surveillance programs and systems currently available for users to work under. The admin can use the input fields and click the add button to make another program / system available for in the users profile drop down.</p> <h2 className="help-section-subtitle" id="group-list">Group List</h2> <p>On the group list tab an administrator can add new groups and curate the user membership lists for any of the groups in the application. For any group click on the Manage Users button in the right column to see a list of current users and add or remove users by email.</p> <h2 className="help-section-subtitle" id="elasticsearch-admin-tab">Elasticsearch</h2> <p>The Elasticsearch tab is used to synchronize the Elasticsearch database with any activity stored in the Vocabulary service database while Elasticsearch may have been down. This page should only be used according to the instructions given on the page by an experienced administrator. Actions on this page could cause Elasticsearch to become temporarily unavailable.</p> </div> ); } instructionsTab() { return( <div className={`tab-pane ${this.state.selectedTab === 'instructions' && 'active'}`} id="instructions" role="tabpanel" aria-hidden={this.state.selectedTab !== 'instructions'} aria-labelledby="instructions-tab"> <div className="col-md-3 how-to-nav no-print"> <h2 className="showpage_sidenav_subtitle"> <text className="sr-only">Version History Navigation Links</text> <ul className="list-inline"> <li className="subtitle_icon"><span className="fa fa-graduation-cap " aria-hidden="true"></span></li> <li className="subtitle">Learn How To:</li> </ul> </h2> <ul className="nav nav-pills nav-stacked" role="tablist"> <li id="general-tab" className="active" role="tab" onClick={() => this.selectInstruction('general')} aria-selected={this.state.selectedInstruction === 'general'} aria-controls="general"><a data-toggle="tab" href="#general">General</a></li> <li id="manage-account-tab" role="tab" onClick={() => this.selectInstruction('manage-account')} aria-selected={this.state.selectedInstruction === 'manage-account'} aria-controls="manage-account"><a data-toggle="tab" href="#manage-account">Manage Account</a></li> <li id="search-tab" role="tab" onClick={() => this.selectInstruction('search')} aria-selected={this.state.selectedInstruction === 'search'} aria-controls="search"><a data-toggle="tab" href="#search">Search</a></li> <li id="view-tab" role="tab" onClick={() => this.selectInstruction('view')} aria-selected={this.state.selectedInstruction === 'view'} aria-controls="view"><a data-toggle="tab" href="#view">View and Export Content</a></li> <li id="workflow-tab" role="tab" onClick={() => this.selectInstruction('workflow')} aria-selected={this.state.selectedInstruction === 'workflow'} aria-controls="workflow"><a data-toggle="tab" href="#workflow">Workflow Status and Content Stage</a></li> <li id="create-and-edit-tab" role="tab" onClick={() => this.selectInstruction('create-and-edit')} aria-selected={this.state.selectedInstruction === 'create-and-edit'} aria-controls="create-and-edit"><a data-toggle="tab" href="#create-and-edit">Create and Edit Content</a></li> <li id="curation-tab" role="tab" onClick={() => this.selectInstruction('curation')} aria-selected={this.state.selectedInstruction === 'curation'} aria-controls="curation"><a data-toggle="tab" href="#curation">Curation Wizard</a></li> <li id="import-tab" role="tab" onClick={() => this.selectInstruction('import')} aria-selected={this.state.selectedInstruction === 'import'} aria-controls="import"><a data-toggle="tab" href="#import">Import Content</a></li> <li id="tagging-tab" role="tab" onClick={() => this.selectInstruction('tagging')} aria-selected={this.state.selectedInstruction === 'tagging'} aria-controls="tagging"><a data-toggle="tab" href="#tagging">Tagging Content</a></li> <li id="mapping-tab" role="tab" onClick={() => this.selectInstruction('mapping')} aria-selected={this.state.selectedInstruction === 'mapping'} aria-controls="mapping"><a data-toggle="tab" href="#mapping">Code System Mappings</a></li> <li id="comment-tab" role="tab" onClick={() => this.selectInstruction('comment')} aria-selected={this.state.selectedInstruction === 'comment'} aria-controls="comment"><a data-toggle="tab" href="#comment">Comment on Content</a></li> <li id="admin-tab" role="tab" onClick={() => this.selectInstruction('admin')} aria-selected={this.state.selectedInstruction === 'admin'} aria-controls="admin"><a data-toggle="tab" href="#admin">Admin Panel</a></li> </ul> </div> <div className="tab-content col-md-8"> {this.generalInstructions()} {this.searchInstructions()} {this.accountInstructions()} {this.viewInstructions()} {this.workflowInstructions()} {this.editInstructions()} {this.curationInstructions()} {this.importInstructions()} {this.taggingInstructions()} {this.mappingInstructions()} {this.commentInstructions()} {this.adminInstructions()} </div> </div> ); } glossaryTab() { return ( <div className="tab-pane" id="glossary" role="tabpanel" aria-hidden={this.state.selectedTab !== 'glossary'} aria-labelledby="glossary-tab"> <h1 id="glossaryTab">Glossary</h1> <br/> <p><strong>Author –</strong> An actor (organization, person, or program) responsible for creating and/or maintaining a data collection item, a code set, a value set, or a data collection instrument</p> <p><strong>Code –</strong> a succinct label for a concept, variable, value, or question</p> <p><strong>Code System –</strong> a collection of unique codes pertaining to one or more topic areas and maintained as a unit; aka code set</p> <p><strong>Data Collection Instrument –</strong> a method for collecting data from or about subjects using tests, questionnaires, inventories, interview schedules or guides, and survey plans</p> <p><strong>Data Collection Item –</strong> A question or data element used to indicate the name and meaning of a datum. It may be identified by a code in a code system, and it may be associated with keywords or search tags from a code system</p> <p><strong>Data Collection Item Group –</strong> a set of data collection items such as questions that are used together in data collection instruments, for example as questionnaire sections, message segments, or SDV-Sections</p> <p><strong>Data Collection Specification -</strong> a set of data terms or questions, definitions, and data value constraints used to describe information collected manually or electronically for surveillance purposes and may also prescribe organization and collection instructions, guidelines, or logic. Examples include an HL7 V2.x message mapping guide, and HL7 CDA implementation guide</p> <p><strong>Data Element –</strong> A unit of data or a variable defined for evaluating and processing. It typically is associated with a code name, a description, and a set of expected values. It may have other associated metadata.</p> <p><strong>Question –</strong> a data collection item that has a natural language expression used to solicit a value for a data variable. A question may be identified by a code name that stands for the question.</p> <p><strong>SDP-V Survey –</strong> a kind of data collection specification created in the SDP Vocabulary Service. It is a selection of questions and response sets (grouped into sections) used together to define the contents of a data collection instrument such as a survey instrument.</p> <p><strong>Survey Instrument -</strong> a data collection instrument in which the collection is done by asking questions and receiving responses. A survey can be implemented as a paper or electronic form, or as a live interview. This is also called a questionnaire</p> <p><strong>Value –</strong> an item of data that can be assigned to a data element or a response to a question</p> <p><strong>Value Set –</strong> a set of value choices that are applicable to one or more data collection items (e.g. data elements or questions). In the case where the data collection item is a question, a value set is also referred to as a response set.</p> </div> ); } whatsnewTab() { return ( <div className={`tab-pane ${this.state.selectedTab === 'whatsnew' && 'active'}`} id="whatsnew" role="tabpanel" aria-hidden={this.state.selectedTab !== 'whatsnew'} aria-labelledby="whatsnew-tab"> <h1 id="whatsnewTab">What&lsquo;s New</h1> <br/> <p>Here you can find the latest news and information about the CDC Vocabulary Service. Read our latest release notes to learn how the application is continuously improving, learn about updates to user documentation, and find other announcements important to the user community.</p> <br/> <strong>Find Out What&lsquo;s New In:</strong> <br/> <br/> <ol> <a href="#announcements">Announcements</a><br/> <a href="#releasenotes">Release Notes </a> <small> (<a href="#1.1">1.1</a>,&nbsp; <a href="#1.2">1.2</a>,&nbsp; <a href="#1.3">1.3</a>,&nbsp; <a href="#1.4">1.4</a>,&nbsp; <a href="#1.5">1.5</a>,&nbsp; <a href="#1.6">1.6</a>,&nbsp; <a href="#1.7">1.7</a>,&nbsp; <a href="#1.8">1.8</a>,&nbsp; <a href="#1.9">1.9</a>,&nbsp; <a href="#1.10">1.10</a>,&nbsp; <a href="#1.11">1.11</a>,&nbsp; <a href="#1.12">1.12</a>,&nbsp; <a href="#1.13">1.13</a>,&nbsp; <a href="#1.14">1.14</a>,&nbsp; <a href="#1.15">1.15</a>,&nbsp; <a href="#1.16">1.16</a>,&nbsp; <a href="#1.17">1.17</a>,&nbsp; <a href="#1.18">1.18</a>,&nbsp; <a href="#1.19">1.19</a>,&nbsp; <a href="#1.20">1.20</a>,&nbsp; <a href="#1.21">1.21</a>,&nbsp; <a href="#1.22">1.22</a>,&nbsp; <a href="#1.23">1.23</a>) </small><br/> <a href="#userdocupdates">User Documentation Updates</a> </ol> <br/> <h4 id="Announcements"><strong>Announcements</strong></h4> <ol>This section will be periodically updated with announcements relevant to the user community. Please check back for updates.</ol> <br/> <h4 id="releasenotes"><strong>Release Notes</strong></h4> <ul> <li id="1.23"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/1264353282/SDP+Vocabulary+Service+Release+1.23' target='_blank'>1.23</a></strong> <small>(August 4, 2020)</small></li> <ol> <li>Response type default update to "Choice" when creating a Question.</li> <li>Updated Section Edit page with Type Filter allowing a user to easily distiguish between filtering between Questions and Sections.</li> <li>Added a Position info button to Create Section page.</li> <li>Updated API to return the latest version.</li> <li>Updated EPI Info export mapping.</li> <li>Description textbox updated in Details section to dynamically scale.</li> <InfoModal show={this.state.showInfoImportFileBug} header="Known Bug: File Import" body={<p> <ul> <u>Status</u>: Deferred <br/> <u>Summary</u>: <br/> When a user attempts to import a file using the 'Import Spreadsheet' option, the user may encounter a 'Server 500' error stating that the import was not successful.<br/> <u>Expected Result</u>: <br/>Dependant on file size, an error message is presented to the user with a '500 Server Error'.<br/> <u>Actual Result</u>: <br/>Processing of the imported spreadsheet continues to process and the upload is successful.<br/> <u>Content Requirements for Successful Import of the Spreadsheet</u>: <ul> <li>Formatting (i.e. Tab name or header name changes) of the Excel import spreadsheet file has not been changed.</li> <li>Content is enterred and saved with accuracy.</li> </ul> </ul></p>} hideInfo={()=>this.setState({showInfoImportFileBug: false})} /> <li>File Import Error <i>(Known Bug<Button bsStyle='link' style={{ padding: 3 }} onClick={() => this.setState({showInfoImportFileBug: true})}><i className="fa fa-info-circle" aria-hidden="true"></i><text className="sr-only">Click for info about this item</text></Button>)</i>.</li> <li>Security updates include acorn, arrify, coffeescript, del, devise, esquery, estraverse, fast-levenshtein, flat-cache, generate-function, glob, globby, handlebars, is-my-json-valid, is-property, jquery, json, js-yaml, lodash, nio4r, node-sass, nokogiri, nokogiri x64 and x86, optionator, path-parse, puma, rack, resolve, rimraf, swagger-cli, webpack, webpack-bundle-analyzer, websocket-extensions, word-wrap.</li> <li>Updated privacy policy link.</li> </ol> <li id="1.22"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/592838675/SDP+Vocabulary+Service+Release+1.22' target='_blank'>1.22</a></strong> <small>(August 6, 2019)</small></li> <ol> <li>Removed clickable filters and highlighting from dashboard items.</li> <li>Per usability testing feedback, components and detail sections have been reordered across the service for ease of readablity.</li> <li>Content stage filter badges have been added for ease of identification and use.</li> <li>Response Type and Category selections are now multi-select.</li> <li>Multi-select drop-downs do not disappear when a user selects multiple items.</li> <li>Duplicate content when viewing 'Author Recommended Response Sets' and 'Response Set Linked on Sections' have been removed.</li> <li>'Response Set Linked on Sections' has been renamed to 'Alternative Response Set Options'.</li> <li>SDP-V will return and store EPI Info published data.</li> </ol> <li id="1.21"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/579338249/SDP+Vocabulary+Service+Release+1.21' target='_blank'>1.21</a></strong> <small>(June 28, 2019)</small></li> <ol> <li>Users can now preview response sets linked to questions on the dashboard by clicking the 'preview' button on the right side of the search result expansion.</li> <li>The metrics API and admin dashboard now report a count of the number of collaborative authoring groups.</li> <li>The application now has a reusable info button that has been added to various places that required clarifications on language and use of functionality around the application.</li> <li>Various improvements were made to the dashboard based on the usability testing, including: <ul> <li>Increase visibility of object type color-coding scheme</li> <li>Object filters consolidated under the search bar and made to look more like filters</li> <li>Improve clarity of Program and System counts on dashboard with updated colors</li> <li>Rearranged layout and descreased size or eliminated unnecessary and unimportant information to reduce visual clutter</li> </ul> </li> </ol> <li id="1.20"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/571015169/SDP+Vocabulary+Service+Release+1.20' target='_blank'>1.20</a></strong> <small>(May 30, 2019)</small></li> <ol> <li>Implemented logic to determine if PHIN VADS link is valid and if the OID exists</li> <li>Added ability to create an Epi Info web-based Survey using SDP-V content</li> <li>Implemented versions of content on dashboard search results</li> <li>Implemented the abiliy to remove advanced filters from the dashboard</li> <li>Implemented the ability to indicate which Response Set is linked on Sections/Surveys when a user navigates to the Question details page</li> <li>Users have the ability to identify a new position for Question/Sections on Survey and Section edit pages</li> <li>Added the ability to view 'Hide retired content' on the dashboard</li> <li>Implemented sorting of search results to show most rescent version at the top</li> </ol> <li id="1.19"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/564461569/SDP+Vocabulary+Service+Release+1.19' target='_blank'>1.19</a></strong> <small>(May 2, 2019)</small></li> <ol> <li>Collaborator role has been implemented</li> <li>Implemented Dashboard Search Result Report Feature that allows users to export dashboard search results into a spreadsheet format</li> <li>Implemented metrics tab on admin panel to allow administrators to view system metrics</li> <li>Aggregate metrics have been exposed in the API</li> <li>Added pagination to linked content to accommodate application growth and ensure performance and page responsiveness as linked content increases on pages</li> <li>Curation wizard feature has been extended to allow administrators and publishers to view suggested replacement questions on surveys</li> <li>Additional google tags have been implemented for analytics</li> <li>Bug fixes</li> </ol> <li id="1.18"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/524910593/SDP+Vocabulary+Service+Release+1.18' target='_blank'>1.18</a></strong> <small>(Apr 5, 2019)</small></li> <ol> <li>Authors have the ability to request that publishers retired content</li> <li>'Draft' visibility has been changed to 'Private' and 'Published' visibility has been changed to 'Public' to attributes more intuitive</li> <li>"Access denied" message updated for authenticated and non-authenticated users to promote collaboration on private content</li> </ol> <li id="1.17"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/491061249/SDP+Vocabulary+Service+Release+1.17' target='_blank'>1.17</a></strong> <small>(Mar 8, 2019)</small></li> <ol> <li>Added advanced search feature on create Questions page</li> <li>Implemented "matched on fields" values to increase transparency of dashboard results</li> <li>Curation Wizard updates, including:</li> <ol type="a"> <li>“Mark as Reviewed” capability to filter out previously reviewed suggestions</li> <li>Filter out "Retired" content from suggestions</li> <li>Optimize match algorithm</li> </ol> <li>Added Curation History Tab to Response Sets and Questions</li> </ol> <li id="1.16"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/484081696/SDP+Vocabulary+Service+Release+1.16' target='_blank'>1.16</a></strong> <small>(Feb 5, 2019)</small></li> <ol> <li>Elasticsearch improvements</li> <li>Advanced Filter Improvements</li> <li>Importer Bug Fixes</li> </ol> <li id="1.15"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/473858095/SDP+Vocabulary+Service+Release+1.15' target='_blank'>1.15</a></strong> <small>(Jan 8, 2019)</small></li> <ol> <li>Links in descriptions will open in a new tab</li> <li>Allow duplicate OMB number for more than one survey</li> <li>Improvement of linked content</li> <li>Exact match on dashboard with double quotes</li> <li>Dashboard search optimization and tokenizer changes</li> <li>Epi Info Export improvement</li> </ol> <li id="1.14"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/463994881/SDP+Vocabulary+Service+Release+1.14' target='_blank'>1.14</a></strong> <small>(Dec 04, 2018)</small></li> <ol> <li>Added 'What's New' tab to Help</li> <li>Updated SDP-V import template</li> <li>OMB Approval number and date on show page</li> <li>Metadata Tab importing for Surveys and Sections</li> </ol> <li id="1.13"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/462422017/SDP+Vocabulary+Service+Release+1.13' target='_blank'>1.13</a></strong> <small>(Nov 28, 2018)</small></li> <ol> <li>Tracking associations in the change history tab</li> <li>Rolling out large response set code in demo</li> <li>Single word tags and code system mappings</li> <li>API performance improvements</li> </ol> <li id="1.12"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/407928833/SDP+Vocabulary+Service+Release+1.12' target='_blank'>1.12</a></strong> <small>(Sept 28, 2018)</small></li> <ol> <li>Curating Public Content</li> <li>UI Asynchronous Rework & Optimizations</li> <li>Comprehensive Developer Documentation</li> </ol> <li id="1.11"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/360546430/SDP+Vocabulary+Service+Release+1.11' target='_blank'>1.11</a></strong> <small>(July 25, 2018)</small></li> <ol> <li>Introduction of Content Stage Attributes</li> <li>User Feedback Success Message</li> <li>Addition of Source to the Response Set Details Summary</li> </ol> <li id="1.10"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/349601800/SDP+Vocabulary+Service+Release+1.10' target='_blank'>1.10</a></strong> <small>(June 29, 2018)</small></li> <ol> <li>New Advanced Search filters</li> <li>Introduction of the Ability for an Author to Save Comments on Private Draft</li> <li>FHIR API Update</li> </ol> <li id="1.9"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/281509889/SDP+Vocabulary+Service+Release+1.9' target='_blank'>1.9</a></strong> <small>(May 22, 2018)</small></li> <ol> <li>Curation Wizard Feature</li> <li>"CDC preferred" content attribute</li> <li>Import content that conforms to SDP-V generic spreadsheet</li> </ol> <li id="1.8"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/256507905/SDP+Vocabulary+Service+Release+1.8' target='_blank'>1.8</a></strong> <small>(April 25, 2018)</small></li> <ol> <li>Revision history for private draft content</li> <li>"Delete/Delete All" prompts</li> <li>Group member visibility in the User Interface (UI)</li> </ol> <li id="1.7"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/212893697/SDP+Vocabulary+Service+Release+1.7' target='_blank'>1.7</a></strong> <small>(March 28, 2018)</small></li> <ol> <li>Export SDP-V data</li> <li>Survey creation by importing using Message Mapping Guide (MMG)</li> <li>"Contact Us" link addition</li> </ol> <li id="1.6"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/145883215/SDP+Vocabulary+Service+Release+1.6' target='_blank'>1.6</a></strong> <small>(February 26, 2018)</small></li> <ol> <li>User Interface (UI) updated for nesting sections and questions</li> <li>Generic spreadsheet importer update (i.e. FHIR API, Swagger API, MMG importer)</li> <li>Collaborative authoring group functionality</li> </ol> <li id="1.5"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/120750131/SDP+Vocabulary+Service+Release+1.5' target='_blank'>1.5</a></strong> <small>(January 30, 2018)</small></li> <ol> <li>Improvement to User Interface (UI) for nesting sections and questions</li> <li>FHIR API update</li> <li>User Interface navigation between various responses</li> </ol> <li id="1.4"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/48627713/SDP+Vocabulary+Service+Release+1.4' target='_blank'>1.4</a></strong> <small>(January 4, 2018)</small></li> <ol> <li>Share private draft content per groups</li> <li>User Interface to better display relationships between content</li> <li>SDP-V API update</li> </ol> <li id="1.3"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/60653574/SDP+Vocabulary+Service+Release+1.3' target='_blank'>1.3</a></strong> <small>(Nov 13, 2017)</small></li> <ol> <li>SDP-V form name update</li> <li>Added new advanced search filters</li> <li>Dashboard ranks</li> </ol> <li id="1.2"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/51871750/SDP+Vocabulary+Service+Release+1.2' target='_blank'>1.2</a></strong> <small>(Oct 17, 2017)</small></li> <ol> <li>Tag features</li> <li>"out of date" development</li> <li>Administration role feature</li> </ol> <li id="1.1"><strong>Release <a href='https://publichealthsurveillance.atlassian.net/wiki/spaces/SVS/pages/50036737/SDP+Vocabulary+Service+Release+1.1' target='_blank'>1.1</a></strong> <small>(Oct 10, 2017)</small></li> <ol> <li>See release for more details.</li> </ol> </ul> <br/> <h4 id="userdocupdates"><strong>User Documentation Updates</strong></h4> <ul> <li><strong>May 2019</strong></li> <ul> <li>The <strong>Vocabulary Service User Guide</strong> has been updated with features available through Release 1.15. The user guide is available on the <a href='https://www.cdc.gov/sdp/SDPHowItWorksVocabularyService.html' target='_blank'>Accessing SDP Vocabulary Service</a> webpage.</li> <li><strong>Surveillance Data Platform Vocabulary Service Fact Sheet</strong> has been updated. The fact sheet is available at the bottom of the <a href='https://www.cdc.gov/sdp/SDPVocabularyServiceSharedServices.html' target='_blank'>SDP Vocabulary Service</a> webpage.</li> </ul> <li><strong>August 2018</strong></li> <ul> <li>The <strong>Vocabulary Service User Guide</strong> has been updated with features available through Release 1.8. The user guide is available on the <a href='https://www.cdc.gov/sdp/SDPHowItWorksVocabularyService.html' target='_blank'>Accessing SDP Vocabulary Service</a> webpage.</li> <li><strong>Surveillance Data Platform Vocabulary Service Fact Sheet</strong> has been updated. The fact sheet is available at the bottom of the <a href='https://www.cdc.gov/sdp/SDPVocabularyServiceSharedServices.html' target='_blank'>SDP Vocabulary Service</a> webpage.</li> </ul> <li><strong>June 2018</strong></li> <ul> <li>The <strong>Vocabulary Service Value Diagram</strong> has been updated to reflect recent enhancements to the system. This diagram summarizes the value of the Vocabulary Service by highlighting specific capabilities of the service. The diagram is available on the <a href='https://www.cdc.gov/sdp/SDPVocabularyServiceSharedServices.html' target='_blank'>SDP Vocabulary Service</a> webpage.</li> <li>The <strong>SDP Vocabulary Info Graphic</strong> has been updated to show that Sections can now include either questions or one or more sections (e.g., sub-sections or nested sections). This ability to nest sections was introduced in Release 1.5. The info graphic is available on the <a href='https://www.cdc.gov/sdp/SDPHowItWorksVocabularyService.html' target='_blank'>Accessing SDP Vocabulary Service</a> webpage.</li> </ul> </ul> </div> ); } render() { return ( <div className="container" href="#help"> <div className="row basic-bg"> <div className="col-md-12"> <div className="showpage_header_container no-print"> <ul className="list-inline"> <li className="showpage_button"><span className="fa fa-question-circle fa-2x" aria-hidden="true"></span></li> <li className="showpage_title"><h1>Help</h1></li> </ul> </div> <div className="container col-md-12"> <div className="row"> <div className="col-md-12 nopadding"> <ul className="nav nav-tabs" role="tablist"> <li id="instructions-tab" className={`nav-item ${this.state.selectedTab === 'instructions' && 'active'}`} role="tab" onClick={() => this.selectTab('instructions')} aria-selected={this.state.selectedTab === 'instructions'} aria-controls="instructions"> <a className="nav-link" data-toggle="tab" href="#instructions" role="tab">Instructions</a> </li> <li id="glossary-tab" className="nav-item" role="tab" onClick={() => this.selectTab('glossary')} aria-selected={this.state.selectedTab === 'glossary'} aria-controls="glossary"> <a className="nav-link" data-toggle="tab" href="#glossary" role="tab">Glossary</a> </li> <li id="faq-tab" className="nav-item" role="tab" onClick={() => this.selectTab('faq')} aria-selected={this.state.selectedTab === 'faq'} aria-controls="faq"> <a className="nav-link" data-toggle="tab" href="#faq" role="tab">FAQs</a> </li> <li id="whatsnew-tab" className={`nav-item ${this.state.selectedTab === 'whatsnew' && 'active'}`} role="tab" onClick={() => this.selectTab('whatsnew')} aria-selected={this.state.selectedTab === 'whatsnew'} aria-controls="whatsnew"> <a className="nav-link" data-toggle="tab" href="#whatsnew" role="tab">What&lsquo;s New</a> </li> </ul> <div className="tab-content"> {this.instructionsTab()} <div className="tab-pane" id="faq" role="tabpanel" aria-hidden={this.state.selectedTab !== 'faq'} aria-labelledby="faq-tab"> <h1 id="faqTab">FAQs</h1> <br/> <p>Please visit the FAQ page on the official cdc.gov website: <a href="https://www.cdc.gov/sdp/SDPFAQs.html#tabs-2-2" target="_blank">https://www.cdc.gov/sdp/SDPFAQs.html</a></p> </div> {this.glossaryTab()} {this.whatsnewTab()} </div> </div> </div> </div> </div> </div> </div> ); } } function mapDispatchToProps(dispatch) { return bindActionCreators({setSteps}, dispatch); } Help.propTypes = { setSteps: PropTypes.func, location: PropTypes.object }; export default connect(null, mapDispatchToProps)(Help);
docs/app/Examples/collections/Grid/Variations/GridExampleRelaxedVery.js
aabustamante/Semantic-UI-React
import React from 'react' import { Grid, Image } from 'semantic-ui-react' const GridExampleRelaxedVery = () => ( <Grid relaxed='very' columns={4}> <Grid.Column> <Image src='/assets/images/wireframe/image.png' /> </Grid.Column> <Grid.Column> <Image src='/assets/images/wireframe/image.png' /> </Grid.Column> <Grid.Column> <Image src='/assets/images/wireframe/image.png' /> </Grid.Column> <Grid.Column> <Image src='/assets/images/wireframe/image.png' /> </Grid.Column> </Grid> ) export default GridExampleRelaxedVery
src/chapters/04-porazdelitve-verjetnosti/03-diskretne-porazdelitve/05-hipergeometrijska-porazdelitev/index.js
medja/ovs-prirocnik
import React from 'react'; import { createChapter } from 'components/chapter'; import Equation from 'components/equation'; import Formula from 'components/formula'; import Chart from 'components/chart'; const title = 'Hipergeomterijska porazdelitev'; function Title(props) { return ( <span> { props.title }{' '} <Equation math="H(n, M, N)" /> </span> ); } function Chapter() { const variables = '0 & 1 & 2 & ... & n'; const probabilities = 'f(0) & f(1) & f(2) & ... & f(n)'; const distribution = ` H(n, M, N) \\sim \\left(\\begin{array}{c} ${variables}\\\\ ${probabilities} \\end{array}\\right) `; return ( <div> <p> Hipergeometrijska porazdelitev razporeja glede na število ugodnih izborov. Odvisna je od števila vseh možnih izbir, vseh ugodnih izbir in števila izbir, ki jih naredimo. Primer take porazdelitve je igra z barvastimi kroglicami, kjer izbiramo brez vračanja in nas zanima verjetnost, da smo izbrali določeno število kroglic prave barve. </p> <Formula name="Hipergeomterijska porazdelitev" math={distribution} params={{ 'n': 'Število vseh izbir', 'M': 'Število ugodnih možnosti', 'N': 'Število vseh možnosti' }} /> <p> Pri računanju s hipergeomterijsko porazdelitvijo si lahko pomagamo z naslednjimi formulami: </p> <Formula.Group> <Formula name="Funkcija gostote" math="f(x) = \frac{\binom{M}{x}\binom{N - M}{n - x}}{\binom{N}{n}}" /> <Formula name="Porazdelitvena funkcija" math="F(x) = \frac{\sum_{i=0}^x \binom{M}{i}\binom{N - M}{n - i}}{\binom{N}{n}}" params={{ 'x': 'Število poskusov' }} /> </Formula.Group> <Formula.Group> <Formula name="Matematično upanje" math="E(X) = \frac{nM}{N}" /> <Formula name="Disperzija" math="D(X) = n \frac{M}{N} \frac{(N - M)}{N} \frac{N - n}{N - 1}" params={{ 'X': 'Slučajna spremenljivka' }} /> </Formula.Group> <Chart name="Primer grafa" width="500" height="400" func="Hypergeometric(x, n, M, N)" params={{ n: 4, M: 3, N: 10 }} range={[-1, 4]} discrete /> </div> ); } export default createChapter(title, Chapter, [], { Title });
consoles/my-joy-images/src/mocks/declarative-redux-form.js
yldio/joyent-portal
import React from 'react'; export default ({ children, ...props }) => React.createElement(children, props);
src/Parser/Druid/Restoration/Modules/Features/NaturesEssence.js
hasseboulen/WoWAnalyzer
import React from 'react'; import { formatPercentage } from 'common/format'; import SpellLink from 'common/SpellLink'; import Analyzer from 'Parser/Core/Analyzer'; import Wrapper from 'common/Wrapper'; import SPELLS from 'common/SPELLS'; import Combatants from 'Parser/Core/Modules/Combatants'; const HEAL_WINDOW_MS = 500; const RECOMMENDED_HIT_THRESHOLD = 3; class NaturesEssence extends Analyzer { static dependencies = { combatants: Combatants, }; casts = 0; castsWithTargetsHit = []; // index is number of targets hit, value is number of casts that hit that many targets castHits = 0; totalHits = 0; healTimestamp = undefined; on_initialized() { this.active = this.combatants.selected.traitsBySpellId[SPELLS.NATURES_ESSENCE_TRAIT.id] > 0; } on_byPlayer_heal(event) { if (event.ability.guid !== SPELLS.NATURES_ESSENCE_DRUID.id) { return; } if(!this.healTimestamp || this.healTimestamp + HEAL_WINDOW_MS < this.owner.currentTimestamp) { this._tallyHits(); this.healTimestamp = this.owner.currentTimestamp; } if(event.amount !== 0) { this.castHits += 1; this.totalHits += 1; } } on_byPlayer_cast(event) { if (event.ability.guid === SPELLS.WILD_GROWTH.id) { this.casts += 1; } } on_finished() { this._tallyHits(); } _tallyHits() { if(!this.healTimestamp) { return; } this.castsWithTargetsHit[this.castHits] ? this.castsWithTargetsHit[this.castHits] += 1 : this.castsWithTargetsHit[this.castHits] = 1; this.castHits = 0; this.healTimestamp = undefined; } get averageEffectiveHits() { return (this.totalHits / this.casts) || 0; } get belowRecommendedCasts() { return this.castsWithTargetsHit.reduce((accum, casts, hits) => { return (hits < RECOMMENDED_HIT_THRESHOLD) ? accum + casts : accum; }, 0); } get percentBelowRecommendedCasts() { return (this.belowRecommendedCasts / this.casts) || 0; } get suggestionThresholds() { return { actual: this.percentBelowRecommendedCasts, isGreaterThan: { minor: 0.00, average: 0.15, major: 0.35, }, style: 'percentage', }; } suggestions(when) { when(this.suggestionThresholds) .addSuggestion((suggest, actual, recommended) => { return suggest(<Wrapper>You sometimes cast <SpellLink id={SPELLS.WILD_GROWTH.id} /> on too few targets. <SpellLink id={SPELLS.WILD_GROWTH.id} /> is not mana efficient when hitting few targets, you should only cast it when you can hit at least {RECOMMENDED_HIT_THRESHOLD} wounded targets. Make sure you are not casting on a primary target isolated from the raid. <SpellLink id={SPELLS.WILD_GROWTH.id} /> has a maximum hit radius, the injured raiders could have been out of range. Also, <SpellLink id={SPELLS.WILD_GROWTH.id} /> healing is frontloaded due to <SpellLink id={SPELLS.NATURES_ESSENCE_DRUID.id} />, you should never pre-hot with <SpellLink id={SPELLS.WILD_GROWTH.id} />. </Wrapper>) .icon(SPELLS.NATURES_ESSENCE_DRUID.icon) .actual(`${formatPercentage(this.percentBelowRecommendedCasts, 0)}% casts on fewer than ${RECOMMENDED_HIT_THRESHOLD} targets.`) .recommended(`never casting on fewer than ${RECOMMENDED_HIT_THRESHOLD} is recommended`); }); } } export default NaturesEssence;
js/jqwidgets/demos/react/app/grid/columnshierarchy/app.js
luissancheza/sice
import React from 'react'; import ReactDOM from 'react-dom'; import JqxGrid from '../../../jqwidgets-react/react_jqxgrid.js'; class App extends React.Component { render() { let source = { datatype: 'xml', datafields: [ { name: 'SupplierName', type: 'string' }, { name: 'Quantity', type: 'number' }, { name: 'OrderDate', type: 'date' }, { name: 'OrderAddress', type: 'string' }, { name: 'Freight', type: 'number' }, { name: 'Price', type: 'number' }, { name: 'City', type: 'string' }, { name: 'ProductName', type: 'string' }, { name: 'Address', type: 'string' } ], url: '../sampledata/orderdetailsextended.xml', root: 'DATA', record: 'ROW' }; let dataAdapter = new $.jqx.dataAdapter(source); let columns = [ { text: 'Supplier Name', cellsalign: 'center', align: 'center', datafield: 'SupplierName', width: 110 }, { text: 'Name', columngroup: 'ProductDetails', cellsalign: 'center', align: 'center', datafield: 'ProductName', width: 120 }, { text: 'Quantity', columngroup: 'ProductDetails', datafield: 'Quantity', cellsformat: 'd', cellsalign: 'center', align: 'center', width: 80 }, { text: 'Freight', columngroup: 'OrderDetails', datafield: 'Freight', cellsformat: 'd', cellsalign: 'center', align: 'center', width: 100 }, { text: 'Order Date', columngroup: 'OrderDetails', cellsalign: 'center', align: 'center', cellsformat: 'd', datafield: 'OrderDate', width: 100 }, { text: 'Order Address', columngroup: 'OrderDetails', cellsalign: 'center', align: 'center', datafield: 'OrderAddress', width: 100 }, { text: 'Price', columngroup: 'ProductDetails', datafield: 'Price', cellsformat: 'c2', align: 'center', cellsalign: 'center', width: 70 }, { text: 'Address', columngroup: 'Location', cellsalign: 'center', align: 'center', datafield: 'Address', width: 120 }, { text: 'City', columngroup: 'Location', cellsalign: 'center', align: 'center', datafield: 'City', width: 80 } ]; let columngroups = [ { text: 'Product Details', align: 'center', name: 'ProductDetails' }, { text: 'Order Details', parentgroup: 'ProductDetails', align: 'center', name: 'OrderDetails' }, { text: 'Location', align: 'center', name: 'Location' } ]; return ( <JqxGrid width={850} source={dataAdapter} pageable={true} autorowheight={true} altrows={true} columnsresize={true} columns={columns} columngroups={columngroups} /> ) } } ReactDOM.render(<App />, document.getElementById('app'));
customView/node_modules/babel-plugin-react-transform/test/fixtures/code-ignore/expected.js
TheKingOfNorway/React-Native
import React from 'react'; const First = React.createNotClass({ displayName: 'First' }); class Second extends React.NotComponent {}
react/features/settings/components/web/audio/TestButton.js
jitsi/jitsi-meet
// @flow import React from 'react'; type Props = { /** * Click handler for the button. */ onClick: Function, /** * Keypress handler for the button. */ onKeyPress: Function, }; /** * React {@code Component} representing an button used for testing output sound. * * @returns { ReactElement} */ export default function TestButton({ onClick, onKeyPress }: Props) { return ( <div className = 'audio-preview-test-button' onClick = { onClick } onKeyPress = { onKeyPress } role = 'button' tabIndex = { 0 }> Test </div> ); }