Repository: rickbergfalk/sqlpad
Pull request #708 (2020-06-25 05:57:23)

don't prompt for LDAP if not configured
Users should not see the word LDAP if LDAP authentications is not configured in.

Well actually - users should not see the word LDAP ever - so I just used "username"


Patch:
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 9ff38bf4..140a153d 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -1,7 +1,6 @@
-
 name: lint
 
-on: [push]
+on: [push, pull_request]
 
 jobs:
   lint:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8eaf25fd..202a1500 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -30,15 +30,11 @@ Of course if you'd like to start the work without opening an issue with the unde
 
 Once a pull request has been submitted, a maintainer will review your pull request and either merge it, request changes, or close it with an explanation.
 
-## Becoming a Maintainer
+## Collaborator Invite
 
-If you've made a significant contribution to SQLPad and would like to become a core maintainer, please get in touch by emailing rick.bergfalk@gmail.com.
+If you've made a significant contribution to SQLPad you'll be invited to join as a collaborator. This will give you commit access to non-protected branches, the ability to review PRs, merge approved PRs, and lots of other things.
 
-Maintainers will get commit access to the repository, and will be requested to review pull requests and provide input on project direction. You might be pinged every now and then to review a pull request or provide your opinion on project direction.
-
-There is no hard commitment associated with becoming a maintainer. SQLPad is a side project worked on in people's spare time, and you can stop being a maintainer at any time.
-
-If you actively use SQLPad, have the JavaScript expertise, and think you might have just a few hours every month or two to help with bugs or library updates please consider it.
+No pressure to accept the invite or even do anything with the access. Contribute as much or as little as you'd like, even if it is just to weigh in on the direction of the project.
 
 ## Contributing Money
 
diff --git a/client/src/SignIn.js b/client/src/SignIn.js
index 8a9d5f06..870e2fc0 100644
--- a/client/src/SignIn.js
+++ b/client/src/SignIn.js
@@ -39,12 +39,20 @@ function SignIn() {
     return;
   }
 
+  function PlaceholderForUsername() {
+    if (config.ldapConfigured) {
+      return 'Username or e-mail address';
+    } else {
+      return 'e-mail address';
+    }
+  }
+
   const localForm = (
     <form onSubmit={signIn}>
       <Input
         name="email"
         type="email"
-        placeholder="LDAP User / Email"
+        placeholder={PlaceholderForUsername()}
         onChange={(e) => setEmail(e.target.value)}
         required
       />
diff --git a/server/routes/app.js b/server/routes/app.js
index d4839599..a3302e9d 100644
--- a/server/routes/app.js
+++ b/server/routes/app.js
@@ -33,6 +33,7 @@ async function getApp(req, res) {
       samlConfigured: Boolean(config.get('samlEntryPoint')),
       samlLinkHtml: config.get('samlLinkHtml'),
       smtpConfigured: config.smtpConfigured(),
+      ldapConfigured: config.get('enableLdapAuth'),
     },
     version: packageJson.version,
   });


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 0fd492c7..d6517cd6 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -1,7 +1,6 @@
-
 name: test
 
-on: [push]
+on: [push, pull_request]
 
 jobs:
   test:
diff --git a/server/test/api/app.js b/server/test/api/app.js
index 6f300382..edf281c2 100644
--- a/server/test/api/app.js
+++ b/server/test/api/app.js
@@ -25,6 +25,7 @@ const expectedConfigKeys = [
   'localAuthConfigured',
   'samlConfigured',
   'samlLinkHtml',
+  'ldapConfigured',
 ];
 
 describe('api/app', function () {