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

Create status page PR2 #1494

Open
wants to merge 40 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
136ed04
- Update status home page to connect to create status page
jennifer-gan Nov 26, 2024
4345d69
- Fix the checkbox position to be conditional on non string label
jennifer-gan Nov 28, 2024
5adffd8
- WIP general setting panel
jennifer-gan Nov 28, 2024
2405d01
- update to match BE
jennifer-gan Nov 28, 2024
8506291
- Fix the component not showing the file text and logo section issue
jennifer-gan Nov 28, 2024
df36f87
- Add log and general settins tab validation
jennifer-gan Dec 2, 2024
5df7ddb
- WIP Replace Field with TextInput , HttpAdornment seems not working
jennifer-gan Dec 2, 2024
0759b16
- add lower case first letter string util func
jennifer-gan Dec 4, 2024
cc2187d
- add routes to status page nested pages
jennifer-gan Dec 4, 2024
b275bdc
- Link general settings and contens to status page in navigation
jennifer-gan Dec 4, 2024
35a981a
- Update icons etc
jennifer-gan Dec 4, 2024
b651369
- WIP Server list tab
jennifer-gan Dec 5, 2024
cbec5fd
- Change "Next" to "Save"
jennifer-gan Dec 6, 2024
2825ff4
- WIP contents tab adding servers list
jennifer-gan Dec 5, 2024
03ce805
- Add React DND related libraries
jennifer-gan Dec 9, 2024
b1f0568
- Created Card type
jennifer-gan Dec 9, 2024
1ab4bd7
Merge branch 'develop' into feat/fe/statuspage-3
jennifer-gan Dec 10, 2024
9370db6
- Fix the suburl prefix via extending existing HttpAdorment
jennifer-gan Dec 10, 2024
00be6c2
- Fix the warning button can not be descendant of button
jennifer-gan Dec 12, 2024
c61d1ac
Merge branch 'develop' into feat/fe/statuspage-3
jennifer-gan Dec 12, 2024
9d212c9
Merge branch 'develop' into feat/fe/statuspage-3
jennifer-gan Dec 12, 2024
fdca92e
Merge branch 'develop' into feat/fe/statuspage-3
jennifer-gan Dec 13, 2024
406fa6e
- Merge feedback works from status page 1 and status page 2 branches
jennifer-gan Dec 13, 2024
c1dc049
- Remove nested routes for tabs
jennifer-gan Dec 13, 2024
8292654
- Add context provider for both tabs
jennifer-gan Dec 13, 2024
5045eaf
- useContext from parent page for form fields
jennifer-gan Dec 13, 2024
219bcd4
- Add GetStatusPageByUrl to networkservice
jennifer-gan Dec 17, 2024
c9b804a
- Update getStatusPageByUrl to match BE
jennifer-gan Dec 17, 2024
3a00742
Merge branch 'develop' into feat/fe/statuspage-3
jennifer-gan Dec 17, 2024
11154ad
- Code clean up
jennifer-gan Dec 20, 2024
feaf1e3
Merge branch 'develop' into feat/fe/statuspage-3
jennifer-gan Dec 24, 2024
c535a6f
- Update path
jennifer-gan Dec 24, 2024
d844078
- Update validation
jennifer-gan Dec 24, 2024
23d97f8
- Replace Doc icon with Reorder icon
jennifer-gan Dec 28, 2024
a5df7be
- Create new status page and retrieval are now working end to end, ex…
jennifer-gan Dec 30, 2024
d8da182
Merge branch 'develop' into feat/fe/statuspage-3
jennifer-gan Dec 30, 2024
1206451
- Update JSDoc
jennifer-gan Dec 30, 2024
8b72f84
- Update logo handling and validation
jennifer-gan Jan 2, 2025
5226f3c
- Update to add status page subdomain as env variable
jennifer-gan Jan 3, 2025
a544a0f
Merge branch 'develop' into feat/fe/statuspage-3
jennifer-gan Jan 3, 2025
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
1 change: 1 addition & 0 deletions Client/.env.production
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VITE_APP_API_BASE_URL=UPTIME_APP_API_BASE_URL
VITE_STATUS_PAGE_SUBDOMAIN_PREFIX=UPTIME_STATUS_PAGE_SUBDOMAIN_PREFIX
79 changes: 78 additions & 1 deletion Client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
"@reduxjs/toolkit": "2.5.0",
"axios": "^1.7.4",
"dayjs": "1.11.13",
"immutability-helper": "^3.1.1",
"joi": "17.13.3",
"jwt-decode": "^4.0.0",
"react": "^18.2.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dom": "^18.2.0",
"react-redux": "9.2.0",
"react-router": "^6.23.0",
Expand Down
1 change: 1 addition & 0 deletions Client/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { logger } from "./Utils/Logger"; // Import the logger
import { networkService } from "./main";
import { Routes } from "./Routes";

