Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure Renovate #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}
1 change: 1 addition & 0 deletions src/components/dashboard/common/loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const Loading = () => {
<Box sx={{
display: 'flex',
justifyContent:'center',
marginTop: "100px",
alignItems:'center'
}}>
<CircularProgress />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const ReportComponentSelector = (props) => {
});
return (
<Grid container
mt={2}
justifyContent="space-between"
spacing={2}>
{components}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"
import {Box, Button, Card, CardContent, Grid} from '@mui/material';
import {Box, Button, Card, CardContent, Typography, Grid} from '@mui/material';
import {useRouter} from 'next/router';
import {useFormik} from 'formik';
import {useAuth} from "@/hooks/use-auth";
Expand All @@ -11,8 +11,6 @@ import {DeleteConfirmModal} from '@/components/dashboard/common/delete-confirm-m
import {ComponentConfigs} from "@/components/dashboard/reports/report-components/creators/configs";




export const BaseComponentForm = (props) => {
const {
componentType,
Expand Down Expand Up @@ -106,58 +104,70 @@ export const BaseComponentForm = (props) => {

return (
<>
<RedirectBackConfirmModal open={cancelModalOpen}
onClose={handleCloseCancel}
onAccept={handleAcceptCancel}/>
<DeleteConfirmModal open={deleteModalOpen}
header="Usunać wybrany komponent?"
message1="Czy jesteś pewien, że chcesz usunąć wybrany komponent?"
message2="Uwaga, operacja usunięcia wpisów jest nieodwracalna."
onClose={handleCloseDelete}
onAccept={handleAcceptDelete}/>
<form onSubmit={formik.handleSubmit}>
<Grid container spacing={3}>
<Grid item xs={12}>
{componentForm}
</Grid>
<Grid item xs={12}>
<Box
sx={{
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'space-between',
mx: -1,
mb: -1,
mt: 3
}}
>
{
isUpdating ?
<Button onClick={handleOpenDelete}
sx={{ m: 1, ml: 'auto' }}
variant="outlined" color="error">
Usuń
</Button> : null
}
<Button onClick={handleOpenCancel}
sx={isUpdating ? {m: 1} : { m: 1 , ml: 'auto'}}
variant="outlined">
Anuluj
</Button>
<Button sx={{ m: 1 }}
type="submit"
disabled={!checkSubmitEnabled()}
variant="contained">
<Grid item xs={12}>
<Typography variant="h4">
{config.name}
</Typography>
<Typography color="textSecondary"
variant="body2"
sx={{ mt: 1 }}>
{config.description}
</Typography>
</Grid>
<Grid item xs={12}>
<RedirectBackConfirmModal open={cancelModalOpen}
onClose={handleCloseCancel}
onAccept={handleAcceptCancel}/>
<DeleteConfirmModal open={deleteModalOpen}
header="Usunać wybrany komponent?"
message1="Czy jesteś pewien, że chcesz usunąć wybrany komponent?"
message2="Uwaga, operacja usunięcia wpisów jest nieodwracalna."
onClose={handleCloseDelete}
onAccept={handleAcceptDelete}/>
<form onSubmit={formik.handleSubmit}>
<Grid container spacing={3}>
<Grid item xs={12}>
{componentForm}
</Grid>
<Grid item xs={12}>
<Box
sx={{
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'space-between',
mx: -1,
mb: -1,
mt: 3
}}
>
{
isUpdating ?
"Aktualizuj komponent" :
"Dodaj komponent"
<Button onClick={handleOpenDelete}
sx={{ m: 1, ml: 'auto' }}
variant="outlined" color="error">
Usuń
</Button> : null
}
</Button>
</Box>
<Button onClick={handleOpenCancel}
sx={isUpdating ? {m: 1} : { m: 1 , ml: 'auto'}}
variant="outlined">
Anuluj
</Button>
<Button sx={{ m: 1 }}
type="submit"
disabled={!checkSubmitEnabled()}
variant="contained">
{
isUpdating ?
"Aktualizuj komponent" :
"Dodaj komponent"
}
</Button>
</Box>
</Grid>
</Grid>
</Grid>
</form>
</form>
</Grid>
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,15 @@ export const MetadataForm = (props) => {
metadataFields.forEach((field) => {
if (field.type === "number") {
if (fields.length > 0) {
fields.push(<Grid item md={4} xs="hidden"/>);
fields.push(
<Grid item
key={`metadata-hidden-field-${fields.length}`}
md={4}
sx={{display: {xs: "none", md: "block"}}}/>
);
}
fields.push(
<Grid item md={8} xs={12} key={field.name}>
<Grid item md={8} xs={12} key={`metadata-field-${fields.length}`}>
<NumberMetadataField name={field.name}
label={field.label}
value={state[field.name]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,10 @@ const EditReportComponent = () => {
</Link>
</NextLink>
</Grid>
<Grid item md={12}>
<BaseComponentForm componentType={componentType}
reportId={reportId}
componentId={componentId}
initialValues={initialValues}/>
</Grid>
<BaseComponentForm componentType={componentType}
reportId={reportId}
componentId={componentId}
initialValues={initialValues}/>
</Grid>
</Box>
</Container>
Expand Down
4 changes: 1 addition & 3 deletions src/pages/dashboard/reports/[reportId]/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ const AddReportComponent = () => {
</Link>
</NextLink>
</Grid>
<Grid item md={12}>
<ReportComponentSelector reportId={reportId}/>
</Grid>
<ReportComponentSelector reportId={reportId}/>
</Grid>
</Box>
</Container>
Expand Down