Skip to content
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
2 changes: 1 addition & 1 deletion bin/update_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ console.log(
name,
version,
commit,
date
date,
},
undefined,
2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"reactstrap": "8.4.1"
},
"devDependencies": {
"prettier": "1.19.1",
"prettier": "2.0.2",
"source-map-explorer": "2.4.1"
},
"resolutions": {
Expand Down
8 changes: 4 additions & 4 deletions src/AutoProgressBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ export default class AutoProgressBar extends React.Component {
total: PropTypes.number,
targetTime: PropTypes.number,
auto: PropTypes.bool,
autoTickRate: PropTypes.number
autoTickRate: PropTypes.number,
};

static defaultProps = {
targetTime: 5000,
auto: true,
autoTickRate: 100
autoTickRate: 100,
};

constructor(props) {
super(props);
this.state = {
autoCounter: 0
autoCounter: 0,
};
this.interval = null;
}
Expand All @@ -36,7 +36,7 @@ export default class AutoProgressBar extends React.Component {

tick() {
const { autoTickRate, targetTime } = this.props;
this.setState(state => {
this.setState((state) => {
const next = state.autoCounter + autoTickRate;
if (next > targetTime) {
clearInterval(this.interval);
Expand Down
4 changes: 2 additions & 2 deletions src/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export class EllipsisLoading extends React.PureComponent {
static defaultProps = {
text: 'Loading',
animationMs: 400,
maxDots: 5
maxDots: 5,
};
componentDidMount() {
this.interval = window.setInterval(() => {
this.setState(state => {
this.setState((state) => {
return { dots: (state.dots + 1) % this.props.maxDots };
});
}, this.props.animationMs);
Expand Down
71 changes: 38 additions & 33 deletions src/DeployPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function makeTagAbsoluteUrl(owner, repo, tag) {

class DeployPage extends React.Component {
static propsTypes = {
shortCode: PropTypes.string.isRequired
shortCode: PropTypes.string.isRequired,
};

state = {
Expand All @@ -32,7 +32,7 @@ class DeployPage extends React.Component {
deployInfo: null,
error: null,
loading: null,
tags: null
tags: null,
};

isLoading() {
Expand All @@ -53,13 +53,13 @@ class DeployPage extends React.Component {
}

finishLoad(name) {
this.setState(state => state.loading.delete(name));
this.setState((state) => state.loading.delete(name));
}

async decodeShortCode() {
const {
history,
match: { params }
match: { params },
} = this.props;
this.startLoad('parameters');
try {
Expand Down Expand Up @@ -90,7 +90,7 @@ class DeployPage extends React.Component {
} else {
this.setState({
deployInfo: res.deployments,
tags: res.tags
tags: res.tags,
});
}
} catch (error) {
Expand Down Expand Up @@ -137,8 +137,8 @@ class DeployPage extends React.Component {
render() {
const {
match: {
params: { code }
}
params: { code },
},
} = this.props;
const {
error,
Expand All @@ -147,7 +147,7 @@ class DeployPage extends React.Component {
commits,
tags,
owner,
repo
repo,
} = this.state;

document.title = `What's Deployed on ${owner}/${repo}?`;
Expand Down Expand Up @@ -219,19 +219,19 @@ class DeployTable extends React.Component {
tags: PropTypes.object.isRequired,
code: PropTypes.string.isRequired,
owner: PropTypes.string.isRequired,
repo: PropTypes.string.isRequired
repo: PropTypes.string.isRequired,
};
static prefBorsModeCacheKey = 'pref-bors-mode';

state = {
borsMode: false
borsMode: false,
};

componentDidMount() {
this._restoreBorsModeChoice();
}

handleBorsCheckbox = ev => {
handleBorsCheckbox = (ev) => {
this.setState({ borsMode: ev.target.checked }, this._persistBorsModeChoice);
};

Expand Down Expand Up @@ -282,7 +282,7 @@ class DeployTable extends React.Component {
for (const deploy of deployInfo) {
if (commit.sha === deploy.sha) {
foundDeploy[deploy.name] = true;
if (Array.from(Object.values(foundDeploy)).every(f => f)) {
if (Array.from(Object.values(foundDeploy)).every((f) => f)) {
foundMatch = true;
}
}
Expand All @@ -308,7 +308,7 @@ class DeployTable extends React.Component {
owner={owner}
repo={repo}
/>
{deployInfo.map(deploy => (
{deployInfo.map((deploy) => (
<td
className={classNames({ checked: foundDeploy[deploy.name] })}
key={`${commit.sha}:${deploy.name}`}
Expand Down Expand Up @@ -341,7 +341,7 @@ class DeployTable extends React.Component {
</span>
)}
</th>
{deployInfo.map(deployment => (
{deployInfo.map((deployment) => (
<th key={`${deployment.name}-col`}>{deployment.name}</th>
))}
</tr>
Expand Down Expand Up @@ -382,12 +382,12 @@ class CommitDetails extends React.Component {
author: PropTypes.shape({
login: PropTypes.string.isRequired,
avatar_url: PropTypes.string.isRequired,
html_url: PropTypes.string.isRequired
html_url: PropTypes.string.isRequired,
}),
html_url: PropTypes.string.isRequired,
owner: PropTypes.string.isRequired,
repo: PropTypes.string.isRequired,
tag: PropTypes.any
tag: PropTypes.any,
};

parseBorsMessage(commit) {
Expand All @@ -409,12 +409,12 @@ class CommitDetails extends React.Component {
const { users } = this.props;
let headers = commit.message
.split(/\n\n/g)
.filter(paragraph => /^\d+: /.test(paragraph));
.filter((paragraph) => /^\d+: /.test(paragraph));

return {
description: headers.join('; '),
authors: headers
.map(header => {
.map((header) => {
const match = header.match(/a=([^ ]*)+/);
if (match) {
let [, author] = match;
Expand All @@ -427,7 +427,7 @@ class CommitDetails extends React.Component {
}
return null;
})
.filter(login => login)
.filter((login) => login),
};
}

Expand All @@ -444,7 +444,10 @@ class CommitDetails extends React.Component {
const { description, authors } = this.parseBorsMessage(commit);
title = description;
for (const author of authors) {
if (author && !involvedUsers.map(u => u.login).includes(author.login)) {
if (
author &&
!involvedUsers.map((u) => u.login).includes(author.login)
) {
involvedUsers.unshift(author);
}
}
Expand Down Expand Up @@ -480,7 +483,7 @@ class CommitDetails extends React.Component {
function UserAvatars({ users }) {
return (
<div className="user-avatar-group">
{users.map(user => {
{users.map((user) => {
if (!user) {
return (
<span className="user-avatar unknown-user" title="Unknown User" />
Expand Down Expand Up @@ -510,7 +513,7 @@ class RepoSummary extends React.Component {
).isRequired,
owner: PropTypes.string.isRequired,
repo: PropTypes.string.isRequired,
tags: PropTypes.object.isRequired
tags: PropTypes.object.isRequired,
};

render() {
Expand All @@ -529,13 +532,13 @@ class RepoSummary extends React.Component {
<tr>
<th>Revision URLs</th>
<th>SHA</th>
{deployInfo.map(deployment => (
{deployInfo.map((deployment) => (
<td key={deployment.name}>{deployment.name}</td>
))}
</tr>
</thead>
<tbody>
{deployInfo.map(deployment => (
{deployInfo.map((deployment) => (
<tr key={deployment.name}>
<td>
<a
Expand All @@ -554,7 +557,7 @@ class RepoSummary extends React.Component {
tags={tags}
/>
</td>
{deployInfo.map(otherDeployment => {
{deployInfo.map((otherDeployment) => {
if (otherDeployment.name === deployment.name) {
return <td key="same">-</td>;
} else {
Expand Down Expand Up @@ -606,7 +609,7 @@ class Culprits extends React.PureComponent {
state = {
loading: true,
culprits: null,
error: null
error: null,
};

componentDidMount() {
Expand All @@ -628,7 +631,7 @@ class Culprits extends React.PureComponent {
const res = await ky
.post('/culprits', {
signal,
json: { owner, repo, deployments: deployInfo }
json: { owner, repo, deployments: deployInfo },
})
.json();
if (this.dismounted) return;
Expand All @@ -655,7 +658,7 @@ class Culprits extends React.PureComponent {
{loading && <EllipsisLoading text="loading culprits" />}
{culprits && (
<div className="culprits">
{culprits.map(group => (
{culprits.map((group) => (
<div key={group.name} className="group">
<h4>
<span className="on-prefix">On</span> {group.name}
Expand Down Expand Up @@ -691,18 +694,18 @@ class Culprits extends React.PureComponent {
class BadgesAndUrls extends React.Component {
state = {
showHelp: false,
textCopied: ''
textCopied: '',
};

componentWillUnmount() {
this.dismounted = true;
}

toggleHelp = () => {
this.setState(state => ({ showHelp: !state.showHelp }));
this.setState((state) => ({ showHelp: !state.showHelp }));
};

copiedText = textCopied => {
copiedText = (textCopied) => {
this.setState({ textCopied }, () => {
window.setTimeout(() => {
if (!this.dismounted) {
Expand All @@ -712,7 +715,7 @@ class BadgesAndUrls extends React.Component {
});
};

showCopyToClipboard = text => {
showCopyToClipboard = (text) => {
return (
<CopyToClipboard text={text} onCopy={() => this.copiedText(text)}>
<small>
Expand All @@ -735,7 +738,9 @@ class BadgesAndUrls extends React.Component {

const { protocol, host } = window.location;
const fullUrl = `${protocol}//${host}${shortUrl}/${owner}/${repo}`;
const envs = deployInfo.map(deploy => deploy.name.toLowerCase()).join(',');
const envs = deployInfo
.map((deploy) => deploy.name.toLowerCase())
.join(',');
const badgeUrl = `https://img.shields.io/badge/whatsdeployed-${envs}-green.svg`;
const badgeAlt = `What's deployed on ${envs}?`;
const markdown = `[![${badgeAlt}](${badgeUrl})](${fullUrl})`;
Expand Down
8 changes: 4 additions & 4 deletions src/LongUrlRedirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { withRouter } from './Routes';

class LongUrlRedirect extends React.Component {
state = {
error: null
error: null,
};

static propsTypes = {
Expand All @@ -16,9 +16,9 @@ class LongUrlRedirect extends React.Component {
deployments: PropTypes.arrayOf(
PropTypes.shape({
url: PropTypes.string.isRequired,
name: PropTypes.string.isRequired
name: PropTypes.string.isRequired,
})
)
),
};

async shorten(props = this.props) {
Expand All @@ -40,7 +40,7 @@ class LongUrlRedirect extends React.Component {
pathname: `/s/${code}`,
search: '',
hash: '',
state: null
state: null,
});
} catch (error) {
this.setState({ error });
Expand Down
4 changes: 2 additions & 2 deletions src/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Switch,
Redirect,
Route,
withRouter as originalWithRouter
withRouter as originalWithRouter,
} from 'react-router-dom';

import SetupPage from './SetupPage';
Expand All @@ -28,7 +28,7 @@ const Routes = withRouter(({ location }) => {
export default Routes;

export function withRouter(Component) {
return originalWithRouter(props => {
return originalWithRouter((props) => {
props.location.searchParams = new URLSearchParams(props.location.search);
return <Component {...props} />;
});
Expand Down
Loading