This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from davidradl/git41
#41 handle untentanted url
- Loading branch information
Showing
3 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 */ | ||
/* Copyright Contributors to the ODPi Egeria project. */ | ||
import React, {useState} from "react"; | ||
import "./Login.css"; | ||
import Egeriacolor from "../images/odpi/Egeria_logo_color"; | ||
|
||
import { | ||
Grid, | ||
Row, | ||
Column, | ||
Form, | ||
FormGroup, | ||
TextInput | ||
} from "carbon-components-react"; | ||
|
||
const NoServerName = () => { | ||
const [serverName, setServerName] = useState(""); | ||
|
||
const handleOnChange = (event) => { | ||
const value = event.target.value; | ||
setServerName(value); | ||
console.log("handleOnChange :" + value); | ||
}; | ||
|
||
const validateForm = () => { | ||
return serverName && serverName.length > 0; | ||
}; | ||
|
||
return ( | ||
<div> | ||
<Egeriacolor /> | ||
<div>Please supply a server name:</div> | ||
<Grid> | ||
<Row> | ||
<Column | ||
sm={{ span: 4 }} | ||
md={{ span: 4, offset: 2 }} | ||
lg={{ span: 4, offset: 6 }} | ||
> | ||
<Form id="egeria-login-form"> | ||
<FormGroup legendText=""> | ||
<TextInput | ||
type="text" | ||
labelText="Server Name" | ||
id="server-name" | ||
name="serverName" | ||
value={serverName} | ||
onChange={handleOnChange} | ||
placeholder="Server Name" | ||
required | ||
/> | ||
</FormGroup> | ||
{validateForm() && ( | ||
<a href={serverName}>Login with server name {serverName}</a> | ||
)} | ||
</Form> | ||
</Column> | ||
</Row> | ||
</Grid> | ||
</div> | ||
); | ||
}; | ||
|
||
export default NoServerName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters