Skip to content

Commit

Permalink
revert to java 8 and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ist149372 committed Mar 17, 2022
1 parent dd2d2ef commit dabeda0
Show file tree
Hide file tree
Showing 24 changed files with 111 additions and 107 deletions.
4 changes: 2 additions & 2 deletions edition-ldod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>9</source>
<target>9</target>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import pt.ist.socialsoftware.edition.ldod.domain.*;
import pt.ist.socialsoftware.edition.ldod.search.options.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

Expand All @@ -26,7 +23,7 @@ public SimpleSearchDto getSimpleSearch(@RequestBody SimpleSearchDto simpleSearch
|| inter.getShortName().toLowerCase().contains(simpleSearchDto.getSearchSource().toLowerCase()))
.filter(inter -> simpleSearchDto.getSearchType().equals("")
|| inter.getTitle().toLowerCase().contains(simpleSearchDto.getSearchTerm().toLowerCase()))
.collect(Collectors.toMap(FragInter_Base::getFragment, List::of, (exist, replace) -> Stream
.collect(Collectors.toMap(FragInter_Base::getFragment, Arrays::asList, (exist, replace) -> Stream
.concat(exist.stream(), replace.stream())
.collect(Collectors.toList()))));
}
Expand Down
1 change: 1 addition & 0 deletions microfrontend-vite/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{
"deepscan.enable": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default ({ posY, image }) => {
useEffect(() => window.scrollTo({ top: posY }));
return (
<>
<h1 class="text-center">Book</h1>
<h1 className="text-center">Book</h1>
<p>&nbsp;</p>
<img
className="center"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
}

.ldod-navbar.navbar {
border-top: 10px solid #FC1B27;
border-top: 10px solid #e71924;
font-family: 'Space-Mono';
font-weight: bold;
font-size: 14px;
}

.ldod-navbar .container-fluid:first-of-type {
border-bottom: 1px solid #FC1B27;
border-bottom: 1px solid #e71924;
}

.ldod-navbar.navbar-default {
Expand All @@ -68,12 +68,12 @@
}

.ldod-navbar.navbar-default .navbar-nav>li.dropdown.logged-in>a {
color: #FC1B27;
color: #e71924;
}


.ldod-navbar.navbar-default .navbar-nav>li>a.active {
color: #FC1B27;
color: #e71924;
}

.ldod-navbar.navbar-default .navbar-brand:hover,
Expand All @@ -82,7 +82,7 @@
}

.ldod-navbar.navbar-default .navbar-nav>li>a:focus {
color: #FC1B27;
color: #e71924;
}

.ldod-navbar.navbar-default .navbar-toggle:focus,
Expand Down Expand Up @@ -183,13 +183,13 @@
transform: translateX(-50%);
background-color: rgba(255, 255, 255, 0.8);
z-index: -1;
border-top: 1px dashed #FC1B27;
border-bottom: 1px solid #FC1B27;
border-top: 1px dashed #e71924;
border-bottom: 1px solid #e71924;
}

