aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/auth
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-07-30 10:54:54 +0200
committerLibravatar GitHub <noreply@github.com>2021-07-30 14:24:54 +0530
commitf4b4416ea52d564bc2dbe543a82084ed98843ccc (patch)
tree7ca6b23571c86458a6b799746c91a7191de02715 /src/components/auth
parent5.6.1-nightly.8 [skip ci] (diff)
downloadferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.tar.gz
ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.tar.zst
ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.zip
chore: migrate from tslint to @typescript-eslint (#1706)
- update .eslintrc to work for .js and .ts - update devDependencies - lint properly both root /src and nested /packages - update webhint recommended setting for tsconfig.json to shrink output - Manage all eslint rules from the repo root - escape single quotes in scripts to please windows build Co-authored-by: Vijay A <avijayr@protonmail.com>
Diffstat (limited to 'src/components/auth')
-rw-r--r--src/components/auth/AuthLayout.js28
-rw-r--r--src/components/auth/ChangeServer.js4
-rw-r--r--src/components/auth/Locked.js2
-rw-r--r--src/components/auth/Login.js2
-rw-r--r--src/components/auth/Password.js2
-rw-r--r--src/components/auth/SetupAssistant.js10
-rw-r--r--src/components/auth/Signup.js2
-rw-r--r--src/components/auth/Welcome.js2
8 files changed, 32 insertions, 20 deletions
diff --git a/src/components/auth/AuthLayout.js b/src/components/auth/AuthLayout.js
index 6fa3adf92..c0e6b982b 100644
--- a/src/components/auth/AuthLayout.js
+++ b/src/components/auth/AuthLayout.js
@@ -7,14 +7,19 @@ import { TitleBar } from 'electron-react-titlebar';
7import Link from '../ui/Link'; 7import Link from '../ui/Link';
8import InfoBar from '../ui/InfoBar'; 8import InfoBar from '../ui/InfoBar';
9 9
10import { oneOrManyChildElements, globalError as globalErrorPropType } from '../../prop-types'; 10import {
11 oneOrManyChildElements,
12 globalError as globalErrorPropType,
13} from '../../prop-types';
11import globalMessages from '../../i18n/globalMessages'; 14import globalMessages from '../../i18n/globalMessages';
12 15
13import { isWindows } from '../../environment'; 16import { isWindows } from '../../environment';
14import AppUpdateInfoBar from '../AppUpdateInfoBar'; 17import AppUpdateInfoBar from '../AppUpdateInfoBar';
15import { GITHUB_FERDI_URL } from '../../config'; 18import { GITHUB_FERDI_URL } from '../../config';
16 19
17export default @observer class AuthLayout extends Component { 20export default
21@observer
22class AuthLayout extends Component {
18 static propTypes = { 23 static propTypes = {
19 children: oneOrManyChildElements.isRequired, 24 children: oneOrManyChildElements.isRequired,
20 error: globalErrorPropType.isRequired, 25 error: globalErrorPropType.isRequired,
@@ -30,7 +35,7 @@ export default @observer class AuthLayout extends Component {
30 35
31 state = { 36 state = {
32 shouldShowAppUpdateInfoBar: true, 37 shouldShowAppUpdateInfoBar: true,
33 } 38 };
34 39
35 static defaultProps = { 40 static defaultProps = {
36 nextAppReleaseVersion: null, 41 nextAppReleaseVersion: null,
@@ -57,12 +62,15 @@ export default @observer class AuthLayout extends Component {
57 62
58 return ( 63 return (
59 <> 64 <>
60 {isWindows && !isFullScreen && <TitleBar menu={window.ferdi.menu.template} icon="assets/images/logo.svg" />} 65 {isWindows && !isFullScreen && (
66 <TitleBar
67 menu={window.ferdi.menu.template}
68 icon="assets/images/logo.svg"
69 />
70 )}
61 <div className="auth"> 71 <div className="auth">
62 {!isOnline && ( 72 {!isOnline && (
63 <InfoBar 73 <InfoBar type="warning">
64 type="warning"
65 >
66 <span className="mdi mdi-flash" /> 74 <span className="mdi mdi-flash" />
67 {intl.formatMessage(globalMessages.notConnectedToTheInternet)} 75 {intl.formatMessage(globalMessages.notConnectedToTheInternet)}
68 </InfoBar> 76 </InfoBar>
@@ -95,7 +103,11 @@ export default @observer class AuthLayout extends Component {
95 })} 103 })}
96 </div> 104 </div>
97 {/* </div> */} 105 {/* </div> */}
98 <Link to={`${GITHUB_FERDI_URL}/ferdi`} className="auth__adlk" target="_blank"> 106 <Link
107 to={`${GITHUB_FERDI_URL}/ferdi`}
108 className="auth__adlk"
109 target="_blank"
110 >
99 <img src="./assets/images/adlk.svg" alt="" /> 111 <img src="./assets/images/adlk.svg" alt="" />
100 </Link> 112 </Link>
101 </div> 113 </div>
diff --git a/src/components/auth/ChangeServer.js b/src/components/auth/ChangeServer.js
index 0dedd825a..7bab80280 100644
--- a/src/components/auth/ChangeServer.js
+++ b/src/components/auth/ChangeServer.js
@@ -100,7 +100,7 @@ export default @observer class ChangeServer extends Component {
100 const { intl } = this.context; 100 const { intl } = this.context;
101 return ( 101 return (
102 <div className="auth__container"> 102 <div className="auth__container">
103 <form className="franz-form auth__form" onSubmit={e => this.submit(e)}> 103 <form className="franz-form auth__form" onSubmit={(e) => this.submit(e)}>
104 <h1>{intl.formatMessage(messages.headline)}</h1> 104 <h1>{intl.formatMessage(messages.headline)}</h1>
105 {form.$('server').value === this.franzServer 105 {form.$('server').value === this.franzServer
106 && ( 106 && (
@@ -113,7 +113,7 @@ export default @observer class ChangeServer extends Component {
113 && ( 113 && (
114 <Input 114 <Input
115 placeholder="Custom Server" 115 placeholder="Custom Server"
116 onChange={e => this.submit(e)} 116 onChange={(e) => this.submit(e)}
117 field={form.$('customServer')} 117 field={form.$('customServer')}
118 /> 118 />
119 )} 119 )}
diff --git a/src/components/auth/Locked.js b/src/components/auth/Locked.js
index 1fdbea595..2ad8a2409 100644
--- a/src/components/auth/Locked.js
+++ b/src/components/auth/Locked.js
@@ -102,7 +102,7 @@ export default @observer class Locked extends Component {
102 102
103 return ( 103 return (
104 <div className="auth__container"> 104 <div className="auth__container">
105 <form className="franz-form auth__form" onSubmit={e => this.submit(e)}> 105 <form className="franz-form auth__form" onSubmit={(e) => this.submit(e)}>
106 <img 106 <img
107 src="./assets/images/logo.svg" 107 src="./assets/images/logo.svg"
108 className="auth__logo" 108 className="auth__logo"
diff --git a/src/components/auth/Login.js b/src/components/auth/Login.js
index 52b09eab6..9e6a8d046 100644
--- a/src/components/auth/Login.js
+++ b/src/components/auth/Login.js
@@ -135,7 +135,7 @@ export default @inject('actions') @observer class Login extends Component {
135 135
136 return ( 136 return (
137 <div className="auth__container"> 137 <div className="auth__container">
138 <form className="franz-form auth__form" onSubmit={e => this.submit(e)}> 138 <form className="franz-form auth__form" onSubmit={(e) => this.submit(e)}>
139 <img 139 <img
140 src="./assets/images/logo.svg" 140 src="./assets/images/logo.svg"
141 className="auth__logo" 141 className="auth__logo"
diff --git a/src/components/auth/Password.js b/src/components/auth/Password.js
index ad34e39af..eafc48502 100644
--- a/src/components/auth/Password.js
+++ b/src/components/auth/Password.js
@@ -86,7 +86,7 @@ export default @observer class Password extends Component {
86 86
87 return ( 87 return (
88 <div className="auth__container"> 88 <div className="auth__container">
89 <form className="franz-form auth__form" onSubmit={e => this.submit(e)}> 89 <form className="franz-form auth__form" onSubmit={(e) => this.submit(e)}>
90 <img 90 <img
91 src="./assets/images/logo.svg" 91 src="./assets/images/logo.svg"
92 className="auth__logo" 92 className="auth__logo"
diff --git a/src/components/auth/SetupAssistant.js b/src/components/auth/SetupAssistant.js
index e03cf9101..bd9069eb7 100644
--- a/src/components/auth/SetupAssistant.js
+++ b/src/components/auth/SetupAssistant.js
@@ -34,7 +34,7 @@ const messages = defineMessages({
34 }, 34 },
35}); 35});
36 36
37const styles = theme => ({ 37const styles = (theme) => ({
38 root: { 38 root: {
39 width: '500px !important', 39 width: '500px !important',
40 textAlign: 'center', 40 textAlign: 'center',
@@ -161,7 +161,7 @@ class SetupAssistant extends Component {
161 const sanitizedWorkspace = slackWorkspace.trim().replace(/^https?:\/\//, ''); 161 const sanitizedWorkspace = slackWorkspace.trim().replace(/^https?:\/\//, '');
162 162
163 if (sanitizedWorkspace) { 163 if (sanitizedWorkspace) {
164 const index = services.findIndex(s => s.id === SLACK_ID); 164 const index = services.findIndex((s) => s.id === SLACK_ID);
165 165
166 if (index === -1) { 166 if (index === -1) {
167 const newServices = services; 167 const newServices = services;
@@ -215,11 +215,11 @@ class SetupAssistant extends Component {
215 <button 215 <button
216 className={classnames({ 216 className={classnames({
217 [classes.serviceContainer]: true, 217 [classes.serviceContainer]: true,
218 [classes.selected]: this.state.services.findIndex(s => s.id === id) !== -1, 218 [classes.selected]: this.state.services.findIndex((s) => s.id === id) !== -1,
219 })} 219 })}
220 key={id} 220 key={id}
221 onClick={() => { 221 onClick={() => {
222 const index = this.state.services.findIndex(s => s.id === id); 222 const index = this.state.services.findIndex((s) => s.id === id);
223 if (index === -1) { 223 if (index === -1) {
224 if (id === SLACK_ID) { 224 if (id === SLACK_ID) {
225 this.setState({ isSlackModalOpen: true }); 225 this.setState({ isSlackModalOpen: true });
@@ -283,7 +283,7 @@ class SetupAssistant extends Component {
283 <Input 283 <Input
284 suffix=".slack.com" 284 suffix=".slack.com"
285 placeholder="workspace-url" 285 placeholder="workspace-url"
286 onChange={e => this.setState({ slackWorkspace: e.target.value })} 286 onChange={(e) => this.setState({ slackWorkspace: e.target.value })}
287 value={slackWorkspace} 287 value={slackWorkspace}
288 /> 288 />
289 <div className={classes.modalActionContainer}> 289 <div className={classes.modalActionContainer}>
diff --git a/src/components/auth/Signup.js b/src/components/auth/Signup.js
index 140867ea1..411b6697b 100644
--- a/src/components/auth/Signup.js
+++ b/src/components/auth/Signup.js
@@ -138,7 +138,7 @@ export default @inject('actions') @observer class Signup extends Component {
138 return ( 138 return (
139 <div className="auth__scroll-container"> 139 <div className="auth__scroll-container">
140 <div className="auth__container auth__container--signup"> 140 <div className="auth__container auth__container--signup">
141 <form className="franz-form auth__form" onSubmit={e => this.submit(e)}> 141 <form className="franz-form auth__form" onSubmit={(e) => this.submit(e)}>
142 <img 142 <img
143 src="./assets/images/logo.svg" 143 src="./assets/images/logo.svg"
144 className="auth__logo" 144 className="auth__logo"
diff --git a/src/components/auth/Welcome.js b/src/components/auth/Welcome.js
index 5f2fac64b..cb522e26e 100644
--- a/src/components/auth/Welcome.js
+++ b/src/components/auth/Welcome.js
@@ -84,7 +84,7 @@ export default @inject('actions') @observer class Login extends Component {
84 </Link> 84 </Link>
85 </div> 85 </div>
86 <div className="welcome__featured-services"> 86 <div className="welcome__featured-services">
87 {recipes.map(recipe => ( 87 {recipes.map((recipe) => (
88 <div 88 <div
89 key={recipe.id} 89 key={recipe.id}
90 className="welcome__featured-service" 90 className="welcome__featured-service"