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

ENH CMS 6 compatibility #346

Draft
wants to merge 1 commit into
base: 3.0
Choose a base branch
from

Conversation

emteknetnz
Copy link
Member

@emteknetnz emteknetnz commented Mar 4, 2025

Issue https://github.com/silverstripeltd/product-issues/issues/895

Requirement is in framework so we don't need to include it here as well

It's also the CMS 5 version of the plugin so means that campaign-admin currently isn't installable with CMS 6

@emteknetnz emteknetnz force-pushed the pulls/3.0/campaign-admin branch from dcbe5be to 7391e6f Compare March 4, 2025 06:08
@emteknetnz emteknetnz changed the title DEP Remove vendor-plugin requirement ENH CMS 6 compatibility Mar 4, 2025
@emteknetnz emteknetnz force-pushed the pulls/3.0/campaign-admin branch 3 times, most recently from b2062e7 to a2826ba Compare March 5, 2025 03:09
@@ -1,59 +0,0 @@
/* global jest, jasmine, describe, it, expect, beforeEach */

import configureMockStore from 'redux-mock-store';
Copy link
Member Author

Choose a reason for hiding this comment

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

This test was removed because 'redux-mock-store' wasn't compatible with latest version of redux. There was a link in the failed test to a page where the maintainers or redux recommend testing with react-testing-library instead. Since that kind of acts like a quasi behat test, and the fact we already have behat tests for campaign admin, I think we can safety just delete this test without a replacement

"classnames": "^2.3.2",
"core-js": "^3.26.0",
"deep-freeze-strict": "^1.1.1",
"prop-types": "^15.8.1",
"react": "^18.2.0",
Copy link
Member Author

@emteknetnz emteknetnz Mar 5, 2025

Choose a reason for hiding this comment

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

Removed all of the react* deps because they're not needed as it'll automatically just use the deps from admin, and also because I could ran yarn build with them here as they causes the 'Invalid hook call' issue.

@emteknetnz emteknetnz force-pushed the pulls/3.0/campaign-admin branch from a2826ba to fca2c46 Compare March 5, 2025 03:59
@@ -0,0 +1,108 @@
/* global window */
Copy link
Member Author

Choose a reason for hiding this comment

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

This is JS that used to be in admin silverstripe/silverstripe-admin#1857


# Allow users only only have access to the campaign-admin, and not all CMS access
# i.e. CMS_ACCESS_LeftAndMain, to still be able to manage changesets
SilverStripe\Versioned\ChangeSet:
Copy link
Member Author

Choose a reason for hiding this comment

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

These used to be done in Versioned silverstripe/silverstripe-versioned#482

The plural_name is used here with a call to ChangeSet::singleton()->i18n_pluralise()

We may as well also keep the singlular_name for consistency

@@ -24,8 +24,7 @@
"php": "^8.3",
"silverstripe/admin": "^3",
"silverstripe/framework": "^6",
"silverstripe/versioned": "^3",
"silverstripe/vendor-plugin": "^2"
Copy link
Member Author

Choose a reason for hiding this comment

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

Using the vendor-plugin defined in framework instead

@emteknetnz emteknetnz force-pushed the pulls/3.0/campaign-admin branch from fca2c46 to 5e7ba3e Compare March 5, 2025 04:42
@@ -0,0 +1,114 @@
<?php
Copy link
Member Author

Choose a reason for hiding this comment

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

This class contains a bunch of code that used to be in silverstripe/cms silverstripe/silverstripe-cms#3027

@@ -68,6 +68,8 @@ public function testValidationFailed()
'fieldName' => 'Campaign',
'messageType' => 'error',
'messageCast' => 'text',
'modelClass' => '',
Copy link
Member Author

Choose a reason for hiding this comment

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

Validators in CMS 6 pass through extra info so that it can be seen in CLI

@emteknetnz emteknetnz force-pushed the pulls/3.0/campaign-admin branch from 5e7ba3e to da63674 Compare March 5, 2025 05:11
@@ -0,0 +1,104 @@
<?php
Copy link
Member Author

@emteknetnz emteknetnz Mar 5, 2025

Choose a reason for hiding this comment

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

This contains code from asset-admin silverstripe/silverstripe-asset-admin#1512

@@ -0,0 +1,39 @@
<?php
Copy link
Member Author

Choose a reason for hiding this comment

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

This contains code from asset-admin silverstripe/silverstripe-asset-admin#1512

@emteknetnz emteknetnz force-pushed the pulls/3.0/campaign-admin branch from da63674 to ecab072 Compare March 5, 2025 05:25
@@ -0,0 +1,13 @@
<?php
Copy link
Member Author

Choose a reason for hiding this comment

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

@emteknetnz emteknetnz force-pushed the pulls/3.0/campaign-admin branch from ecab072 to 5aa1456 Compare March 6, 2025 02:56
@emteknetnz emteknetnz force-pushed the pulls/3.0/campaign-admin branch from 5aa1456 to 5ccd01c Compare March 6, 2025 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant