Skip to content

Commit

Permalink
Formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rquazi committed Nov 24, 2023
1 parent f438c85 commit 15c7e14
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 15 deletions.
10 changes: 9 additions & 1 deletion mscr-ui/src/common/components/history-table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ import TableCell from '@mui/material/TableCell';
import TableBody from '@mui/material/TableBody';
import { Revision } from '@app/common/interfaces/schema.interface';

export default function HistoryTable({ headers, revisions, ariaLabel }: { headers: Array<string>; revisions: Revision[]; ariaLabel: string }) {
export default function HistoryTable({
headers,
revisions,
ariaLabel,
}: {
headers: Array<string>;
revisions: Revision[];
ariaLabel: string;
}) {
return (
<TableContainer>
<Table aria-label={ariaLabel}>
Expand Down
6 changes: 3 additions & 3 deletions mscr-ui/src/common/components/schema/schema.slice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import isHydrate from '@app/store/isHydrate';
import {
Schema,
SchemaFormType,
SchemaWithVersionInfo
SchemaWithVersionInfo,
} from '@app/common/interfaces/schema.interface';
import { AnyNsRecord } from 'dns';

Expand Down Expand Up @@ -50,8 +50,8 @@ export const schemaApi = createApi({
getSchemaWithRevisions: builder.query<SchemaWithVersionInfo, string>({
query: (pid: string) => ({
url: `/schema/${pid}?includeVersionInfo=true`,
method: 'GET'
})
method: 'GET',
}),
}),
postSchema: builder.mutation<
string,
Expand Down
1 change: 0 additions & 1 deletion mscr-ui/src/modules/front-page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export default function FrontPage() {
});
}, [organizationsData, i18n.language]);


// Need to decide what data we want to fetch loading the application
const refetchInfo = () => {
refetchOrganizationsData();
Expand Down
11 changes: 8 additions & 3 deletions mscr-ui/src/modules/schema-view/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ import Tab from '@mui/material/Tab';
import { SyntheticEvent, useState } from 'react';
import MetadataAndFiles from '@app/modules/schema-view/metadata-and-files';
import VersionHistory from '@app/modules/schema-view/version-history';
import {useTranslation} from 'next-i18next';
import { useTranslation } from 'next-i18next';
import { useGetSchemaWithRevisionsQuery } from '@app/common/components/schema/schema.slice';

export default function SchemaView({ schemaId }: { schemaId: string }) {
const { t } = useTranslation('common');

const { data: schemaDetails, isLoading, isSuccess, isError, error } =
useGetSchemaWithRevisionsQuery(schemaId);
const {
data: schemaDetails,
isLoading,
isSuccess,
isError,
error,
} = useGetSchemaWithRevisionsQuery(schemaId);
const [selectedTab, setSelectedTab] = useState(0);

function a11yProps(index: number) {
Expand Down
8 changes: 6 additions & 2 deletions mscr-ui/src/modules/schema-view/version-history/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import {useTranslation} from 'next-i18next';
import { useTranslation } from 'next-i18next';
import { SchemaWithVersionInfo } from '@app/common/interfaces/schema.interface';
import HistoryTable from '@app/common/components/history-table';

export default function VersionHistory({ schemaDetails }: {schemaDetails: SchemaWithVersionInfo}) {
export default function VersionHistory({
schemaDetails,
}: {
schemaDetails: SchemaWithVersionInfo;
}) {
const { t } = useTranslation('common');

const headers = [
Expand Down
3 changes: 1 addition & 2 deletions mscr-ui/src/modules/search-screen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export default function SearchScreen() {
}

return (

<SearchContainer>
<Grid container justifyContent="space-between">
<Grid item xs={2}>
Expand All @@ -93,6 +92,6 @@ export default function SearchScreen() {
</CloseButton>
</Grid>
</Grid>
</SearchContainer >
</SearchContainer>
);
}
2 changes: 1 addition & 1 deletion mscr-ui/src/modules/search-screen/search-screen.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const SearchContainer = styled(Block)`
position: absolute;
background-color: ${(props) => props.theme.suomifi.colors.depthLight3};
z-index: 1;
width: 100%;
width: 100%;
`;

export const FacetsWrapper = styled(Block)`
Expand Down
4 changes: 2 additions & 2 deletions mscr-ui/src/pages/schema/[...pid].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import UpdateWithFileModal from '@app/common/components/update-with-file-modal';
import Separator from 'yti-common-ui/components/separator';
import { BasicBlock, BasicBlockExtraWrapper } from 'yti-common-ui/block';
import { MscrUser } from '@app/common/interfaces/mscr-user.interface';
import SchemaView from "@app/modules/schema-view";
import SchemaView from '@app/modules/schema-view';

interface IndexPageProps extends CommonContextState {
_netI18Next: SSRConfig;
Expand All @@ -33,7 +33,7 @@ interface IndexPageProps extends CommonContextState {
export default function SchemaPage(props: IndexPageProps) {
const { query, asPath } = useRouter();
const schemaId = (query?.pid ?? '') as string;

return (
<CommonContextProvider value={props}>
<Layout
Expand Down

0 comments on commit 15c7e14

Please sign in to comment.