Skip to content

Commit

Permalink
solved issues ( pagination, semantic, responsivity for single element…
Browse files Browse the repository at this point in the history
… in catalog, banner fix) (#475)

* Fixed handling on URI

* Redirection fixes

* Accessibility fixes

* Small fixes

* Accessibility updates

* New error page built

* Eslint fix

* Implemented the new service and fixed redirecton issue

* Vulnerability fix

* Changed the node version

* Docker file changes

* Update Dockerfile

* Update Dockerfile 2

* Update node.js.yml

* Fixed node version

* Node -v changes

* e2e test changes

* wdio new versions

* Url content check

* Fixed font problem

* Fixed firefox icons

* Update nginx.conf firefox icons

* Update nginx.conf

* Update index.html

* Accessibility fixes

* New accessibility fixes

* Accessibility fixes

* Accessibility test

* Bug fixes

* issues solved

---------

Co-authored-by: BelishtaArjol <[email protected]>
Co-authored-by: AntonioBenci <[email protected]>
Co-authored-by: Francesco Palermo <[email protected]>
  • Loading branch information
4 people authored Jan 26, 2024
1 parent 2b6ff80 commit 90f6705
Show file tree
Hide file tree
Showing 22 changed files with 29,989 additions and 2,359 deletions.
27,295 changes: 27,295 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@testing-library/user-event": "^13.5.0",
"@typescript-eslint/eslint-plugin": "^4.5.0",
"@typescript-eslint/parser": "^4.5.0",
"axios": "^1.6.1",
"axios": "^1.6.7",
"babel-loader": "9.1.0",
"babel-plugin-named-asset-import": "^0.3.8",
"babel-preset-react-app": "10.0.1",
Expand Down Expand Up @@ -209,4 +209,4 @@
]
},
"proxy": "http://localhost:5001"
}
}
26 changes: 13 additions & 13 deletions src/components/common/EndSection/EndSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import React from "react";
import { DIGITALE_DOCS_URL, GITHUB_SCHEMA } from "../../../services/routes";
import sprite from "../../../assets/images/sprite.svg";
export const EndSection = (props) => {
const buttonStyles = {
display: "inline-block",
padding: "0.5rem 1rem",
border: "1px solid white",
color: "white",
textDecoration: "none",
fontWeight: "bold",
background: "transparent",
};
// const buttonStyles = {
// display: "inline-block",
// padding: "0.5rem 1rem",
// border: "1px solid white",
// color: "white",
// textDecoration: "none",
// fontWeight: "bold",
// background: "transparent",
// };
return (
<React.Fragment>
<div className="endSectionBkg">
Expand Down Expand Up @@ -62,8 +62,8 @@ export const EndSection = (props) => {
<div className="col-xl-12">
<p className="txtWhite">
Se trovi errori o bug apri una issue su github.
<br /> Se vuoi contribuire al catalogo con un contenuto{" "}
leggi la guida su docs italia
{/* <br /> Se vuoi contribuire al catalogo con un contenuto{" "}
leggi la guida su docs italia */}
</p>
</div>
</div>
Expand All @@ -85,7 +85,7 @@ export const EndSection = (props) => {
</a>
</div>
<div className="col-xl-7 ms-5 mt-lg-0 d-flex justify-content-start">
<a
{/* <a
className="btn ms-0 ms-xl-2 mt-xl-0"
href={DIGITALE_DOCS_URL}
role="button"
Expand All @@ -94,7 +94,7 @@ export const EndSection = (props) => {
style={buttonStyles}
>
Scopri come contribuire
</a>
</a> */}
</div>
</div>
</div>
Expand Down
18 changes: 16 additions & 2 deletions src/components/layout/FooterLinks/FooterLinks.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,28 @@
a:hover {
color: white !important;
}

.bottomFooter {
color: white !important;
font-size: 15px;
padding-right: 15px;
}
.bottomFooter + .bottomFooter {
padding-left: 40px; /* Add your desired padding value */

.bottomFooter+.bottomFooter {
padding-left: 40px;
/* Add your desired padding value */
}

.bottomFooter:hover {
color: #0bd9d2 !important;
}


@media screen and (max-width: 992px) {
.bottomFooter {
text-wrap: nowrap;
font-size: 10px;
margin-right: -3em;
}

}
2 changes: 1 addition & 1 deletion src/components/search/AssetTypeChip/AssetTypeChip.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {

const AssetTypeChip = ({ type }) => (
<div
className={"bg-primary chip chip-simple chip-lg border-0"}
className={styles.chop + " bg-primary chip chip-simple chip-lg border-0"}
data-testid="AssetTypeChip"
aria-label={"Tipologia:" + getAssetLabel(type)}
>
Expand Down
8 changes: 8 additions & 0 deletions src/components/search/AssetTypeChip/AssetTypeChip.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@
text-transform: none;
color: #fff !important;
}


@media screen and (max-width: 992px) {
.chop {
height: 5em !important;
padding-bottom: 1em !important;
}
}
8 changes: 8 additions & 0 deletions src/components/search/Pagination/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ export const DEFAULT_OFFSET = 0;
const SUPPORTED_THEMES = getCategories().map((c) => c.key);

const getPageSlidingWindow = (currentPage, totalPages) => {
if (totalPages <= 2) {
if (totalPages === 2) {
return [1, 2];
}
return [1];
}

if (currentPage === 1) {
return [1, 2, 3];
}
Expand All @@ -18,6 +25,7 @@ const getPageSlidingWindow = (currentPage, totalPages) => {
if (totalPages > 3) {
return [currentPage - 2, currentPage - 1, currentPage];
}

return [1, 2, 3];
}

Expand Down
10 changes: 8 additions & 2 deletions src/components/search/Pagination/Pagination.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Pagination from "./Pagination";
import userEvent from "@testing-library/user-event";

const onPageSelect = jest.fn();

describe("<Pagination/> should mount", () => {
test("it should mount", () => {
render(
Expand Down Expand Up @@ -58,13 +59,18 @@ describe("<Pagination/> should mount", () => {
onPageSelect={onPageSelect}
/>
);

const pageNumber1 = screen.getByTestId("page-1");
const pageNumber2 = screen.getByTestId("page-2");
const pageNumber3 = screen.getByTestId("page-3");
const pageNumber3 = screen.queryByTestId("page-3");

expect(pageNumber1).toBeInTheDocument();
expect(pageNumber2).toBeInTheDocument();
expect(pageNumber3).toBeInTheDocument();

if (!pageNumber3) {
console.warn("Page-3 is not present in the DOM");
return;
}
expect(pageNumber3).toHaveClass("disabled");

const page2Link = screen.getByText("2");
Expand Down
2 changes: 1 addition & 1 deletion src/components/search/SearchPage/SearchPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ const SearchPage = () => {
</div>
</div>
</div>
<EndSection type={1} />
<EndSection type={2} />
</div>
</React.Fragment>
);
Expand Down
9 changes: 8 additions & 1 deletion src/components/search/SearchResultItem/SearchResultItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const SearchResultItem = ({ item }) => {
const categories = getCategories().filter(
(c) => item.themes.indexOf(c.uri) > -1
);

const copyUrlToClipboard = () => {
navigator.clipboard.writeText(item.assetIri);
};

return (
<div className="card-wrapper card-space " data-testid="SearchResultItem">
<div className={"card card-bg my-2 " + styles.smallerFooter}>
Expand Down Expand Up @@ -53,11 +58,13 @@ const SearchResultItem = ({ item }) => {
>
{item.title}
</h2>

<p className={"card-text " + styles.itemDescription}>
{truncate(item.description, 250)}
</p>
<div className={styles.itemInfo}>
<button className="btn btn-secondary" onClick={copyUrlToClipboard}>
Copia URL
</button>
{item.type !== AT_SCHEMA && (
<div>
<span className={"fw-bold " + styles.itemInfoLabel}>URI:</span>{" "}
Expand Down
4 changes: 2 additions & 2 deletions src/components/semantic-assets/AssetDetails/AssetDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const AssetDetails = ({ details }) => {
<div className={"w-100 " + styles.bkg}>
<div className={"container-fluid "}>
<div className="mx-0 ps-3">
<div className="col-lg-12 ps-5">
<div className={"col-lg-12 " + styles.padding}>
<BreadCrumbs arrayBread={breadC} />
</div>
</div>
Expand Down Expand Up @@ -130,7 +130,7 @@ const AssetDetails = ({ details }) => {
</div>
</div>
</div>
<EndSection type={1} />
<EndSection type={2} />
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,15 @@
font-size: 16px;
letter-spacing: 1px;
}

.padding{
padding-left: 16px !important;
}


@media screen and (max-width: 992px) {
.ps-5 {
padding-left: 0 !important;
padding-right: 0 !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const AssetIriRow = (props) => {
};

return (
<div className="row" data-testid="asset-iri-row">
<div className={"row " + rowStyle.column} data-testid="asset-iri-row">
<div className={"col-3 strong "}>
<h3 className={"strong " + rowStyle.propertyName}>URI</h3>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as PropTypes from "prop-types";
const MetadataRow = (props) => {
return (
<div>
<div className="row">
<div className={"row " + styles.column}>
<div className="col-3">
<div className="pe-3">
<h3 className={styles.propertyName}>{props.name}</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@
.assetLink:hover {
color: #084d91 !important;
}

@media screen and (max-width: 992px) {
.column {
flex-direction: column ;
}

.propertyName {
text-wrap: nowrap;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const VocabularyMetadata = ({ details }) => {
<div data-testid="vocab-metadata">
<CommonMetadataGroup details={details} />
{details.endpointUrl && (
<div className="row" data-testid="asset-iri-row">
<div className={"row " + rowStyle.column} data-testid="asset-iri-row">
<div className={"col-3 strong " + rowStyle.propertyName}>
Indirizzo dell&apos;endpoint
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const AssetDetailsButtons = (props) => {

return (
<div
className="justify-content-end d-flex"
className={"justify-content-end d-flex " + styles.cntbuttons}
data-testid="asset-details-buttons"
>
{props.type !== AT_SCHEMA && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@
width: 186px;
height: 48px;
}


@media screen and (max-width: 992px) {
.cntbuttons {
margin-left: 2.5em;
flex-direction: column;
justify-content: flex-end !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const AssetDetailsSummary = (props) => {
}, []);
return (
<div data-testid="asset-details-summary">
<div className="row pt-3 pb-3">
<div className="col-6 text-uppercase fw-bold">
<div className={" row pt-3 pb-3"}>
<div className={styles.text + " col-6 text-uppercase fw-bold"}>
<div className="category-top pt-1">
{categories.map((c) => (
<div key={c.key} className="category">
Expand All @@ -46,22 +46,22 @@ const AssetDetailsSummary = (props) => {
))}
</div>
</div>
<div className="col-6 text-end">
<div className="col-6 text-center">
<AssetTypeChip type={props.type} bgColor={"blue"} />
</div>
</div>
<div className="row pt-3 pb-3">
<div className="col-12">
<h1 className="h2">{props.title}</h1>
<h1 className={styles.topp + "h2"}>{props.title}</h1>
</div>
</div>
<div className={"row " + styles.detailsCard}>
<div className="col-12">
<div className="card-wrapper card-space">
<div className="card card-bg my-2 ps-5 pe-5 pt-5">
<div className={" card card-bg my-2 ps-5 pe-5 pt-5"}>
<div className={"row " + styles.description}>
<div
className={`${columnClass} ${styles.scrollable}`}
className={`${columnClass} ${styles.scrollable} ${styles.card}`}
tabIndex="0"
>
<div className={"pe-3 pt-1" + styles.descriptionText}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,20 @@
font-size: 18px;
line-height: 21px;
}


@media screen and (max-width: 992px) {
.card {
height: 170px;
overflow: auto;
width: 15em;
}

.text {
font-size: 15px;
}

h1 {
margin-top: 3em !important;
}
}
2 changes: 1 addition & 1 deletion src/components/static-content/contact/ContactPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const ContactPage = () => {
</div>
</div>

<EndSection type={2} />
<EndSection type={1} />
</div>
);
};
Expand Down
Loading

0 comments on commit 90f6705

Please sign in to comment.