Skip to content

Commit

Permalink
Updated eslint-config-jitsi
Browse files Browse the repository at this point in the history
  • Loading branch information
akshitkrnagpal authored and saghul committed Jun 11, 2018
1 parent 67cab07 commit decb351
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 40 deletions.
6 changes: 1 addition & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
module.exports = {
'extends': [
'eslint-config-jitsi',
'plugin:react/recommended'
],
'plugins': [
'react'
'eslint-config-jitsi'
]
};
7 changes: 7 additions & 0 deletions app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
'extends': [
'./../.eslintrc.js',
'eslint-config-jitsi/jsdoc',
'eslint-config-jitsi/react'
]
};
2 changes: 1 addition & 1 deletion app/features/app/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export default class App extends Component<*> {
<Router history = { history }>
<Switch>
<Route
exact
component = { Welcome }
exact = { true }
path = '/' />
<Route
component = { Conference }
Expand Down
14 changes: 12 additions & 2 deletions app/features/conference/components/Conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class Conference extends Component<Props, *> {

/**
* Attach the script to this component.
*
* @returns {void}
*/
componentDidMount() {
const parentNode = this._ref.current;
Expand All @@ -75,6 +77,8 @@ class Conference extends Component<Props, *> {

/**
* Remove conference on unmounting.
*
* @returns {void}
*/
componentWillUnmount() {
if (this._api) {
Expand All @@ -85,15 +89,16 @@ class Conference extends Component<Props, *> {
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
return <Wrapper innerRef={this._ref} />;
return <Wrapper innerRef = { this._ref } />;
}

/**
* Navigates to home screen (Welcome).
*
* @returns {void}
*/
_navigateToHome() {
this.props.dispatch(push('/'));
Expand All @@ -102,6 +107,11 @@ class Conference extends Component<Props, *> {
/**
* When the script is loaded create the iframe element in this component
* and attach utils from jitsi-meet-electron-utils.
*
* @param {Object} parentNode - Node to which iframe has to be attached.
* @param {string} roomName - Conference room name to be joined.
* @param {string} domain - Jitsi Meet server domain.
* @returns {void}
*/
_onScriptLoad(parentNode: Object, roomName: string, domain: string) {
const JitsiMeetExternalAPI = window.JitsiMeetExternalAPI;
Expand Down
44 changes: 26 additions & 18 deletions app/features/navbar/components/HelpAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,66 +32,74 @@ class HelpAction extends Component< *, State> {
droplistOpen: false
};

this._droplistToggle = this._droplistToggle.bind(this);
this._openPrivacyPage = this._openPrivacyPage.bind(this);
this._openTermsPage = this._openTermsPage.bind(this);
this._sendFeedback = this._sendFeedback.bind(this);
this._onIconClick = this._onIconClick.bind(this);
this._onPrivacyOptionClick = this._onPrivacyOptionClick.bind(this);
this._onTermsOptionClick = this._onTermsOptionClick.bind(this);
this._onSendFeedback = this._onSendFeedback.bind(this);
}

_droplistToggle: (*) => void;
_onIconClick: (*) => void;

/**
* Toggles the droplist.
*
* @returns {void}
*/
_droplistToggle() {
_onIconClick() {
this.setState({
droplistOpen: !this.state.droplistOpen
});
}

_openPrivacyPage: (*) => void;
_onPrivacyOptionClick: (*) => void;

/**
* Opens Privacy Policy Page in default browser.
*
* @returns {void}
*/
_openPrivacyPage() {
_onPrivacyOptionClick() {
openExternalLink(config.privacyPolicyURL);
}

_openTermsPage: (*) => void;
_onTermsOptionClick: (*) => void;

/**
* Opens Terms and Conditions Page in default browser.
*
* @returns {void}
*/
_openTermsPage() {
_onTermsOptionClick() {
openExternalLink(config.termsAndConditionsURL);
}

_sendFeedback: (*) => void;
_onSendFeedback: (*) => void;

/**
* Opens Support/Feedback Email.
*
* @returns {void}
*/
_sendFeedback() {
_onSendFeedback() {
openExternalLink(config.feedbackURL);
}

/**
* Render function of component.
*
* @return {ReactElement}
* @returns {ReactElement}
*/
render() {
return (
<Droplist
isOpen = { this.state.droplistOpen }
onClick = { () => this._droplistToggle() }
onOpenChange = { () => this._droplistToggle() }
onClick = { this._onIconClick }
onOpenChange = { this._onIconClick }
position = 'right bottom'
trigger = { <HelpIcon /> }>
<Item onActivate = { this._openTermsPage }>Terms</Item>
<Item onActivate = { this._openPrivacyPage }>Privacy</Item>
<Item onActivate = { this._sendFeedback } >Send Feedback</Item>
<Item onActivate = { this._onTermsOptionClick }>Terms</Item>
<Item onActivate = { this._onPrivacyOptionClick }>Privacy</Item>
<Item onActivate = { this._onSendFeedback }>Send Feedback</Item>
</Droplist>
);
}
Expand Down
6 changes: 4 additions & 2 deletions app/features/navbar/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import HelpAction from './HelpAction';
class Navbar extends Component<*> {
/**
* Get the array of Secondary actions of Global Navigation.
*
* @returns {ReactElement[]}
*/
_getSecondaryActions() {
return [
<AkGlobalItem key={0}>
<AkGlobalItem key = { 0 }>
<HelpAction />
</AkGlobalItem>
];
Expand All @@ -27,7 +29,7 @@ class Navbar extends Component<*> {
/**
* Render function of component.
*
* @return {ReactElement}
* @returns {ReactElement}
*/
render() {
return (
Expand Down
5 changes: 5 additions & 0 deletions app/features/utils/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ import { shell } from 'electron';

/**
* Opens the provided link in default broswer.
*
* @param {string} link - Link to open outside the desktop app.
* @returns {void}
*/
export function openExternalLink(link: string) {
shell.openExternal(link);
}

/**
* Return true if Electron app is running on Mac system.
*
* @returns {boolean}
*/
export function isElectronMac() {
return process.platform === 'darwin';
Expand Down
11 changes: 10 additions & 1 deletion app/features/welcome/components/Welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Welcome extends Component<Props, State> {
/**
* Render function of component.
*
* @return {ReactElement}
* @returns {ReactElement}
*/
render() {
return (
Expand Down Expand Up @@ -92,6 +92,9 @@ class Welcome extends Component<Props, State> {

/**
* Prevents submission of the form and delegates the join logic.
*
* @param {Event} event - Event by which this function is called.
* @returns {void}
*/
_onFormSubmit(event: Event) {
event.preventDefault();
Expand All @@ -102,6 +105,8 @@ class Welcome extends Component<Props, State> {

/**
* Redirect and join conference.
*
* @returns {void}
*/
_onJoin() {
const url = URL.parse(this.state.url);
Expand All @@ -122,6 +127,10 @@ class Welcome extends Component<Props, State> {

/**
* Keeps URL input value and URL in state in sync.
*
* @param {SyntheticInputEvent<HTMLInputElement>} event - Event by which
* this function is called.
* @returns {void}
*/
_onURLChange(event: SyntheticInputEvent<HTMLInputElement>) {
this.setState({
Expand Down
2 changes: 2 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { store } from './features/redux';
class Root extends Component<*> {
/**
* Implements React's {@link Component#render()}.
*
* @returns {ReactElement}
*/
render() {
return (
Expand Down
18 changes: 8 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"electron-packager": "12.0.2",
"electron-rebuild": "1.7.3",
"eslint": "4.12.1",
"eslint-config-jitsi": "jitsi/eslint-config-jitsi",
"eslint-config-jitsi": "jitsi/eslint-config-jitsi#v0.1.0",
"eslint-plugin-flowtype": "2.46.3",
"eslint-plugin-import": "2.11.0",
"eslint-plugin-jsdoc": "3.2.0",
Expand Down

0 comments on commit decb351

Please sign in to comment.