Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signup styles #443

Merged
merged 9 commits into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions frontend/common/project.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
module.exports = global.Project = {
api: 'https://api-staging.flagsmith.com/api/v1/',
api: 'https://api.flagsmith.com/api/v1/',
flagsmithClientAPI: 'https://api.flagsmith.com/api/v1/',
flagsmith: 'ENktaJnfLVbLifybz34JmX', // This is our Bullet Train API key - Bullet Train runs on Bullet Train!
env: 'staging', // This is used for Sentry tracking
flagsmith: '4vfqhypYjcPoGGu8ByrBaj', // This is our Bullet Train API key - Bullet Train runs on Bullet Train!
env: 'prod', // This is used for Sentry tracking
sentry: 'https://2f6eb58a3987406aaeee38d5f0c38005@o486744.ingest.sentry.io/5666694',
maintenance: false, // trigger maintenance mode
cookieDomain: '.flagsmith.com',
excludeAnalytics: 'nightwatch@solidstategroup.com',
demoAccount: {
email: 'kyle+bullet-train@solidstategroup.com',
password: 'demo_account',
},
chargebee: {
site: 'flagsmith-test',
site: 'flagsmith',
},
assetUrl: 'https://cdn.flagsmith.com', // Location of the static files from build/, should contain a directory called static/
};
8 changes: 0 additions & 8 deletions frontend/tests/register-fail.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ module.exports = {
browser.expect.element('#error-alert').to.be.visible;
browser.expect.element('#email-error').to.be.visible;
},
'Registration should fail with invalid email address': function (browser) {
fillOutForm(browser)
.waitAndSet('[name="email"]', 'crap-email')
.click('button[name="signup-btn"]');

browser.expect.element('#error-alert').to.be.visible;
browser.expect.element('#email-error').to.be.visible;
},
'Registration should fail with password too short error': function (browser) {
fillOutForm(browser)
.waitAndSet('[name="password"]', 'abc123')
Expand Down
21 changes: 11 additions & 10 deletions frontend/web/components/Aside.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import FeaturesIcon from './svg/FeaturesIcon';
import UsersIcon from './svg/UsersIcon';
import SegmentsIcon from './svg/SegmentsIcon';
import EnvironmentSettingsIcon from './svg/EnvironmentSettingsIcon';

import ProjectStore from '../../common/stores/project-store'
const Aside = class extends Component {
static displayName = 'Aside';

Expand Down Expand Up @@ -176,6 +176,16 @@ const Aside = class extends Component {
</NavLink>
)}
</Permission>

<NavLink
to={`/project/${project.id}/environment/${this.props.environmentId || (ProjectStore.model&&ProjectStore.model.environments[0].api_key)}/segments`}

id="segments-link"
className="aside__nav-item"
>
<SegmentsIcon className="aside__nav-item--icon"/>
Segments
</NavLink>
<Permission level="project" permission="CREATE_ENVIRONMENT" id={this.props.projectId}>
{({ permission, isLoading }) => permission && (

Expand Down Expand Up @@ -230,15 +240,6 @@ const Aside = class extends Component {
/>
Users
</NavLink>
<NavLink
to={`/project/${project.id}/environment/${this.props.environmentId}/segments`}

id="segments-link"
className="aside__environment-list-item"
>
<SegmentsIcon className="aside__environment-list-item--icon"/>
Segments
</NavLink>
{environmentAdmin && (
<NavLink
id="env-settings-link"
Expand Down
18 changes: 16 additions & 2 deletions frontend/web/components/ForgotPasswordModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@ import data from '../../common/data/base/_data';
const ForgotPassword = class extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {};
this.state = {
email: props.initialValue,
};
}

componentDidMount() {
setTimeout(() => {
const emailField = document.querySelector('input[name="forgotPasswordEmail"]');
if (emailField) {
emailField.focus();
emailField.value = emailField.value;
}
}, 1000);
}

handleSubmit = (e) => {
Expand All @@ -27,9 +39,11 @@ const ForgotPassword = class extends React.Component {
<p>Please enter your email address</p>
<form onSubmit={this.handleSubmit}>
<InputGroup
inputProps={{ className: 'full-width mb-2' }}
inputProps={{ className: 'full-width mb-2',
name: 'forgotPasswordEmail' }}
title="Email Address"
placeholder="email" type="email"
value={this.state.email}
onChange={e => this.setState({ email: Utils.safeParseEventValue(e) })}
/>

Expand Down
4 changes: 2 additions & 2 deletions frontend/web/components/IntegrationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Integration extends Component {
const showAdd = !(!perEnvironment && activeIntegrations && activeIntegrations.length);
return (
<Panel
className="no-pad m-4"
className="no-pad panel--transparent m-4"
title={(
<Row style={{ flexWrap: 'noWrap' }}>
<Flex>
Expand All @@ -39,7 +39,7 @@ class Integration extends Component {
className="btn-lg btn-primary ml-4" id="show-create-segment-btn" data-test="show-create-segment-btn"
onClick={this.add}
>
<span className="icon ion-ios-apps"/>
<span className="icon ion-ios-apps text-white"/>
{' '}
Add integration
</Button>
Expand Down
10 changes: 8 additions & 2 deletions frontend/web/components/base/forms/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ export const ButtonLink = class extends PureComponent {
static displayName = 'ButtonLink';

render() {
const {buttonText, ...rest} = this.props;
return (
<Button {...this.props} className={`btn--link ${this.props.className || ''}`}>
<a className="btn--link" target={this.props.target} href={this.props.href}>{this.props.buttonText}{this.props.children}</a>
<Button {...rest} className={`btn--link ${this.props.className || ''}`}>
{this.props.href ? (
<a className="btn--link" target={this.props.target} href={this.props.href}>{this.props.buttonText}{this.props.children}</a>
) : (

<span className="btn--link">{this.props.buttonText}{this.props.children}</span>
)}
</Button>
);
}
Expand Down
9 changes: 8 additions & 1 deletion frontend/web/components/base/forms/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Input = class extends React.Component {

constructor(props, context) {
super(props, context);
this.state = { shouldValidate: false };
this.state = { shouldValidate: false, type: this.props.type };
}

onFocus = (e) => {
Expand Down Expand Up @@ -65,6 +65,7 @@ const Input = class extends React.Component {

const className = cn({
'input-container': true,
'password': this.props.type === 'password',
'focused': this.state.isFocused,
'invalid': this.state.shouldValidate && !isValid,
}, this.props.className);
Expand All @@ -82,6 +83,7 @@ const Input = class extends React.Component {
ref={c => this.input = c}
{...rest}
mask={this.props.mask}
type={this.state.type}
formatCharacters={maskedCharacters}
onKeyDown={this.onKeyDown}
onFocus={this.onFocus}
Expand All @@ -94,11 +96,16 @@ const Input = class extends React.Component {
ref={c => this.input = c}
{...rest} onFocus={this.onFocus}
onKeyDown={this.onKeyDown}
type={this.state.type}

onBlur={this.onBlur}
value={this.props.value}
className={innerClassName}
/>
)}
{this.props.type === 'password' && (
<span onClick={() => this.setState({ type: this.state.type === 'password' ? 'text' : 'password' })} className={`input-icon-right icon ion ${this.state.type === 'text' ? 'ion-ios-eye-off' : 'ion-ios-eye'}`}/>
)}
</div>
);
}
Expand Down
14 changes: 13 additions & 1 deletion frontend/web/components/base/forms/InputGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,19 @@ const FormGroup = class extends Component {
>
{this.props.tooltip}
</Tooltip>
) : <label htmlFor={id} className="cols-sm-2 control-label">{props.title}</label>}
) : (
<Row>
<Flex className="mr-4">
<label htmlFor={id} className="cols-sm-2 control-label">{props.title}</label>
</Flex>
<div style={{
marginBottom:"0.5rem"
}}>
{this.props.rightComponent}
</div>
</Row>

)}

{inputProps && inputProps.error && (
<span>
Expand Down
2 changes: 1 addition & 1 deletion frontend/web/components/pages/FeaturesPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ const FeaturesPage = class extends Component {
]}
items={this.filter(projectFlags, this.state.tags)}
header={(
<Row className="panel--grey px-0 pt-0 pb-2">
<Row className="px-0 pt-0 pb-2">
<TagSelect
showUntagged
showClearAll
Expand Down
Loading