From 60edb7060c62c02da2f50f62f822063dfd844032 Mon Sep 17 00:00:00 2001 From: Lacey-Anne Sanderson Date: Wed, 24 Jul 2024 09:35:23 -0600 Subject: [PATCH] Removing the credentials info from the pop-up form. --- .../DrupalRestAuthLoginForm.tsx | 49 +++++-------------- src/DrupalRestAuthModel/configSchema.ts | 2 +- src/DrupalRestAuthModel/model.tsx | 4 +- 3 files changed, 16 insertions(+), 39 deletions(-) diff --git a/src/DrupalRestAuthModel/DrupalRestAuthLoginForm.tsx b/src/DrupalRestAuthModel/DrupalRestAuthLoginForm.tsx index c5bc571..6d04d58 100644 --- a/src/DrupalRestAuthModel/DrupalRestAuthLoginForm.tsx +++ b/src/DrupalRestAuthModel/DrupalRestAuthLoginForm.tsx @@ -1,65 +1,42 @@ import React, { useState } from 'react' -import { Button, DialogContent, DialogActions, TextField } from '@mui/material' +import { Button, DialogContent, DialogActions, TextField, Container } from '@mui/material' import { Dialog } from '@jbrowse/core/ui' export function DrupalRestAuthLoginForm({ internetAccountId, + internetAccountName, + internetAccountDescription, handleClose, }: { internetAccountId: string + internetAccountName: string + internetAccountDescription: string handleClose: (arg?: string) => void }) { - const [username, setUsername] = useState('') - const [password, setPassword] = useState('') + // const [username, setUsername] = useState('') + // const [password, setPassword] = useState('') return (
{ - if (username && password) { - handleClose(btoa(`${username}:${password}`)) - } else { - handleClose() - } + handleClose(btoa(`not:needed`)) event.preventDefault() }} > - setUsername(event.target.value)} - margin="dense" - /> - setPassword(event.target.value)} - margin="dense" - /> + + {internetAccountDescription} + -
diff --git a/src/DrupalRestAuthModel/configSchema.ts b/src/DrupalRestAuthModel/configSchema.ts index 5463a96..de2e79a 100644 --- a/src/DrupalRestAuthModel/configSchema.ts +++ b/src/DrupalRestAuthModel/configSchema.ts @@ -11,7 +11,7 @@ const DrupalRestConfigSchema = ConfigurationSchema( 'DrupalRestAuthInternetAccount', { /** - * #slot + * #slot The URI of the Drupal REST API */ drupalUri: { description: 'The base URL for the Drupal site we want to authenticate against.', diff --git a/src/DrupalRestAuthModel/model.tsx b/src/DrupalRestAuthModel/model.tsx index a63c615..2a58d47 100644 --- a/src/DrupalRestAuthModel/model.tsx +++ b/src/DrupalRestAuthModel/model.tsx @@ -74,6 +74,8 @@ const stateModelFactory = ( DrupalRestAuthLoginForm, { internetAccountId: self.internetAccountId, + internetAccountName: self.name, + internetAccountDescription: self.description, handleClose: (token: string) => { if (token) { resolve(token) @@ -94,8 +96,6 @@ const stateModelFactory = ( } const checkLoginStatusUri = self.drupalUri + "user/login_status?_format=json" - console.log(checkLoginStatusUri) - const newInit = self.addAuthHeaderToInit({ method: 'HEAD' }, token) const response = await fetch(checkLoginStatusUri) if (!response.ok) { throw new Error(