Skip to content

Commit

Permalink
Merge pull request #611 from mixcore/develop-v1
Browse files Browse the repository at this point in the history
fix export / import theme
  • Loading branch information
nhathoang989 authored Apr 7, 2022
2 parents e8eb23a + 8d7b958 commit 0336438
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static JProperty ToJProperty(
item.DateTimeValue = date;
}
}
return (new JProperty(item.MixDatabaseColumnName, item.DateTimeValue.Value.ToString("yyyy-MM-dd HH:mm:ss")));
return (new JProperty(item.MixDatabaseColumnName, !item.DateTimeValue.HasValue ? null : item.DateTimeValue.Value.ToString("yyyy-MM-dd HH:mm:ss")));

case MixDataType.Time:
return (new JProperty(item.MixDatabaseColumnName, item.DateTimeValue));
Expand Down
2 changes: 1 addition & 1 deletion src/Mix.Cms.Web/Views/_ViewImports.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
@using MixDatas = Mix.Cms.Lib.ViewModels.MixDatabaseDatas
@using System.Text.Json
@using Mix.Cms.Lib.Extensions

@using Microsoft.EntityFrameworkCore
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
58 changes: 34 additions & 24 deletions src/Mix.Cms.Web/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"ConnectionStrings": {
"MixAccountConnection": null,
"MixCmsConnection": null,
"MixMessengerConnection": null
"MixAccountConnection": "Data Source=MixContent\\mix-cms.db",
"MixCmsConnection": "Data Source=MixContent\\mix-cms.db",
"MixMessengerConnection": "Data Source=MixContent\\mix-cms.db"
},
"GlobalSettings": {
"IsInit": true,
"InitStatus": 0,
"IsInit": false,
"InitStatus": 3,
"IsMaintenance": false,
"IsRewrite": true,
"IsHttps": false,
Expand Down Expand Up @@ -35,8 +35,8 @@
"TagPageSize": "20",
"SearchPageSize": "20",
"IsEncryptApi": true,
"ApiEncryptKey": "RHZhMEFvckY0VUF3Ynd2YUZZTnRIdz09LGx3dk82QlR0WHlPUG5FWC8rUFV2bU1pdUpIMnVQTEF5TW9kMFpPdU5aMlU9",
"LastUpdateConfiguration": null,
"ApiEncryptKey": "VlZRMHZ6dkdiSitVOWtuNE9DZjVNdz09LGRScUg4cDE2OE1aTDA2RytwZFlzdnEvYk53WThFcVNMWnZnZXNESWxpVGM9",
"LastUpdateConfiguration": "2022-04-07T08:13:19.4181642Z",
"DatabaseProvider": "SQLITE",
"AllowedHosts": [],
"Smtp": {
Expand Down Expand Up @@ -65,14 +65,14 @@
"fontFamily": "",
"fontSizeH1": "16",
"fontSize": "12"
}
},
"MixcoreVersion": "1.0.1"
},

