Problem/Motivation
Followup from #2490818: Add help to clarify purpose and usage of bundles.
Because they're used for namespacing, most or all features developers will want to first create a bundle before generating features. However, currently, the first screen to appear on initial install is the feature generation one, with "Default" selected for "Bundle". Users may proceed to generate features and only later discover that they should first have created one or more bundles.
Proposed resolution
If no bundles have yet been created, at admin/config/development/features generate a message. Draft:
You have not yet created any bundles. Before generating features, you may wish to [link]create a bundle[/link] to group your features within.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff-2653166-4-7.txt | 3.21 KB | naveenvalecha |
#7 | 2653166-7.patch | 3.57 KB | naveenvalecha |
| |||
#6 | 2653166-6.patch | 3.56 KB | naveenvalecha |
| |||
#6 | interdiff-2653166-4-6.txt | 3.21 KB | naveenvalecha |
#3 | 2653166-4.patch | 2.12 KB | naveenvalecha |
|
Comments
Comment #2
nedjoPatch attached, but setting to needs work pending tests.
Comment #3
naveenvalechaAdded tests.
Comment #4
naveenvalechaAs we only need to check the message. If we need to check the features.asssignment link as well, we can move to assertRaw, Do we need to check the link in message as well ?
Comment #5
nedjo@naveenvalecha: thanks for starting into work on a test!
+++ b/src/Tests/FeaturesCreateUITest.php
@@ -36,6 +36,8 @@ class FeaturesCreateUITest extends WebTestBase {
+ // Check the message is displaying if there are no custom bundles.
+ $this->assertText(t('You have not yet created any bundles. Before generating features, you may wish to create a bundle to group your features within.'), 'The text "You have not yet created any bundles. Before generating features, you may wish to create a bundle to group your features within." appears on the user register page.');
Since
::testCreateFeaturesUI()
is testing the features edit form, rather than the form atadmin/config/development/features
(except to ensure that page includes a working local action link to the features edit form), we should put this into a different method, and probably into a new class focused on testing the form atadmin/config/development/features
.We'll also need to test the contrary case, by adding a custom bundle and ensuring the message does not appear.
I guess it couldn't hurt. In e.g. AddFeedTest::testAddFeed() it looks like
::assertRaw()
is sometimes used to test a message.Comment #6
naveenvalechaOkay A seperate class sounds good in features_ui
Added :)
Comment #7
naveenvalechaohhh yeah taken this from FeaturesCreateUITest.php to skip the config schema validation , otherwise it was failing
Comment was missing me ;)
Comment #8
nedjoThanks, looks good! I'm leaving RTBC for a bit in case anyone else wants to take a look before we commit this.
Comment #9
nedjoCommitted, thanks!