diff --git a/app/_config/api-map.yml b/app/_config/api-map.yml index 653e7e6..d3950c3 100644 --- a/app/_config/api-map.yml +++ b/app/_config/api-map.yml @@ -14,7 +14,7 @@ SilverStripe\Core\Injector\Injector: A2nt\SilverStripeMapboxField\MapboxField: map_style: 'mapbox://styles/mapbox/streets-v9' #'mapbox://styles/mapbox/light-v10' -Site\Elements\MapElement: +App\Elements\MapElement: map_type: 'google-maps' BetterBrief\GoogleMapField: diff --git a/app/_config/base-extensions.yml b/app/_config/base-extensions.yml index 7345afd..910767e 100644 --- a/app/_config/base-extensions.yml +++ b/app/_config/base-extensions.yml @@ -2,52 +2,46 @@ Name: webapp-base-extensions --- # Basic extensions - SilverStripe\Admin\LeftAndMain: extensions: - - Site\Extensions\LeftAndMainExtension + - App\Extensions\LeftAndMainExtension SilverStripe\SiteConfig\SiteConfig: extensions: - - Site\Extensions\SocialExtension - - Site\Extensions\SiteConfigExtension - - Site\Extensions\NotificationsExtension + - App\Extensions\SocialExtension + - App\Extensions\SiteConfigExtension + - App\Extensions\NotificationsExtension SilverStripe\CMS\Model\SiteTree: extensions: - - Site\Extensions\SiteTreeExtension + - App\Extensions\SiteTreeExtension Sheadawson\Linkable\Models\EmbeddedObject: extensions: - - Site\Extensions\EmbeddedObjectExtension + - App\Extensions\EmbeddedObjectExtension SilverStripe\Assets: extensions: - - Site\Extensions\ImageExtension + - App\Extensions\ImageExtension Dynamic\FlexSlider\Model\SlideImage: extensions: - - Site\Extensions\SlideImageExtension + - App\Extensions\SlideImageExtension SilverStripe\Core\Injector\Injector: #SilverStripe\UserForms\Model\UserDefinedForm: - # class: Site\Extensions\UserDefinedForm_HiddenClass + # class: App\Extensions\UserDefinedForm_HiddenClass Sheadawson\Linkable\Forms\EmbeddedObjectField: - class: Site\Extensions\EmbedObjectField + class: App\Extensions\EmbedObjectField SilverStripe\Forms\CompositeField: - class: Site\Extensions\CompositeFieldExtension - -# User Forms module -SilverStripe\UserForms\Model\UserDefinedForm: - show_in_sitetree: false - can_be_root: false - extensions: - - Site\Extensions\UserDefinedFormExtension + class: App\Extensions\CompositeFieldExtension SilverStripe\UserForms\Form\UserForm: extensions: - - Site\Extensions\PlaceholderFormExtension + - App\Extensions\PlaceholderFormExtension -DNADesign\ElementalUserForms\Model\ElementForm: +Page: + searchable_objects: + - App\Models\TeamMember extensions: - - Site\Extensions\UserDefinedFormExtension + - DNADesign\Elemental\Extensions\ElementalPageExtension diff --git a/app/_config/base-graphql.yml b/app/_config/base-graphql.yml index df2acd8..f172106 100644 --- a/app/_config/base-graphql.yml +++ b/app/_config/base-graphql.yml @@ -17,22 +17,22 @@ SilverStripe\GraphQL\Controller: SilverStripe\GraphQL\Auth\Handler: authenticators: - - class: Site\GraphQL\APIKeyAuthenticator + - class: App\GraphQL\APIKeyAuthenticator priority: 30 SilverStripe\GraphQL\Manager.default: properties: Middlewares: - APIKeyMiddleware: Site\GraphQL\APIKeyMiddleware + APIKeyMiddleware: App\GraphQL\APIKeyMiddleware SilverStripe\GraphQL\Manager: schemas: default: types: - member: 'Site\GraphQL\MemberTypeCreator' - page: 'Site\GraphQL\PageTypeCreator' - element: 'Site\GraphQL\ElementTypeCreator' + member: 'App\GraphQL\MemberTypeCreator' + page: 'App\GraphQL\PageTypeCreator' + element: 'App\GraphQL\ElementTypeCreator' queries: - readPages: 'Site\GraphQL\PaginatedReadPagesQueryCreator' - readMembers: 'Site\GraphQL\ReadMembersQueryCreator' - paginatedReadMembers: 'Site\GraphQL\PaginatedReadMembersQueryCreator' + readPages: 'App\GraphQL\PaginatedReadPagesQueryCreator' + readMembers: 'App\GraphQL\ReadMembersQueryCreator' + paginatedReadMembers: 'App\GraphQL\PaginatedReadMembersQueryCreator' diff --git a/app/_config/base-security.yml b/app/_config/base-security.yml index 33eb2b9..ee8eabb 100644 --- a/app/_config/base-security.yml +++ b/app/_config/base-security.yml @@ -4,9 +4,9 @@ After: 'framework/*, cms/*, security_baseline' --- SilverStripe\Core\Injector\Injector: SilverStripe\Security\MemberAuthenticator\LostPasswordHandler: - class: Site\Extensions\LostPasswordHandlerExtension + class: App\Extensions\LostPasswordHandlerExtension SilverStripe\Security\MemberAuthenticator\MemberLoginForm: - class: Site\Extensions\SiteMemberLoginForm + class: App\Extensions\SiteMemberLoginForm --- Except: environment: dev diff --git a/app/_config/locale-fluent.yml_ b/app/_config/locale-fluent.yml_ index f410cf2..caec94c 100644 --- a/app/_config/locale-fluent.yml_ +++ b/app/_config/locale-fluent.yml_ @@ -29,14 +29,14 @@ Page: extensions: - DNADesign\Elemental\TopPage\SiteTreeExtension - DNADesign\Elemental\Extensions\ElementalPageExtension - - Site\Extensions\PageFluentExtension + - App\Extensions\PageFluentExtension DNADesign\Elemental\Models\ElementalArea: extensions: - DNADesign\Elemental\TopPage\FluentExtension - - Site\Extensions\ElementalArea + - App\Extensions\ElementalArea DNADesign\Elemental\Models\BaseElement: extensions: - DNADesign\Elemental\TopPage\FluentExtension - - Site\Extensions\ElementRows + - App\Extensions\ElementRows diff --git a/app/_config/options-elements.yml b/app/_config/options-elements.yml index 8dd8853..3e9fdc1 100644 --- a/app/_config/options-elements.yml +++ b/app/_config/options-elements.yml @@ -4,33 +4,44 @@ After: - elemental - elemental-list - elementalvirtual + - webapp-base-extensions --- + +# User Forms module +DNADesign\ElementalUserForms\Model\ElementForm: + extensions: + - App\Elements\Extensions\UserDefinedFormExtension + +SilverStripe\UserForms\Model\UserDefinedForm: + show_in_sitetree: false + can_be_root: false + extensions: + - App\Elements\Extensions\UserDefinedFormExtension +################## + Page: searchable_elements: - DNADesign\Elemental\Models\ElementContent - searchable_objects: - - Site\Models\TeamMember extensions: - - DNADesign\Elemental\TopPage\SiteTreeExtension - DNADesign\Elemental\Extensions\ElementalPageExtension SilverStripe\CMS\Controllers\ContentController: extensions: - DNADesign\Elemental\Extensions\ElementalContentControllerExtension - - Site\Elements\ElementalContentControllerExtension + - App\Elements\ElementalContentControllerExtension url_handlers: 'element/$ID!': 'handleElement' DNADesign\Elemental\Models\ElementalArea: extensions: #- DNADesign\Elemental\TopPage\DataExtension - - Site\Extensions\ElementalArea + - App\Elements\Extensions\ElementalArea DNADesign\Elemental\Models\BaseElement: default_global_elements: true extensions: #- DNADesign\Elemental\TopPage\DataExtension - - Site\Extensions\ElementRows + - App\Elements\Extensions\ElementRows SilverStripe\CMS\Model\SiteTree: allowed_elements: @@ -41,21 +52,21 @@ SilverStripe\CMS\Model\SiteTree: - Dynamic\Elements\Blog\Elements\ElementBlogPosts - Dynamic\Elements\Oembed\Elements\ElementOembed - Dynamic\Elements\Elements\ElementTestimonials - #- Site\Elements\TeamMembersElement - - Site\Elements\SliderElement - - Site\Elements\BlockElement - - Site\Elements\MapElement - #- Site\Elements\AccordionElement + #- App\Elements\TeamMembersElement + - App\Elements\SliderElement + - App\Elements\BlockElement + - App\Elements\MapElement + #- App\Elements\AccordionElement - DNADesign\ElementalVirtual\Model\ElementVirtual - - Site\Elements\AccordionElement - - Site\Elements\CustomSnippetElement - - Site\Elements\InstagramElement + - App\Elements\AccordionElement + - App\Elements\CustomSnippetElement + - App\Elements\InstagramElement DNADesign\ElementalList\Model\ElementList: inline_editable: false default_global_elements: false extensions: - - Site\Elements\ElementListExtension + - App\Elements\ElementListExtension allowed_elements: - DNADesign\ElementalList\Model\ElementList - DNADesign\Elemental\Models\ElementContent @@ -64,18 +75,18 @@ DNADesign\ElementalList\Model\ElementList: - Dynamic\Elements\Blog\Elements\ElementBlogPosts - Dynamic\Elements\Oembed\Elements\ElementOembed - Dynamic\Elements\Elements\ElementTestimonials - #- Site\Elements\TeamMembersElement - - Site\Elements\SliderElement - - Site\Elements\BlockElement - - Site\Elements\MapElement - - Site\Elements\AccordionElement - - Site\Elements\CustomSnippetElement - - Site\Elements\InstagramElement + #- App\Elements\TeamMembersElement + - App\Elements\SliderElement + - App\Elements\BlockElement + - App\Elements\MapElement + - App\Elements\AccordionElement + - App\Elements\CustomSnippetElement + - App\Elements\InstagramElement styles: whiteframe: 'White Frame' noframe: 'No Frame' -Site\Elements\AccordionElement: +App\Elements\AccordionElement: allowed_elements: - DNADesign\Elemental\Models\ElementContent @@ -83,7 +94,7 @@ DNADesign\Elemental\Models\ElementContent: default_global_elements: false inline_editable: false extensions: - - Site\Extensions\ElementContentWidget + - App\Elements\Extensions\ElementContentWidget frontend_searchable_fields: - 'Title:PartialMatch' - 'HTML:PartialMatch' @@ -91,4 +102,4 @@ DNADesign\Elemental\Models\ElementContent: Dynamic\Elements\Image\Elements\ElementImage: inline_editable: false extensions: - - Site\Extensions\ElementImageWidget + - App\Elements\Extensions\ElementImageWidget diff --git a/app/_config/options-widgets.yml b/app/_config/options-widgets.yml index 6618dfe..74fc861 100644 --- a/app/_config/options-widgets.yml +++ b/app/_config/options-widgets.yml @@ -4,19 +4,19 @@ Name: webapp-options-widgets # Blog + Widgets module extensions Page: extensions: - - Site\Widgets\WidgetPageExtension + - App\Widgets\WidgetPageExtension SilverStripe\Blog\Model\Blog: extensions: - - Site\Extensions\BlogExtension + - App\Extensions\BlogExtension SilverStripe\Blog\Model\BlogPost: extensions: - - Site\Extensions\BlogPostExtension + - App\Extensions\BlogPostExtension SilverStripe\Widgets\Model\Widget: icon: '' extensions: - - Site\Widgets\WidgetExtension + - App\Widgets\WidgetExtension SilverStripe\Blog\Widgets\BlogArchiveWidget: icon: '' SilverStripe\Blog\Widgets\BlogCategoriesWidget: diff --git a/app/_config/shop.yml_ b/app/_config/shop.yml_ index 1a99d64..157bd78 100644 --- a/app/_config/shop.yml_ +++ b/app/_config/shop.yml_ @@ -3,20 +3,20 @@ Name: webapp-shop --- SilverStripe\Core\Injector\Injector: SilverShop\Checkout\SinglePageCheckoutComponentConfig: - class: Site\Models\CheckoutNoDeliveryConfig + class: App\Models\CheckoutNoDeliveryConfig SilverShop\Extension\ShopConfigExtension: base_currency: USD SilverShop\Model\Address: extensions: - - Site\Extensions\AddressExtension + - App\Extensions\AddressExtension SilverShop\Cart\ShoppingCartController: extensions: - - Site\Extensions\ShoppingCartControllerExtension + - App\Extensions\ShoppingCartControllerExtension -Site\Templates\DeferedRequirements: +App\Templates\DeferedRequirements: custom_requirements: SilverShop\Page\AccountPageController: - SilverShop.Page.CheckoutPageController.js diff --git a/app/_config/templates-requirements.yml b/app/_config/templates-requirements.yml index ee80f98..0691bce 100644 --- a/app/_config/templates-requirements.yml +++ b/app/_config/templates-requirements.yml @@ -1,7 +1,7 @@ --- Name: webapp-templates-requirements --- -Site\Templates\DeferredRequirements: +App\Templates\DeferredRequirements: nofontawesome: false version: false static_domain: false diff --git a/app/_config/templates-themes.yml b/app/_config/templates-themes.yml index f84c38f..e81a55b 100644 --- a/app/_config/templates-themes.yml +++ b/app/_config/templates-themes.yml @@ -9,11 +9,11 @@ SilverStripe\View\SSViewer: - '$public' - '$default' -Site\Elements\SliderElement: +App\Elements\SliderElement: slide_width: 2140 slide_height: 700 # 2x container width to automatically resize images for 2K display -Site\Extensions\ElementRows: +App\Elements\Extensions\ElementRows: container_max_width: 2280 column_class: 'col-block col-md' diff --git a/app/_config/webpack.yml b/app/_config/webpack.yml index 24518e7..e05ae01 100644 --- a/app/_config/webpack.yml +++ b/app/_config/webpack.yml @@ -3,7 +3,7 @@ # with all configuration variables presented # Cuz WebPack compiling script use it to set configuration -Site\Templates\WebpackTemplateProvider: +App\Templates\WebpackTemplateProvider: APPDIR: './app' THEMESDIR: './themes' HOSTNAME: 127.0.0.1 diff --git a/app/src/Controllers/MapElementController.php b/app/src/Controllers/MapElementController.php index 2d53985..4792990 100644 --- a/app/src/Controllers/MapElementController.php +++ b/app/src/Controllers/MapElementController.php @@ -1,10 +1,10 @@ owner; parent::updateCMSFields($fields); $fields->removeByName(['AvailableGlobally', 'TopPageLocale', 'TopPageID']); @@ -62,8 +63,7 @@ class ElementRows extends DataExtension // column size if ($this->isColumn()) { - $sizes = $this->owner->dbObject('Size'); - $defaultSize = $sizes->getDefaultValue(); + $sizes = $obj->dbObject('Size'); $sizeDropdown = DropdownField::create( 'Size', @@ -92,11 +92,16 @@ class ElementRows extends DataExtension ); $tab->push($sizeDropdown); - // set default size - if (!$this->owner->getField('Size')) { + // set default size if size field wasn't set or if it's new object without title set and the size is default + $size = $obj->getField('Size'); + if (!$size || (!$obj->getField('Title') && $size === 'auto')) { $sibling = $this->getSibling(); - $sizeDropdown->setValue($sibling ? $sibling->getField('Size') : $defaultSize); + $defaultSize = $sizes->getDefaultValue(); + $defaultSize = $sibling ? $sibling->getField('Size') : $defaultSize; + + $obj->setField('Size', $defaultSize); + $sizeDropdown->setValue($defaultSize); } } else { $fields->removeByName('Size'); @@ -104,7 +109,7 @@ class ElementRows extends DataExtension // move parent elements if ($this->isList()) { - $currEls = $this->owner->getField('Elements')->Elements(); + $currEls = $obj->getField('Elements')->Elements(); if ($currEls->count()) { $tab->push(DropdownField::create( 'MoveElementIDToParent', @@ -113,7 +118,7 @@ class ElementRows extends DataExtension )->setEmptyString('(select an element to move)')); } - $parentEls = $this->owner->Parent()->Elements()->exclude('ID', $this->owner->ID); + $parentEls = $obj->Parent()->Elements()->exclude('ID', $obj->ID); if ($parentEls->count()) { $tab->push(DropdownField::create( 'MoveElementIDFromParent', @@ -129,7 +134,7 @@ class ElementRows extends DataExtension 'ClassName', '
' .'
Class
' - .'
'.$this->owner->getField('ClassName').'
' + .'
'.$obj->getField('ClassName').'
' .'
' )); } diff --git a/app/src/Extensions/ElementalArea.php b/app/src/Elements/Extensions/ElementalArea.php similarity index 97% rename from app/src/Extensions/ElementalArea.php rename to app/src/Elements/Extensions/ElementalArea.php index 22dde8a..9637d90 100644 --- a/app/src/Extensions/ElementalArea.php +++ b/app/src/Elements/Extensions/ElementalArea.php @@ -6,7 +6,7 @@ * Time: 1:23 PM */ -namespace Site\Extensions; +namespace App\Elements\Extensions; use DNADesign\Elemental\Models\BaseElement; use SilverStripe\ORM\ArrayList; diff --git a/app/src/Extensions/MapExtension.php b/app/src/Elements/Extensions/MapExtension.php similarity index 96% rename from app/src/Extensions/MapExtension.php rename to app/src/Elements/Extensions/MapExtension.php index 38df861..3a461fa 100644 --- a/app/src/Extensions/MapExtension.php +++ b/app/src/Elements/Extensions/MapExtension.php @@ -6,7 +6,7 @@ * Time: 12:55 PM */ -namespace Site\Extensions; +namespace App\Elements\Extensions; use SilverStripe\Core\Extension; use SilverStripe\Forms\CompositeField; @@ -16,7 +16,7 @@ use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor; use SilverStripe\Forms\GridField\GridFieldDataColumns; use SilverStripe\Forms\NumericField; use SilverStripe\ORM\DataExtension; -use Site\Models\MapPin; +use App\Models\MapPin; class MapExtension extends DataExtension { diff --git a/app/src/Extensions/UserDefinedFormExtension.php b/app/src/Elements/Extensions/UserDefinedFormExtension.php similarity index 98% rename from app/src/Extensions/UserDefinedFormExtension.php rename to app/src/Elements/Extensions/UserDefinedFormExtension.php index afbf61e..f96734c 100644 --- a/app/src/Extensions/UserDefinedFormExtension.php +++ b/app/src/Elements/Extensions/UserDefinedFormExtension.php @@ -1,6 +1,6 @@ sort('RAND()'); } -} \ No newline at end of file +} diff --git a/app/src/Extensions/AddressExtension.php b/app/src/Extensions/AddressExtension.php index b2a74cb..79e57f6 100644 --- a/app/src/Extensions/AddressExtension.php +++ b/app/src/Extensions/AddressExtension.php @@ -6,7 +6,7 @@ * Time: 12:55 PM */ -namespace Site\Extensions; +namespace App\Extensions; use SilverStripe\Core\Extension; @@ -26,4 +26,4 @@ class AddressExtension extends Extension $holder->addExtraClass('col-sm-6'); $fields->push($holder); } -} \ No newline at end of file +} diff --git a/app/src/Extensions/BlogExtension.php b/app/src/Extensions/BlogExtension.php index afae42a..73cf922 100644 --- a/app/src/Extensions/BlogExtension.php +++ b/app/src/Extensions/BlogExtension.php @@ -1,7 +1,7 @@ Current:' - .$this->owner->renderWith('Site\\Objects\\NotificationsList') + .$this->owner->renderWith('App\\Objects\\NotificationsList') ), CheckboxField::create('ShowNotifications'), GridField::create( diff --git a/app/src/Extensions/OpenningHoursExtension.php b/app/src/Extensions/OpenningHoursExtension.php index c5e9237..7674a25 100644 --- a/app/src/Extensions/OpenningHoursExtension.php +++ b/app/src/Extensions/OpenningHoursExtension.php @@ -1,6 +1,6 @@ Today:' .'

' - .$this->owner->renderWith('Site\\Objects\\OpeningHoursList') + .$this->owner->renderWith('App\\Objects\\OpeningHoursList') .'

' ), CheckboxField::create('ShowOpeningHours'), diff --git a/app/src/Extensions/PageFluentExtension.php b/app/src/Extensions/PageFluentExtension.php index 2322d89..0f98e9d 100644 --- a/app/src/Extensions/PageFluentExtension.php +++ b/app/src/Extensions/PageFluentExtension.php @@ -1,7 +1,7 @@ enableSpamProtection(); } } -} \ No newline at end of file +} diff --git a/app/src/Extensions/SiteTreeExtension.php b/app/src/Extensions/SiteTreeExtension.php index eb0af3d..664982d 100644 --- a/app/src/Extensions/SiteTreeExtension.php +++ b/app/src/Extensions/SiteTreeExtension.php @@ -1,6 +1,6 @@ addComponent(CheckoutMapComponent::create()); $this->addComponent(Terms::create()); } -} \ No newline at end of file +} diff --git a/app/src/Tasks/BrokenFilesTask.php b/app/src/Tasks/BrokenFilesTask.php index c51ed28..ac6f14e 100644 --- a/app/src/Tasks/BrokenFilesTask.php +++ b/app/src/Tasks/BrokenFilesTask.php @@ -1,7 +1,7 @@ Success!'; } -} \ No newline at end of file +} diff --git a/app/src/Tasks/CleanContentTask.php b/app/src/Tasks/CleanContentTask.php index 2a34e3f..2618878 100644 --- a/app/src/Tasks/CleanContentTask.php +++ b/app/src/Tasks/CleanContentTask.php @@ -1,7 +1,7 @@ <% loop $PostsList %>
- <% include BlogPostInfo %> + <% include SilverStripe\Blog\Includes\BlogPostInfo %>
<% end_loop %> diff --git a/app/templates/Includes/Alerts.ss b/app/templates/Includes/Alerts.ss index 4770ea3..e554845 100644 --- a/app/templates/Includes/Alerts.ss +++ b/app/templates/Includes/Alerts.ss @@ -48,6 +48,6 @@ <% end_if %> <% with $SiteConfig %> - <% include Site\Objects\NotificationsList NotificationsToday=$NotificationsToday.filter('Area', 'Site') %> + <% include App\Objects\NotificationsList NotificationsToday=$NotificationsToday.filter('Area', 'Site') %> <% end_with %> diff --git a/app/templates/Includes/LoadingSpinner.ss b/app/templates/Includes/LoadingSpinner.ss index 0814251..834122a 100644 --- a/app/templates/Includes/LoadingSpinner.ss +++ b/app/templates/Includes/LoadingSpinner.ss @@ -28,8 +28,8 @@ font-size: 14px; margin: 0; padding: 0; - background: #fff; - color: #333; + background: #1c2947; + color: #fff; overflow-x: hidden; } @media (min-width: 2000px) { @@ -52,8 +52,8 @@ justify-content: center; z-index: 2000; will-change: opacity; - background: #fff; - color: #212529; + background: #1c2947; + color: #fff; } #PageLoading .logo { width:100px; @@ -62,7 +62,7 @@ #PageLoading .tagline { margin-top:1rem; margin-bottom:1rem; - color: #212529; + color: #fff; font-size:1.8rem; font-size: 4vh; letter-spacing: .25em; diff --git a/webpack.configuration.js b/webpack.configuration.js index 78c0df3..394ff57 100755 --- a/webpack.configuration.js +++ b/webpack.configuration.js @@ -3,6 +3,7 @@ */ const YML_PATH = '/app/_config/webpack.yml'; +const CONF_VAR = 'App\\Templates\\WebpackTemplateProvider'; const path = require('path'); const filesystem = require('fs'); @@ -10,28 +11,28 @@ const fs = require('fs'); const yaml = require('js-yaml'); const conf = yaml.safeLoad( - fs.readFileSync(path.join(__dirname, YML_PATH), 'utf8'), + fs.readFileSync(path.join(__dirname, YML_PATH), 'utf8'), ); let themes = []; // add themes -if (conf['Site\\Templates\\WebpackTemplateProvider'].THEMESDIR) { - const themeDir = conf['Site\\Templates\\WebpackTemplateProvider'].THEMESDIR; - const dir = path.resolve(__dirname, themeDir); +if (conf[CONF_VAR].THEMESDIR) { + const themeDir = conf[CONF_VAR].THEMESDIR; + const dir = path.resolve(__dirname, themeDir); - if (filesystem.existsSync(dir)) { - filesystem.readdirSync(dir).forEach((file) => { - filePath = path.join(themeDir, file); - const stat = filesystem.statSync(filePath); + if (filesystem.existsSync(dir)) { + filesystem.readdirSync(dir).forEach((file) => { + filePath = path.join(themeDir, file); + const stat = filesystem.statSync(filePath); - if (stat && stat.isDirectory()) { - themes.push(filePath); - } - }); - } + if (stat && stat.isDirectory()) { + themes.push(filePath); + } + }); + } } module.exports = { - configuration: conf['Site\\Templates\\WebpackTemplateProvider'], - themes: themes, + configuration: conf[CONF_VAR], + themes: themes, };