mirror of
https://github.com/wassname/talk.git
synced 2026-07-17 11:33:39 +08:00
Missing propTypes and classes
This commit is contained in:
@@ -2,17 +2,25 @@ import React from 'react';
|
||||
import TagsInput from 'react-tagsinput';
|
||||
import styles from './TagsInput.css';
|
||||
import AutosizeInput from 'react-input-autosize';
|
||||
import PropTypes from 'prop-types';
|
||||
import cn from 'classnames';
|
||||
|
||||
const autosizingRenderInput = ({onChange, value, addTag: _, ...other}) =>
|
||||
<AutosizeInput type='text' onChange={onChange} value={value} {...other} />;
|
||||
|
||||
export default (props) => {
|
||||
autosizingRenderInput.propTypes = {
|
||||
onChange: PropTypes.func,
|
||||
value: PropTypes.string,
|
||||
addTag: PropTypes.func,
|
||||
};
|
||||
|
||||
const TagsInputComponent = ({className = '', ...props}) => {
|
||||
return (
|
||||
<TagsInput
|
||||
addOnBlur={true}
|
||||
addOnPaste={true}
|
||||
pasteSplit={(data) => data.split(',').map((d) => d.trim())}
|
||||
className={styles.root}
|
||||
className={cn(styles.root, 'tags-input', className)}
|
||||
focusedClassName={styles.rootFocus}
|
||||
renderInput={autosizingRenderInput}
|
||||
{...props}
|
||||
@@ -29,3 +37,11 @@ export default (props) => {
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
TagsInputComponent.propTypes = {
|
||||
className: PropTypes.string,
|
||||
inputProps: PropTypes.object,
|
||||
tagProps: PropTypes.object,
|
||||
};
|
||||
|
||||
export default TagsInputComponent;
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import React from 'react';
|
||||
import styles from './style.css';
|
||||
import {TextField, Button} from 'coral-ui';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import t from 'coral-framework/services/i18n';
|
||||
import cn from 'classnames';
|
||||
|
||||
const AddOrganizationName = (props) => {
|
||||
const {handleSettingsChange, handleSettingsSubmit, install} = props;
|
||||
return (
|
||||
<div className={styles.step}>
|
||||
<div className={cn(styles.step, 'talk-install-step-2')}>
|
||||
<p>{t('install.add_organization.description')}</p>
|
||||
<div className={styles.form}>
|
||||
<form onSubmit={handleSettingsSubmit}>
|
||||
@@ -19,11 +20,17 @@ const AddOrganizationName = (props) => {
|
||||
onChange={handleSettingsChange}
|
||||
showErrors={install.showErrors}
|
||||
errorMsg={install.errors.organizationName} />
|
||||
<Button type="submit" cStyle='black' full>{t('install.add_organization.save')}</Button>
|
||||
<Button className="talk-install-step-2-save-button" type="submit" cStyle='black' full>{t('install.add_organization.save')}</Button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
AddOrganizationName.propTypes = {
|
||||
handleSettingsChange: PropTypes.func,
|
||||
handleSettingsSubmit: PropTypes.func,
|
||||
install: PropTypes.object,
|
||||
};
|
||||
|
||||
export default AddOrganizationName;
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import React from 'react';
|
||||
import styles from './style.css';
|
||||
import {TextField, Button, Spinner} from 'coral-ui';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import t from 'coral-framework/services/i18n';
|
||||
import cn from 'classnames';
|
||||
|
||||
const InitialStep = (props) => {
|
||||
const {handleUserChange, handleUserSubmit, install} = props;
|
||||
return (
|
||||
<div className={styles.step}>
|
||||
<div className={cn(styles.step, 'talk-install-step-3')}>
|
||||
<div className={styles.form}>
|
||||
<form onSubmit={handleUserSubmit}>
|
||||
<TextField
|
||||
@@ -53,7 +54,7 @@ const InitialStep = (props) => {
|
||||
|
||||
{
|
||||
!props.install.isLoading ?
|
||||
<Button cStyle='black' type="submit" full>{t('install.create.save')}</Button>
|
||||
<Button className="talk-install-step-3-save-button" cStyle='black' type="submit" full>{t('install.create.save')}</Button>
|
||||
:
|
||||
<Spinner />
|
||||
}
|
||||
@@ -64,4 +65,10 @@ const InitialStep = (props) => {
|
||||
);
|
||||
};
|
||||
|
||||
InitialStep.propTypes = {
|
||||
handleUserChange: PropTypes.func,
|
||||
handleUserSubmit: PropTypes.func,
|
||||
install: PropTypes.object,
|
||||
};
|
||||
|
||||
export default InitialStep;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import styles from './style.css';
|
||||
import {Button} from 'coral-ui';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import t from 'coral-framework/services/i18n';
|
||||
|
||||
const InitialStep = (props) => {
|
||||
@@ -9,9 +9,13 @@ const InitialStep = (props) => {
|
||||
return (
|
||||
<div className={styles.step}>
|
||||
<p>{t('install.initial.description')}</p>
|
||||
<Button cStyle='green' onClick={nextStep} raised>{t('install.initial.submit')}</Button>
|
||||
<Button className={'talk-install-get-started-button'} cStyle='green' onClick={nextStep} raised>{t('install.initial.submit')}</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
InitialStep.propTypes = {
|
||||
nextStep: PropTypes.func,
|
||||
};
|
||||
|
||||
export default InitialStep;
|
||||
|
||||
@@ -2,26 +2,34 @@ import React from 'react';
|
||||
import styles from './style.css';
|
||||
import {Button, Card} from 'coral-ui';
|
||||
import TagsInput from 'coral-admin/src/components/TagsInput';
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import cn from 'classnames';
|
||||
import t from 'coral-framework/services/i18n';
|
||||
|
||||
const PermittedDomainsStep = (props) => {
|
||||
const {finishInstall, install, handleDomainsChange} = props;
|
||||
const domains = install.data.settings.domains.whitelist;
|
||||
return (
|
||||
<div className={styles.step}>
|
||||
<div className={cn(styles.step, 'talk-install-step-4')}>
|
||||
<h3>{t('install.permitted_domains.title')}</h3>
|
||||
<Card className={styles.card}>
|
||||
<p>{t('install.permitted_domains.description')}</p>
|
||||
<TagsInput
|
||||
className="talk-install-step-4-permited-domains-input"
|
||||
value={domains}
|
||||
inputProps={{placeholder: 'URL'}}
|
||||
onChange={(tags) => handleDomainsChange(tags)}
|
||||
/>
|
||||
</Card>
|
||||
<Button cStyle='green' onClick={finishInstall} raised>{t('install.permitted_domains.submit')}</Button>
|
||||
<Button className="talk-install-step-4-save-button" cStyle='green' onClick={finishInstall} raised>{t('install.permitted_domains.submit')}</Button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
PermittedDomainsStep.propTypes = {
|
||||
finishInstall: PropTypes.func,
|
||||
handleDomainsChange: PropTypes.func,
|
||||
install: PropTypes.object,
|
||||
};
|
||||
|
||||
export default PermittedDomainsStep;
|
||||
|
||||
@@ -31,11 +31,8 @@ module.exports = {
|
||||
'enabled': true,
|
||||
'on_failure': true,
|
||||
'on_error': true,
|
||||
'path': './tests/e2e/reports'
|
||||
'path': './test/e2e/reports'
|
||||
},
|
||||
'exclude': [
|
||||
'./tests/e2e/tests/EmbedStreamTests.js'
|
||||
]
|
||||
},
|
||||
'integration': {
|
||||
'launch_url': 'http://localhost:3000'
|
||||
|
||||
Reference in New Issue
Block a user