Skip to content
Merged
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
9 changes: 8 additions & 1 deletion Classes/Controller/WhatsNewInProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Mvc\Controller\ActionController;
use Neos\Neos\Domain\Service\ContentContext;
use DateTime;

/**
* @Flow\Scope("singleton")
Expand All @@ -26,8 +27,14 @@ public function indexAction()
$node = $flowQuery->find('[instanceof Flowpack.Neos.WhatsNewEditor.InMyProject:Document.WhatsNewDashboardPage]')->get(0);
$clientNotificationDateTime = $node->getProperty('clientNotificationDateTime');

if ($clientNotificationDateTime instanceof DateTime) {
$clientNotificationTimestamp = $clientNotificationDateTime->getTimestamp() * 1000; // to get timestamp in ms instead of seconds to match js timestamp
} else {
$clientNotificationTimestamp = 0; // If no DateTime is set, we don't want to show the notification
}

return json_encode([
"clientNotificationTimestamp" => $clientNotificationDateTime->getTimestamp() * 1000 // to get timestamp in ms instead of seconds to match js timestamp
"clientNotificationTimestamp" => $clientNotificationTimestamp,
]);
}

Expand Down
1 change: 1 addition & 0 deletions NodeTypes/ContentCollection/ContentCollection.Default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
'Neos.Neos:ContentCollection': true
constraints:
nodeTypes:
'*': false
'Flowpack.Neos.WhatsNewEditor.InMyProject:Content.Section.OneColumn': true
'Flowpack.Neos.WhatsNewEditor.InMyProject:Content.Section.TwoColumns': true
2 changes: 1 addition & 1 deletion NodeTypes/ContentCollection/ContentCollection.Section.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'Neos.Neos:ContentCollection': true
constraints:
nodeTypes:
'*': false
'Flowpack.Neos.WhatsNewEditor.InMyProject:Content.Headline': true
'Flowpack.Neos.WhatsNewEditor.InMyProject:Content.Text': true
'Flowpack.Neos.WhatsNewEditor.InMyProject:Content.Image': true

8 changes: 8 additions & 0 deletions NodeTypes/Overwrite/ContentCollection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'Neos.Neos:ContentCollection':
constraints:
nodeTypes:
'Flowpack.Neos.WhatsNewEditor.InMyProject:Content.Section.OneColumn': false
'Flowpack.Neos.WhatsNewEditor.InMyProject:Content.Section.TwoColumns': false
'Flowpack.Neos.WhatsNewEditor.InMyProject:Content.Headline': false
'Flowpack.Neos.WhatsNewEditor.InMyProject:Content.Text': false
'Flowpack.Neos.WhatsNewEditor.InMyProject:Content.Image': false
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Install via composer with `composer require flowpack/neos-whatsneweditor-inmypro

### Usage

Add `'Flowpack.Neos.WhatsNewEditor.InMyProject:Document.WhatsNewDashboardPage': true` to your root (or another) page > this is the entrypoint for the news. You then can find the page in the `What's new dashboard elements` section:
Add `'Flowpack.Neos.WhatsNewEditor.InMyProject:Document.WhatsNewDashboardPage': true` to your root (or another)
page > this is the entrypoint for the news. You then can find the page in the `What's new dashboard elements` section:

![Page Element](./docs/page.jpg)

Expand All @@ -24,3 +25,5 @@ Below the main content collection you can add 2 kinds of sections. A one column
In those sections you can add basic content elements to structure your project news page.

![Content elements](./docs/contentElements.jpg)

[what's new dashboard package]: https://github.com/Flowpack/Flowpack.Neos.WhatsNewDashboard
2 changes: 1 addition & 1 deletion Resources/Private/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"watch:js": "node ./build.mjs --watch",
"watch:typecheck": "nodemon -e ts -x \"yarn run typecheck || echo '!!!!!!!!!!!!!!!!!!!!!! TypeScript Errors, Please fix !!!!!!!!!!!!!!!!!!!!!!'\"",
"build": "yarn run typecheck && yarn run build:tailwind && yarn run build:js",
"build:tailwind": "npx tailwindcss -i ./tailwind.css -o ../Public/main.css",
"build:tailwind": "npx tailwindcss -m -i ./tailwind.css -o ../Public/main.css",
"build:js": "node ./build.mjs",
"postbuild:css": "./node_modules/.bin/postcss --use autoprefixer --autoprefixer.browsers 'last 4 versions' ../Public/*.css -d ../Public/",
"typecheck": "tsc -noEmit"
Expand Down
Loading