"MixConfigurations": {
"IsCache": true,
"MixCacheMode": "Json",
"MixCacheConnectionString": "",
"MixCacheDbProvider": "",
"MixCacheConnectionString": "Data Source=MixContent\\mix-cms.db",
"MixCacheDbProvider": "SQLITE",
"MixCacheFolder": "MixContent/cache",
"JsonDataFolder": "MixContent/data",
"MixLogsFolder": "MixContent/logs",
Expand Down Expand Up @@ -106,7 +106,7 @@
"ValidateIssuerSigningKey": true,
"TokenType": "Bearer",
"Audience": "mix-core",
"SecretKey": "mixcore-secret-key",
"SecretKey": "5f631ca7406b46b6b0a8e143bad0f203",
"Issuer": "mix-core",
"Issuers": "mix-core",
"Audiences": "mix-core",
Expand Down Expand Up @@ -140,20 +140,29 @@
"OriginKey": ""
}
},
"Translator": {},
"Translator": {
"en-us": {}
},
"LocalSettings": {
"en-us": {
"ContactAddress": "",
"ContactEmail": "",
"ContactPhone": "",
"Facebook": "",
"FacebookAppId": "",
"Favicon": "",
"SiteName": "test import",
"LanguageVersion": "1",
"Logo": "",
"SettingVersion": "1",
"Theme": "Default",
"ThemeId": "1"
"ThemeName": "test-import",
"ThemeFolder": "test-import",
"ThemeId": "1",
"DateTimeFormat": "dd-MM-yyyy HH:mm:ss",
"StartWeekOn": "Monday",
"DefaultThumbnailImgWidth": "1000",
"DefaultThumbnailImgHeight": "608",
"DefaultFeatureImgWidth": "2000",
"DefaultFeatureImgHeight": "1216",
"SiteTitle": "Mixcore Casper Theme",
"SiteCoverImage": "",
"SiteLogo": "/mix-content/assets/test-import/uploads/2021-02/mixcorewhite-637498510478815515.png",
"SiteDescription": "The professional publishing platform",
"post_image_width": "",
"post_image_height": ""
}
},
"Logging": {
Expand All @@ -171,10 +180,11 @@
"Language": "en-us",
"EPPlus": {
"ExcelPackage": {
"LicenseContext": "NonCommercial" //The license context used
"LicenseContext": "NonCommercial"
}
},
"Quartz": {
"quartz.scheduler.instanceName": "Mixcore Cms Scheduler"
}
},
"Smtp": {}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="page-wrapper d-flex flex-column pt-4 w-100"><aside class="bd-sidebar sub-sidebar"><nav class="bd-links p-3" aria-label="Sub-section navigation"><div class="btn-group w-100" role="group"><button id="btnToSubmit" type="button" ng-click="export()" class="btn btn-primary text-white"><i class="fa fa-save"></i> <span ng-bind="translate('Export')"></span></button></div></nav></aside><div class="content-body py-3 pe-3"><h3>Export theme and data</h3><p class="text-subtitle text-muted">Use the filter side bar on the right to filter and search your themes.</p><section class="" ng-init="getExportData()"><form id="frm-theme" ng-class="{'submitted': submitted}" ng-submit="export()"><div class="row justify-content-md-center"><div class="col-12 mb-3"><div class="form-check form-switch"><input type="checkbox" class="form-check-input" ng-model="selectedExport.isIncludeAssets"> <label class="custom-control-label">Include Assets</label></div><div class="form-check form-switch"><input type="checkbox" class="form-check-input" ng-model="selectedExport.isIncludeTemplates"> <label class="custom-control-label">Include Templates</label></div><div class="form-check form-switch"><input type="checkbox" class="form-check-input" ng-model="selectedExport.isIncludeConfigurations"> <label class="custom-control-label"></label>Include Configurations</div><div class="form-check form-switch"><input type="checkbox" class="form-check-input" ng-model="selectedExport.isIncludePermissions"> <label class="custom-control-label">Include IncludePermissions</label></div></div><div class=""><tabs-v><pane-v header="Pages" class="card"><div class="card-body"><theme-export-pages export-data="exportData" selected-export="selectedExport"></theme-export-pages></div></pane-v><pane-v header="Modules" class="card"><div class="card-body"><theme-export-modules export-data="exportData" selected-export="selectedExport"></theme-export-modules></div></pane-v><pane-v header="Database" class="card"><div class="card-body"><theme-export-mix-databases export-data="exportData" selected-export="selectedExport"></theme-export-mix-databases></div></pane-v><pane-v header="Posts" class="card"><div class="card-body"><theme-export-posts export-data="exportData" selected-export="selectedExport"></theme-export-posts></div></pane-v></tabs-v></div></div></form></section></div></div>
<div class="page-wrapper d-flex pt-4 w-100 flex-row-reverse"><aside class="bd-sidebar sub-sidebar"><nav class="bd-links p-3" aria-label="Sub-section navigation"><div class="btn-group w-100" role="group"><button id="btnToSubmit" type="button" ng-click="export()" class="btn btn-primary text-white"><i class="fa fa-save"></i> <span ng-bind="translate('Export')"></span></button></div></nav></aside><div class="content-body py-3 pe-3"><h3>Export theme and data</h3><p class="text-subtitle text-muted">Use the filter side bar on the right to filter and search your themes.</p><section class="" ng-init="getExportData()"><form id="frm-theme" ng-class="{'submitted': submitted}" ng-submit="export()"><div class="row justify-content-md-center"><div class="col-12 mb-3"><div class="form-check form-switch"><input type="checkbox" class="form-check-input" ng-model="selectedExport.isIncludeAssets"> <label class="custom-control-label">Include Assets</label></div><div class="form-check form-switch"><input type="checkbox" class="form-check-input" ng-model="selectedExport.isIncludeTemplates"> <label class="custom-control-label">Include Templates</label></div><div class="form-check form-switch"><input type="checkbox" class="form-check-input" ng-model="selectedExport.isIncludeConfigurations"> <label class="custom-control-label"></label>Include Configurations</div><div class="form-check form-switch"><input type="checkbox" class="form-check-input" ng-model="selectedExport.isIncludePermissions"> <label class="custom-control-label">Include IncludePermissions</label></div></div><div class=""><tabs-v><pane-v header="Pages" class="card"><div class="card-body"><theme-export-pages export-data="exportData" selected-export="selectedExport"></theme-export-pages></div></pane-v><pane-v header="Modules" class="card"><div class="card-body"><theme-export-modules export-data="exportData" selected-export="selectedExport"></theme-export-modules></div></pane-v><pane-v header="Database" class="card"><div class="card-body"><theme-export-mix-databases export-data="exportData" selected-export="selectedExport"></theme-export-mix-databases></div></pane-v><pane-v header="Posts" class="card"><div class="card-body"><theme-export-posts export-data="exportData" selected-export="selectedExport"></theme-export-posts></div></pane-v></tabs-v></div></div></form></section></div></div>

0 comments on commit 0336438

Please sign in to comment.