.ldod-navbar .navbar-right>li.login .dropdown-menu {
background-color: white;
border: 1px solid #FC1B27;
border: 1px solid #e71924;
margin-right: 15px;
padding-left: 15px;
padding-right: 15px;
Expand All @@ -208,7 +208,7 @@
}
.ldod-navbar .navbar-collapse {
background-color: white;
border-bottom: 1px solid #FC1B27;
border-bottom: 1px solid #e71924;
}
.navbar-nav-flex {
-webkit-box-orient: vertical;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const getDimensionList = (dimensions) =>
`${
dimensions
?.reduce(
(prev, cur) => [...prev, `${cur?.height}cm X ${cur.width}cm`],
(prev, cur) => [...prev, `${cur?.height}cm X ${cur?.width}cm`],
[]
)
.join(', ') ?? ''
Expand Down Expand Up @@ -179,13 +179,13 @@ export function EncodedFragment(
JP: getExpertData(expertEditionInterDtoMap.JP ?? '', messages),
sourceInterDtoList_0:
sourceInterDtoList?.[0] &&
getSourceData(sourceInterDtoList?.[0], messages, displayDoc),
getSourceData(sourceInterDtoList?.[0] ?? {}, messages, displayDoc),
sourceInterDtoList_1:
sourceInterDtoList?.[1] &&
getSourceData(sourceInterDtoList?.[1], messages, displayDoc),
getSourceData(sourceInterDtoList?.[1] ?? {}, messages, displayDoc),
sourceInterDtoList_2:
sourceInterDtoList?.[2] &&
getSourceData(sourceInterDtoList?.[2], messages, displayDoc),
getSourceData(sourceInterDtoList?.[2] ?? {}, messages, displayDoc),
};
return { ...result, searchData: JSON.stringify(result) };
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const getDimensionList = (dimensions) =>
.join('<br />') ?? ''
}`;

const getSurfaceList = (surfaces, title, displayDoc) =>
const getSurfaceList = (surfaces, title) =>
`${
surfaces
?.reduce(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ const options = {
const CategoryEntry = (data) => {
const result = {
title: (
<Link to={`/fragments/fragment/${data?.xmlId}/inter/${data?.urlId}`}>
{data?.title}
<Link to={`/fragments/fragment/${data.xmlId}/inter/${data.urlId}`}>
{data.title}
</Link>
),
virtualEdition: <Link to={`/edition/acronym/${data?.acronym}`}>{parseHTML(data?.editionTitle ?? "")}</Link>,
virtualEdition: <Link to={`/edition/acronym/${data.acronym}`}>{parseHTML(data.editionTitle ?? "")}</Link>,
user: parseHTML(
data.userDtoList
?.reduce(
Expand All @@ -28,7 +28,7 @@ const CategoryEntry = (data) => {
options
),
useEditions: parseHTML(
data?.usedList
data.usedList
?.reduce(
(prev, { shortName, urlId, xmlId }) => [
...prev,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { Link } from 'react-router-dom';
export const isExpertEdition = (edition) => edition?.type === 'EXPERT';

const dropEmptyCols = (data) => {
let filteredHeaders = Object.keys(data[0]).filter((header) =>
let filteredHeaders = Object.keys(data?.[0] ?? {}).filter((header) =>
data.some((entry) => entry[header])
);
return data.map((row) =>
return data?.map((row) =>
Object.keys(row)
.filter((header) => filteredHeaders.includes(header))
.reduce(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ export function UserContributionData(data) {
score: data.score,
position: data.position,
fragments: data.fragInterSize,
tableData: data?.fragInterSet?.map((entry) => UserContributionEntry(entry)),
tableData: data.fragInterSet?.map((entry) => UserContributionEntry(entry)),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function VirtualEditionModel(data) {
title: Title(data),
editors: Editors(data),
type: 'VIRTUAL',
tableData: data?.sortedInterpsList?.map((entry) =>
tableData: data.sortedInterpsList?.map((entry) =>
VirtualEditionEntry(entry)
),
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getExpertData, getSourceData } from '../../documents/models/Fragment';
import { isEditorial, isPublication } from '../dataExtraction';
import { isEditorial } from '../dataExtraction';
import {
fragmentStateSelector,
setDocPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export default ({ colsWidth, data, tbWidth, author }) => {
<table width={tbWidth}>
{author && (
<caption className="text-center">
<Link to={`/edition/acronym/${author?.acronym}`}>
{author?.editor}
<Link to={`/edition/acronym/${author.acronym}`}>
{author.editor}
</Link>
</caption>
)}
Expand Down
20 changes: 10 additions & 10 deletions microfrontend-vite/src/microfrontends/fragment/dataExtraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ function FragmentAuthorialSingle({
prevSurface,
inters,
}) {
const inter = inters?.[0];
const inter = inters[0];
const type = inter.type;

return {
type,
transcriptType: transcriptType.SINGLE,
sourceType: getSourceType(inter),
title: inter?.title,
title: inter.title,
transcript,
fontFamily: 'courier',
fontSize: '',
Expand All @@ -128,14 +128,14 @@ function FragmentAuthorialSingle({
}

function FragmentEditorialSingle({ fragment, transcript, inters }) {
const inter = inters?.[0];
const inter = inters[0];
const type = inter.type;

return {
type,
transcriptType: transcriptType.SINGLE,
sourceType: null,
title: inter?.title,
title: inter.title,
transcript,
fontFamily: 'georgia',
fontSize: 'medium',
Expand All @@ -148,8 +148,8 @@ function FragmentEditorialSingle({ fragment, transcript, inters }) {
}

function FragmentVirtualSingle({ transcript, inters }) {
const inter = inters?.[0];
const type = inter.type;
const inter = inters[0] ?? {};
const type = inter?.type;

return {
type,
Expand All @@ -161,9 +161,9 @@ function FragmentVirtualSingle({ transcript, inters }) {
fontFamily: 'monospace',
fontSize: '',
metaData: null,
taxonomies: inters?.length <= 1 && inter.categoryUserDtoList,
taxonomies: inters.length <= 1 && inter.categoryUserDtoList,
taxonomiesComp:
inters?.length > 1 && inters.map((inter) => inter?.categoryUserDtoList),
inters.length > 1 && inters.map((inter) => inter?.categoryUserDtoList),
editionTitle: inter.editionTitle,
usesList: inter.usedList.map(({ shortName }) => shortName),
usesReference: `${inter.usesReference}${
Expand All @@ -179,7 +179,7 @@ function FragmentInterSide(data) {
inters: data.inters?.map((inter, index) => ({
type: inter.type,
setTranscriptionSideBySide: data.setTranscriptionSideBySide[index],
title: inter?.title,
title: inter.title,
metaData: isAuthorial(inter)
? data.fragment.sourceInterDtoList?.find(
({ externalId }) => externalId === inter.externalId
Expand All @@ -204,7 +204,7 @@ export function extractData(data, state) {
const inters = data.inters;
const inter = inters?.[0];

if (isVirtual(inter)) {
if (isVirtual(inter ?? {})) {
setVirtualsInter(inters?.map((inter) => inter?.externalId) ?? [])
return FragmentVirtualSingle(data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getNoAuthFragment } from '../api/fragment';
import Fragment from '../components/Fragment';
import FragmentNav from '../components/FragmentNav';
import {
fragmentStateSelector, getVirtualEditionsAcronyms, setAuthorialsInter, setFragmentInter, setFragmentNavData, setSelectedVE
fragmentStateSelector, setAuthorialsInter, setFragmentInter, setFragmentNavData, setSelectedVE
} from '../fragmentStore';

export default ({ messages, language }) => {
Expand Down
Loading

0 comments on commit dabeda0

Please sign in to comment.