Skip to content

Commit

Permalink
Merge pull request #454 from BinaryStudioAcademy/fix/hide-mention
Browse files Browse the repository at this point in the history
fix: Hide mention on Settings profile
  • Loading branch information
olyakolesnichenko authored Sep 13, 2019
2 parents 1cd0a70 + 8cbe485 commit 034fc55
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 53 deletions.
10 changes: 7 additions & 3 deletions client/src/components/IssueComments/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ IssueComments.propTypes = {
repositoryId: PropTypes.string.isRequired,
userImg: PropTypes.string,
userName: PropTypes.string.isRequired,
owner: PropTypes.string.isRequired,
reponame: PropTypes.string.isRequired,
owner: PropTypes.string.isRequired,
reponame: PropTypes.string.isRequired,
fetchCurrentRepo: PropTypes.func.isRequired,
history: PropTypes.shape({
push: PropTypes.func.isRequired
Expand All @@ -418,7 +418,11 @@ const mapStateToProps = ({
},
currentRepo: {
repository: {
currentRepoInfo: { id: repositoryId, name: reponame, user: { username: owner } }
currentRepoInfo: {
id: repositoryId,
name: reponame,
user: { username: owner }
}
}
}
}) => ({
Expand Down
70 changes: 35 additions & 35 deletions client/src/components/IssuesPullsList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,47 +168,47 @@ class IssuesPullsList extends React.Component {

onUserInputChange = async (e, { value }) => {
switch (e.target.name) {
case 'author':
await this.setState({ authorDropdownFilter: value });
break;
case 'assignee':
await this.setState({ assigneeDropdownFilter: value });
break;
default:
return;
case 'author':
await this.setState({ authorDropdownFilter: value });
break;
case 'assignee':
await this.setState({ assigneeDropdownFilter: value });
break;
default:
return;
}
};

onUserInputHitEnter = async e => {
if (e.key === 'Enter') {
switch (e.target.name) {
case 'author':
const { authorList, authorDropdownFilter } = this.state;
const filteredAuthorList = authorList.filter(author => author.username.includes(authorDropdownFilter));
if (filteredAuthorList.length > 0) {
await this.setState({
authorDropdownFilter: '',
filter: { ...this.state.filter, authorId: filteredAuthorList[0].id }
});
this.fetchData();
}
break;
case 'assignee':
const { assigneeList, assigneeDropdownFilter } = this.state;
const filteredAssigneeList = assigneeList.filter(
assignee => assignee && assignee.username && assignee.username.includes(assigneeDropdownFilter)
);

if (filteredAssigneeList.length > 0) {
await this.setState({
assigneeDropdownFilter: '',
filter: { ...this.state.filter, assigneeId: filteredAssigneeList[0].id }
});
this.fetchData();
}
break;
default:
return;
case 'author':
const { authorList, authorDropdownFilter } = this.state;
const filteredAuthorList = authorList.filter(author => author.username.includes(authorDropdownFilter));
if (filteredAuthorList.length > 0) {
await this.setState({
authorDropdownFilter: '',
filter: { ...this.state.filter, authorId: filteredAuthorList[0].id }
});
this.fetchData();
}
break;
case 'assignee':
const { assigneeList, assigneeDropdownFilter } = this.state;
const filteredAssigneeList = assigneeList.filter(
assignee => assignee && assignee.username && assignee.username.includes(assigneeDropdownFilter)
);

if (filteredAssigneeList.length > 0) {
await this.setState({
assigneeDropdownFilter: '',
filter: { ...this.state.filter, assigneeId: filteredAssigneeList[0].id }
});
this.fetchData();
}
break;
default:
return;
}
}
};
Expand Down
6 changes: 5 additions & 1 deletion client/src/containers/CreateIssuePage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ const mapStateToProps = ({
issuesData: { issues },
currentRepo: {
repository: {
currentRepoInfo: { id, name, user: { username: owner } }
currentRepoInfo: {
id,
name,
user: { username: owner }
}
}
}
}) => ({
Expand Down
8 changes: 6 additions & 2 deletions client/src/containers/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const SearchInp = () => {
onClick={() => {
setText('');
setResults([]);
window.location.href = `${window.location.origin}${endpoint}`;
window.location.href = `${window.location.origin}${endpoint}`;
}}
>
<p className={styles.searchItem}>
Expand All @@ -55,7 +55,7 @@ const SearchInp = () => {
</p>
</div>
);
};
};

const handleSearchChange = async (e, { value }) => {
if (!value) {
Expand Down Expand Up @@ -325,6 +325,10 @@ HeaderDesktopAuth.propTypes = {
})
};

SearchInp.propTypes = {
content: PropTypes.array.isRequired
};

const Header = ({ isAuthorized, username, imgUrl, status, fetchCurrentUser }) => {
return isAuthorized
? WithSidebar(HeaderDesktopAuth, { username, imgUrl, status, fetchCurrentUser })
Expand Down
12 changes: 0 additions & 12 deletions client/src/containers/SettingsProfile/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,6 @@ class SettingsProfile extends Component {
<div>Your name may appear around Depot where you contribute or are mentioned. You can remove it at any time.</div>
),
email: <div>You cannot change your email at this time.</div>,
bio: (
<div>
You can @<strong>mention</strong> other users and organizations to link to them.
</div>
),
company: (
<div>
You can @<strong>mention</strong> your company’s Depot organization to link it.
</div>
),
disclaimer: (
<div>
All of the fields on this page are optional and can be deleted at any time, and by filling them out, you're
Expand Down Expand Up @@ -204,7 +194,6 @@ class SettingsProfile extends Component {
<Header as="h4">Bio</Header>
<Field name="bio" render={this.renderTextArea} />
<InputError name="bio" />
<div className={styles.note}>{this.NOTES.bio}</div>

<Header as="h4">URL</Header>
<Field type="text" name="url" render={this.renderField} />
Expand All @@ -213,7 +202,6 @@ class SettingsProfile extends Component {
<Header as="h4">Company</Header>
<Field type="text" name="company" render={this.renderField} />
<InputError name="company" />
<div className={styles.note}>{this.NOTES.company}</div>

<Divider />

Expand Down

0 comments on commit 034fc55

Please sign in to comment.