-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99e23b4
commit 9d9c607
Showing
23 changed files
with
386 additions
and
123 deletions.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,4 @@ | ||
export type ProjectConfig = { | ||
projectUrl: string, | ||
sourceFolder: string | ||
} |
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,41 @@ | ||
import { useQuery } from '@apollo/client'; | ||
import { Alert, Box, Button, TextField, Typography } from '@mui/material'; | ||
import React, { useState } from 'react'; | ||
import { useParams } from 'react-router'; | ||
import Headline from '../component/Headline'; | ||
import { fetchProjectConfigQuery } from '../ProjectData'; | ||
|
||
export function ProjectConfigview() { | ||
const { projectUrl } = useParams(); | ||
const encodedProjectUrl = toBase64(projectUrl); | ||
const [sourceFolder, setSourceFolder] = useState("") | ||
const { loading, error} = useQuery(fetchProjectConfigQuery, { | ||
variables: { projectUrl: encodedProjectUrl }, | ||
onCompleted: (data) => { | ||
setSourceFolder(data.getProjectConfig.sourceFolder) | ||
} | ||
}); | ||
return ( | ||
<div> | ||
<Headline /> | ||
<Box padding={5}> | ||
<br /> | ||
<Typography variant='h4'>Project Config </Typography> | ||
<br /> | ||
{loading && <p>Loading...</p>} | ||
{error && <Alert severity="error">Can not fetch data. Are you logged in?</Alert>} | ||
<TextField label="SourceFolder" value={sourceFolder} onChange={(e) => setSourceFolder(e.target.value)} /> | ||
<Button variant="contained" onClick={ | ||
(e) => { | ||
console.log(sourceFolder); | ||
}}>Save</Button> | ||
</Box> | ||
</div> | ||
); | ||
} | ||
function toBase64(str: string | undefined): string { | ||
if (undefined === str) { | ||
return ""; | ||
} | ||
return atob(str); | ||
} |
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 was deleted.
Oops, something went wrong.
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
7 changes: 7 additions & 0 deletions
7
...-bot/src/main/java/io/github/martinwitt/laughing_train/data/FindProjectConfigRequest.java
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,7 @@ | ||
package io.github.martinwitt.laughing_train.data; | ||
|
||
import java.io.Serializable; | ||
|
||
public sealed interface FindProjectConfigRequest extends Serializable { | ||
record ByProjectUrl(String projectUrl) implements FindProjectConfigRequest, Serializable {} | ||
} |
13 changes: 13 additions & 0 deletions
13
...b-bot/src/main/java/io/github/martinwitt/laughing_train/data/FindProjectConfigResult.java
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,13 @@ | ||
package io.github.martinwitt.laughing_train.data; | ||
|
||
import io.github.martinwitt.laughing_train.persistence.ProjectConfig; | ||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
public sealed interface FindProjectConfigResult extends Serializable { | ||
record SingleResult(ProjectConfig projectConfig) implements FindProjectConfigResult {} | ||
|
||
record MultipleResults(List<? super ProjectConfig> projectConfigs) implements FindProjectConfigResult {} | ||
|
||
record NotFound() implements FindProjectConfigResult {} | ||
} |
Oops, something went wrong.