import CreateStatus from "./Pages/Status/CreateStatus";
function App() {
const mode = useSelector((state) => state.ui.mode);
const { authToken } = useSelector((state) => state.auth);
Expand Down
7 changes: 6 additions & 1 deletion Client/src/Components/Inputs/Checkbox/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import "./index.css";
* @param {string} [props.value] - Optional value associated with the checkbox
* @param {Function} [props.onChange] - Callback function triggered when checkbox state changes
* @param {boolean} [props.isDisabled] - Determines if the checkbox is disabled
* @param {boolean} [props.alignSelf] - Whether the checkbox label should be positioned on flex-start.
*
* @returns {React.ReactElement} Rendered Checkbox component
*
Expand All @@ -42,6 +43,7 @@ import "./index.css";
* isChecked={isAdvanced}
* isDisabled={!canModify}
* onChange={handleAdvancedToggle}
* alignSelf = {alignSelf}
* />
*/
const Checkbox = ({
Expand All @@ -53,10 +55,12 @@ const Checkbox = ({
value,
onChange,
isDisabled,
alignSelf
}) => {
/* TODO move sizes to theme */
const sizes = { small: "14px", medium: "16px", large: "18px" };
const theme = useTheme();
const override = alignSelf? { alignSelf: "flex-start" } : {}
return (
<FormControlLabel
className="checkbox-wrapper"
Expand All @@ -75,7 +79,7 @@ const Checkbox = ({
sx={{
"&:hover": { backgroundColor: "transparent" },
"& svg": { width: sizes[size], height: sizes[size] },
alignSelf: "flex-start",
...override
}}
/>
}
Expand Down Expand Up @@ -114,6 +118,7 @@ Checkbox.propTypes = {
value: PropTypes.string,
onChange: PropTypes.func,
isDisabled: PropTypes.bool,
alignSelf: PropTypes.bool,
};

export default Checkbox;
30 changes: 25 additions & 5 deletions Client/src/Components/Inputs/Image/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ import { checkImage } from "../../../Utils/fileUtils";
* @param {string} props.id - The unique identifier for the input field.
* @param {string} props.src - The URL of the image to display.
* @param {function} props.onChange - The function to handle file input change.
* @param {string} props.isRound - The shape of the image to display.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Possible JSDoc mismatch
This line's documentation calls isRound a string, but it is declared and used as a boolean. Updating the JSDoc to reflect a boolean type prevents confusion.

- * @param {string} props.isRound - The shape of the image to display.
+ * @param {boolean} props.isRound - The shape of the image to display.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* @param {string} props.isRound - The shape of the image to display.
* @param {boolean} props.isRound - The shape of the image to display.

* @returns {JSX.Element} The rendered component.
*/

const ImageField = ({ id, src, loading, onChange }) => {
const ImageField = ({ id, src, loading, onChange, error, isRound = true }) => {
const theme = useTheme();
const error_border_style = error ? { borderColor: theme.palette.error.main } : {};

const roundShape = isRound ? { borderRadius: "50%" } : {};

const [isDragging, setIsDragging] = useState(false);
const handleDragEnter = () => {
Expand All @@ -28,7 +32,7 @@ const ImageField = ({ id, src, loading, onChange }) => {
return (
<>
{!checkImage(src) || loading ? (
<>
<>
<Box
className="image-field-wrapper"
mt={theme.spacing(8)}
Expand All @@ -46,6 +50,7 @@ const ImageField = ({ id, src, loading, onChange }) => {
borderColor: theme.palette.primary.main,
backgroundColor: "hsl(215, 87%, 51%, 0.05)",
},
...error_border_style
}}
onDragEnter={handleDragEnter}
onDragLeave={handleDragLeave}
Expand All @@ -62,6 +67,7 @@ const ImageField = ({ id, src, loading, onChange }) => {
cursor: "pointer",
maxWidth: "500px",
minHeight: "175px",
zIndex: 1,
},
"& fieldset": {
padding: 0,
Expand All @@ -78,7 +84,7 @@ const ImageField = ({ id, src, loading, onChange }) => {
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
zIndex: "-1",
zIndex: 0,
width: "100%",
}}
>
Expand Down Expand Up @@ -113,7 +119,7 @@ const ImageField = ({ id, src, loading, onChange }) => {
>
(maximum size: 3MB)
</Typography>
</Stack>
</Stack>
</Box>
<Typography
component="p"
Expand All @@ -122,6 +128,19 @@ const ImageField = ({ id, src, loading, onChange }) => {
>
Supported formats: JPG, PNG
</Typography>
{error && (
<Typography
component="span"
className="input-error"
color={theme.palette.error.main}
mt={theme.spacing(2)}
sx={{
opacity: 0.8,
}}
>
{error}
</Typography>
)}
</>
) : (
<Stack
Expand All @@ -132,10 +151,10 @@ const ImageField = ({ id, src, loading, onChange }) => {
sx={{
width: "250px",
height: "250px",
borderRadius: "50%",
overflow: "hidden",
backgroundImage: `url(${src})`,
backgroundSize: "cover",
...roundShape,
}}
></Box>
</Stack>
Expand All @@ -148,6 +167,7 @@ ImageField.propTypes = {
id: PropTypes.string.isRequired,
src: PropTypes.string,
onChange: PropTypes.func.isRequired,
isRound: PropTypes.bool,
};

export default ImageField;
22 changes: 15 additions & 7 deletions Client/src/Components/Inputs/Search/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ const Search = ({
isAdorned = true,
error,
disabled,
startAdornment,
endAdornment
}) => {
const theme = useTheme();

Expand All @@ -66,15 +68,15 @@ const Search = ({
onInputChange={(_, newValue) => {
handleInputChange(newValue);
}}
onChange={(_, newValue) => {
handleChange && handleChange(newValue);
onChange={(e, newValue) => {
handleChange && handleChange(e, newValue);
}}
fullWidth
freeSolo
disabled={disabled}
disableClearable
options={options}
getOptionLabel={(option) => option[filteredBy]}
getOptionLabel={(option) => option[filteredBy]??""}
renderInput={(params) => (
<Stack>
<Typography
Expand All @@ -89,9 +91,13 @@ const Search = ({
{...params}
error={Boolean(error)}
placeholder="Type to search"
InputProps={{
...params.InputProps,
...(isAdorned && { startAdornment: <SearchAdornment /> }),
slotProps={{
input: {
...params.InputProps,
...(isAdorned && { startAdornment: <SearchAdornment /> }),
...(startAdornment && { startAdornment: startAdornment }),
...(endAdornment && { endAdornment: endAdornment }),
},
}}
sx={{
"& fieldset": {
Expand Down Expand Up @@ -187,14 +193,16 @@ Search.propTypes = {
options: PropTypes.array.isRequired,
filteredBy: PropTypes.string.isRequired,
secondaryLabel: PropTypes.string,
value: PropTypes.array,
value: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
inputValue: PropTypes.string.isRequired,
handleInputChange: PropTypes.func.isRequired,
handleChange: PropTypes.func,
isAdorned: PropTypes.bool,
sx: PropTypes.object,
error: PropTypes.string,
disabled: PropTypes.bool,
startAdornment: PropTypes.object,
endAdornment: PropTypes.object
};

export default Search;
Loading
Loading