Skip to content

Commit

Permalink
just before rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Chidiebere Oguejiofor committed Oct 19, 2018
1 parent e44dd9f commit 95324ba
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 64 deletions.
40 changes: 0 additions & 40 deletions client/public/resources/images/copy.svg

This file was deleted.

13 changes: 6 additions & 7 deletions client/src/modules/Teams/components/InviteForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import image from '../../../../public/resources/images/copy.png';
const AccountsForm = ({
options, isDisabled, handleSelected, formTitle,
ismultiSelectDisabled, inviteMember, buttonCaption,
hideLink, sharedLink, copyToClipboard
sharedLink, copyToClipboard, copyText
}) => (
<div id="invite_form">
<div className="row account-row">
Expand Down Expand Up @@ -63,14 +63,13 @@ const AccountsForm = ({
onCopy={() => copyToClipboard(true)}>
<img
className="copy-icon" src={image} alt="Hello" srcSet=""

onClick={copyToClipboard}
/>
</CopyToClipboard>

<input className="disabled-input-text" type="text" value={sharedLink} />
</div>
<div className="copy-link-text">Copy shareable link above</div>
<div className="copy-link-text">{copyText}</div>
</div>

</form>
Expand All @@ -90,14 +89,14 @@ AccountsForm.propTypes = {
ismultiSelectDisabled: PropTypes.bool.isRequired,
inviteMember: PropTypes.func.isRequired,
buttonCaption: PropTypes.string.isRequired,
hideLink: PropTypes.bool,
sharedLink: PropTypes.string,
copyToClipboard: PropTypes.func.isRequired
copyToClipboard: PropTypes.func.isRequired,
copyText: PropTypes.string

};

AccountsForm.defaultProps = {
hideLink: false,
sharedLink: ''
sharedLink: '',
copyText: 'Copy shareable link above'
};
export default AccountsForm;
7 changes: 0 additions & 7 deletions client/src/modules/Teams/components/Member.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,6 @@ export class Member extends Component {
</li>
)
}
<li
className="nav-link "
onClick={event => chooseContent(event, 'see members')}
>
<i className="material-icons left nav-icons">group</i>
<span className="nav-icons">See members</span>
</li>
<li
className="nav-link "
onClick={event => chooseContent(event, 'share link')}
Expand Down
13 changes: 8 additions & 5 deletions client/src/modules/Teams/components/ShareLink.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,24 @@ export class ShareLink extends Component {

handleSelected(selectedOption) {
this.setState({ accounts: selectedOption });
console.log(selectedOption);
}

submitForm(e) {
e.preventDefault();

const { accounts } = this.state;
const token = jwt.sign({
accounts,
userId: localStorage.getItem('userId'),
role: localStorage.getItem('role')
}, process.env.JSON_SECRET, { expiresIn: '1week' });

console.log(accounts);
const token = jwt.sign({ accounts }, process.env.JSON_SECRET, { expiresIn: '1week' });
this.setState({
sharedLink: `${window.location.host}/join/${token}`
});
}
copyText() {
console.log('Copied');
this.setState({ copyPrompt: 'Copied to clipboard' });
}


Expand All @@ -59,7 +61,7 @@ export class ShareLink extends Component {


render() {
const { sharedLink } = this.state;
const { sharedLink, copyPrompt } = this.state;

return (
<React.Fragment>
Expand All @@ -74,6 +76,7 @@ export class ShareLink extends Component {
buttonCaption={sharedLink ? "Regenerate Link" : "Generate Link"}
sharedLink={sharedLink}
copyToClipboard={this.copyText}
copyText={copyPrompt}
/>
</React.Fragment>
);
Expand Down
1 change: 0 additions & 1 deletion client/src/redux/actions/requests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export const loadRequests = (requestType = '', limit = '', offset = 0) => dispat
data.errors[0]
));
}
console.log(data, 'the data response');
const payload = {
requests: data.data.requests,
meta: data.meta
Expand Down
3 changes: 0 additions & 3 deletions client/src/routes/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ import Teams from '../modules/Teams/container';
import RequireAuth from './RequireAuth';
import AuthRoute from './AuthRoute';
import ErrorPage from '../modules/common/404';
import store from "../store";
import { loadRequests } from "../redux/actions/requests/index";

store.dispatch(loadRequests('member_requests'));
export default class Routes extends Component {
componentDidMount() {
M.AutoInit();
Expand Down
1 change: 0 additions & 1 deletion client/src/tests/redux/actions/requests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ describe('Request Actions', () => {
return store.dispatch(loadRequests('admin_request', 10, 10))
.then(() => {
const actions = store.getActions();
console.log(actions);

expect(actions[0].type).toEqual(IS_LOGGED_IN);
expect(actions[0].payload).toEqual(false);
Expand Down

0 comments on commit 95324ba

Please sign in to comment.