Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2c108bc
feature: listing-with-date
Tishasoumya-02 Aug 11, 2025
f54b052
Merge branch 'main' into event-listing-variation
Tishasoumya-02 Aug 11, 2025
cff71d0
fix
Tishasoumya-02 Aug 11, 2025
8d66f5f
Merge branch 'event-listing-variation' of github.com:kitconcept/kitco…
Tishasoumya-02 Aug 11, 2025
e3da1b4
add cypress test
Tishasoumya-02 Aug 13, 2025
5e86460
Update +listingWithDate.feature
Tishasoumya-02 Aug 13, 2025
cfc3da4
fix: remove duplicate confid, design
Tishasoumya-02 Aug 14, 2025
cbfe3c7
Merge branch 'event-listing-variation' of github.com:kitconcept/kitco…
Tishasoumya-02 Aug 14, 2025
b512d54
Merge branch 'main' into event-listing-variation
Tishasoumya-02 Aug 14, 2025
723829e
Merge branch 'main' into event-listing-variation
Tishasoumya-02 Aug 19, 2025
b31798e
fix: bring back the css
Tishasoumya-02 Aug 19, 2025
907d466
Merge branch 'event-listing-variation' of github.com:kitconcept/kitco…
Tishasoumya-02 Aug 19, 2025
7589856
update example content
Tishasoumya-02 Aug 19, 2025
9e20aad
example content for list with date variation
Tishasoumya-02 Aug 19, 2025
fd70d27
fix
Tishasoumya-02 Aug 19, 2025
af6a225
fix lint
Tishasoumya-02 Aug 19, 2025
b0a6ab7
fix
Tishasoumya-02 Aug 19, 2025
2edf2bc
fix the eslint error
iFlameing Aug 19, 2025
2df466b
fix: move common functions outside the component
Tishasoumya-02 Aug 20, 2025
0c148db
merge
Tishasoumya-02 Aug 20, 2025
851ff3c
merge
Tishasoumya-02 Aug 28, 2025
d827bc6
fix
Tishasoumya-02 Aug 28, 2025
5922067
Merge branch 'main' into event-listing-variation
Tishasoumya-02 Aug 28, 2025
f66d6d5
Merge branch 'main' into event-listing-variation
Tishasoumya-02 Aug 29, 2025
10ad227
Merge branch 'main' into event-listing-variation
danalvrz Sep 3, 2025
8402c1d
fix invalid date issue
iFlameing Sep 4, 2025
cc930e3
Merge branch 'main' into event-listing-variation
iFlameing Sep 4, 2025
0246d98
Merge branch 'main' into event-listing-variation
Tishasoumya-02 Sep 5, 2025
02d37f9
Merge branch 'main' into event-listing-variation
Tishasoumya-02 Sep 8, 2025
3db85f2
Merge remote-tracking branch 'origin' into event-listing-variation
danalvrz Sep 17, 2025
a688588
Merge branch 'main' into event-listing-variation
danalvrz Sep 17, 2025
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
1 change: 1 addition & 0 deletions backend/news/177.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add example content for list with date variation for listing block @Tishasoumya-02
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"modified": "2025-07-25T15:25:07+00:00",
"nav_title": null,
"preview_caption_link": null,
"remoteUrl": "/features/content-types",
"remoteUrl": "http://nohost/Plone/features/content-types",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this http://nohost/Plone

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How this got added here , not sure but removed it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible it is a bug in plone.exportimport. We should check to see if it happens again with remoteUrl

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it is a bug in plone.exportimport.

