Skip to content

Commit

Permalink
fix(ci): run locally
Browse files Browse the repository at this point in the history
  • Loading branch information
bas-kirill committed Aug 25, 2024
1 parent dbeaba3 commit 3974c4d
Show file tree
Hide file tree
Showing 32 changed files with 100 additions and 87 deletions.
6 changes: 3 additions & 3 deletions client/src/app/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
}

#app {
background-color: #F5F5F5;
background-color: #f5f5f5;
max-width: 1024px;
margin: 0 auto;
border: 1px #DEE2E6 solid;
border: 1px #dee2e6 solid;
}

h1 {
margin: 0;
}
}
3 changes: 0 additions & 3 deletions client/src/pages/catalogue/ui/Catalogue.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,10 @@ export function CataloguePage() {
<>
<HeaderWidget />



<div className={styles.catalogue__wrapper}>
<SearchBarInputField filters={filters} setFilters={setFilters} />

<div className={styles.catalogue__filters__serp__navbar__wrapper}>

<div className={styles.catalogue__filters__wrapper}>
<SidebarFilterWidget onFilterChange={setFilters} />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

.catalogue__filters__wrapper {
flex: 1;
background-color: #E0E0E0;
background-color: #e0e0e0;
}

.catalogue__serp__navbar__wrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

font-size: 2em;
text-align: start;
border: 1px #DEE2E6 solid;
border: 1px #dee2e6 solid;
/*}*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
}

.instrument__wrapper {
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import styles from "./styles/EditInstrument.button.module.css";
import { Link, useNavigate } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import { InstrumentDetail } from "generated/model";

interface Props {
Expand All @@ -11,10 +11,14 @@ export const EditInstrumentButton = (props: Props) => {
const navigate = useNavigate();

return (
<button className={styles.edit_instrument__button} onClick={_ => {
const uri = `/instrument/${props.instrument.instrument_id.instrument_id}/edit`;
navigate(uri);
}}>
<button
className={styles.edit_instrument__button}
/* eslint-disable */
onClick={(_) => {
const uri = `/instrument/${props.instrument.instrument_id.instrument_id}/edit`;
navigate(uri);
}}
>
Edit
</button>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export const FavoriteButton = (props: Props) => {
const toggleFavorite = async () => {
if (favorite) {
removeFavorite.removeFavorite(props.instrumentId, {
withCredentials: true
withCredentials: true,
});
} else {
addFavorite.addFavorite(props.instrumentId, {
withCredentials: true
withCredentials: true,
});
}
setFavorite(!favorite);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ export const GoToInstrumentButton = (props: Props) => {
const navigate = useNavigate();

return (
<button className={styles.go_to_instrument__button} onClick={_ => {
const uri = `/instrument/${props.instrument.instrument_id.instrument_id}`;
navigate(uri);
}}>
<button
className={styles.go_to_instrument__button}
/* eslint-disable */
onClick={(_) => {
const uri = `/instrument/${props.instrument.instrument_id.instrument_id}`;
navigate(uri);
}}
>
Show
</button>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
.edit_instrument__button {
flex: 1;
cursor: pointer;
background-color: #28A745;
background-color: #28a745;
color: white;
border: 1px #CCCCCC solid;
border: 1px #cccccc solid;
}

.edit_instrument__button:hover {
background-color: #007BFF;
}
background-color: #007bff;
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.favorite__button {
background-color: #1E90FF;
color: #FFFFFF;
background-color: #1e90ff;
color: #ffffff;
flex: 1;
cursor: pointer;
border: 1px #CCCCCC solid;
border: 1px #cccccc solid;
}

.favorite {
color: #DC143C;
color: #dc143c;
font-weight: bold;
}

.favorite__button:hover {
background-color: #007BFF;
background-color: #007bff;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.remove_instrument__button {
flex: 1;
background-color: #DC3545;
background-color: #dc3545;
color: white;
cursor: pointer;
border: 1px #CCCCCC solid;
border: 1px #cccccc solid;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
flex: 1;
/*padding: 10px 0;*/
height: 3em;
background-color: #007BFF;
background-color: #007bff;
color: white;
cursor: pointer;
border: 1px #CCCCCC solid;
border: 1px #cccccc solid;
}

.go_to_instrument__button:hover {
background-color: #007BFF;
}
background-color: #007bff;
}
7 changes: 6 additions & 1 deletion client/src/shared/instrument-card/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ import { InstrumentDescription } from "./ui/InstrumentDescription";
import { InstrumentActions } from "./ui/InstrumentActions";
import { InstrumentPhoto } from "./ui/InstrumentPhoto";

export { InstrumentCard, InstrumentDescription, InstrumentActions, InstrumentPhoto };
export {
InstrumentCard,
InstrumentDescription,
InstrumentActions,
InstrumentPhoto,
};
6 changes: 5 additions & 1 deletion client/src/shared/instrument-card/ui/InstrumentCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import React from "react";
import styles from "./styles/InstrumentCard.module.css";
import { InstrumentDescription, InstrumentPhoto, InstrumentActions } from "shared/instrument-card";
import {
InstrumentDescription,
InstrumentPhoto,
InstrumentActions,
} from "shared/instrument-card";
import { InstrumentDetail } from "generated/model";

interface Props {
Expand Down
32 changes: 13 additions & 19 deletions client/src/shared/instrument-card/ui/InstrumentDescription.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react";
import React from "react";
import styles from "./styles/InstrumentDescription.module.css";
import { InstrumentDetail } from "generated/model";

Expand All @@ -13,7 +13,7 @@ export const InstrumentDescription = (props: Props) => {
manufacturer_date: { manufacture_date },
release_date: { release_date },
country: { country },
basic_materials
basic_materials,
} = props.instrument;

return (
Expand All @@ -22,33 +22,27 @@ export const InstrumentDescription = (props: Props) => {
<h1 className={styles.instrument_description__header}>
{manufacturer_name}
</h1>
<b className={styles.secondary}>
Type
</b>: <span>{instrument_type}</span>
<b className={styles.secondary}>Type</b>: <span>{instrument_type}</span>
<br />
<b className={styles.secondary}>
Manufacturer
</b>: <span>{manufacturer_name}</span>
<b className={styles.secondary}>Manufacturer</b>:{" "}
<span>{manufacturer_name}</span>
<br />
<b className={styles.secondary}>
Manufacturer date
</b>: <span>{manufacture_date}</span>
<b className={styles.secondary}>Manufacturer date</b>:{" "}
<span>{manufacture_date}</span>
<br />
<b className={styles.secondary}>
Release Date
</b>: <span>{release_date}</span>
<b className={styles.secondary}>Release Date</b>:{" "}
<span>{release_date}</span>
<br />
<b className={styles.secondary}>
Country
</b>: <span>{country}</span>
<b className={styles.secondary}>Country</b>: <span>{country}</span>
<br />
<b className={styles.secondary}>Basic Materials</b>:
<>
{basic_materials.map((basic_material, index) => (
<span>{index > 0 ? "," : ""} {basic_material.basic_material}</span>
<span>
{index > 0 ? "," : ""} {basic_material.basic_material}
</span>
))}
</>

</div>
</div>
);
Expand Down
5 changes: 2 additions & 3 deletions client/src/shared/instrument-card/ui/InstrumentPhoto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ interface Props {

const getInstrumentPhoto = new GetInstrumentPhotoApi();


export const InstrumentPhoto = (props: Props) => {
const [photo, setPhoto] = useState<string | undefined>();

useEffect(() => {
const fetchPhoto = async () => {
const response = await getInstrumentPhoto.getInstrumentPhoto(
props.instrument.instrument_id.instrument_id
props.instrument.instrument_id.instrument_id,
);

setPhoto(response.data.photo);
Expand All @@ -36,4 +35,4 @@ export const InstrumentPhoto = (props: Props) => {
)}
</div>
);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
width: 50%;
display: flex;
flex-direction: column;
border: 1px #DEE2E6 solid;
background-color: #FFFFFF;
border: 1px #dee2e6 solid;
background-color: #ffffff;
padding: 5px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
}

.secondary {
color: #6C757D;
color: #6c757d;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
max-width: 100%;
height: auto;
object-fit: contain;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const CountryFilter = ({ onValueChange }: Props) => {

return (
<div>
<legend style={{padding: "0"}}>Country:</legend>
<legend style={{ padding: "0" }}>Country:</legend>
{countries.map((country) => (
<div key={country.country}>
<input
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.label {
color: #333333;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useEffect, useState } from "react";
import styles from "./Filter.module.css";
import textStyle from "./Text.module.css";
import { GetInstrumentTypesApi } from "generated/api/get-instrument-types-api";
import { InstrumentType } from "generated/model/instrument-type";
Expand All @@ -16,9 +15,8 @@ export const InstrumentTypeFilter = (props: Props) => {
useEffect(() => {
const fetchTypes = async () => {
const response = await getInstrumentTypes.getInstrumentTypes();
setInstrumentTypes(response.data.content)
}

setInstrumentTypes(response.data.content);
};

fetchTypes();
}, []);
Expand All @@ -42,7 +40,9 @@ export const InstrumentTypeFilter = (props: Props) => {

return (
<div>
<legend className={`${textStyle.primary}`} style={{padding: "0"}}>Type</legend>
<legend className={`${textStyle.primary}`} style={{ padding: "0" }}>
Type
</legend>
{instrumentTypes.map((instrumentType) => (
<div key={instrumentType.instrument_type}>
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export const ManufactureDateFilter = ({

return (
<div className={styles.manufacture_date}>
<label htmlFor={fieldName} style={{padding: "0"}}>{labelName}</label>
<label htmlFor={fieldName} style={{ padding: "0" }}>
{labelName}
</label>
<input
ref={manufacturerDate}
type="date"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const ManufacturerNameFilter = ({ onValueChange }: Props) => {

return (
<div>
<legend style={{padding: "0"}}>Manufacturer:</legend>
<legend style={{ padding: "0" }}>Manufacturer:</legend>
{manufacturers.map((manufacturer) => (
<div key={manufacturer.manufacturer}>
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const MaterialFilter = ({ onValueChange }: Props) => {

return (
<div>
<legend style={{padding: "0"}}>Basic Materials:</legend>
<legend style={{ padding: "0" }}>Basic Materials:</legend>
{materials.map((material) => (
<div key={material.basic_material}>
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export const ReleaseDateFilter = ({

return (
<div>
<label htmlFor={fieldName} style={{padding: "0"}}>{labelName}</label>
<label htmlFor={fieldName} style={{ padding: "0" }}>
{labelName}
</label>
<input
ref={manufacturerDate}
type="date"
Expand Down
Loading

0 comments on commit 3974c4d

Please sign in to comment.