Fixed app authentication when generating
This commit is contained in:
@@ -1859,8 +1859,18 @@ const AngularWorkflow = (props) => {
|
||||
{filteredApps.map(app=> {
|
||||
// FIXME - add label to apps, as this might be slow with A LOT of apps
|
||||
var newAppname = app.name
|
||||
newAppname = newAppname.replace("_", " ")
|
||||
newAppname = newAppname.charAt(0).toUpperCase()+newAppname.substring(1)
|
||||
newAppname = newAppname.replace("_", " ").charAt(0).toUpperCase()+newAppname.substring(1)
|
||||
const maxlen = 24
|
||||
if (newAppname.length > maxlen) {
|
||||
newAppname = newAppname.slice(0, maxlen)+".."
|
||||
}
|
||||
|
||||
// Description fucks this up - fix overflow :)
|
||||
//const maxdesclen = 5
|
||||
//var desc = app.description
|
||||
//if (newAppname.length > maxdesclen) {
|
||||
// desc = desc.slice(0, maxdesclen)+".."
|
||||
//}
|
||||
|
||||
const image = "url("+app.large_image+")"
|
||||
return(
|
||||
@@ -1881,13 +1891,13 @@ const AngularWorkflow = (props) => {
|
||||
<div style={{height: 80, width: 80, backgroundImage: image, backgroundSize: "cover", backgroundRepeat: "no-repeat"}} />
|
||||
</Grid>
|
||||
<Grid style={{display: "flex", flexDirection: "column", marginLeft: "20px"}}>
|
||||
<Grid item style={{flex: "1"}}>
|
||||
<Grid item style={{flex: 1}}>
|
||||
<h4 style={{marginBottom: "0px", marginTop: "5px"}}>{newAppname}</h4>
|
||||
</Grid>
|
||||
<Grid item style={{flex: "1"}}>
|
||||
Description
|
||||
<Grid item style={{flex: 1, width: "100%", }}>
|
||||
Short description...
|
||||
</Grid>
|
||||
<Grid item style={{flex: "1"}}>
|
||||
<Grid item style={{flex: 1}}>
|
||||
Version: {app.app_version}
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -4303,6 +4313,7 @@ const AngularWorkflow = (props) => {
|
||||
fullWidth
|
||||
type="text"
|
||||
color="primary"
|
||||
disabled={true}
|
||||
placeholder="Bearer token"
|
||||
defaultValue={selectedApp.link}
|
||||
onChange={(event) => {
|
||||
@@ -4318,6 +4329,7 @@ const AngularWorkflow = (props) => {
|
||||
)
|
||||
}
|
||||
|
||||
// This whole part is redundant. Made it part of Arguments instead.
|
||||
const authenticationModal = authenticationModalOpen ?
|
||||
<Dialog modal
|
||||
open={authenticationModalOpen}
|
||||
@@ -4337,7 +4349,7 @@ const AngularWorkflow = (props) => {
|
||||
<DialogContent>
|
||||
<a href="/docs/apps#authentication" style={{textDecoration: "none", color: "#f85a3e"}}>What is this?</a>
|
||||
<div />
|
||||
<EndpointData />
|
||||
{selectedApp.link.length > 0 ? <EndpointData /> : null}
|
||||
<div style={{marginTop: 15, marginBottom: 15, }}/>
|
||||
<AuthenticationData />
|
||||
</DialogContent>
|
||||
|
||||
@@ -1148,8 +1148,8 @@ const AppCreator = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
<Divider style={{marginBottom: "10px", marginTop: "30px", height: "1px", width: "100%", backgroundColor: "grey"}}/>
|
||||
<h4 style={{marginBottom: "10px"}}>General API information</h4>
|
||||
Base URL
|
||||
<h3 style={{marginBottom: "10px"}}>API information</h3>
|
||||
Base URL - leave empty if user changeable
|
||||
<TextField
|
||||
color="primary"
|
||||
style={{backgroundColor: inputColor, marginTop: "5px"}}
|
||||
@@ -1170,7 +1170,7 @@ const AppCreator = (props) => {
|
||||
margin="normal"
|
||||
variant="outlined"
|
||||
value={baseUrl}
|
||||
helperText={<div style={{color:"white", marginBottom: "2px",}}>Must start with http(s):// and CANT end with /. Can be empty if you its a variable.</div>}
|
||||
helperText={<div style={{color:"white", marginBottom: "2px",}}>Must start with http(s):// and CANT end with /. </div>}
|
||||
placeholder="https://api.example.com"
|
||||
onChange={e => setBaseUrl(e.target.value)}
|
||||
/>
|
||||
|
||||
@@ -319,8 +319,10 @@ const Apps = (props) => {
|
||||
<div>
|
||||
<h2>{newAppname}</h2>
|
||||
<p>{description}</p>
|
||||
<p>{selectedApp.id}</p>
|
||||
<p>{selectedApp.privateId}</p>
|
||||
<Divider style={{marginBottom: "10px", marginTop: "10px", backgroundColor: dividerColor}}/>
|
||||
<p>URL: {selectedApp.link}</p>
|
||||
<p>ID: {selectedApp.id}</p>
|
||||
<p>PrivateID: {selectedApp.privateId}</p>
|
||||
{editButton}
|
||||
{deleteButton}
|
||||
</div>
|
||||
|
||||
@@ -474,7 +474,7 @@ const Workflows = (props) => {
|
||||
|
||||
var t = new Date(data.started_at*1000)
|
||||
var showResult = data.result.trim()
|
||||
if (showResult.startsWith("{") && showResult.endsWith("}")) {
|
||||
if ((showResult.startsWith("{") && showResult.endsWith("}")) || (showResult.startsWith("[{") && showResult.endsWith("}]"))) {
|
||||
//showResult = <JSONPretty
|
||||
// id="json-pretty"
|
||||
// theme={JSONPrettyMon}
|
||||
|
||||
Reference in New Issue
Block a user