-
Notifications
You must be signed in to change notification settings - Fork 16
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
base: 3.0
Are you sure you want to change the base?
ENH CMS 6 compatibility #346
Conversation
dcbe5be
to
7391e6f
Compare
b2062e7
to
a2826ba
Compare
@@ -1,59 +0,0 @@ | |||
/* global jest, jasmine, describe, it, expect, beforeEach */ | |||
|
|||
import configureMockStore from 'redux-mock-store'; |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
a2826ba
to
fca2c46
Compare
@@ -0,0 +1,108 @@ | |||
/* global window */ |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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
fca2c46
to
5e7ba3e
Compare
@@ -0,0 +1,114 @@ | |||
<?php |
There was a problem hiding this comment.
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' => '', |
There was a problem hiding this comment.
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
5e7ba3e
to
da63674
Compare
@@ -0,0 +1,104 @@ | |||
<?php |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
da63674
to
ecab072
Compare
@@ -0,0 +1,13 @@ | |||
<?php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was used in both assets - silverstripe/silverstripe-assets#660
And elemental - silverstripe/silverstripe-elemental#1283
ecab072
to
5aa1456
Compare
5aa1456
to
5ccd01c
Compare
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