Skip to content

Commit

Permalink
Merge pull request #161 from CSCfi/CSCFC4EMSCR-459_Remove-namespace-c…
Browse files Browse the repository at this point in the history
…olumn-from-crosswalk-listing

MSCR-459 Remove namespace column from workspace table when crosswalks
  • Loading branch information
rquazi authored May 3, 2024
2 parents e7c7f76 + 19d55a7 commit 75a3ead
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions mscr-ui/src/modules/workspace/group-home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ export default function GroupWorkspace({
return data.hits.hits.map((result) => {
const info = result._source;
const linkUrl =
contentType == 'SCHEMA'
contentType == Type.Schema
? router.basePath + '/schema/' + info.id
: router.basePath + '/crosswalk/' + info.id;
return {
label: getLanguageVersion({
data: info.label,
lang,
}),
namespace: info.namespace,
...(contentType == Type.Schema && { namespace: info.namespace }),
state: info.state,
numberOfRevisions: info.numberOfRevisions.toString(),
pid: info.handle ?? t('metadata.not-available'),
Expand Down
13 changes: 6 additions & 7 deletions mscr-ui/src/modules/workspace/personal-home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import { useStoreDispatch } from '@app/store';
import { useRouter } from 'next/router';
import { getLanguageVersion } from '@app/common/utils/get-language-version';
import { useEffect, useMemo, useState } from 'react';
import WorkspaceTable, { ContentRow } from '@app/modules/workspace/workspace-table';
import WorkspaceTable, {
ContentRow,
} from '@app/modules/workspace/workspace-table';

export default function PersonalWorkspace({
contentType,
Expand Down Expand Up @@ -49,15 +51,15 @@ export default function PersonalWorkspace({
return data.hits.hits.map((result) => {
const info = result._source;
const linkUrl =
contentType == 'SCHEMA'
contentType == Type.Schema
? router.basePath + '/schema/' + info.id
: router.basePath + '/crosswalk/' + info.id;
return {
label: getLanguageVersion({
data: info.label,
lang,
}),
namespace: info.namespace,
...(contentType == Type.Schema && { namespace: info.namespace }),
state: info.state,
numberOfRevisions: info.numberOfRevisions.toString(),
pid: info.handle ?? t('metadata.not-available'),
Expand Down Expand Up @@ -131,10 +133,7 @@ export default function PersonalWorkspace({
: t('workspace.no-crosswalks')}
</div>
) : (
<WorkspaceTable
content={content}
contentType={contentType}
/>
<WorkspaceTable content={content} contentType={contentType} />
)}
{lastPage > 1 && <Pagination lastPage={lastPage} />}
</main>
Expand Down
6 changes: 3 additions & 3 deletions mscr-ui/src/modules/workspace/workspace-table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { State } from '@app/common/interfaces/state.interface';

export interface ContentRow {
label: string;
namespace: string;
namespace?: string;
state: State;
numberOfRevisions: string;
pid: string;
Expand All @@ -22,13 +22,13 @@ export default function WorkspaceTable({
const { t } = useTranslation('common');

const caption =
contentType == 'SCHEMA'
contentType == Type.Schema
? t('workspace.schemas')
: t('workspace.crosswalks');

const headings = [
t('workspace.label'),
t('workspace.namespace'),
...((contentType == Type.Schema) ? [t('workspace.namespace')] : []),
t('workspace.state'),
t('workspace.numberOfRevisions'),
t('workspace.pid'),
Expand Down

0 comments on commit 75a3ead

Please sign in to comment.