"review_state": "published",
"rights": "",
"subjects": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,26 @@
},
"theme": "default"
},
"b72b932a-c191-4116-afed-024d0893b340": {
"@type": "listing",
"headlineTag": "h2",
"querystring": {
"query": [
{
"i": "portal_type",
"o": "plone.app.querystring.operation.selection.any",
"v": [
"Event",
"Document"
]
}
],
"sort_order": "ascending"
},
"styles": {},
"theme": "default",
"variation": "listDate"
},
"c2eaacd0-4e96-4344-a0ac-26ed644fc503": {
"@type": "listing",
"block": "c2eaacd0-4e96-4344-a0ac-26ed644fc503",
Expand Down Expand Up @@ -542,6 +562,11 @@
"theme": "default",
"variation": "grid"
},
"dacab3f8-187e-45da-9823-e67e6db70498": {
"@type": "heading",
"heading": "List with date",
"theme": "default"
},
"e405a8b2-9a83-47b7-a1c6-52a919f01e08": {
"@type": "listing",
"headline": "List",
Expand Down Expand Up @@ -665,7 +690,9 @@
"ab005953-3360-4186-97ad-a4e1b4903b1c",
"e405a8b2-9a83-47b7-a1c6-52a919f01e08",
"e87a3b1a-493e-4cd7-8ca5-76b83a3595c2",
"245f8bda-5a49-4639-bbeb-d005c6a1a731"
"245f8bda-5a49-4639-bbeb-d005c6a1a731",
"dacab3f8-187e-45da-9823-e67e6db70498",
"b72b932a-c191-4116-afed-024d0893b340"
]
},
"changeNote": "",
Expand All @@ -689,7 +716,7 @@
"locked": false,
"stealable": true
},
"modified": "2025-08-07T12:08:49+00:00",
"modified": "2025-08-19T09:59:59+00:00",
"nav_title": null,
"preview_caption_link": null,
"review_state": "published",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@
"102f648399914851951ffa3fefc8665c": 11,
"144516507ac74892b96c1f7b574af7c4": 10,
"17a8b501a1f94d3ea1a9570aea2f4493": 11,
"195d96ca9952493cbffa69cda040b8b3": 5,
"195d96ca9952493cbffa69cda040b8b3": 4,
"1a22eddf0e7941a0962cbfaa785e4b4d": 10,
"1cdfd0c5a337469f8c41ade1fba5274d": 6,
"1e7262f173a54700a5ca2578506b1bc1": 45,
Expand All @@ -1354,11 +1354,11 @@
"3906609d0456404ca7146f6aa1f12f32": 13,
"3a0f24fe528f49eb8273784127ffaf51": 0,
"3ac4a2c6c4034a1686bc0ee2d2072fd6": 0,
"3f5e5703eee34cbbb27a7c41e2ed347e": 5,
"3f5e5703eee34cbbb27a7c41e2ed347e": 8,
"405582582e70493c96a6c549444a1eaa": 1,
"40a436ad604f4f80aeafe0977806760a": 5,
"425695d2b7cb47e69374d6f211f17e38": 1,
"453f894078814ffbb290ad61a23a6693": 4,
"453f894078814ffbb290ad61a23a6693": 5,
"49d22a94521c4883a1bb448ac7863cdd": 11,
"4d844688c768462ab158fe0bdb80c098": 18,
"4de23606a34b4db284c6125a94ca1c41": 3,
Expand All @@ -1380,7 +1380,7 @@
"6e4e9914ff9e4955a1b8b459e743f361": 43,
"6f42321fa6cf4f57969c78a21f92dd79": 17,
"70e63351448f45968af7bca53f418e6b": 12,
"75f2d0b5a1f04f7a922c47be34f9f532": 10,
"75f2d0b5a1f04f7a922c47be34f9f532": 11,
"77de6a96dadf457e8091cc4fee063273": 20,
"7950cae06c994276930f6d13151308c5": 9,
"7a3655ae11434336aeb0d2dd921de43b": 7,
Expand All @@ -1404,7 +1404,7 @@
"99c70917b6894af08dd306fdbc0eff6a": 2,
"ab9fa349a4704ae9bc83fef1f51fe08a": 8,
"ad6b8c2a3bce424fbf017b5b42d2bfd3": 1,
"afb59233c4e04945a4c8c1ec161c7124": 6,
"afb59233c4e04945a4c8c1ec161c7124": 5,
"b25ac9b29c9247c7bde7c6b5eca71720": 13,
"b654dac9f2c64dc7a6a45b61a0736c21": 10,
"b6beefd0959348018cc38709f5e80bbe": 3,
Expand All @@ -1425,16 +1425,16 @@
"d2ce9e4549e54ea8978cf521bb997ad4": 2,
"d5b125fd30ad4b149e0255aed9422aa0": 22,
"d7c7e8ed1ffb4b2fa20525f4f434ba27": 4,
"da07e218ea5e4c6c8582be7936d4686d": 7,
"da07e218ea5e4c6c8582be7936d4686d": 6,
"db1e7fbb041046e5845686df8b096545": 2,
"db324785b70b4c6085a94f7505b52462": 28,
"df4d71d6f0d044ec8ecd9c5164449c37": 2,
"e017bd4a0b3845aab26f6d855cc4ef14": 7,
"e090d954d0a448bca81c1a646e673a12": 15,
"e22f445ce04d465aa3635729294fb81a": 8,
"e22f445ce04d465aa3635729294fb81a": 7,
"e511f0a026e34f09b362d7d6f0ee219f": 16,
"e63af2b6f659485b836c34037606d42f": 0,
"e6a2ed459bd84ff1b1b75818c0b373b1": 11,
"e6a2ed459bd84ff1b1b75818c0b373b1": 10,
"e8178744e30a418b9a5768997bb29a19": 9,
"ebfa8d561c284d04a14ba05fc7937870": 0,
"ed622e194da44a319d9caa501a5d4684": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,17 @@
"type": "portlets.Events",
"visible": true
},
{
"assignment": {
"count": 5,
"no_thumbs": false,
"search_base_uid": null,
"state": null,
"thumb_scale": null
},
"type": "portlets.Events",
"visible": true
},
{
"assignment": {
"count": 5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,51 @@ describe('Folder Contents Tests', () => {
expect($img[0].naturalWidth).to.be.greaterThan(0);
});
});
it('Should render list with date template with Event Content Type', () => {
let startDate;
let endDate;
const now = new Date();
startDate = new Date(now);
startDate.setMonth(startDate.getMonth() + 1);
// End = start + 7 days
endDate = new Date(startDate.getTime() + 7 * 24 * 60 * 60 * 1000);
const formatDate = (date) => date.toISOString().replace('.000Z', '+00:00');
const eventStart = new Date((startDate.getTime() + endDate.getTime()) / 2);
const eventEnd = new Date(eventStart.getTime() + 2 * 24 * 60 * 60 * 1000);
cy.createContent({
contentType: 'Event',
contentId: 'my-event',
contentTitle: 'My Event',
bodyModifier(body) {
body.start = formatDate(eventStart);
body.end = formatDate(eventEnd);
return body;
},
});
cy.createContent({
contentType: 'Event',
contentId: 'my-next-event',
contentTitle: 'My Next Event',
bodyModifier(body) {
body.start = formatDate(eventStart);
body.end = formatDate(eventEnd);
return body;
},
});
cy.visit('/my-folder/my-document');

cy.get('.edit').click();
cy.addNewBlock('listing');
cy.get('#field-variation').click().type('list with date{enter}');

// set Type criteria filter to Event
cy.configureListingWith('Event');
cy.wait('@content');
cy.get('#toolbar-save').click();
cy.wait('@content');
cy.get('.card-inner .date-inset')
.should('be.visible')
.and('contain', eventStart.getDate())
.and('contain', eventEnd.getDate());
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add listing template listing with Date and cypress test for the same @Tishasoumya-02
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import { useSelector } from 'react-redux';
import Card from '@kitconcept/volto-light-theme/primitives/Card/Card';

Check warning on line 2 in frontend/packages/volto-intranet/src/components/Blocks/Listing/EventCalendarTemplate.tsx

View workflow job for this annotation

GitHub Actions / frontend / Frontend: Codeanalysis / Code analysis check

Unable to resolve path to module '@kitconcept/volto-light-theme/primitives/Card/Card'
import DefaultSummary from '@kitconcept/volto-light-theme/components/Summary/DefaultSummary';

Check warning on line 3 in frontend/packages/volto-intranet/src/components/Blocks/Listing/EventCalendarTemplate.tsx

View workflow job for this annotation

GitHub Actions / frontend / Frontend: Codeanalysis / Code analysis check

Unable to resolve path to module '@kitconcept/volto-light-theme/components/Summary/DefaultSummary'
import cx from 'classnames';

type IntlType = {
intl: {
locale: string;
};
};

const EventItem = ({
item,
lang,
isEditMode,
}: {
item: any;
lang: string;
isEditMode: boolean;
}) => {
const formatter = new Intl.DateTimeFormat(lang, {
year: 'numeric',
month: 'short',
});
const headFormatter = new Intl.DateTimeFormat(lang, {
day: 'numeric',
year: 'numeric',
month: 'long',
});

const itemDates = (item: any) => {
Comment thread
Tishasoumya-02 marked this conversation as resolved.
Outdated
const start =
item['@type'] === 'Event'
? item.start
? new Date(item.start)
: null
: item.Effective
? new Date(item.Effective)
: new Date(item.CreationDate);

const end =
item['@type'] === 'Event' && (item.end ? new Date(item.end) : null);

const notSameDay = end && start?.getDate() !== end?.getDate();
const formattedStartDate = start ? formatter.format(start) : '';
const formattedEndDate = end ? formatter.format(end) : '';
const formattedHeaderDate = !end
? start
? headFormatter.format(start)
: ''
: start && end
? headFormatter.formatRange(start, end)
: '';

return {
start,
end,
formattedStartDate,
formattedEndDate,
formattedHeaderDate,
notSameDay,
};
};

const {
start,
end,
formattedHeaderDate,
notSameDay,
formattedStartDate,
formattedEndDate,
} = itemDates(item);

return (
<div className="card-listing">
<Card href={isEditMode ? '' : item['@id']} className="event-card">
<Card.Image>
<div className={cx('date-inset', { 'has-end-date': notSameDay })}>
<div className="day">
{start && String(start?.getDate()).padStart(2, '0')}
</div>
<div className="month">{formattedStartDate}</div>
{notSameDay && (
<>
<div className="separator"></div>
<div className="day">
{end && String(end?.getDate()).padStart(2, '0')}
</div>
<div className="month">{formattedEndDate}</div>
</>
)}
</div>
</Card.Image>
<Card.Summary>
<div className="headline calendar">
<span className="day">{formattedHeaderDate}</span>
{item.head_title && (
<span className="event-title">{item.head_title}</span>
)}
</div>
<DefaultSummary item={item} HeadingTag="h2" />
</Card.Summary>
</Card>
</div>
);
};

const EventCalendarTemplate = (props: any) => {
const lang = useSelector((state: IntlType) => state.intl.locale);
return (
<div className="event-calendar items">
{props.items.map((item: any, index: number) => (
<EventItem
key={index}
item={item}
lang={lang}
isEditMode={props.isEditMode}
/>
))}
</div>
);
};

export default EventCalendarTemplate;
20 changes: 20 additions & 0 deletions frontend/packages/volto-intranet/src/config/blocks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { ConfigType } from '@plone/registry';
import EventCalendarTemplate from '../components/Blocks/Listing/EventCalendarTemplate';

export default function install(config: ConfigType) {
const listingBlockVariations = [
...(config.blocks.blocksConfig.listing.variations || []),
{
id: 'listDate',
title: 'List with date',
template: EventCalendarTemplate,
},
].filter((variation) => !!variation);

config.blocks.blocksConfig.listing = {
...config.blocks.blocksConfig.listing,
Comment thread
Tishasoumya-02 marked this conversation as resolved.
variations: listingBlockVariations,
Comment thread
Tishasoumya-02 marked this conversation as resolved.
};

return config;
}
3 changes: 2 additions & 1 deletion frontend/packages/volto-intranet/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ConfigType } from '@plone/registry';
import installSettings from './config/settings';
import installSlots from './config/slots';

import installBlocks from './config/blocks';
declare module '@plone/types' {
export interface GetSiteResponse {
'kitconcept.intranet.custom_css': string;
Expand All @@ -11,6 +11,7 @@ declare module '@plone/types' {
const applyConfig = (config: ConfigType) => {
installSettings(config);
installSlots(config);
installBlocks(config);
return config;
};

Expand Down
1 change: 1 addition & 0 deletions frontend/packages/volto-intranet/src/theme/_main.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@import 'slots';
@import 'components/search';
@import 'components/eventsList.scss';
Loading
Loading