Skip to content

Commit

Permalink
Hide unnecessary information of resources and bulk enable crop.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitkonikov committed Feb 12, 2024
1 parent f30f6b0 commit fb2b865
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 0 deletions.
16 changes: 16 additions & 0 deletions backend/src/resources/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ export const files = {
resource: File,
options: {
properties: {
_id: {
isVisible: {
list: false,
filter: false,
show: true,
edit: false,
},
},
link: {
type: 'string',
},
Expand All @@ -24,6 +32,14 @@ export const files = {
type: 'reference',
reference: 'Playlist',
},
filepath: {
isVisible: {
list: false,
filter: false,
show: true,
edit: false,
},
},
},
},
features: [
Expand Down
8 changes: 8 additions & 0 deletions backend/src/resources/playlists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ export const playlists = {
resource: Playlist,
options: {
properties: {
_id: {
isVisible: {
list: false,
filter: false,
show: true,
edit: false,
},
},
name: {
type: 'string',
},
Expand Down
8 changes: 8 additions & 0 deletions backend/src/resources/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ export const sites = {
resource: Site,
options: {
properties: {
_id: {
isVisible: {
list: false,
filter: false,
show: true,
edit: false,
},
},
name: {
type: 'string',
},
Expand Down
31 changes: 31 additions & 0 deletions backend/src/resources/thumbnail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,40 @@ export const thumbnails = {
resource: Thumbnail,
options: {
properties: {
_id: {
isVisible: {
list: false,
filter: false,
show: true,
edit: false,
},
},
crop: {
type: 'boolean',
},
filepath: {
isVisible: {
list: false,
filter: false,
show: true,
edit: false,
},
},
},
actions: {
EnableCrop: {
actionType: 'bulk',
component: false,
handler: (request, response, context) => {
const { records, currentAdmin } = context;
// eslint-disable-next-line no-restricted-syntax, prefer-const
for (let record of records) {
const recordId = record.params._id as number;
Thumbnail.findByIdAndUpdate(recordId, { crop: true }).exec();
}
return { records };
},
},
},
},
features: [
Expand Down
8 changes: 8 additions & 0 deletions backend/src/resources/trailer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ export const trailers = {
resource: Trailer,
options: {
properties: {
_id: {
isVisible: {
list: false,
filter: false,
show: true,
edit: false,
},
},
visible: {
type: 'boolean',
},
Expand Down

0 comments on commit fb2b865

Please sign in to comment.