Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRYD-1399: RestrictedMedia #240

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/plugins/recordTypes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import relation from './relation';
import repatriationclaim from './repatriationclaim';
import report from './report';
import reportinvocation from './reportinvocation';
import restrictedmedia from './restrictedmedia';
import structdateparser from './structdateparser';
import summarydocumentation from './summarydocumentation';
import transport from './transport';
Expand Down Expand Up @@ -95,6 +96,7 @@ export default [
relation,
report,
reportinvocation,
restrictedmedia,
structdateparser,
summarydocumentation,
valuation,
Expand Down
59 changes: 59 additions & 0 deletions src/plugins/recordTypes/restrictedmedia/advancedSearch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
export default (configContext) => {
const {
OP_EQ,
OP_CONTAIN,
OP_RANGE,
} = configContext.searchOperators;

const {
defaultAdvancedSearchBooleanOp,
extensions,
} = configContext.config;

return {
op: defaultAdvancedSearchBooleanOp,
value: [
{
op: OP_CONTAIN,
path: 'ns2:restrictedmedia_common/identificationNumber',
},
{
op: OP_CONTAIN,
path: 'ns2:restrictedmedia_common/title',
},
{
op: OP_EQ,
path: 'ns2:restrictedmedia_common/creator',
},
{
op: OP_EQ,
path: 'ns2:restrictedmedia_common/languageList/language',
},
{
op: OP_EQ,
path: 'ns2:restrictedmedia_common/publisher',
},
{
op: OP_EQ,
path: 'ns2:restrictedmedia_common/typeList/type',
},
{
op: OP_RANGE,
path: 'ns2:restrictedmedia_common/dateGroupList/dateGroup',
},
{
op: OP_CONTAIN,
path: 'ns2:restrictedmedia_common/source',
},
{
op: OP_CONTAIN,
path: 'ns2:restrictedmedia_common/subjectList/subject',
},
{
op: OP_EQ,
path: 'ns2:restrictedmedia_common/rightsHolder',
},
...extensions.core.advancedSearch,
],
};
};
58 changes: 58 additions & 0 deletions src/plugins/recordTypes/restrictedmedia/columns.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { defineMessages } from 'react-intl';

export default (configContext) => {
const {
formatTimestamp,
thumbnailImage,
} = configContext.formatHelpers;

return {
default: {
blobCsid: {
formatValue: thumbnailImage,
messages: defineMessages({
label: {
id: 'column.restrictedmedia.default.blobCsid',
defaultMessage: 'Thumbnail',
},
}),
order: 10,
width: 70,
},
identificationNumber: {
messages: defineMessages({
label: {
id: 'column.restrictedmedia.default.identificationNumber',
defaultMessage: 'Identification number',
},
}),
order: 20,
sortBy: 'restrictedmedia_common:identificationNumber',
width: 200,
},
title: {
messages: defineMessages({
label: {
id: 'column.restrictedmedia.default.title',
defaultMessage: 'Title',
},
}),
order: 30,
sortBy: 'restrictedmedia_common:title',
width: 380,
},
updatedAt: {
formatValue: formatTimestamp,
messages: defineMessages({
label: {
id: 'column.restrictedmedia.default.updatedAt',
defaultMessage: 'Updated',
},
}),
order: 40,
sortBy: 'collectionspace_core:updatedAt',
width: 150,
},
},
};
};
Loading