From ff68f9563793c45299903dff5a5317db1a76ed1f Mon Sep 17 00:00:00 2001 From: Eric Nguyen Date: Mon, 16 Oct 2023 12:34:47 +0700 Subject: [PATCH] update --- .../Mixcore/Controllers/AppController.cs | 10 +- .../wwwroot/mix-app/js/app-portal.min.js | 10070 ++++++++-------- .../app-portal/pages/application/details.html | 2 +- .../app-portal/pages/application/list.html | 2 +- .../pages/order-detail/details.html | 2 +- .../Controllers/MixApplicationController.cs | 6 +- .../Domain/Services/MixApplicationService.cs | 68 +- .../ViewModels/MixApplicationViewModel.cs | 4 +- .../MixApplicationConfiguration.cs | 2 +- .../Entities/Cms/MixApplication.cs | 2 +- ...016051353_UpdateMixAppBaseHref.Designer.cs | 2882 +++++ .../20231016051353_UpdateMixAppBaseHref.cs | 28 + .../MySqlMixCmsContextModelSnapshot.cs | 10 +- ...016051055_UpdateMixAppBaseHref.Designer.cs | 2736 +++++ .../20231016051055_UpdateMixAppBaseHref.cs | 28 + .../PostgresqlMixCmsContextModelSnapshot.cs | 8 +- ...016051506_UpdateMixAppBaseHref.Designer.cs | 2761 +++++ .../20231016051506_UpdateMixAppBaseHref.cs | 28 + .../SqlServerMixCmsContextModelSnapshot.cs | 8 +- ...016050432_UpdateMixAppBaseHref.Designer.cs | 2700 +++++ .../20231016050432_UpdateMixAppBaseHref.cs | 28 + .../SqliteMixCmsContextModelSnapshot.cs | 8 +- 22 files changed, 16293 insertions(+), 5100 deletions(-) create mode 100644 src/platform/mix.database/Migrations/Cms/MySqlMixCms/20231016051353_UpdateMixAppBaseHref.Designer.cs create mode 100644 src/platform/mix.database/Migrations/Cms/MySqlMixCms/20231016051353_UpdateMixAppBaseHref.cs create mode 100644 src/platform/mix.database/Migrations/Cms/PostgresqlMixCms/20231016051055_UpdateMixAppBaseHref.Designer.cs create mode 100644 src/platform/mix.database/Migrations/Cms/PostgresqlMixCms/20231016051055_UpdateMixAppBaseHref.cs create mode 100644 src/platform/mix.database/Migrations/Cms/SqlServerMixCms/20231016051506_UpdateMixAppBaseHref.Designer.cs create mode 100644 src/platform/mix.database/Migrations/Cms/SqlServerMixCms/20231016051506_UpdateMixAppBaseHref.cs create mode 100644 src/platform/mix.database/Migrations/Cms/SqliteMixCms/20231016050432_UpdateMixAppBaseHref.Designer.cs create mode 100644 src/platform/mix.database/Migrations/Cms/SqliteMixCms/20231016050432_UpdateMixAppBaseHref.cs diff --git a/src/applications/Mixcore/Controllers/AppController.cs b/src/applications/Mixcore/Controllers/AppController.cs index b4d9b6686..c07645d34 100644 --- a/src/applications/Mixcore/Controllers/AppController.cs +++ b/src/applications/Mixcore/Controllers/AppController.cs @@ -53,12 +53,12 @@ protected override void ValidateRequest() } #region Routes - [Route("{baseRoute}/{param1?}/{param2?}/{param3?}/{param4?}/{param5?}/{param6?}")] - public async Task Index(string baseRoute) + [Route("{appName}/{param1?}/{param2?}/{param3?}/{param4?}/{param5?}/{param6?}")] + public async Task Index(string appName) { if (IsValid) { - return await App($"/app/{baseRoute}"); + return await App($"/app/{appName}"); } else { @@ -69,11 +69,11 @@ public async Task Index(string baseRoute) #endregion Routes #region Helper - protected async Task App(string baseRoute) + protected async Task App(string baseHref) { // Home App var pageRepo = ApplicationViewModel.GetRepository(Uow, _cacheService); - var page = await pageRepo.GetSingleAsync(m => m.BaseRoute == baseRoute && m.MixTenantId == CurrentTenant.Id); + var page = await pageRepo.GetSingleAsync(m => m.BaseHref == baseHref && m.MixTenantId == CurrentTenant.Id); if (page == null) return NotFound(); diff --git a/src/applications/Mixcore/wwwroot/mix-app/js/app-portal.min.js b/src/applications/Mixcore/wwwroot/mix-app/js/app-portal.min.js index 3379fe3d8..2c2927847 100644 --- a/src/applications/Mixcore/wwwroot/mix-app/js/app-portal.min.js +++ b/src/applications/Mixcore/wwwroot/mix-app/js/app-portal.min.js @@ -1,4 +1,4 @@ -/* Sun Oct 15 2023 18:28:40 GMT+0700 (Indochina Time) */"use strict"; +/* Mon Oct 16 2023 12:19:03 GMT+0700 (Indochina Time) */"use strict"; var app = angular.module("MixPortal", [ "angularCroppie", "ui.bootstrap", @@ -342,114 +342,6 @@ app.factory("AppSettingsServices", [ }, ]); -"use strict"; -app.controller("ConfigurationController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "ConfigurationService", - "ApiService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - service, - apiService - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.init = function () { - $scope.request.category = $routeParams.category || ""; - $scope.getList(); - }; - $scope.getSingleSuccessCallback = function () { - $scope.cates = ngAppSettings.enums?.configuration_cates; - $scope.appSettings = $rootScope.globalSettings; - $scope.request.category = $routeParams.category || ""; - if (!$scope.viewmodel.id) { - $scope.viewmodel.dataType = "Text"; - } - if (!$scope.viewmodel.category) { - $scope.viewmodel.category = "Site"; - } - }; - $scope.saveSuccessCallback = function () { - apiService.getAllSettings().then(function () { - // $location.url($scope.referrerUrl); - $rootScope.isBusy = false; - $scope.$apply(); - }); - }; - $scope.removeCallback = function () { - apiService.getAllSettings().then(function () { - $location.url($scope.referrerUrl); - }); - }; - - $scope.generateName = function () { - $scope.viewmodel.keyword = $rootScope.generateKeyword( - $scope.viewmodel.keyword, - "_", - true - ); - }; - }, -]); - -"use strict"; -app.factory("ConfigurationService", [ - "BaseRestService", - "ApiService", - "CommonService", - function (baseService, apiService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("configuration"); - - var _uploadConfiguration = async function (configurationFile) { - //var container = $(this).parents('.model-configuration').first().find('.custom-file').first(); - if ( - configurationFile.file !== undefined && - configurationFile.file !== null - ) { - // Create FormData object - var files = new FormData(); - - // Looping over all files and add it to FormData object - files.append(configurationFile.file.name, configurationFile.file); - - // Adding one more key to FormData object - files.append("fileFolder", configurationFile.folder); - files.append("title", configurationFile.title); - files.append("description", configurationFile.description); - - var req = { - url: this.prefixUrl + "/upload", - type: "POST", - headers: {}, - contentType: false, // Not to set any content header - processData: false, // Not to process data - data: files, - }; - - return await apiService.sendRequest(req); - } - }; - serviceFactory.uploadConfiguration = _uploadConfiguration; - return serviceFactory; - }, -]); - "use strict"; app.controller("MixApplicationController", [ "$scope", @@ -490,7 +382,7 @@ app.controller("MixApplicationController", [ $scope.request.columns = [ "id", "displayName", - "baseRoute", + "baseHref", "detailUrl", "createdDateTime", "createdBy", @@ -498,12 +390,12 @@ app.controller("MixApplicationController", [ $scope.canDrag = $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - $scope.generateBaseRoute = (forceRename) => { + $scope.generateBaseHref = (forceRename) => { if ( forceRename || - ($scope.viewmodel.displayName && !$scope.viewmodel.baseRoute) + ($scope.viewmodel.displayName && !$scope.viewmodel.baseHref) ) { - $scope.viewmodel.baseRoute = `/app/${$rootScope.generateKeyword( + $scope.viewmodel.baseHref = `/app/${$rootScope.generateKeyword( $scope.viewmodel.displayName, "-", false, @@ -620,8 +512,8 @@ app.controller("MixApplicationController", [ $scope.viewMode = "list"; }; $scope.validate = function () { - if ($scope.viewmodel.baseRoute.indexOf("/app/") != 0) { - $rootScope.showErrors(['baseRoute must start with "/app/"']); + if ($scope.viewmodel.baseHref.indexOf("/app/") != 0) { + $rootScope.showErrors(['baseHref must start with "/app/"']); return false; } return true; @@ -665,223 +557,158 @@ app.factory("MixApplicationRestService", [ ]); "use strict"; -app.controller("CustomerController", [ +app.controller("AuditLogController", [ "$scope", "$rootScope", "ngAppSettings", - "$routeParams", - "$timeout", "$location", - "CustomerServices", + "$routeParams", + "AuthService", + "AuditLogRestService", function ( $scope, $rootScope, ngAppSettings, - $routeParams, - $timeout, $location, - customerServices + $routeParams, + authService, + service ) { - $scope.request = angular.copy(ngAppSettings.request); - $scope.request.contentStatuses = ["Active"]; - $scope.request.status = "0"; - $scope.activedCustomer = null; - $scope.relatedCustomers = []; - $rootScope.isBusy = false; - $scope.data = { - pageIndex: 0, - pageSize: 1, - totalItems: 0, - }; - $scope.errors = []; + BaseRestCtrl.call( + this, + $scope, + $rootScope, + $location, + $routeParams, + ngAppSettings, + service + ); + BaseHub.call(this, $scope); + authService.fillAuthData(); + $scope.request.status = null; + $scope.messages = []; + $scope.canDrag = + $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - $scope.range = function (max) { - var input = []; - for (var i = 1; i <= max; i += 1) input.push(i); - return input; + $scope.connect = () => { + $scope.startConnection( + "log-stream-hub", + authService.authentication.accessToken, + (err) => { + if ( + authService.authentication.refreshToken && + err.message.indexOf("401") >= 0 + ) { + authService.refreshToken().then(async () => { + $scope.startConnection( + "log-stream-hub", + authService.authentication.accessToken + ); + }); + } + } + ); }; + $scope.receiveMessage = function (msg) { + switch (msg.action) { + case "MyConnection": + $scope.hubRequest.from = msg.data; + $scope.$apply(); + break; + case "NewMessage": + $scope.newMessage(msg); - $scope.loadCustomer = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - var response = await customerServices.getCustomer(id, "portal"); - if (response.success) { - $scope.activedCustomer = response.data; - $rootScope.initEditor(); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); + break; } }; - $scope.loadCustomers = async function (pageIndex) { - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var d = new Date($scope.request.fromDate); - $scope.request.fromDate = d.toISOString(); - } - if ($scope.request.toDate !== null) { - var d = new Date($scope.request.toDate); - $scope.request.toDate = d.toISOString(); + $scope.newMessage = function (msg) { + msg.style = $scope.getMessageType(msg.type); + if (msg.data) { + msg.data = JSON.parse(msg.data); } - var resp = await customerServices.getCustomers($scope.request); - if (resp && resp.success) { - $scope.data = resp.data; - //$("html, body").animate({ "scrollTop": "0px" }, 500); - $.each($scope.data.items, function (i, customer) { - $.each($scope.activedCustomers, function (i, e) { - if (e.customerId === customer.id) { - customer.isHidden = true; - } - }); - }); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $scope.$apply(); + $scope.messages.push(msg); + $scope.$apply(); + + setTimeout(() => { + $("body,html").animate( + { + scrollTop: $("#log-stream-container").height(), // Scroll to top of body + }, + 500 + ); + }, 200); + }; + $scope.getMessageType = function (type) { + switch (type) { + case "Success": + return "success"; + case "Error": + return "danger"; + case "Warning": + return "warning"; + case "Info": + return "info"; + default: + return "default"; } }; - - $scope.removeCustomer = function (id) { - $rootScope.showConfirm( - $scope, - "removeCustomerConfirmed", - [id], - null, - "Remove Customer", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - - $scope.removeCustomerConfirmed = async function (id) { - var result = await customerServices.removeCustomer(id); - if (result.success) { - $rootScope.showMessage("success", "success"); - $scope.loadCustomers(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.saveCustomer = async function (customer) { - customer.content = $(".editor-content").val(); - var resp = await customerServices.saveCustomer(customer); - if (resp && resp.success) { - $scope.activedCustomer = resp.data; - $rootScope.showMessage("Update successfully!", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - //$location.path('/admin/customer/details/' + resp.data.id); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $scope.$apply(); - } - }; - }, -]); + $scope.view = function (item) { + item.objClass = item.success ? "text-success" : "text-danger"; + $rootScope.preview("object", item, null, "modal-lg"); + }; + }, +]); "use strict"; -app.factory("CustomerServices", [ - "$http", - "$rootScope", - "ApiService", - "CommonService", - function ($http, $rootScope, apiService, commonService) { - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var customersServiceFactory = {}; +app.factory("AuditLogRestService", [ + "BaseRestService", + function (baseService) { + var serviceFactory = Object.create(baseService); + serviceFactory.initService("/rest", "mix-log/audit-log", true); + var _search = async function (objData, queries = null) { + var data = serviceFactory.parseQuery(objData); - var settings = $rootScope.globalSettings; + var url = `${this.prefixUrl}/search`; - var _getCustomer = async function (id, type) { - var apiUrl = "/queen-beauty/customer/"; - var url = apiUrl + "details/" + type; - if (id) { - url += "/" + id; + if (data) { + url += "?"; + url = url.concat(data); + if (queries) { + url += "&"; + var extraQueries = serviceFactory.parseQuery(queries); + url = url.concat(extraQueries); + } } var req = { + serviceBase: this.serviceBase, + apiVersion: this.apiVersion, method: "GET", url: url, }; - return await apiService.sendRequest(req); - }; - - var _initCustomer = async function (type) { - var apiUrl = "/queen-beauty/customer/"; - var req = { - method: "GET", - url: apiUrl + "init/" + type, - }; - return await apiService.sendRequest(req); - }; - - var _getCustomers = async function (request) { - var apiUrl = "/queen-beauty/customer/"; - var req = { - method: "POST", - url: apiUrl + "list", - data: JSON.stringify(request), - }; - - return await apiService.sendRequest(req); - }; - - var _removeCustomer = async function (id) { - var apiUrl = "/queen-beauty/customer/"; - var req = { - method: "GET", - url: apiUrl + "delete/" + id, - }; - return await apiService.sendRequest(req); - }; - - var _saveCustomer = async function (customer) { - var apiUrl = "/queen-beauty/customer/"; - var req = { - method: "POST", - url: apiUrl + "save", - data: JSON.stringify(customer), - }; - return await apiService.sendRequest(req); + return await this.getRestApiResult(req); }; - - customersServiceFactory.getCustomer = _getCustomer; - customersServiceFactory.initCustomer = _initCustomer; - customersServiceFactory.getCustomers = _getCustomers; - customersServiceFactory.removeCustomer = _removeCustomer; - customersServiceFactory.saveCustomer = _saveCustomer; - return customersServiceFactory; + serviceFactory.getList = _search; + return serviceFactory; }, ]); "use strict"; -app.controller("AuditLogController", [ +app.controller("ConfigurationController", [ "$scope", "$rootScope", "ngAppSettings", - "$location", "$routeParams", - "AuthService", - "AuditLogRestService", + "$location", + "ConfigurationService", + "ApiService", function ( $scope, $rootScope, ngAppSettings, - $location, $routeParams, - authService, - service + $location, + service, + apiService ) { BaseRestCtrl.call( this, @@ -892,203 +719,84 @@ app.controller("AuditLogController", [ ngAppSettings, service ); - BaseHub.call(this, $scope); - authService.fillAuthData(); - $scope.request.status = null; - $scope.messages = []; - $scope.canDrag = - $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - - $scope.connect = () => { - $scope.startConnection( - "log-stream-hub", - authService.authentication.accessToken, - (err) => { - if ( - authService.authentication.refreshToken && - err.message.indexOf("401") >= 0 - ) { - authService.refreshToken().then(async () => { - $scope.startConnection( - "log-stream-hub", - authService.authentication.accessToken - ); - }); - } - } - ); + $scope.init = function () { + $scope.request.category = $routeParams.category || ""; + $scope.getList(); }; - $scope.receiveMessage = function (msg) { - switch (msg.action) { - case "MyConnection": - $scope.hubRequest.from = msg.data; - $scope.$apply(); - break; - case "NewMessage": - $scope.newMessage(msg); - - break; + $scope.getSingleSuccessCallback = function () { + $scope.cates = ngAppSettings.enums?.configuration_cates; + $scope.appSettings = $rootScope.globalSettings; + $scope.request.category = $routeParams.category || ""; + if (!$scope.viewmodel.id) { + $scope.viewmodel.dataType = "Text"; } - }; - $scope.newMessage = function (msg) { - msg.style = $scope.getMessageType(msg.type); - if (msg.data) { - msg.data = JSON.parse(msg.data); + if (!$scope.viewmodel.category) { + $scope.viewmodel.category = "Site"; } - $scope.messages.push(msg); - $scope.$apply(); - - setTimeout(() => { - $("body,html").animate( - { - scrollTop: $("#log-stream-container").height(), // Scroll to top of body - }, - 500 - ); - }, 200); }; - $scope.getMessageType = function (type) { - switch (type) { - case "Success": - return "success"; - case "Error": - return "danger"; - case "Warning": - return "warning"; - case "Info": - return "info"; - default: - return "default"; - } + $scope.saveSuccessCallback = function () { + apiService.getAllSettings().then(function () { + // $location.url($scope.referrerUrl); + $rootScope.isBusy = false; + $scope.$apply(); + }); }; - $scope.view = function (item) { - item.objClass = item.success ? "text-success" : "text-danger"; - $rootScope.preview("object", item, null, "modal-lg"); + $scope.removeCallback = function () { + apiService.getAllSettings().then(function () { + $location.url($scope.referrerUrl); + }); + }; + + $scope.generateName = function () { + $scope.viewmodel.keyword = $rootScope.generateKeyword( + $scope.viewmodel.keyword, + "_", + true + ); }; }, ]); "use strict"; -app.factory("AuditLogRestService", [ +app.factory("ConfigurationService", [ "BaseRestService", - function (baseService) { + "ApiService", + "CommonService", + function (baseService, apiService, commonService) { var serviceFactory = Object.create(baseService); - serviceFactory.initService("/rest", "mix-log/audit-log", true); - var _search = async function (objData, queries = null) { - var data = serviceFactory.parseQuery(objData); + serviceFactory.init("configuration"); - var url = `${this.prefixUrl}/search`; + var _uploadConfiguration = async function (configurationFile) { + //var container = $(this).parents('.model-configuration').first().find('.custom-file').first(); + if ( + configurationFile.file !== undefined && + configurationFile.file !== null + ) { + // Create FormData object + var files = new FormData(); - if (data) { - url += "?"; - url = url.concat(data); - if (queries) { - url += "&"; - var extraQueries = serviceFactory.parseQuery(queries); - url = url.concat(extraQueries); - } - } - var req = { - serviceBase: this.serviceBase, - apiVersion: this.apiVersion, - method: "GET", - url: url, - }; - return await this.getRestApiResult(req); - }; - serviceFactory.getList = _search; - return serviceFactory; - }, -]); + // Looping over all files and add it to FormData object + files.append(configurationFile.file.name, configurationFile.file); -"use strict"; -app.controller("DashboardController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$timeout", - "$location", - "DashboardServices", - function ( - $scope, - $rootScope, - ngAppSettings, - $timeout, - $location, - dashboardServices - ) { - $scope.pageClass = "page-dashboard"; - $(".side-nav li").removeClass("active"); - $(".side-nav .page-dashboard").addClass("active"); - $scope.data = { - totalPage: 0, - totalPost: 0, - totalProduct: 0, - totalUser: 0, - }; - $scope.users = []; - $scope.$on("$viewContentLoaded", function () { - $rootScope.isBusy = false; - }); - $scope.getDashboardInfo = async function () { - $rootScope.isBusy = true; - // var response = await dashboardServices.getDashboardInfo(); - // if (response.success) { - // // $('#mainSection').removeClass('card'); - // $scope.data = response.data; - // $rootScope.isBusy = false; - // $scope.$apply(); - // // $scope.getChart(); - // } else { - // $rootScope.showErrors(response.errors); - // $rootScope.isBusy = false; - // $scope.$apply(); - // } - }; - $scope.getChart = function () { - var ctx = document.getElementById("myChart"); - var myChart = new Chart(ctx, { - // type: 'pie', - // data: { - // labels: ["Africa", "Asia", "Europe", "Latin America", "North America"], - // datasets: [{ - // label: "Population (millions)", - // backgroundColor: ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"], - // data: [2478,5267,734,784,433] - // }] - // }, - // options: { - // title: { - // display: true, - // text: 'Predicted world population (millions) in 2050' - // } - // } - }); - }; - }, -]); + // Adding one more key to FormData object + files.append("fileFolder", configurationFile.folder); + files.append("title", configurationFile.title); + files.append("description", configurationFile.description); -"use strict"; -app.factory("DashboardServices", [ - "$rootScope", - "$http", - "ApiService", - "CommonService", - function ($rootScope, $http, apiService, commonService) { - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; + var req = { + url: this.prefixUrl + "/upload", + type: "POST", + headers: {}, + contentType: false, // Not to set any content header + processData: false, // Not to process data + data: files, + }; - var usersServiceFactory = {}; - var apiUrl = "/rest/portal/common/" + $rootScope.globalSettings.lang; - var _getDashboardInfo = async function () { - var req = { - method: "GET", - url: apiUrl + "/dashboard", - }; - return await apiService.sendRequest(req); + return await apiService.sendRequest(req); + } }; - - usersServiceFactory.getDashboardInfo = _getDashboardInfo; - return usersServiceFactory; + serviceFactory.uploadConfiguration = _uploadConfiguration; + return serviceFactory; }, ]); @@ -1176,74 +884,49 @@ app.factory("CultureService", [ ]); "use strict"; -app.controller("DomainController", [ +app.controller("CustomerController", [ "$scope", "$rootScope", "ngAppSettings", - "$location", "$routeParams", - "DomainRestService", + "$timeout", + "$location", + "CustomerServices", function ( $scope, $rootScope, ngAppSettings, - $location, $routeParams, - service + $timeout, + $location, + customerServices ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.request.columns = [ - "id", - "displayName", - "host", - "createdDateTime", - "createdBy", - ]; - $scope.canDrag = - $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - }, -]); + $scope.request = angular.copy(ngAppSettings.request); + $scope.request.contentStatuses = ["Active"]; + $scope.request.status = "0"; + $scope.activedCustomer = null; + $scope.relatedCustomers = []; + $rootScope.isBusy = false; + $scope.data = { + pageIndex: 0, + pageSize: 1, + totalItems: 0, + }; + $scope.errors = []; -"use strict"; -app.factory("DomainRestService", [ - "BaseRestService", - function (baseService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("mix-domain"); - return serviceFactory; - }, -]); + $scope.range = function (max) { + var input = []; + for (var i = 1; i <= max; i += 1) input.push(i); + return input; + }; -"use strict"; -app.controller("ImportFileController", [ - "$scope", - "$rootScope", - "ImportFileServices", - "TranslatorService", - "AppSettingsService", - function ( - $scope, - $rootScope, - service, - translatorService, - AppSettingsService - ) { - $scope.saveImportFile = async function () { + $scope.loadCustomer = async function () { $rootScope.isBusy = true; - var form = document.getElementById("frm-import"); - var frm = new FormData(); - frm.append("assets", form["assets"].files[0]); - var response = await service.saveImportFile(frm); + var id = $routeParams.id; + var response = await customerServices.getCustomer(id, "portal"); if (response.success) { - $scope.viewmodel = response.data; + $scope.activedCustomer = response.data; + $rootScope.initEditor(); $rootScope.isBusy = false; $scope.$apply(); } else { @@ -1252,170 +935,75 @@ app.controller("ImportFileController", [ $scope.$apply(); } }; - }, -]); - -"use strict"; -app.factory("ImportFileServices", [ - "$rootScope", - "BaseService", - function ($rootScope, baseService) { - //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - - var serviceFactory = {}; - - var settings = $rootScope.globalSettings; - var serviceFactory = Object.create(baseService); - serviceFactory.init("portal", true); - var _saveImportFile = async function (frm) { - var apiUrl = this.prefixUrl + "/" + settings.lang + "/import"; - return await this.ajaxSubmitForm(frm, apiUrl); + $scope.loadCustomers = async function (pageIndex) { + if (pageIndex !== undefined) { + $scope.request.pageIndex = pageIndex; + } + if ($scope.request.fromDate !== null) { + var d = new Date($scope.request.fromDate); + $scope.request.fromDate = d.toISOString(); + } + if ($scope.request.toDate !== null) { + var d = new Date($scope.request.toDate); + $scope.request.toDate = d.toISOString(); + } + var resp = await customerServices.getCustomers($scope.request); + if (resp && resp.success) { + $scope.data = resp.data; + //$("html, body").animate({ "scrollTop": "0px" }, 500); + $.each($scope.data.items, function (i, customer) { + $.each($scope.activedCustomers, function (i, e) { + if (e.customerId === customer.id) { + customer.isHidden = true; + } + }); + }); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + if (resp) { + $rootScope.showErrors(resp.errors); + } + $scope.$apply(); + } }; - serviceFactory.saveImportFile = _saveImportFile; - return serviceFactory; - }, -]); - -"use strict"; -app.controller("JsonDataController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$timeout", - "$location", - "AuthService", - "JsonDataService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $timeout, - $location, - authService, - service - ) { - $scope.request = { - pageSize: "10", - pageIndex: 0, - status: "Published", - orderBy: "CreatedDateTime", - direction: "Desc", - fromDate: null, - toDate: null, - keyword: "", - key: "", - }; - - $scope.activedFile = null; - $scope.editorVisible = false; - $scope.data = null; - $scope.relatedFiles = []; - $rootScope.isBusy = false; - - $scope.errors = []; - - $scope.loadPage = async function (folder) { - if (folder) { - $scope.request.key += $scope.request.key !== "" ? "/" : ""; - $scope.request.key += folder; - } - $location.url( - "/admin/json-data/list?folder=" + encodeURIComponent($scope.request.key) - ); - }; - $scope.init = async function () { - $rootScope.isBusy = true; - $scope.filename = $routeParams.filename; - $scope.folder = $routeParams.folder; - $scope.listUrl = "/admin/json-data/list?folder=" + $routeParams.folder; - $rootScope.isBusy = true; - var response = await service.getFile( - $routeParams.folder, - $routeParams.filename + $scope.removeCustomer = function (id) { + $rootScope.showConfirm( + $scope, + "removeCustomerConfirmed", + [id], + null, + "Remove Customer", + "Deleted data will not able to recover, are you sure you want to delete this item?" ); - if (response.success) { - $scope.activedFile = response.data; - $scope.data = $.parseJSON(response.data.content); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } }; - $scope.loadFiles = async function (folder) { - if (folder) { - $scope.request.key += $scope.request.key !== "" ? "/" : ""; - $scope.request.key += folder; - } else { - $scope.request.key = $routeParams.folder ? $routeParams.folder : "data"; - } - $rootScope.isBusy = true; - var resp = await service.getFiles($scope.request); - if (resp && resp.success) { - $scope.data = resp.data; - $.each($scope.data.items, function (i, file) { - $.each($scope.activedFiles, function (i, e) { - if (e.fileId === file.id) { - file.isHidden = true; - } - }); - }); - $rootScope.isBusy = false; - $scope.$apply(); + $scope.removeCustomerConfirmed = async function (id) { + var result = await customerServices.removeCustomer(id); + if (result.success) { + $rootScope.showMessage("success", "success"); + $scope.loadCustomers(); } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } + $rootScope.showMessage("failed"); $rootScope.isBusy = false; $scope.$apply(); } }; - $scope.removeFile = async function (id) { - if (confirm("Are you sure!")) { - $rootScope.isBusy = true; - var resp = await service.removeFile(id); - if (resp && resp.success) { - $scope.loadFiles(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - $scope.selectPane = function (pane) { - $scope.editorVisible = pane.header == "Content"; - }; - $scope.save = async function (data) { - $scope.activedFile.contennt = JSON.stringify(data); - $scope.saveFile($scope.activedFile); - }; - $scope.updateData = async function (data) { - $scope.data = data; - }; - $scope.saveFile = async function (file) { - $rootScope.isBusy = true; - file.content = JSON.stringify($scope.data); - var resp = await service.saveFile(file); + $scope.saveCustomer = async function (customer) { + customer.content = $(".editor-content").val(); + var resp = await customerServices.saveCustomer(customer); if (resp && resp.success) { - $scope.activedFile = resp.data; + $scope.activedCustomer = resp.data; $rootScope.showMessage("Update successfully!", "success"); $rootScope.isBusy = false; $scope.$apply(); + //$location.path('/admin/customer/details/' + resp.data.id); } else { if (resp) { $rootScope.showErrors(resp.errors); } - $rootScope.isBusy = false; $scope.$apply(); } }; @@ -1423,19 +1011,24 @@ app.controller("JsonDataController", [ ]); "use strict"; -app.factory("JsonDataService", [ +app.factory("CustomerServices", [ "$http", "$rootScope", "ApiService", "CommonService", function ($http, $rootScope, apiService, commonService) { - var filesServiceFactory = {}; + //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; + + var customersServiceFactory = {}; var settings = $rootScope.globalSettings; - var _getFile = async function (folder, filename) { - var apiUrl = "/file/"; - var url = apiUrl + "details?folder=" + folder + "&filename=" + filename; + var _getCustomer = async function (id, type) { + var apiUrl = "/queen-beauty/customer/"; + var url = apiUrl + "details/" + type; + if (id) { + url += "/" + id; + } var req = { method: "GET", url: url, @@ -1443,8 +1036,8 @@ app.factory("JsonDataService", [ return await apiService.sendRequest(req); }; - var _initFile = async function (type) { - var apiUrl = "/file/"; + var _initCustomer = async function (type) { + var apiUrl = "/queen-beauty/customer/"; var req = { method: "GET", url: apiUrl + "init/" + type, @@ -1452,8 +1045,8 @@ app.factory("JsonDataService", [ return await apiService.sendRequest(req); }; - var _getFiles = async function (request) { - var apiUrl = "/file/"; + var _getCustomers = async function (request) { + var apiUrl = "/queen-beauty/customer/"; var req = { method: "POST", url: apiUrl + "list", @@ -1463,8 +1056,8 @@ app.factory("JsonDataService", [ return await apiService.sendRequest(req); }; - var _removeFile = async function (id) { - var apiUrl = "/file/"; + var _removeCustomer = async function (id) { + var apiUrl = "/queen-beauty/customer/"; var req = { method: "GET", url: apiUrl + "delete/" + id, @@ -1472,155 +1065,131 @@ app.factory("JsonDataService", [ return await apiService.sendRequest(req); }; - var _saveFile = async function (file) { - var apiUrl = "/file/"; + var _saveCustomer = async function (customer) { + var apiUrl = "/queen-beauty/customer/"; var req = { method: "POST", url: apiUrl + "save", - data: JSON.stringify(file), + data: JSON.stringify(customer), }; return await apiService.sendRequest(req); }; - filesServiceFactory.getFile = _getFile; - filesServiceFactory.initFile = _initFile; - filesServiceFactory.getFiles = _getFiles; - filesServiceFactory.removeFile = _removeFile; - filesServiceFactory.saveFile = _saveFile; - return filesServiceFactory; + customersServiceFactory.getCustomer = _getCustomer; + customersServiceFactory.initCustomer = _initCustomer; + customersServiceFactory.getCustomers = _getCustomers; + customersServiceFactory.removeCustomer = _removeCustomer; + customersServiceFactory.saveCustomer = _saveCustomer; + return customersServiceFactory; }, ]); "use strict"; -app.controller("loginController", [ - "$rootScope", +app.controller("DashboardController", [ "$scope", + "$rootScope", "ngAppSettings", + "$timeout", "$location", - "AuthService", - "ngAppSettings", + "DashboardServices", function ( - $rootScope, $scope, + $rootScope, ngAppSettings, + $timeout, $location, - authService, - ngAuthSettings + dashboardServices ) { - if ( - authService.authentication && - authService.authentication.isAuth && - authService.authentication.isAdmin - ) { - authService.referredUrl = $location.path(); - $location.path("/admin"); - } - - $scope.pageClass = "page-login"; - - $scope.loginData = { - username: "", - password: "", - rememberme: true, + $scope.pageClass = "page-dashboard"; + $(".side-nav li").removeClass("active"); + $(".side-nav .page-dashboard").addClass("active"); + $scope.data = { + totalPage: 0, + totalPost: 0, + totalProduct: 0, + totalUser: 0, }; - - $scope.message = ""; + $scope.users = []; $scope.$on("$viewContentLoaded", function () { $rootScope.isBusy = false; }); - $scope.login = async function () { - if (authService.referredUrl === "/init/login") { - authService.referredUrl = "/admin"; - } + $scope.getDashboardInfo = async function () { $rootScope.isBusy = true; - var result = await authService.login($scope.loginData); - if (result.success) { - if ($routeParams.ReturnUrl) { - window.top.location = $routeParams.ReturnUrl; - } else if ( - document.referrer && - document.referrer.indexOf("init") === -1 - ) { - window.top.location = document.referrer; - } else { - window.top.location = "/"; - } - } - $rootScope.isBusy = false; - $scope.$apply(); - }; - - $scope.authExternalProvider = function (provider) { - var redirectUri = - location.protocol + "//" + location.host + "/authcomplete.html"; - - var externalProviderUrl = - ngAuthSettings.apiServiceBaseUri + - "api/Account/ExternalLogin?provider=" + - provider + - "&response_type=token&client_id=" + - ngAuthSettings.clientId + - "&redirect_uri=" + - redirectUri; - window.$windowScope = $scope; - - var oauthWindow = window.open( - externalProviderUrl, - "Authenticate Account", - "location=0,status=0,width=600,height=750" - ); + // var response = await dashboardServices.getDashboardInfo(); + // if (response.success) { + // // $('#mainSection').removeClass('card'); + // $scope.data = response.data; + // $rootScope.isBusy = false; + // $scope.$apply(); + // // $scope.getChart(); + // } else { + // $rootScope.showErrors(response.errors); + // $rootScope.isBusy = false; + // $scope.$apply(); + // } }; + $scope.getChart = function () { + var ctx = document.getElementById("myChart"); + var myChart = new Chart(ctx, { + // type: 'pie', + // data: { + // labels: ["Africa", "Asia", "Europe", "Latin America", "North America"], + // datasets: [{ + // label: "Population (millions)", + // backgroundColor: ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"], + // data: [2478,5267,734,784,433] + // }] + // }, + // options: { + // title: { + // display: true, + // text: 'Predicted world population (millions) in 2050' + // } + // } + }); + }; + }, +]); - $scope.authCompletedCB = function (fragment) { - $scope.$apply(function () { - if (fragment.haslocalaccount === "False") { - authService.logOut(); - - authService.externalAuthData = { - provider: fragment.provider, - username: fragment.external_user_name, - externalAccessToken: fragment.external_access_token, - }; +"use strict"; +app.factory("DashboardServices", [ + "$rootScope", + "$http", + "ApiService", + "CommonService", + function ($rootScope, $http, apiService, commonService) { + //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; - $location.path("/associate"); - } else { - //Obtain access token and redirect to orders - var externalData = { - provider: fragment.provider, - externalAccessToken: fragment.external_access_token, - }; - authService.obtainAccessToken(externalData).then( - function (response) { - $location.path("/orders"); - }, - function (err) { - $scope.message = err.error_description; - } - ); - } - }); + var usersServiceFactory = {}; + var apiUrl = "/rest/portal/common/" + $rootScope.globalSettings.lang; + var _getDashboardInfo = async function () { + var req = { + method: "GET", + url: apiUrl + "/dashboard", + }; + return await apiService.sendRequest(req); }; + + usersServiceFactory.getDashboardInfo = _getDashboardInfo; + return usersServiceFactory; }, ]); "use strict"; -app.controller("LocalizeController", [ +app.controller("DomainController", [ "$scope", "$rootScope", "ngAppSettings", - "$routeParams", "$location", - "LocalizeService", - "ApiService", - "CommonService", + "$routeParams", + "DomainRestService", function ( $scope, $rootScope, ngAppSettings, - $routeParams, $location, - service, - commonService + $routeParams, + service ) { BaseRestCtrl.call( this, @@ -1631,256 +1200,58 @@ app.controller("LocalizeController", [ ngAppSettings, service ); - - $scope.getSingleSuccessCallback = function () { - $scope.cates = ngAppSettings.enums.configuration_cates; - $scope.appSettings = $rootScope.globalSettings; - $scope.request.category = $routeParams.category || ""; - if (!$scope.viewmodel.id) { - $scope.viewmodel.dataType = "Text"; - } - if (!$scope.viewmodel.category) { - $scope.viewmodel.category = "Site"; - } - }; - $scope.saveSuccessCallback = function () { - apiService.getAllSettings().then(function () { - // $location.url($scope.referrerUrl); - $rootScope.isBusy = false; - $scope.$apply(); - }); - }; - $scope.removeCallback = function () { - apiService.getAllSettings().then(function () { - $location.url($scope.referrerUrl); - }); - }; - - $scope.generateName = function () { - $scope.viewmodel.keyword = $rootScope.generateKeyword( - $scope.viewmodel.keyword, - "_", - true - ); - }; + $scope.request.columns = [ + "id", + "displayName", + "host", + "createdDateTime", + "createdBy", + ]; + $scope.canDrag = + $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; }, ]); "use strict"; -app.factory("LocalizeService", [ +app.factory("DomainRestService", [ "BaseRestService", - "ApiService", - "CommonService", - function (baseService, apiService, commonService) { + function (baseService) { var serviceFactory = Object.create(baseService); - serviceFactory.init("language"); - - var _uploadLanguage = async function (languageFile) { - //var container = $(this).parents('.model-language').first().find('.custom-file').first(); - if (languageFile.file !== undefined && languageFile.file !== null) { - // Create FormData object - var files = new FormData(); - - // Looping over all files and add it to FormData object - files.append(languageFile.file.name, languageFile.file); - - // Adding one more key to FormData object - files.append("fileFolder", languageFile.folder); - files.append("title", languageFile.title); - files.append("description", languageFile.description); - - var req = { - url: this.prefixUrl + "/upload", - type: "POST", - headers: {}, - contentType: false, // Not to set any content header - processData: false, // Not to process data - data: files, - }; - - return await apiService.sendRequest(req); - } - }; - serviceFactory.uploadLanguage = _uploadLanguage; + serviceFactory.init("mix-domain"); return serviceFactory; }, ]); "use strict"; -app.controller("MixDatabaseController", [ +app.controller("FileController", [ "$scope", "$rootScope", - "$location", "ngAppSettings", "$routeParams", - "RestMixDatabaseDataPortalService", - "RestMixDatabaseColumnPortalService", - "RestMixDatabasePortalService", - "RestMixDatabaseContextService", + "$timeout", + "$location", + "AuthService", + "FileServices", function ( $scope, $rootScope, - $location, ngAppSettings, $routeParams, - databaseDataService, - databaseColumnService, - databaseService, - dbContextService + $timeout, + $location, + authService, + fileServices ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - databaseService - ); - $scope.defaultAttr = null; - $scope.actions = ["Delete"]; - $scope.viewmodelType = "mix-database"; - // $scope.request.selects = 'id,title,name,createdDateTime'; - $scope.orders = [ - { title: "Id", value: "Id" }, - { title: "Name", value: "Name" }, - { title: "Created Date", value: "CreatedDateTime" }, - ]; - $scope.request.orderBy = "CreatedDateTime"; - $scope.request.columns = "id,displayName,systemName,type,createdDatetime"; - $scope.request.searchColumns = "displayName,systemName"; - $scope.saveDatabase = function () { - $scope.save($scope.viewmodel); - }; - - $scope.getSingleSuccessCallback = async function () { - $scope.viewmodel.mixDatabaseContextId = $routeParams.mixDatabaseContextId; - if ($scope.viewmodel.mixDatabaseContextId) { - var resp = await dbContextService.getSingle([ - $scope.viewmodel.mixDatabaseContextId, - ]); - if (resp.success) { - $scope.dbContext = resp.data; - } - } - if (!$scope.defaultAttr) { - var getDefaultAttr = await databaseColumnService.getDefault(); - if (getDefaultAttr.success) { - $scope.defaultAttr = getDefaultAttr.data; - $scope.defaultAttr.options = []; - } - $scope.$apply(); - } - }; - $scope.migrate = async function () { - if ($scope.viewmodel.id) { - $rootScope.isBusy = true; - var result = await databaseService.migrate($scope.viewmodel); - if (result.success) { - $rootScope.showMessage( - "Please restart pool to apply new db schema", - "warning" - ); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(["Cannot migrate database"]); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - $scope.backup = async function () { - if ($scope.viewmodel.id) { - $rootScope.isBusy = true; - var result = await databaseService.backup($scope.viewmodel); - if (result.success) { - $rootScope.showMessage( - `Backup ${$scope.viewmodel.systemName} is queued`, - "success" - ); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(["Cannot backup database"]); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - $scope.restore = async function () { - if ($scope.viewmodel.id) { - $rootScope.isBusy = true; - var result = await databaseService.restore($scope.viewmodel); - if (result.success) { - $rootScope.showMessage( - `Restore ${$scope.viewmodel.systemName} is queued`, - "success" - ); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(["Cannot restore database"]); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - $scope.updateSchema = async function () { - if ($scope.viewmodel.id) { - $rootScope.isBusy = true; - var result = await databaseService.updateSchema($scope.viewmodel); - if (result.success) { - $rootScope.showMessage( - "Please restart pool to apply new db schema", - "warning" - ); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(["Cannot update database"]); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - - $scope.back = function () { - window.history.back(); - }; - }, -]); - -"use strict"; -app.controller("FileController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$timeout", - "$location", - "AuthService", - "FileServices", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $timeout, - $location, - authService, - fileServices - ) { - $scope.request = { - pageSize: "10", - pageIndex: 0, - status: "Published", - orderBy: "CreatedDateTime", - direction: "Desc", - fromDate: null, - toDate: null, - keyword: "", - key: "", + $scope.request = { + pageSize: "10", + pageIndex: 0, + status: "Published", + orderBy: "CreatedDateTime", + direction: "Desc", + fromDate: null, + toDate: null, + keyword: "", + key: "", }; $scope.activedFile = null; @@ -2092,209 +1463,123 @@ app.factory("FileServices", [ ]); "use strict"; -app.controller("MixDatabaseDataController", [ +app.controller("ImportFileController", [ + "$scope", + "$rootScope", + "ImportFileServices", + "TranslatorService", + "AppSettingsService", + function ( + $scope, + $rootScope, + service, + translatorService, + AppSettingsService + ) { + $scope.saveImportFile = async function () { + $rootScope.isBusy = true; + var form = document.getElementById("frm-import"); + var frm = new FormData(); + frm.append("assets", form["assets"].files[0]); + var response = await service.saveImportFile(frm); + if (response.success) { + $scope.viewmodel = response.data; + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showErrors(response.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + }, +]); + +"use strict"; +app.factory("ImportFileServices", [ + "$rootScope", + "BaseService", + function ($rootScope, baseService) { + //var serviceBase = 'http://ngauthenticationapi.azurewebsites.net/'; + + var serviceFactory = {}; + + var settings = $rootScope.globalSettings; + var serviceFactory = Object.create(baseService); + serviceFactory.init("portal", true); + var _saveImportFile = async function (frm) { + var apiUrl = this.prefixUrl + "/" + settings.lang + "/import"; + return await this.ajaxSubmitForm(frm, apiUrl); + }; + + serviceFactory.saveImportFile = _saveImportFile; + return serviceFactory; + }, +]); + +"use strict"; +app.controller("JsonDataController", [ "$scope", "$rootScope", "ngAppSettings", "$routeParams", + "$timeout", "$location", - "MixDbService", + "AuthService", + "JsonDataService", function ( $scope, $rootScope, ngAppSettings, $routeParams, + $timeout, $location, - mixDbService + authService, + service ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - mixDbService - ); - $scope.queries = {}; - $scope.data = null; - $scope.exportAll = true; - $scope.mixConfigurations = $rootScope.globalSettings; - $scope.filterType = "contain"; - $scope.defaultId = "default"; - $scope.importFile = { - file: null, - fullPath: "", - folder: "import", - title: "", - description: "", + $scope.request = { + pageSize: "10", + pageIndex: 0, + status: "Published", + orderBy: "CreatedDateTime", + direction: "Desc", + fromDate: null, + toDate: null, + keyword: "", + key: "", }; - $scope.initRouteParams = () => { - $scope.requestKey = `request${$rootScope.generateKeyword( - $location.$$path, - "_" - )}_${$routeParams.mixDatabaseId}`; - $scope.request = $rootScope.getRequest($scope.requestKey); - if ($routeParams.mixDatabaseId) { - $scope.request.mixDatabaseId = $routeParams.mixDatabaseId; - } - if ($routeParams.queryFields) { - if (Array.isArray($routeParams.queryFields)) { - angular.forEach($routeParams.queryFields, (e) => { - let val = e.split(":"); - $scope.queries[val[0]] = val[1]; - }); - } else { - let val = $routeParams.queryFields.split(":"); - $scope.queries[val[0]] = val[1]; - } - $scope.request.mixDatabaseId = $routeParams.mixDatabaseId; - } - $scope.request.mixDatabaseName = $routeParams.mixDatabaseName; - $scope.request.filterType = $routeParams.filterType || "contain"; - $scope.request.compareType = $routeParams.compareType || "or"; - $scope.mixDatabaseId = $routeParams.mixDatabaseId; - $scope.mixDatabaseName = $routeParams.mixDatabaseName; - $scope.mixDatabaseTitle = $routeParams.mixDatabaseTitle; - $scope.guidParentId = $routeParams.guidParentId; - $scope.parentType = $routeParams.parentType; - $scope.request.mixDatabaseName = $routeParams.mixDatabaseName; - $scope.request.isGroup = $routeParams.isGroup || false; - $scope.dataUrl = `/admin/mix-database-data/list?mixDatabaseId=${$scope.mixDatabaseId}&mixDatabaseName=${$scope.mixDatabaseName}&mixDatabaseTitle=${$scope.mixDatabaseTitle}`; - if ($routeParams.backUrl) { - $scope.backUrl = decodeURIComponent($routeParams.backUrl); - } - if ($routeParams.dataContentId != $scope.defaultId) { - $scope.dataContentId = $routeParams.dataContentId; - } + $scope.activedFile = null; + $scope.editorVisible = false; + $scope.data = null; + $scope.relatedFiles = []; + $rootScope.isBusy = false; - if ($scope.parentId && $scope.parentType) { - $scope.refDataModel = { - parentId: $scope.parentId, - parentType: $scope.parentType, - }; - } - }; - $scope.init = async function () { - $scope.initRouteParams(); - mixDbService.initDbName($scope.request.mixDatabaseName); - }; - $scope.saveSuccess = function (data) { - if ($scope.backUrl) { - $location.url($scope.backUrl); - } else { - $location.url( - `/admin/mix-database-data/details?dataContentId=${data}&mixDatabaseTitle=${ - $scope.mixDatabaseTitle - }&backUrl=${encodeURIComponent($scope.dataUrl)}` - ); - } - }; - $scope.selectData = function () { - if ($scope.selectedList.data.length) { - $scope.viewmodel = $scope.selectedList.data[0]; - } - }; - - $scope.preview = function (item) { - item.editUrl = "/admin/post/details/" + item.id; - $rootScope.preview("post", item, item.title, "modal-lg"); - }; - $scope.edit = function (data) { - $rootScope.goToPath( - `/admin/mix-database-data/details?dataContentId=${data.id}&mixDatabaseName=${$scope.mixDatabaseName}&mixDatabaseTitle=${$scope.mixDatabaseTitle}` - ); - }; - $scope.remove = function (data) { - $rootScope.showConfirm( - $scope, - "removeConfirmed", - [data.id], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; + $scope.errors = []; - $scope.removeConfirmed = async function (dataContentId) { - $rootScope.isBusy = true; - var result = await mixDbService.delete([dataContentId]); - if (result.success) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName( - "removeCallback", - $scope.removeCallbackArgs, - $scope - ); - } - $scope.getList(); - } else { - $rootScope.showErrors(result.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.import = async function () { - if ($scope.validateDataFile()) { - $rootScope.isBusy = true; - var form = document.getElementById("form-portal"); - var result = await mixDbService.import( - form["import-data-inp"].files[0] - ); - if (result.success) { - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.getList(0); - } else { - $rootScope.showErrors(result.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - }; - $scope.validateDataFile = function () { - if (!$scope.importFile.file) { - $rootScope.showMessage("Please choose data file", "danger"); - return false; - } else { - return true; + $scope.loadPage = async function (folder) { + if (folder) { + $scope.request.key += $scope.request.key !== "" ? "/" : ""; + $scope.request.key += folder; } - }; - $scope.sendMail = function (data) { - var email = ""; - angular.forEach(data.values, function (e) { - if (e.mixDatabaseColumnName == "email") { - email = e.stringValue; - } - }); - $rootScope.showConfirm( - $scope, - "sendMailConfirmed", - [data], - null, - "Send mail", - "Are you sure to send mail to " + email + $location.url( + "/admin/json-data/list?folder=" + encodeURIComponent($scope.request.key) ); }; - $scope.sendMailConfirmed = async function (data) { + $scope.init = async function () { $rootScope.isBusy = true; + $scope.filename = $routeParams.filename; + $scope.folder = $routeParams.folder; + $scope.listUrl = "/admin/json-data/list?folder=" + $routeParams.folder; $rootScope.isBusy = true; - var result = await service.sendMail([data.id]); - if (result.success) { - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(result.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); + var response = await service.getFile( + $routeParams.folder, + $routeParams.filename + ); if (response.success) { - $scope.getList(); + $scope.activedFile = response.data; + $scope.data = $.parseJSON(response.data.content); + $rootScope.isBusy = false; $scope.$apply(); } else { $rootScope.showErrors(response.errors); @@ -2302,123 +1587,68 @@ app.controller("MixDatabaseDataController", [ $scope.$apply(); } }; - $scope.selectImportFile = function (files) { - if (files !== undefined && files !== null && files.length > 0) { - const file = files[0]; - $scope.importFile.folder = "imports"; - $scope.importFile.title = $scope.mixDatabaseName; - $scope.importFile.description = $scope.mixDatabaseName + "'s data"; - $scope.importFile.file = file; - - // if (ctrl.auto=='true') { - // ctrl.uploadFile(file); - // } - // else { - // ctrl.getBase64(file); - // } - } - }; - $scope.getList = async function (pageIndex) { - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var df = new Date($scope.request.fromDate); - $scope.request.fromDate = df.toISOString(); - } - if ($scope.request.toDate !== null) { - var dt = new Date($scope.request.toDate); - $scope.request.toDate = dt.toISOString(); + $scope.loadFiles = async function (folder) { + if (folder) { + $scope.request.key += $scope.request.key !== "" ? "/" : ""; + $scope.request.key += folder; + } else { + $scope.request.key = $routeParams.folder ? $routeParams.folder : "data"; } - $scope.request.queries = []; - Object.keys($scope.queries).forEach((e) => { - if ($scope.queries[e]) { - $scope.request.queries.push({ - fieldName: e, - value: $scope.queries[e], - }); - } - }); $rootScope.isBusy = true; - var resp = await mixDbService.filter($scope.request); + var resp = await service.getFiles($scope.request); if (resp && resp.success) { $scope.data = resp.data; - $.each($scope.data.items, function (i, data) { - $.each($scope.activeddata, function (i, e) { - if (e.dataContentId === data.id) { - data.isHidden = true; + $.each($scope.data.items, function (i, file) { + $.each($scope.activedFiles, function (i, e) { + if (e.fileId === file.id) { + file.isHidden = true; } }); }); - if ($scope.getListSuccessCallback) { - $scope.getListSuccessCallback(); - } - $("html, body").animate( - { - scrollTop: "0px", - }, - 500 - ); - if (!resp.data || !resp.data.items.length) { - $scope.queries = {}; - } $rootScope.isBusy = false; $scope.$apply(); } else { if (resp) { $rootScope.showErrors(resp.errors); } - if ($scope.getListFailCallback) { - $scope.getListFailCallback(); - } - $scope.queries = {}; $rootScope.isBusy = false; $scope.$apply(); } }; - $scope.export = async function (pageIndex, exportAll) { - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var df = new Date($scope.request.fromDate); - $scope.request.fromDate = df.toISOString(); - } - if ($scope.request.toDate !== null) { - var dt = new Date($scope.request.toDate); - $scope.request.toDate = dt.toISOString(); - } - var query = {}; - if ($routeParams.mixDatabaseId) { - $scope.request.mixDatabaseId = $routeParams.mixDatabaseId; - } - $scope.request.mixDatabaseName = $routeParams.mixDatabaseName; - $scope.request.filterType = $routeParams.filterType || "contain"; - $scope.request.queries = []; - Object.keys($scope.queries).forEach((e) => { - if ($scope.queries[e]) { - $scope.request.queries.push({ - fieldName: e, - value: $scope.queries[e], - }); + $scope.removeFile = async function (id) { + if (confirm("Are you sure!")) { + $rootScope.isBusy = true; + var resp = await service.removeFile(id); + if (resp && resp.success) { + $scope.loadFiles(); + } else { + if (resp) { + $rootScope.showErrors(resp.errors); + } + $rootScope.isBusy = false; + $scope.$apply(); } - }); - var request = angular.copy($scope.request); - $scope.exportAll = $scope.exportAll; - if (exportAll) { - request.pageSize = 10000; - request.pageIndex = 0; } + }; + $scope.selectPane = function (pane) { + $scope.editorVisible = pane.header == "Content"; + }; + $scope.save = async function (data) { + $scope.activedFile.contennt = JSON.stringify(data); + $scope.saveFile($scope.activedFile); + }; + $scope.updateData = async function (data) { + $scope.data = data; + }; + $scope.saveFile = async function (file) { $rootScope.isBusy = true; - var resp = await mixDbService.export(request); - if (resp && resp.success) { - if (resp.data) { - window.top.location = resp.data.webPath; - } else { - $rootScope.showMessage("Nothing to export"); - } + file.content = JSON.stringify($scope.data); + var resp = await service.saveFile(file); + if (resp && resp.success) { + $scope.activedFile = resp.data; + $rootScope.showMessage("Update successfully!", "success"); $rootScope.isBusy = false; $scope.$apply(); } else { @@ -2429,34 +1659,96 @@ app.controller("MixDatabaseDataController", [ $scope.$apply(); } }; + }, +]); - $scope.migrate = async function () { - if ($routeParams.mixDatabaseId) { - $rootScope.isBusy = true; - var result = await service.migrate($routeParams.mixDatabaseId); - $scope.handleResult(result); - $rootScope.isBusy = false; - $scope.$apply(); - } +"use strict"; +app.factory("JsonDataService", [ + "$http", + "$rootScope", + "ApiService", + "CommonService", + function ($http, $rootScope, apiService, commonService) { + var filesServiceFactory = {}; + + var settings = $rootScope.globalSettings; + + var _getFile = async function (folder, filename) { + var apiUrl = "/file/"; + var url = apiUrl + "details?folder=" + folder + "&filename=" + filename; + var req = { + method: "GET", + url: url, + }; + return await apiService.sendRequest(req); + }; + + var _initFile = async function (type) { + var apiUrl = "/file/"; + var req = { + method: "GET", + url: apiUrl + "init/" + type, + }; + return await apiService.sendRequest(req); + }; + + var _getFiles = async function (request) { + var apiUrl = "/file/"; + var req = { + method: "POST", + url: apiUrl + "list", + data: JSON.stringify(request), + }; + + return await apiService.sendRequest(req); + }; + + var _removeFile = async function (id) { + var apiUrl = "/file/"; + var req = { + method: "GET", + url: apiUrl + "delete/" + id, + }; + return await apiService.sendRequest(req); + }; + + var _saveFile = async function (file) { + var apiUrl = "/file/"; + var req = { + method: "POST", + url: apiUrl + "save", + data: JSON.stringify(file), + }; + return await apiService.sendRequest(req); }; + + filesServiceFactory.getFile = _getFile; + filesServiceFactory.initFile = _initFile; + filesServiceFactory.getFiles = _getFiles; + filesServiceFactory.removeFile = _removeFile; + filesServiceFactory.saveFile = _saveFile; + return filesServiceFactory; }, ]); "use strict"; -app.controller("MixDatabaseContextController", [ +app.controller("LocalizeController", [ "$scope", "$rootScope", - "$location", "ngAppSettings", "$routeParams", - "RestMixDatabaseContextService", + "$location", + "LocalizeService", + "ApiService", + "CommonService", function ( $scope, $rootScope, - $location, ngAppSettings, $routeParams, - mixdbContextService + $location, + service, + commonService ) { BaseRestCtrl.call( this, @@ -2465,116 +1757,824 @@ app.controller("MixDatabaseContextController", [ $location, $routeParams, ngAppSettings, - mixdbContextService + service ); - $scope.defaultAttr = null; - $scope.databaseProvider = ["MySQL", "PostgreSQL", "SQLITE", "SQLSERVER"]; - $scope.actions = ["Delete"]; - // $scope.request.selects = 'id,title,name,createdDateTime'; - $scope.orders = [ - { title: "Id", value: "Id" }, - { title: "Name", value: "DisplayName" }, - { title: "Created Date", value: "CreatedDateTime" }, - ]; - $scope.request.orderBy = "CreatedDateTime"; - $scope.request.columns = "id,displayName,systemName,type,createdDatetime"; - $scope.request.searchColumns = "displayName,systemName"; - $scope.saveDatabase = function () { - $scope.save($scope.viewmodel); + + $scope.getSingleSuccessCallback = function () { + $scope.cates = ngAppSettings.enums.configuration_cates; + $scope.appSettings = $rootScope.globalSettings; + $scope.request.category = $routeParams.category || ""; + if (!$scope.viewmodel.id) { + $scope.viewmodel.dataType = "Text"; + } + if (!$scope.viewmodel.category) { + $scope.viewmodel.category = "Site"; + } + }; + $scope.saveSuccessCallback = function () { + apiService.getAllSettings().then(function () { + // $location.url($scope.referrerUrl); + $rootScope.isBusy = false; + $scope.$apply(); + }); + }; + $scope.removeCallback = function () { + apiService.getAllSettings().then(function () { + $location.url($scope.referrerUrl); + }); }; + $scope.generateName = function () { - $scope.viewmodel.systemName = $rootScope.generateKeyword( - $scope.viewmodel.displayName, + $scope.viewmodel.keyword = $rootScope.generateKeyword( + $scope.viewmodel.keyword, "_", - true, true ); }; - $scope.getSingleSuccessCallback = async function () {}; }, ]); "use strict"; -app.factory("RestMixDatabaseContextService", [ +app.factory("LocalizeService", [ "BaseRestService", - function (baseService) { + "ApiService", + "CommonService", + function (baseService, apiService, commonService) { var serviceFactory = Object.create(baseService); - serviceFactory.init("mixdb-context"); + serviceFactory.init("language"); - var _getByName = async function (name) { - var url = `${this.prefixUrl}/get-by-name/${name}`; - var req = { - method: "GET", - url: url, - }; - return await this.getRestApiResult(req); + var _uploadLanguage = async function (languageFile) { + //var container = $(this).parents('.model-language').first().find('.custom-file').first(); + if (languageFile.file !== undefined && languageFile.file !== null) { + // Create FormData object + var files = new FormData(); + + // Looping over all files and add it to FormData object + files.append(languageFile.file.name, languageFile.file); + + // Adding one more key to FormData object + files.append("fileFolder", languageFile.folder); + files.append("title", languageFile.title); + files.append("description", languageFile.description); + + var req = { + url: this.prefixUrl + "/upload", + type: "POST", + headers: {}, + contentType: false, // Not to set any content header + processData: false, // Not to process data + data: files, + }; + + return await apiService.sendRequest(req); + } }; - serviceFactory.getByName = _getByName; + serviceFactory.uploadLanguage = _uploadLanguage; return serviceFactory; }, ]); "use strict"; -app.controller("ModuleController", [ - "$scope", +app.controller("loginController", [ "$rootScope", + "$scope", "ngAppSettings", "$location", - "$routeParams", - "ModuleRestService", - "SharedModuleDataService", - "RestMixDatabaseDataPortalService", - "RestMixDatabaseColumnPortalService", + "AuthService", + "ngAppSettings", function ( - $scope, $rootScope, + $scope, ngAppSettings, $location, - $routeParams, - moduleServices, - moduleDataService, - dataService, - columnService + authService, + ngAuthSettings ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - moduleServices, - "product" - ); - $scope.request.culture = $rootScope.globalSettings.defaultCulture; - $scope.viewmodelType = "module"; - $scope.contentUrl = ""; - $scope.getSingleSuccessCallback = function () { - $scope.loadAdditionalData(); + if ( + authService.authentication && + authService.authentication.isAuth && + authService.authentication.isAdmin + ) { + authService.referredUrl = $location.path(); + $location.path("/admin"); + } - if ($scope.viewmodel.id > 0) { - // module => list post or list product - if ($scope.viewmodel.type.localeCompare("ListPost") == 0) { - $scope.contentUrl = "/admin/module-post/list/" + $scope.viewmodel.id; - } else if ($scope.viewmodel.type.localeCompare("Data") == 0) { - $scope.contentUrl = "/admin/module-data/list/" + $scope.viewmodel.id; - } - } - if ($scope.viewmodel.sysCategories) { - angular.forEach($scope.viewmodel.sysCategories, function (e) { - e.attributeData.obj.isActived = true; - }); - } + $scope.pageClass = "page-login"; - if ($scope.viewmodel.sysTags) { - angular.forEach($scope.viewmodel.sysTags, function (e) { - e.attributeData.obj.isActived = true; - }); - } + $scope.loginData = { + username: "", + password: "", + rememberme: true, + }; - if ($routeParams.template) { - $scope.viewmodel.view = $rootScope.findObjectByKey( - $scope.viewmodel.templates, + $scope.message = ""; + $scope.$on("$viewContentLoaded", function () { + $rootScope.isBusy = false; + }); + $scope.login = async function () { + if (authService.referredUrl === "/init/login") { + authService.referredUrl = "/admin"; + } + $rootScope.isBusy = true; + var result = await authService.login($scope.loginData); + if (result.success) { + if ($routeParams.ReturnUrl) { + window.top.location = $routeParams.ReturnUrl; + } else if ( + document.referrer && + document.referrer.indexOf("init") === -1 + ) { + window.top.location = document.referrer; + } else { + window.top.location = "/"; + } + } + $rootScope.isBusy = false; + $scope.$apply(); + }; + + $scope.authExternalProvider = function (provider) { + var redirectUri = + location.protocol + "//" + location.host + "/authcomplete.html"; + + var externalProviderUrl = + ngAuthSettings.apiServiceBaseUri + + "api/Account/ExternalLogin?provider=" + + provider + + "&response_type=token&client_id=" + + ngAuthSettings.clientId + + "&redirect_uri=" + + redirectUri; + window.$windowScope = $scope; + + var oauthWindow = window.open( + externalProviderUrl, + "Authenticate Account", + "location=0,status=0,width=600,height=750" + ); + }; + + $scope.authCompletedCB = function (fragment) { + $scope.$apply(function () { + if (fragment.haslocalaccount === "False") { + authService.logOut(); + + authService.externalAuthData = { + provider: fragment.provider, + username: fragment.external_user_name, + externalAccessToken: fragment.external_access_token, + }; + + $location.path("/associate"); + } else { + //Obtain access token and redirect to orders + var externalData = { + provider: fragment.provider, + externalAccessToken: fragment.external_access_token, + }; + authService.obtainAccessToken(externalData).then( + function (response) { + $location.path("/orders"); + }, + function (err) { + $scope.message = err.error_description; + } + ); + } + }); + }; + }, +]); + +"use strict"; +app.controller("MixDatabaseController", [ + "$scope", + "$rootScope", + "$location", + "ngAppSettings", + "$routeParams", + "RestMixDatabaseDataPortalService", + "RestMixDatabaseColumnPortalService", + "RestMixDatabasePortalService", + "RestMixDatabaseContextService", + function ( + $scope, + $rootScope, + $location, + ngAppSettings, + $routeParams, + databaseDataService, + databaseColumnService, + databaseService, + dbContextService + ) { + BaseRestCtrl.call( + this, + $scope, + $rootScope, + $location, + $routeParams, + ngAppSettings, + databaseService + ); + $scope.defaultAttr = null; + $scope.actions = ["Delete"]; + $scope.viewmodelType = "mix-database"; + // $scope.request.selects = 'id,title,name,createdDateTime'; + $scope.orders = [ + { title: "Id", value: "Id" }, + { title: "Name", value: "Name" }, + { title: "Created Date", value: "CreatedDateTime" }, + ]; + $scope.request.orderBy = "CreatedDateTime"; + $scope.request.columns = "id,displayName,systemName,type,createdDatetime"; + $scope.request.searchColumns = "displayName,systemName"; + $scope.saveDatabase = function () { + $scope.save($scope.viewmodel); + }; + + $scope.getSingleSuccessCallback = async function () { + $scope.viewmodel.mixDatabaseContextId = $routeParams.mixDatabaseContextId; + if ($scope.viewmodel.mixDatabaseContextId) { + var resp = await dbContextService.getSingle([ + $scope.viewmodel.mixDatabaseContextId, + ]); + if (resp.success) { + $scope.dbContext = resp.data; + } + } + if (!$scope.defaultAttr) { + var getDefaultAttr = await databaseColumnService.getDefault(); + if (getDefaultAttr.success) { + $scope.defaultAttr = getDefaultAttr.data; + $scope.defaultAttr.options = []; + } + $scope.$apply(); + } + }; + $scope.migrate = async function () { + if ($scope.viewmodel.id) { + $rootScope.isBusy = true; + var result = await databaseService.migrate($scope.viewmodel); + if (result.success) { + $rootScope.showMessage( + "Please restart pool to apply new db schema", + "warning" + ); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showErrors(["Cannot migrate database"]); + $rootScope.isBusy = false; + $scope.$apply(); + } + } + }; + $scope.backup = async function () { + if ($scope.viewmodel.id) { + $rootScope.isBusy = true; + var result = await databaseService.backup($scope.viewmodel); + if (result.success) { + $rootScope.showMessage( + `Backup ${$scope.viewmodel.systemName} is queued`, + "success" + ); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showErrors(["Cannot backup database"]); + $rootScope.isBusy = false; + $scope.$apply(); + } + } + }; + $scope.restore = async function () { + if ($scope.viewmodel.id) { + $rootScope.isBusy = true; + var result = await databaseService.restore($scope.viewmodel); + if (result.success) { + $rootScope.showMessage( + `Restore ${$scope.viewmodel.systemName} is queued`, + "success" + ); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showErrors(["Cannot restore database"]); + $rootScope.isBusy = false; + $scope.$apply(); + } + } + }; + $scope.updateSchema = async function () { + if ($scope.viewmodel.id) { + $rootScope.isBusy = true; + var result = await databaseService.updateSchema($scope.viewmodel); + if (result.success) { + $rootScope.showMessage( + "Please restart pool to apply new db schema", + "warning" + ); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showErrors(["Cannot update database"]); + $rootScope.isBusy = false; + $scope.$apply(); + } + } + }; + + $scope.back = function () { + window.history.back(); + }; + }, +]); + +"use strict"; +app.controller("MixDatabaseDataController", [ + "$scope", + "$rootScope", + "ngAppSettings", + "$routeParams", + "$location", + "MixDbService", + function ( + $scope, + $rootScope, + ngAppSettings, + $routeParams, + $location, + mixDbService + ) { + BaseRestCtrl.call( + this, + $scope, + $rootScope, + $location, + $routeParams, + ngAppSettings, + mixDbService + ); + $scope.queries = {}; + $scope.data = null; + $scope.exportAll = true; + $scope.mixConfigurations = $rootScope.globalSettings; + $scope.filterType = "contain"; + $scope.defaultId = "default"; + $scope.importFile = { + file: null, + fullPath: "", + folder: "import", + title: "", + description: "", + }; + $scope.initRouteParams = () => { + $scope.requestKey = `request${$rootScope.generateKeyword( + $location.$$path, + "_" + )}_${$routeParams.mixDatabaseId}`; + $scope.request = $rootScope.getRequest($scope.requestKey); + if ($routeParams.mixDatabaseId) { + $scope.request.mixDatabaseId = $routeParams.mixDatabaseId; + } + if ($routeParams.queryFields) { + if (Array.isArray($routeParams.queryFields)) { + angular.forEach($routeParams.queryFields, (e) => { + let val = e.split(":"); + $scope.queries[val[0]] = val[1]; + }); + } else { + let val = $routeParams.queryFields.split(":"); + $scope.queries[val[0]] = val[1]; + } + $scope.request.mixDatabaseId = $routeParams.mixDatabaseId; + } + $scope.request.mixDatabaseName = $routeParams.mixDatabaseName; + $scope.request.filterType = $routeParams.filterType || "contain"; + $scope.request.compareType = $routeParams.compareType || "or"; + + $scope.mixDatabaseId = $routeParams.mixDatabaseId; + $scope.mixDatabaseName = $routeParams.mixDatabaseName; + $scope.mixDatabaseTitle = $routeParams.mixDatabaseTitle; + $scope.guidParentId = $routeParams.guidParentId; + $scope.parentType = $routeParams.parentType; + $scope.request.mixDatabaseName = $routeParams.mixDatabaseName; + $scope.request.isGroup = $routeParams.isGroup || false; + $scope.dataUrl = `/admin/mix-database-data/list?mixDatabaseId=${$scope.mixDatabaseId}&mixDatabaseName=${$scope.mixDatabaseName}&mixDatabaseTitle=${$scope.mixDatabaseTitle}`; + if ($routeParams.backUrl) { + $scope.backUrl = decodeURIComponent($routeParams.backUrl); + } + if ($routeParams.dataContentId != $scope.defaultId) { + $scope.dataContentId = $routeParams.dataContentId; + } + + if ($scope.parentId && $scope.parentType) { + $scope.refDataModel = { + parentId: $scope.parentId, + parentType: $scope.parentType, + }; + } + }; + $scope.init = async function () { + $scope.initRouteParams(); + mixDbService.initDbName($scope.request.mixDatabaseName); + }; + $scope.saveSuccess = function (data) { + if ($scope.backUrl) { + $location.url($scope.backUrl); + } else { + $location.url( + `/admin/mix-database-data/details?dataContentId=${data}&mixDatabaseTitle=${ + $scope.mixDatabaseTitle + }&backUrl=${encodeURIComponent($scope.dataUrl)}` + ); + } + }; + $scope.selectData = function () { + if ($scope.selectedList.data.length) { + $scope.viewmodel = $scope.selectedList.data[0]; + } + }; + + $scope.preview = function (item) { + item.editUrl = "/admin/post/details/" + item.id; + $rootScope.preview("post", item, item.title, "modal-lg"); + }; + $scope.edit = function (data) { + $rootScope.goToPath( + `/admin/mix-database-data/details?dataContentId=${data.id}&mixDatabaseName=${$scope.mixDatabaseName}&mixDatabaseTitle=${$scope.mixDatabaseTitle}` + ); + }; + $scope.remove = function (data) { + $rootScope.showConfirm( + $scope, + "removeConfirmed", + [data.id], + null, + "Remove", + "Deleted data will not able to recover, are you sure you want to delete this item?" + ); + }; + + $scope.removeConfirmed = async function (dataContentId) { + $rootScope.isBusy = true; + var result = await mixDbService.delete([dataContentId]); + if (result.success) { + if ($scope.removeCallback) { + $rootScope.executeFunctionByName( + "removeCallback", + $scope.removeCallbackArgs, + $scope + ); + } + $scope.getList(); + } else { + $rootScope.showErrors(result.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + $scope.import = async function () { + if ($scope.validateDataFile()) { + $rootScope.isBusy = true; + var form = document.getElementById("form-portal"); + var result = await mixDbService.import( + form["import-data-inp"].files[0] + ); + if (result.success) { + $rootScope.showMessage("success", "success"); + $rootScope.isBusy = false; + $scope.getList(0); + } else { + $rootScope.showErrors(result.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + } + }; + $scope.validateDataFile = function () { + if (!$scope.importFile.file) { + $rootScope.showMessage("Please choose data file", "danger"); + return false; + } else { + return true; + } + }; + $scope.sendMail = function (data) { + var email = ""; + angular.forEach(data.values, function (e) { + if (e.mixDatabaseColumnName == "email") { + email = e.stringValue; + } + }); + $rootScope.showConfirm( + $scope, + "sendMailConfirmed", + [data], + null, + "Send mail", + "Are you sure to send mail to " + email + ); + }; + $scope.sendMailConfirmed = async function (data) { + $rootScope.isBusy = true; + $rootScope.isBusy = true; + var result = await service.sendMail([data.id]); + if (result.success) { + $rootScope.showMessage("success", "success"); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showErrors(result.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + $scope.saveOthers = async function () { + var response = await service.saveList($scope.others); + if (response.success) { + $scope.getList(); + $scope.$apply(); + } else { + $rootScope.showErrors(response.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + $scope.selectImportFile = function (files) { + if (files !== undefined && files !== null && files.length > 0) { + const file = files[0]; + $scope.importFile.folder = "imports"; + $scope.importFile.title = $scope.mixDatabaseName; + $scope.importFile.description = $scope.mixDatabaseName + "'s data"; + $scope.importFile.file = file; + + // if (ctrl.auto=='true') { + // ctrl.uploadFile(file); + // } + // else { + // ctrl.getBase64(file); + // } + } + }; + $scope.getList = async function (pageIndex) { + if (pageIndex !== undefined) { + $scope.request.pageIndex = pageIndex; + } + if ($scope.request.fromDate !== null) { + var df = new Date($scope.request.fromDate); + $scope.request.fromDate = df.toISOString(); + } + if ($scope.request.toDate !== null) { + var dt = new Date($scope.request.toDate); + $scope.request.toDate = dt.toISOString(); + } + $scope.request.queries = []; + + Object.keys($scope.queries).forEach((e) => { + if ($scope.queries[e]) { + $scope.request.queries.push({ + fieldName: e, + value: $scope.queries[e], + }); + } + }); + $rootScope.isBusy = true; + var resp = await mixDbService.filter($scope.request); + if (resp && resp.success) { + $scope.data = resp.data; + $.each($scope.data.items, function (i, data) { + $.each($scope.activeddata, function (i, e) { + if (e.dataContentId === data.id) { + data.isHidden = true; + } + }); + }); + if ($scope.getListSuccessCallback) { + $scope.getListSuccessCallback(); + } + $("html, body").animate( + { + scrollTop: "0px", + }, + 500 + ); + if (!resp.data || !resp.data.items.length) { + $scope.queries = {}; + } + $rootScope.isBusy = false; + $scope.$apply(); + } else { + if (resp) { + $rootScope.showErrors(resp.errors); + } + if ($scope.getListFailCallback) { + $scope.getListFailCallback(); + } + $scope.queries = {}; + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + $scope.export = async function (pageIndex, exportAll) { + if (pageIndex !== undefined) { + $scope.request.pageIndex = pageIndex; + } + if ($scope.request.fromDate !== null) { + var df = new Date($scope.request.fromDate); + $scope.request.fromDate = df.toISOString(); + } + if ($scope.request.toDate !== null) { + var dt = new Date($scope.request.toDate); + $scope.request.toDate = dt.toISOString(); + } + var query = {}; + if ($routeParams.mixDatabaseId) { + $scope.request.mixDatabaseId = $routeParams.mixDatabaseId; + } + $scope.request.mixDatabaseName = $routeParams.mixDatabaseName; + $scope.request.filterType = $routeParams.filterType || "contain"; + $scope.request.queries = []; + + Object.keys($scope.queries).forEach((e) => { + if ($scope.queries[e]) { + $scope.request.queries.push({ + fieldName: e, + value: $scope.queries[e], + }); + } + }); + var request = angular.copy($scope.request); + $scope.exportAll = $scope.exportAll; + if (exportAll) { + request.pageSize = 10000; + request.pageIndex = 0; + } + $rootScope.isBusy = true; + var resp = await mixDbService.export(request); + if (resp && resp.success) { + if (resp.data) { + window.top.location = resp.data.webPath; + } else { + $rootScope.showMessage("Nothing to export"); + } + $rootScope.isBusy = false; + $scope.$apply(); + } else { + if (resp) { + $rootScope.showErrors(resp.errors); + } + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + + $scope.migrate = async function () { + if ($routeParams.mixDatabaseId) { + $rootScope.isBusy = true; + var result = await service.migrate($routeParams.mixDatabaseId); + $scope.handleResult(result); + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + }, +]); + +"use strict"; +app.controller("MixDatabaseContextController", [ + "$scope", + "$rootScope", + "$location", + "ngAppSettings", + "$routeParams", + "RestMixDatabaseContextService", + function ( + $scope, + $rootScope, + $location, + ngAppSettings, + $routeParams, + mixdbContextService + ) { + BaseRestCtrl.call( + this, + $scope, + $rootScope, + $location, + $routeParams, + ngAppSettings, + mixdbContextService + ); + $scope.defaultAttr = null; + $scope.databaseProvider = ["MySQL", "PostgreSQL", "SQLITE", "SQLSERVER"]; + $scope.actions = ["Delete"]; + // $scope.request.selects = 'id,title,name,createdDateTime'; + $scope.orders = [ + { title: "Id", value: "Id" }, + { title: "Name", value: "DisplayName" }, + { title: "Created Date", value: "CreatedDateTime" }, + ]; + $scope.request.orderBy = "CreatedDateTime"; + $scope.request.columns = "id,displayName,systemName,type,createdDatetime"; + $scope.request.searchColumns = "displayName,systemName"; + $scope.saveDatabase = function () { + $scope.save($scope.viewmodel); + }; + $scope.generateName = function () { + $scope.viewmodel.systemName = $rootScope.generateKeyword( + $scope.viewmodel.displayName, + "_", + true, + true + ); + }; + $scope.getSingleSuccessCallback = async function () {}; + }, +]); + +"use strict"; +app.factory("RestMixDatabaseContextService", [ + "BaseRestService", + function (baseService) { + var serviceFactory = Object.create(baseService); + serviceFactory.init("mixdb-context"); + + var _getByName = async function (name) { + var url = `${this.prefixUrl}/get-by-name/${name}`; + var req = { + method: "GET", + url: url, + }; + return await this.getRestApiResult(req); + }; + serviceFactory.getByName = _getByName; + return serviceFactory; + }, +]); + +"use strict"; +app.controller("ModuleController", [ + "$scope", + "$rootScope", + "ngAppSettings", + "$location", + "$routeParams", + "ModuleRestService", + "SharedModuleDataService", + "RestMixDatabaseDataPortalService", + "RestMixDatabaseColumnPortalService", + function ( + $scope, + $rootScope, + ngAppSettings, + $location, + $routeParams, + moduleServices, + moduleDataService, + dataService, + columnService + ) { + BaseRestCtrl.call( + this, + $scope, + $rootScope, + $location, + $routeParams, + ngAppSettings, + moduleServices, + "product" + ); + $scope.request.culture = $rootScope.globalSettings.defaultCulture; + $scope.viewmodelType = "module"; + $scope.contentUrl = ""; + $scope.getSingleSuccessCallback = function () { + $scope.loadAdditionalData(); + + if ($scope.viewmodel.id > 0) { + // module => list post or list product + if ($scope.viewmodel.type.localeCompare("ListPost") == 0) { + $scope.contentUrl = "/admin/module-post/list/" + $scope.viewmodel.id; + } else if ($scope.viewmodel.type.localeCompare("Data") == 0) { + $scope.contentUrl = "/admin/module-data/list/" + $scope.viewmodel.id; + } + } + if ($scope.viewmodel.sysCategories) { + angular.forEach($scope.viewmodel.sysCategories, function (e) { + e.attributeData.obj.isActived = true; + }); + } + + if ($scope.viewmodel.sysTags) { + angular.forEach($scope.viewmodel.sysTags, function (e) { + e.attributeData.obj.isActived = true; + }); + } + + if ($routeParams.template) { + $scope.viewmodel.view = $rootScope.findObjectByKey( + $scope.viewmodel.templates, "fileName", $routeParams.template ); @@ -2907,160 +2907,36 @@ app.controller("ModuleDataController", [ } }; - $scope.getSingle = async function () { - $rootScope.isBusy = true; - var resp = await service.getSingle($routeParams.id, "portal"); - if (resp && resp.success) { - $scope.activedModuleData = resp.data; - $rootScope.initEditor(); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.remove = function (dataContentId) { - $rootScope.showConfirm( - $scope, - "removeConfirmed", - [dataContentId], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - - $scope.removeConfirmed = async function (dataContentId) { - $rootScope.isBusy = true; - var result = await service.delete([dataContentId]); - if (result.success) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName( - "removeCallback", - $scope.removeCallbackArgs, - $scope - ); - } - $scope.getList(); - } else { - $rootScope.showErrors(result.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - $scope.removeCallback = function () {}; - - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); - if (response.success) { - $scope.getList(); - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -"use strict"; -app.factory("ModuleDataRestService", [ - "BaseRestService", - "ApiService", - "CommonService", - function (baseService, apiService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("mix-module-data"); - // Define more service methods here - - var _initForm = async function (moduleContentId) { - var url = `${this.prefixUrl}/init-form/${moduleContentId}`; - var req = { - method: "GET", - url: url, - }; - return await apiService.sendRequest(req); - }; - serviceFactory.initForm = _initForm; - return serviceFactory; - }, -]); - -"use strict"; -app.controller("ModuleGalleryController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "ModuleGalleryService", - "ApiService", - "CommonService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - service, - apiService, - commonService - ) { - BaseCtrl.call( - this, - $scope, - $rootScope, - $routeParams, - ngAppSettings, - service - ); - $scope.cates = ["Site", "System"]; - $scope.others = []; - $scope.mixConfigurations = $rootScope.globalSettings; - $scope.moduleContentId = $routeParams.id; - $scope.canDrag = - $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - $scope.translate = $rootScope.translate; - $scope.moduleContentId = $routeParams.id; - $scope.getList = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.moduleContentId = $routeParams.id; - $scope.request.query = "&moduleContentId=" + id; - $scope.canDrag = - $scope.request.orderBy !== "Priority" || - $scope.request.direction !== "0"; - var response = await service.getList($scope.request); - if (response.success) { - $scope.data = response.data; + $scope.getSingle = async function () { + $rootScope.isBusy = true; + var resp = await service.getSingle($routeParams.id, "portal"); + if (resp && resp.success) { + $scope.activedModuleData = resp.data; + $rootScope.initEditor(); $rootScope.isBusy = false; $scope.$apply(); } else { - $rootScope.showErrors(response.errors); + if (resp) { + $rootScope.showErrors(resp.errors); + } $rootScope.isBusy = false; $scope.$apply(); } }; - $scope.remove = function (moduleContentId, postId) { + $scope.remove = function (dataContentId) { $rootScope.showConfirm( $scope, "removeConfirmed", - [moduleContentId, postId], + [dataContentId], null, "Remove", "Deleted data will not able to recover, are you sure you want to delete this item?" ); }; - $scope.removeConfirmed = async function (moduleContentId, postId) { + $scope.removeConfirmed = async function (dataContentId) { $rootScope.isBusy = true; - var result = await service.delete(moduleContentId, postId); + var result = await service.delete([dataContentId]); if (result.success) { if ($scope.removeCallback) { $rootScope.executeFunctionByName( @@ -3071,7 +2947,7 @@ app.controller("ModuleGalleryController", [ } $scope.getList(); } else { - $rootScope.showMessage("failed"); + $rootScope.showErrors(result.errors); $rootScope.isBusy = false; $scope.$apply(); } @@ -3090,69 +2966,40 @@ app.controller("ModuleGalleryController", [ $scope.$apply(); } }; - $scope.updateInfos = async function (index) { - $scope.data.items.splice(index, 1); - $rootScope.isBusy = true; - var startIndex = $scope.data.items[0].priority - 1; - for (var i = 0; i < $scope.data.items.length; i++) { - $scope.data.items[i].priority = startIndex + i + 1; - } - var resp = await service.updateInfos($scope.data.items); - if (resp && resp.success) { - $scope.activedPage = resp.data; - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }; }, ]); "use strict"; -app.factory("ModuleGalleryService", [ - "$rootScope", +app.factory("ModuleDataRestService", [ + "BaseRestService", "ApiService", "CommonService", - "BaseService", - function ($rootScope, apiService, commonService, baseService) { + function (baseService, apiService, commonService) { var serviceFactory = Object.create(baseService); - serviceFactory.init("module-post"); - var _delete = async function (moduleContentId, postId) { - var url = this.prefixUrl + "/delete/" + moduleContentId + "/" + postId; + serviceFactory.init("mix-module-data"); + // Define more service methods here + + var _initForm = async function (moduleContentId) { + var url = `${this.prefixUrl}/init-form/${moduleContentId}`; var req = { method: "GET", url: url, }; return await apiService.sendRequest(req); }; - var _updateInfos = async function (modules) { - var req = { - method: "POST", - url: this.prefixUrl + "/update-infos", - data: JSON.stringify(modules), - }; - return await apiService.sendRequest(req); - }; - serviceFactory.delete = _delete; - serviceFactory.updateInfos = _updateInfos; + serviceFactory.initForm = _initForm; return serviceFactory; }, ]); "use strict"; -app.controller("ModulePostController", [ +app.controller("ModuleGalleryController", [ "$scope", "$rootScope", "ngAppSettings", "$routeParams", "$location", - "ModulePostRestService", + "ModuleGalleryService", "ApiService", "CommonService", function ( @@ -3162,6 +3009,7 @@ app.controller("ModulePostController", [ $routeParams, $location, service, + apiService, commonService ) { BaseCtrl.call( @@ -3172,34 +3020,23 @@ app.controller("ModulePostController", [ ngAppSettings, service ); - $scope.request.culture = $rootScope.globalSettings.defaultCulture; $scope.cates = ["Site", "System"]; $scope.others = []; $scope.mixConfigurations = $rootScope.globalSettings; + $scope.moduleContentId = $routeParams.id; $scope.canDrag = $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; $scope.translate = $rootScope.translate; - $scope.moduleIds = $routeParams.moduleIds || $routeParams.id; - $scope.pageIds = $routeParams.page_ids; - $scope.type = $routeParams.type; - $scope.template = $routeParams.template || ""; - - $scope.init = function () { - $scope.createUrl = `/admin/post/create?page_ids=${$scope.pageIds}&moduleIds=${$scope.moduleIds}&type=${$scope.type}&template=${$scope.template}`; - $scope.getList(); - }; - $scope.getList = async function (pageIndex) { + $scope.moduleContentId = $routeParams.id; + $scope.getList = async function () { $rootScope.isBusy = true; - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } var id = $routeParams.id; $scope.moduleContentId = $routeParams.id; - $scope.request.parentId = id; + $scope.request.query = "&moduleContentId=" + id; $scope.canDrag = $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - var response = await service.search($scope.request); + var response = await service.getList($scope.request); if (response.success) { $scope.data = response.data; $rootScope.isBusy = false; @@ -3210,24 +3047,20 @@ app.controller("ModulePostController", [ $scope.$apply(); } }; - $scope.preview = function (item) { - item.editUrl = "/admin/post/details/" + item.id; - $rootScope.preview("post", item, item.title, "modal-lg"); - }; - $scope.remove = function (id) { + $scope.remove = function (moduleContentId, postId) { $rootScope.showConfirm( $scope, "removeConfirmed", - [id], + [moduleContentId, postId], null, "Remove", "Deleted data will not able to recover, are you sure you want to delete this item?" ); }; - $scope.removeConfirmed = async function (id) { + $scope.removeConfirmed = async function (moduleContentId, postId) { $rootScope.isBusy = true; - var result = await service.delete(id); + var result = await service.delete(moduleContentId, postId); if (result.success) { if ($scope.removeCallback) { $rootScope.executeFunctionByName( @@ -3282,37 +3115,20 @@ app.controller("ModulePostController", [ ]); "use strict"; -app.factory("ModulePostRestService", [ +app.factory("ModuleGalleryService", [ "$rootScope", "ApiService", "CommonService", - "BaseRestService", + "BaseService", function ($rootScope, apiService, commonService, baseService) { var serviceFactory = Object.create(baseService); serviceFactory.init("module-post"); - - var _search = async function (objData) { - var data = serviceFactory.parseQuery(objData); - var url = this.prefixUrl; - - if (data) { - url += "/search?"; - url = url.concat(data); - } + var _delete = async function (moduleContentId, postId) { + var url = this.prefixUrl + "/delete/" + moduleContentId + "/" + postId; var req = { - serviceBase: this.serviceBase, method: "GET", url: url, }; - return await this.getRestApiResult(req); - }; - - var _delete = async function (id) { - var url = this.prefixUrl + "/" + id; - var req = { - method: "DELETE", - url: url, - }; return await apiService.sendRequest(req); }; var _updateInfos = async function (modules) { @@ -3323,7 +3139,6 @@ app.factory("ModulePostRestService", [ }; return await apiService.sendRequest(req); }; - serviceFactory.search = _search; serviceFactory.delete = _delete; serviceFactory.updateInfos = _updateInfos; return serviceFactory; @@ -3331,102 +3146,13 @@ app.factory("ModulePostRestService", [ ]); "use strict"; -app.controller("OrderDetailController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$location", - "$routeParams", - "RestOrderDetailService", - function ( - $scope, - $rootScope, - ngAppSettings, - $location, - $routeParams, - service - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - BaseHub.call(this, $scope); - $scope.progress = 0; - $scope.viewMode = "list"; - $scope.current = null; - - $scope.canDrag = - $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - - $scope.init = async function () { - $scope.startConnection("mixEcommerceHub", null, (err) => { - console.log(err); - }); - $scope.onConnected = () => { - $scope.joinRoom("Admin"); - }; - await $scope.getThemes(); - }; - $scope.receiveMessage = function (resp) { - let msg = JSON.parse(resp); - switch (msg.action) { - case "Downloading": - var index = $scope.data.items.findIndex( - (m) => m.id == $scope.current.id - ); - var progress = Math.round(msg.message); - if (index >= 0) { - $scope.progress = progress; - if (progress == 100) { - $scope.installStatus = "Installing"; - } - $scope.$apply(); - } - break; - - default: - console.log(msg); - break; - } - }; - }, -]); - -"use strict"; -app.factory("RestOrderDetailService", [ - "BaseRestService", - function (baseService) { - var serviceFactory = Object.create(baseService); - serviceFactory.initService("/rest/ecommerce", "order-detail"); - var _updateOrderStatus = async function (id, objData) { - var url = `${this.prefixUrl}/update-order-status/${id}`; - var req = { - serviceBase: this.serviceBase, - method: "POST", - url: url, - data: JSON.stringify(objData), - }; - return await this.getRestApiResult(req); - }; - serviceFactory.updateOrderStatus = _updateOrderStatus; - return serviceFactory; - }, -]); - -"use strict"; -app.controller("PagePostController", [ +app.controller("ModulePostController", [ "$scope", "$rootScope", "ngAppSettings", "$routeParams", "$location", - "PagePostRestService", - "PostRestService", + "ModulePostRestService", "ApiService", "CommonService", function ( @@ -3436,7 +3162,6 @@ app.controller("PagePostController", [ $routeParams, $location, service, - postService, commonService ) { BaseCtrl.call( @@ -3451,35 +3176,30 @@ app.controller("PagePostController", [ $scope.cates = ["Site", "System"]; $scope.others = []; $scope.mixConfigurations = $rootScope.globalSettings; + $scope.canDrag = + $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; + $scope.translate = $rootScope.translate; + $scope.moduleIds = $routeParams.moduleIds || $routeParams.id; + $scope.pageIds = $routeParams.page_ids; + $scope.type = $routeParams.type; + $scope.template = $routeParams.template || ""; + $scope.init = function () { - $scope.pageId = $routeParams.id; - $scope.type = $routeParams.type || ""; - $scope.template = $routeParams.template || ""; - $scope.pageIds = $routeParams.page_ids || $routeParams.id || ""; - $scope.moduleIds = $routeParams.module_ids || ""; - $scope.canDrag = - $scope.request.orderBy === "Priority" && - $scope.request.direction === "Asc"; - $scope.createUrl = - $routeParams.post_type === "gallery" - ? "/admin/post/create-gallery" - : `/admin/post/create?page_ids=${$scope.pageIds}&moduleIds=${$scope.moduleIds}&type=${$scope.type}&template=${$scope.template}`; - $scope.updateUrl = - $routeParams.post_type === "gallery" - ? "/admin/post/gallery-details" - : "/admin/post/details"; + $scope.createUrl = `/admin/post/create?page_ids=${$scope.pageIds}&moduleIds=${$scope.moduleIds}&type=${$scope.type}&template=${$scope.template}`; + $scope.getList(); }; $scope.getList = async function (pageIndex) { + $rootScope.isBusy = true; if (pageIndex !== undefined) { $scope.request.pageIndex = pageIndex; } - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.request.query = "&page_id=" + id; - var response = await service.getList($scope.request); + var id = $routeParams.id; + $scope.moduleContentId = $routeParams.id; + $scope.request.parentId = id; $scope.canDrag = - $scope.request.orderBy === "Priority" && - $scope.request.direction === "Asc"; + $scope.request.orderBy !== "Priority" || + $scope.request.direction !== "0"; + var response = await service.search($scope.request); if (response.success) { $scope.data = response.data; $rootScope.isBusy = false; @@ -3494,19 +3214,16 @@ app.controller("PagePostController", [ item.editUrl = "/admin/post/details/" + item.id; $rootScope.preview("post", item, item.title, "modal-lg"); }; - $scope.remove = function (pageId, postId) { + $scope.remove = function (id) { $rootScope.showConfirm( $scope, "removeConfirmed", - [pageId, postId], + [id], null, "Remove", "Deleted data will not able to recover, are you sure you want to delete this item?" ); }; - $scope.back = function () { - window.history.back(); - }; $scope.removeConfirmed = async function (id) { $rootScope.isBusy = true; @@ -3521,12 +3238,14 @@ app.controller("PagePostController", [ } $scope.getList(); } else { - $rootScope.showErrors(result.errors); + $rootScope.showMessage("failed"); $rootScope.isBusy = false; $scope.$apply(); } }; + $scope.removeCallback = function () {}; + $scope.saveOthers = async function () { var response = await service.saveList($scope.others); if (response.success) { @@ -3563,30 +3282,48 @@ app.controller("PagePostController", [ ]); "use strict"; -app.factory("PagePostRestService", [ +app.factory("ModulePostRestService", [ "$rootScope", "ApiService", "CommonService", "BaseRestService", function ($rootScope, apiService, commonService, baseService) { var serviceFactory = Object.create(baseService); - serviceFactory.init("mix-page-post"); - var _delete = async function (id) { - var url = this.prefixUrl + "/delete/" + id; + serviceFactory.init("module-post"); + + var _search = async function (objData) { + var data = serviceFactory.parseQuery(objData); + var url = this.prefixUrl; + + if (data) { + url += "/search?"; + url = url.concat(data); + } var req = { + serviceBase: this.serviceBase, method: "GET", url: url, }; - return await apiService.getApiResult(req); + return await this.getRestApiResult(req); }; - var _updateInfos = async function (pages) { + + var _delete = async function (id) { + var url = this.prefixUrl + "/" + id; + var req = { + method: "DELETE", + url: url, + }; + return await apiService.sendRequest(req); + }; + var _updateInfos = async function (modules) { var req = { method: "POST", url: this.prefixUrl + "/update-infos", - data: JSON.stringify(pages), + data: JSON.stringify(modules), }; - return await apiService.getApiResult(req); + return await apiService.sendRequest(req); }; + serviceFactory.search = _search; serviceFactory.delete = _delete; serviceFactory.updateInfos = _updateInfos; return serviceFactory; @@ -3594,51 +3331,168 @@ app.factory("PagePostRestService", [ ]); "use strict"; -app.controller("PageGalleryController", [ +app.controller("OrderDetailController", [ "$scope", "$rootScope", "ngAppSettings", - "$routeParams", "$location", - "PageGalleryService", - "PostRestService", - "ApiService", - "CommonService", + "$routeParams", + "RestOrderDetailService", function ( $scope, $rootScope, ngAppSettings, + $location, $routeParams, + service + ) { + BaseRestCtrl.call( + this, + $scope, + $rootScope, + $location, + $routeParams, + ngAppSettings, + service + ); + BaseHub.call(this, $scope); + $scope.progress = 0; + $scope.viewMode = "list"; + $scope.current = null; + + $scope.canDrag = + $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; + + $scope.init = async function () { + $scope.startConnection("mixEcommerceHub", null, (err) => { + console.log(err); + }); + $scope.onConnected = () => { + $scope.joinRoom("Admin"); + }; + await $scope.getThemes(); + }; + $scope.receiveMessage = function (resp) { + let msg = JSON.parse(resp); + switch (msg.action) { + case "Downloading": + var index = $scope.data.items.findIndex( + (m) => m.id == $scope.current.id + ); + var progress = Math.round(msg.message); + if (index >= 0) { + $scope.progress = progress; + if (progress == 100) { + $scope.installStatus = "Installing"; + } + $scope.$apply(); + } + break; + + default: + console.log(msg); + break; + } + }; + }, +]); + +"use strict"; +app.factory("RestOrderDetailService", [ + "BaseRestService", + function (baseService) { + var serviceFactory = Object.create(baseService); + serviceFactory.initService("/rest/ecommerce", "order-detail"); + var _updateOrderStatus = async function (id, objData) { + var url = `${this.prefixUrl}/update-order-status/${id}`; + var req = { + serviceBase: this.serviceBase, + method: "POST", + url: url, + data: JSON.stringify(objData), + }; + return await this.getRestApiResult(req); + }; + serviceFactory.updateOrderStatus = _updateOrderStatus; + return serviceFactory; + }, +]); + +"use strict"; +app.controller("PageController", [ + "$scope", + "$rootScope", + "ngAppSettings", + "$location", + "$routeParams", + "PageRestService", + "PagePostRestService", + "UrlAliasService", + "RestMixDatabasePortalService", + "RestMixDatabaseDataPortalService", + "RestMixDatabaseColumnPortalService", + "MixDbService", + function ( + $scope, + $rootScope, + ngAppSettings, $location, + $routeParams, service, - postService, - apiService, - commonService + pagePostRestService, + urlAliasService, + databaseService, + dataService, + columnService, + mixDbService ) { - BaseCtrl.call( + BaseRestCtrl.call( this, $scope, $rootScope, + $location, $routeParams, ngAppSettings, service ); - $scope.cates = ["Site", "System"]; - $scope.others = []; - $scope.mixConfigurations = $rootScope.globalSettings; - $scope.pageId = $routeParams.id; + $scope.request.culture = $rootScope.globalSettings.defaultCulture; + var pageModuleService = $rootScope.getRestService("mix-page-module"); + $scope.viewmodelType = "page"; + $scope.request.query = "level=0"; + $scope.pageType = {}; + $scope.pageTypes = $rootScope.globalSettings.pageTypes; + $scope.selectedCategories = []; + $scope.selectedTags = []; + $scope.selectedModules = []; + $scope.pageData = { + posts: [], + products: [], + data: [], + }; + $scope.request.columns = [ + "id", + "title", + "createdDateTime", + "type", + "image", + ]; + $scope.additionalData = null; + $scope.temp = null; + $scope.postRequest = angular.copy(ngAppSettings.request); + $scope.additionalDatabaseRequest = angular.copy(ngAppSettings.request); + ($scope.additionalDatabaseRequest.searchColumns = "Type"), + ($scope.additionalDatabaseRequest.searchMethod = "Equal"), + ($scope.additionalDatabaseRequest.keyword = "AdditionalData"); $scope.canDrag = $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - $scope.getList = async function () { + $scope.loadPosts = async function () { $rootScope.isBusy = true; var id = $routeParams.id; - $scope.request.query = "&page_id=" + id; - var response = await service.getList($scope.request); - $scope.canDrag = - $scope.request.orderBy !== "Priority" || - $scope.request.direction !== "0"; + $scope.postRequest.query += "&page_id=" + id; + var response = await pagePostRestService.getList($scope.postRequest); + if (response.success) { - $scope.data = response.data; + $scope.pageData.posts = response.data; $rootScope.isBusy = false; $scope.$apply(); } else { @@ -3647,46 +3501,64 @@ app.controller("PageGalleryController", [ $scope.$apply(); } }; - $scope.remove = function (pageId, postId) { - $rootScope.showConfirm( - $scope, - "removeConfirmed", - [pageId, postId], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); + $scope.$watch("additionalDatabase", function (newValue, oldValue) { + console.log(newValue, oldValue); + }); + $scope.init = async function () { + await $scope.loadAdditionalDatabases(); + await $scope.getSingle(); }; - - $scope.removeConfirmed = async function (pageId, postId) { - $rootScope.isBusy = true; - var result = await service.delete(pageId, postId); - if (result.success) { - if ($scope.removeCallback) { - $rootScope.executeFunctionByName( - "removeCallback", - $scope.removeCallbackArgs, - $scope - ); - } - $scope.getList(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); + $scope.initList = function () { + $scope.additionalDatabases.splice(0, 0, { + systemName: "", + displayName: "All", + id: 0, + }); + $scope.getList(); + }; + $scope.getSingleSuccessCallback = function () { + mixDbService.initDbName($scope.viewmodel.mixDatabaseName); + $scope.additionalDatabase = $rootScope.findObjectByKey( + $scope.additionalDatabases, + "systemName", + $scope.viewmodel.mixDatabaseName + ); + if ($scope.additionalDatabase) { + $scope.loadAdditionalData(); + } + if ($routeParams.template) { + $scope.viewmodel.view = $rootScope.findObjectByKey( + $scope.viewmodel.templates, + "fileName", + $routeParams.template + ); } + $scope.$apply(); }; - - $scope.saveOthers = async function () { - var response = await service.saveList($scope.others); - if (response.success) { - $scope.getList(); - $scope.$apply(); + $scope.getListSuccessCallback = function () { + $scope.canDrag = + $scope.request.orderBy !== "Priority" || + $scope.request.direction !== "0"; + }; + $scope.loadAdditionalData = async function () { + $scope.loadingData = true; + const getData = await mixDbService.getSingleByParent( + "Page", + $scope.viewmodel.id + ); + if (getData.success) { + $scope.additionalData = getData.data; + $scope.loadingData = false; } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); + $scope.additionalData = { + parentType: "Page", + }; + $scope.loadingData = false; } + $scope.$apply(); + }; + $scope.showChilds = function (id) { + $("#childs-" + id).toggleClass("collapse"); }; $scope.updateInfos = async function (index) { $scope.data.items.splice(index, 1); @@ -3709,86 +3581,103 @@ app.controller("PageGalleryController", [ $scope.$apply(); } }; - }, -]); - -"use strict"; -app.factory("PageGalleryService", [ - "$rootScope", - "ApiService", - "CommonService", - "BaseService", - function ($rootScope, apiService, commonService, baseService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("page-post"); - var _delete = async function (pageId, postId) { - var url = this.prefixUrl + "/delete/" + pageId + "/" + postId; - var req = { - method: "GET", - url: url, - }; - return await apiService.sendRequest(req); + $scope.selPageType = function () { + $scope.request.query = "level=0&pageType=" + $scope.pageType; + $scope.getList(); }; - var _updateInfos = async function (pages) { - var req = { - method: "POST", - url: this.prefixUrl + "/update-infos", - data: JSON.stringify(pages), - }; - return await apiService.sendRequest(req); + $scope.selectModule = (associations) => { + if (associations) { + $scope.selectedModules = associations; + } + }; + $scope.goUp = async function (items, index) { + items[index].priority -= 1; + items[index - 1].priority += 1; }; - serviceFactory.delete = _delete; - serviceFactory.updateInfos = _updateInfos; - return serviceFactory; - }, -]); -"use strict"; -app.controller("PermissionController", [ - "$scope", - "$rootScope", - "ngAppSettings", - "$routeParams", - "$location", - "ApiService", - "CommonService", - "PermissionService", - "RestPortalPageNavigationService", - function ( - $scope, - $rootScope, - ngAppSettings, - $routeParams, - $location, - apiService, - commonService, - service, - navService - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.request.level = 0; - $scope.miOptions = ngAppSettings.miIcons; - $scope.initDialog = function () { - $("#dlg-permission").on("shown.bs.modal", function () { - $scope.initCurrentPath(); - }); + $scope.goDown = async function (items, index) { + items[index].priority += 1; + items[index - 1].priority -= 1; }; - $scope.initCurrentPath = async function () { - var resp = await service.getDefault(); - if (resp && resp.success) { + $scope.saveSuccessCallback = async function () { + var result = await $scope.savePageModules(); + result = result && (await $scope.saveAdditionalData()); + if (result) { + $rootScope.showMessage("Saved", "success"); + } + $rootScope.isBusy = false; + $scope.$apply(); + }; + $scope.loadAdditionalDatabases = async function () { + let getTypes = await databaseService.getList( + $scope.additionalDatabaseRequest + ); + if (getTypes.success) { + $scope.additionalDatabases = getTypes.data.items; + $scope.additionalDatabases.splice(0, 0, { + systemName: null, + displayName: "All", + id: 0, + }); + if ($scope.request.mixDatabaseName) { + $scope.additionalDatabase = $rootScope.findObjectByKey( + $scope.additionalDatabases, + "mixDatabaseName", + $scope.request.mixDatabaseName + ); + } + $scope.request.mixDatabaseName = $routeParams.type || ""; + $scope.$apply(); + } + }; + $scope.onSelectType = async function () { + if ( + $scope.viewmodel && + $scope.additionalDatabase && + $scope.additionalDatabase.systemName + ) { + $scope.viewmodel.mixDatabaseName = $scope.additionalDatabase.systemName; + mixDbService.initDbName($scope.viewmodel.mixDatabaseName); + await $scope.loadAdditionalData(); + } else { + $scope.viewmodel.mixDatabaseName = null; + $scope.additionalData = null; + } + $scope.request.mixDatabaseName = $scope.additionalDatabase.systemName; + $scope.createUrl = `/admin/page/create?type=${$scope.request.mixDatabaseName}`; + if ($routeParams.template) { + $scope.createUrl += `&template=${$routeParams.template}`; + } + if ( + $scope.additionalDatabase && + (!$scope.viewmodel || !$scope.viewmodel.id) + ) { + await $scope.getDefault($scope.request.mixDatabaseName); + } + if ($scope.pageName == "pageList") { + await $scope.filter(); + } + }; + $scope.getDefault = async function (type = null) { + $rootScope.isBusy = true; + type = type || $routeParams.type; + var resp = await service.getDefault({ + type: type || "", + template: $routeParams.template || "", + }); + if (resp.success) { $scope.viewmodel = resp.data; - $scope.viewmodel.url = $location.url(); + mixDbService.initDbName($scope.viewmodel.mixDatabaseName); + if ($scope.getSingleSuccessCallback) { + $scope.getSingleSuccessCallback(); + } + + // $scope.viewmodel.createdDateTime = Date.now(); + $scope.viewmodel.createdBy = $rootScope.authentication.username; + $rootScope.isBusy = false; - $scope.$applyAsync(); + $scope.$apply(); } else { if (resp) { $rootScope.showErrors(resp.errors); @@ -3800,59 +3689,78 @@ app.controller("PermissionController", [ $scope.$apply(); } }; - $scope.saveSuccessCallback = function () { - $scope.getSingle(); + $scope.saveAdditionalData = async () => { + if ($scope.additionalDatabase.systemName && $scope.additionalData) { + $scope.additionalData.isClone = $scope.viewmodel.isClone; + $scope.additionalData.cultures = $scope.viewmodel.cultures; + $scope.additionalData.intParentId = $scope.viewmodel.id; + $scope.additionalData.parentType = "Page"; + let result = await dataService.save($scope.additionalData); + if (!result.success) { + $rootScope.showErrors(result.errors); + } + return result.success; + } }; - - $scope.dragStart = function (index) { - $scope.minPriority = $scope.data.items[0].priority; - $scope.dragStartIndex = index; + $scope.savePageModules = async () => { + angular.forEach($scope.selectedModules, (e) => { + e.parentId = $scope.viewmodel.id; + }); + var result = await pageModuleService.saveMany($scope.selectedModules); + if (!result.success) { + $rootScope.showErrors(result.errors); + } + return result.success; }; - $scope.updateOrders = function (index) { - if (index > $scope.dragStartIndex) { - $scope.data.items.splice($scope.dragStartIndex, 1); - } else { - $scope.data.items.splice($scope.dragStartIndex + 1, 1); + $scope.saveColumns = async function () { + let result = await columnService.saveMany($scope.additionalData.columns); + if (result.success) { + $rootScope.showMessage("success", "success"); } - angular.forEach($scope.data.items, function (e, i) { - e.priority = $scope.minPriority + i; - service.saveFields(e.id, { priority: e.priority }).then((resp) => { - $rootScope.isBusy = false; - $scope.$apply(); - }); - }); }; - - $scope.updateChildInfos = async function (items) { - $rootScope.isBusy = true; - var resp = await service.updateChildInfos(items); - if (resp && resp.success) { - $scope.activedPage = resp.data; - $rootScope.showMessage("success", "success"); + + $scope.validate = async function () { + return true; + // Add default alias if create new page + // if (!$scope.viewmodel.id && !$scope.viewmodel.urlAliases.length) { + // // Ex: en-us/page-seo-name + // // await $scope.addAlias($scope.viewmodel.specificulture + '/' + $scope.viewmodel.seoName); + // return true; + // } else { + // return true; + // } + }; + $scope.addAlias = async function (alias) { + var getAlias = await urlAliasService.getDefault(); + if (getAlias.success) { + if (alias) { + getAlias.data.alias = alias; + } + $scope.viewmodel.urlAliases.push(getAlias.data); $rootScope.isBusy = false; $scope.$apply(); } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } + $rootScope.showErrors(getAlias.errors); $rootScope.isBusy = false; $scope.$apply(); } }; - $("#dlg-favorite").on("show.bs.modal", function (event) { - $scope.initCurrentPath(); - }); + $scope.removeAliasCallback = async function (index) { + $scope.viewmodel.urlAliases.splice(index, 1); + $scope.$apply(); + }; }, ]); "use strict"; -app.factory("PermissionService", [ - "BaseRestService", +app.factory("PageRestService", [ + "$rootScope", "ApiService", "CommonService", - function (baseService, apiService, commonService) { + "BaseRestService", + function ($rootScope, apiService, commonService, baseService) { var serviceFactory = Object.create(baseService); - serviceFactory.initService("/rest/mix-services", "permission", true); + serviceFactory.init("mix-page-content"); var _updateInfos = async function (pages) { var req = { method: "POST", @@ -3861,555 +3769,336 @@ app.factory("PermissionService", [ }; return await apiService.sendRequest(req); }; - - var _updateChildInfos = async function (pages) { - var req = { - method: "POST", - url: this.prefixUrl + "/update-child-infos", - data: JSON.stringify(pages), - }; - return await apiService.sendRequest(req); - }; - serviceFactory.updateInfos = _updateInfos; - serviceFactory.updateChildInfos = _updateChildInfos; - return serviceFactory; - }, -]); - -"use strict"; -app.factory("RestPortalPageNavigationService", [ - "BaseRestService", - "ApiService", - "CommonService", - function (baseService, apiService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.init("portal-page-navigation", true); - return serviceFactory; }, ]); "use strict"; -app.controller("PostController", [ +app.controller("PageGalleryController", [ "$scope", "$rootScope", - "$location", - "$filter", "ngAppSettings", "$routeParams", + "$location", + "PageGalleryService", "PostRestService", - "UrlAliasService", - "RestMixDatabaseDataPortalService", - "RestMixDatabaseColumnPortalService", - "RestRelatedAttributeDataPortalService", - "RestMixDatabasePortalService", - "MixDbService", + "ApiService", + "CommonService", function ( $scope, $rootScope, - $location, - $filter, ngAppSettings, $routeParams, + $location, service, - urlAliasService, - dataService, - columnService, - navService, - databaseService, - mixDbService + postService, + apiService, + commonService ) { - BaseRestCtrl.call( + BaseCtrl.call( this, $scope, $rootScope, - $location, $routeParams, ngAppSettings, service ); - if (!$scope.referrerUrl) { - $scope.referrerUrl = "/admin/post/list"; - } - $scope.request.searchColumns = "title"; - $scope.request.culture = $rootScope.globalSettings.defaultCulture; - $scope.request.queries = []; - $scope.request.metadataQueries = []; - $scope.defaultQuery = { - fieldName: "", - compareOperator: "Equal", - value: "", - }; - $scope.viewmodelType = "post"; - $scope.additionalData = {}; - $scope.createUrl = "/admin/post/create?"; - $scope.postTypeRequest = angular.copy(ngAppSettings.request); - ($scope.postTypeRequest.searchColumns = "Type"), - ($scope.postTypeRequest.searchMethod = "Equal"), - ($scope.postTypeRequest.keyword = "AdditionalData"); - - $scope.initList = async function () { - if ($routeParams.template) { - $scope.createUrl = `${$scope.createUrl}&template=${$routeParams.template}`; - } - if ($routeParams.category) { - $scope.request.category = $routeParams.category; - } - if ($routeParams.type) { - $scope.createUrl = `${$scope.createUrl}&type=${$routeParams.type}`; - $scope.request.additionalDatabase = $routeParams.type; - $scope.request.mixDatabaseName = $routeParams.type; - } - if ($routeParams.layout) { - $scope.createUrl = `${$scope.createUrl}&layout=${$routeParams.layout}`; - } - if ($routeParams.page_ids) { - $scope.createUrl = `${$scope.createUrl}&page_ids=${$routeParams.page_ids}`; - } - $scope.pageName = "postList"; - await $scope.loadAdditionalDatabases(); - $scope.filter(); - }; - - $scope.parseQueryField = function (fieldName, value, operator = "Equal") { - return { - fieldName: fieldName, - value: value, - compareOperator: operator, - }; - }; - $scope.syncProducts = async function () { - $rootScope.isBusy = true; - let names = $scope.data.items.map((m) => { - return m.title; - }); - await service.syncProducts(names); - $rootScope.isBusy = false; - }; - $scope.filter = async function (pageIndex) { + $scope.cates = ["Site", "System"]; + $scope.others = []; + $scope.mixConfigurations = $rootScope.globalSettings; + $scope.pageId = $routeParams.id; + $scope.canDrag = + $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; + $scope.getList = async function () { $rootScope.isBusy = true; - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var d = new Date($scope.request.fromDate); - $scope.request.fromDate = d.toISOString(); - } - if ($scope.request.toDate !== null) { - var dt = new Date($scope.request.toDate); - $scope.request.toDate = dt.toISOString(); - } - var resp = await service.filter($scope.request); - if (resp && resp.success) { - $scope.data = resp.data; - $.each($scope.data.items, function (i, data) { - $.each($scope.viewmodels, function (i, e) { - if (e.dataContentId === data.id) { - data.isHidden = true; - } - }); - }); - if ($scope.getListSuccessCallback) { - $scope.getListSuccessCallback(); - } - if ($scope.isScrollTop) { - $("html, body").animate({ scrollTop: "0px" }, 500); - } + var id = $routeParams.id; + $scope.request.query = "&page_id=" + id; + var response = await service.getList($scope.request); + $scope.canDrag = + $scope.request.orderBy !== "Priority" || + $scope.request.direction !== "0"; + if (response.success) { + $scope.data = response.data; $rootScope.isBusy = false; $scope.$apply(); } else { - if (resp) { - $rootScope.showErrors(resp.errors || ["Failed"]); - } - if ($scope.getListFailCallback) { - $scope.getListFailCallback(); - } + $rootScope.showErrors(response.errors); $rootScope.isBusy = false; $scope.$apply(); } }; - $scope.loadMetadataDatabase = async function () { - var getMixDatabase = await databaseService.getByName(["Metadata"]); - let typeCol = getMixDatabase.data.columns.find( - (c) => c.systemName == "type" + $scope.remove = function (pageId, postId) { + $rootScope.showConfirm( + $scope, + "removeConfirmed", + [pageId, postId], + null, + "Remove", + "Deleted data will not able to recover, are you sure you want to delete this item?" ); - $scope.lstMetadata = typeCol.columnConfigurations.allowedValues; - $scope.$apply(); - }; - $scope.loadAdditionalDatabases = async function () { - let getTypes = await databaseService.getList($scope.postTypeRequest); - if (getTypes.success) { - $scope.additionalDatabases = getTypes.data.items; - $scope.additionalDatabases.splice(0, 0, { - systemName: null, - displayName: "All", - id: 0, - }); - if ($scope.request.mixDatabaseName) { - $scope.additionalDatabase = $rootScope.findObjectByKey( - $scope.additionalDatabases, - "mixDatabaseName", - $scope.request.mixDatabaseName - ); - } - $scope.request.mixDatabaseName = $routeParams.type || ""; - $scope.$apply(); - } }; - $scope.getDefault = async function (type = null) { + + $scope.removeConfirmed = async function (pageId, postId) { $rootScope.isBusy = true; - type = type || $routeParams.type; - var resp = await service.getDefault({ - type: type || "", - template: $routeParams.template || "", - }); - if (resp.success) { - $scope.viewmodel = resp.data; - mixDbService.initDbName($scope.viewmodel.mixDatabaseName); - if ($scope.getSingleSuccessCallback) { - $scope.getSingleSuccessCallback(); + var result = await service.delete(pageId, postId); + if (result.success) { + if ($scope.removeCallback) { + $rootScope.executeFunctionByName( + "removeCallback", + $scope.removeCallbackArgs, + $scope + ); } - - // $scope.viewmodel.createdDateTime = Date.now(); - $scope.viewmodel.createdBy = $rootScope.authentication.username; - - $rootScope.isBusy = false; - $scope.$apply(); + $scope.getList(); } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - if ($scope.getSingleFailCallback) { - $scope.getSingleFailCallback(); - } + $rootScope.showMessage("failed"); $rootScope.isBusy = false; $scope.$apply(); } }; - $scope.preview = function (item) { - item.editUrl = "/admin/post/details/" + item.id; - $rootScope.preview("post", item, item.title, "modal-lg"); - }; - $scope.onSelectType = function () { - if ($scope.viewmodel) { - $scope.viewmodel.mixDatabaseName = $scope.additionalDatabase.systemName; - mixDbService.initDbName($scope.viewmodel.mixDatabaseName); - $scope.loadAdditionalData(); - } - $scope.request.additionalDatabase = - $scope.additionalDatabase.mixDatabaseName; - $scope.createUrl = `/admin/post/create?type=${$scope.request.additionalDatabase}`; - if ($routeParams.template) { - $scope.createUrl += `&template=${$routeParams.template}`; - } - if ( - $scope.additionalDatabase.mixDatabaseName && - (!$scope.viewmodel || !$scope.viewmodel.id) - ) { - $scope.getDefault($scope.request.additionalDatabase); - } - if ($scope.pageName == "postList") { - $scope.filter(); + + $scope.saveOthers = async function () { + var response = await service.saveList($scope.others); + if (response.success) { + $scope.getList(); + $scope.$apply(); + } else { + $rootScope.showErrors(response.errors); + $rootScope.isBusy = false; + $scope.$apply(); } }; - $scope.getListRelated = async function (pageIndex) { - if (pageIndex !== undefined) { - $scope.request.pageIndex = pageIndex; - } - if ($scope.request.fromDate !== null) { - var d = new Date($scope.request.fromDate); - $scope.request.fromDate = d.toISOString(); - } - if ($scope.request.toDate !== null) { - var d = new Date($scope.request.toDate); - $scope.request.toDate = d.toISOString(); + $scope.updateInfos = async function (index) { + $scope.data.items.splice(index, 1); + $rootScope.isBusy = true; + var startIndex = $scope.data.items[0].priority - 1; + for (var i = 0; i < $scope.data.items.length; i++) { + $scope.data.items[i].priority = startIndex + i + 1; } - var resp = await service.filter($scope.request); + var resp = await service.updateInfos($scope.data.items); if (resp && resp.success) { - $scope.relatedData = angular.copy(resp.data); - $scope.relatedData.items = []; - angular.forEach(resp.data.items, (element) => { - let isActive = - null != - $scope.viewmodel.postNavs.find( - (p) => p.destinationId == element.id - ); - if (!isActive) { - var obj = { - description: element.title, - destinationId: element.id, - image: element.image, - isActived: isActive, - sourceId: $scope.viewmodel.id, - specificulture: $scope.viewmodel.specificulture, - status: "Published", - }; - result.push(obj); - } - }); - resp.data.items = result; + $scope.activedPage = resp.data; + $rootScope.showMessage("success", "success"); $rootScope.isBusy = false; $scope.$apply(); - return resp.data; } else { - $rootScope.showErrors(getData.errors); + if (resp) { + $rootScope.showErrors(resp.errors); + } $rootScope.isBusy = false; $scope.$apply(); } }; - $scope.saveFailCallback = function () { - angular.forEach($scope.viewmodel.mixDatabaseNavs, function (nav) { - if (nav.isActived) { - $rootScope.decryptMixDatabase( - nav.mixDatabase.attributes, - nav.mixDatabase.postData.items - ); - } - }); + }, +]); + +"use strict"; +app.factory("PageGalleryService", [ + "$rootScope", + "ApiService", + "CommonService", + "BaseService", + function ($rootScope, apiService, commonService, baseService) { + var serviceFactory = Object.create(baseService); + serviceFactory.init("page-post"); + var _delete = async function (pageId, postId) { + var url = this.prefixUrl + "/delete/" + pageId + "/" + postId; + var req = { + method: "GET", + url: url, + }; + return await apiService.sendRequest(req); }; - $scope.saveSuccessCallback = async function () { - if ($scope.additionalData && $scope.viewmodel.mixDatabaseName) { - var creating = !$scope.additionalData.parentId; - $scope.additionalData.parentType = "Post"; - $scope.additionalData.parentId = $scope.viewmodel.id; - mixDbService.initDbName($scope.viewmodel.mixDatabaseName); - var saveResult = await mixDbService.save($scope.additionalData); - if (saveResult.success) { - $rootScope.showMessage("Additional Data Saved", "success"); - $scope.additionalData = saveResult.data; - if (creating) { - $location.url(`/admin/post/details/${$scope.viewmodel.id}`); - } - } else { - $rootScope.showErrors(result.errors); - } - // $scope.additionalData.isClone = $scope.viewmodel.isClone; - // $scope.additionalData.cultures = $scope.viewmodel.cultures; - // $scope.additionalData.intParentId = $scope.viewmodel.id; - // $scope.additionalData.parentType = "Post"; - // let result = await dataService.save($scope.additionalData); - // if (!result.success) { - // $rootScope.showErrors(result.errors); - // } else { - // $scope.additionalData = result.data; - // // $scope.saveColumns(); - // } - } - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); + var _updateInfos = async function (pages) { + var req = { + method: "POST", + url: this.prefixUrl + "/update-infos", + data: JSON.stringify(pages), + }; + return await apiService.sendRequest(req); }; + serviceFactory.delete = _delete; + serviceFactory.updateInfos = _updateInfos; + return serviceFactory; + }, +]); - $scope.saveColumns = async function () { - let result = await columnService.saveMany($scope.additionalData.columns); - if (result.success) { - $rootScope.showMessage("success", "success"); - } +"use strict"; +app.controller("PermissionController", [ + "$scope", + "$rootScope", + "ngAppSettings", + "$routeParams", + "$location", + "ApiService", + "CommonService", + "PermissionService", + "RestPortalPageNavigationService", + function ( + $scope, + $rootScope, + ngAppSettings, + $routeParams, + $location, + apiService, + commonService, + service, + navService + ) { + BaseRestCtrl.call( + this, + $scope, + $rootScope, + $location, + $routeParams, + ngAppSettings, + service + ); + $scope.request.level = 0; + $scope.miOptions = ngAppSettings.miIcons; + $scope.initDialog = function () { + $("#dlg-permission").on("shown.bs.modal", function () { + $scope.initCurrentPath(); + }); }; - $scope.getSingleSuccessCallback = async function () { - if (!$scope.viewmodel.id) { - $scope.viewmodel.mixDatabaseName = $routeParams.type; - } - mixDbService.initDbName($scope.viewmodel.mixDatabaseName); - await $scope.loadMetadataDatabase(); - // $scope.defaultThumbnailImgWidth = - // ngAppSettings.mixConfigurations.DefaultThumbnailImgWidth; - // $scope.defaultThumbnailImgHeight = - // ngAppSettings.mixConfigurations.DefaultThumbnailImgHeight; - // $scope.defaultFeatureImgWidth = - // ngAppSettings.mixConfigurations.DefaultFeatureImgWidth; - // $scope.defaultFeatureImgHeight = - // ngAppSettings.mixConfigurations.DefaultFeatureImgHeight; - $scope.request.additionalDatabase = $scope.viewmodel.mixDatabaseName; - var moduleIds = $routeParams.moduleIds; - var pageIds = $routeParams.page_ids; - $scope.additionalDatabase = $rootScope.findObjectByKey( - $scope.additionalDatabases, - "systemName", - $scope.request.additionalDatabase - ); - $scope.loadAdditionalData(); - if (moduleIds) { - for (var moduleContentId of moduleIds.split(",")) { - var moduleNav = $rootScope.findObjectByKey( - $scope.viewmodel.modules, - "moduleContentId", - moduleContentId - ); - if (moduleNav) { - moduleNav.isActived = true; - } - } - } - if (pageIds) { - for (var pageId of pageIds.split(",")) { - var pageNav = $rootScope.findObjectByKey( - $scope.viewmodel.pages, - "pageId", - pageId - ); - if (pageNav) { - pageNav.isActived = true; - } + $scope.initCurrentPath = async function () { + var resp = await service.getDefault(); + if (resp && resp.success) { + $scope.viewmodel = resp.data; + $scope.viewmodel.url = $location.url(); + $rootScope.isBusy = false; + $scope.$applyAsync(); + } else { + if (resp) { + $rootScope.showErrors(resp.errors); } - } - }; - $scope.loadAdditionalData = async function () { - if ($scope.viewmodel.mixDatabaseName) { - $scope.loadingData = true; - mixDbService.initDbName($scope.viewmodel.mixDatabaseName); - if ($scope.viewmodel.id) { - const getData = await mixDbService.getSingleByParent( - "Post", - $scope.viewmodel.id - ); - if (getData.success) { - $scope.additionalData = getData.data; - $scope.loadingData = false; - } - $scope.$apply(); - } else { - $scope.additionalData = { - parentType: "Post", - }; - $scope.loadingData = false; + if ($scope.getSingleFailCallback) { + $scope.getSingleFailCallback(); } + $rootScope.isBusy = false; + $scope.$apply(); } }; - $scope.generateSeo = function () { - if ($scope.viewmodel) { - if ( - $scope.viewmodel.seoName === null || - $scope.viewmodel.seoName === "" - ) { - $scope.viewmodel.seoName = $rootScope.generateKeyword( - $scope.viewmodel.title, - "-" - ); - if ($scope.viewmodel.seoName.length > 50) { - $scope.viewmodel.seoName = - $scope.viewmodel.seoName.substring(0, 80) + "..."; - } - } - if ( - $scope.viewmodel.seoTitle === null || - $scope.viewmodel.seoTitle === "" - ) { - $scope.viewmodel.seoTitle = $scope.viewmodel.title; - } - if ( - $scope.viewmodel.seoDescription === null || - $scope.viewmodel.seoDescription === "" - ) { - $scope.viewmodel.seoDescription = $scope.viewmodel.excerpt; - } - if ( - $scope.viewmodel.seoKeywords === null || - $scope.viewmodel.seoKeywords === "" - ) { - $scope.viewmodel.seoKeywords = $scope.viewmodel.title; - } + $scope.saveSuccessCallback = function () { + $scope.getSingle(); + }; + + $scope.dragStart = function (index) { + $scope.minPriority = $scope.data.items[0].priority; + $scope.dragStartIndex = index; + }; + $scope.updateOrders = function (index) { + if (index > $scope.dragStartIndex) { + $scope.data.items.splice($scope.dragStartIndex, 1); + } else { + $scope.data.items.splice($scope.dragStartIndex + 1, 1); } + angular.forEach($scope.data.items, function (e, i) { + e.priority = $scope.minPriority + i; + service.saveFields(e.id, { priority: e.priority }).then((resp) => { + $rootScope.isBusy = false; + $scope.$apply(); + }); + }); }; - $scope.addAlias = async function () { - var getAlias = await urlAliasService.getDefault(); - if (getAlias.success) { - $scope.viewmodel.urlAliases.push(getAlias.data); + + $scope.updateChildInfos = async function (items) { + $rootScope.isBusy = true; + var resp = await service.updateChildInfos(items); + if (resp && resp.success) { + $scope.activedPage = resp.data; + $rootScope.showMessage("success", "success"); $rootScope.isBusy = false; $scope.$apply(); } else { - $rootScope.showErrors(getAlias.errors); + if (resp) { + $rootScope.showErrors(resp.errors); + } $rootScope.isBusy = false; $scope.$apply(); } }; - $scope.removeAliasCallback = async function (index) { - $scope.viewmodel.urlAliases.splice(index, 1); - $scope.$apply(); - }; - - $scope.validate = function () { - angular.forEach($scope.viewmodel.mixDatabaseNavs, function (nav) { - if (nav.isActived) { - $rootScope.encryptMixDatabase( - nav.mixDatabase.attributes, - nav.mixDatabase.postData.items - ); - } - }); - return true; - }; + $("#dlg-favorite").on("show.bs.modal", function (event) { + $scope.initCurrentPath(); + }); }, ]); "use strict"; -app.factory("PostRestService", [ +app.factory("PermissionService", [ "BaseRestService", "ApiService", - function (baseService, apiService) { + "CommonService", + function (baseService, apiService, commonService) { var serviceFactory = Object.create(baseService); - serviceFactory.init("mix-post-content"); - var _syncProducts = async function (names) { - var url = `/api/daphale/sync/products`; + serviceFactory.initService("/rest/mix-services", "permission", true); + var _updateInfos = async function (pages) { var req = { - serviceBase: "", method: "POST", - url: url, - data: { - batch: 50, - isScaleImage: true, - isSyncPrice: true, - isSyncAll: false, - productNames: names, - }, + url: this.prefixUrl + "/update-infos", + data: JSON.stringify(pages), }; - return await apiService.sendPureRequest(req); + return await apiService.sendRequest(req); }; - var _filter = async function (request) { - var url = `${this.prefixUrl}/filter`; + + var _updateChildInfos = async function (pages) { var req = { - serviceBase: this.serviceBase, method: "POST", - url: url, - data: request, + url: this.prefixUrl + "/update-child-infos", + data: JSON.stringify(pages), }; - return await this.getRestApiResult(req); + return await apiService.sendRequest(req); }; - // Define more service methods here - serviceFactory.filter = _filter; - serviceFactory.syncProducts = _syncProducts; + + serviceFactory.updateInfos = _updateInfos; + serviceFactory.updateChildInfos = _updateChildInfos; return serviceFactory; }, ]); "use strict"; -app.controller("PageController", [ +app.factory("RestPortalPageNavigationService", [ + "BaseRestService", + "ApiService", + "CommonService", + function (baseService, apiService, commonService) { + var serviceFactory = Object.create(baseService); + serviceFactory.init("portal-page-navigation", true); + + return serviceFactory; + }, +]); + +"use strict"; +app.controller("PostController", [ "$scope", "$rootScope", - "ngAppSettings", "$location", + "$filter", + "ngAppSettings", "$routeParams", - "PageRestService", - "PagePostRestService", + "PostRestService", "UrlAliasService", - "RestMixDatabasePortalService", "RestMixDatabaseDataPortalService", "RestMixDatabaseColumnPortalService", + "RestRelatedAttributeDataPortalService", + "RestMixDatabasePortalService", "MixDbService", function ( $scope, $rootScope, - ngAppSettings, $location, + $filter, + ngAppSettings, $routeParams, service, - pagePostRestService, urlAliasService, - databaseService, dataService, columnService, + navService, + databaseService, mixDbService ) { BaseRestCtrl.call( @@ -4421,164 +4110,116 @@ app.controller("PageController", [ ngAppSettings, service ); + if (!$scope.referrerUrl) { + $scope.referrerUrl = "/admin/post/list"; + } + $scope.request.searchColumns = "title"; $scope.request.culture = $rootScope.globalSettings.defaultCulture; - var pageModuleService = $rootScope.getRestService("mix-page-module"); - $scope.viewmodelType = "page"; - $scope.request.query = "level=0"; - $scope.pageType = {}; - $scope.pageTypes = $rootScope.globalSettings.pageTypes; - $scope.selectedCategories = []; - $scope.selectedTags = []; - $scope.selectedModules = []; - $scope.pageData = { - posts: [], - products: [], - data: [], - }; - $scope.request.columns = [ - "id", - "title", - "createdDateTime", - "type", - "image", - ]; - $scope.additionalData = null; - $scope.temp = null; - $scope.postRequest = angular.copy(ngAppSettings.request); - $scope.additionalDatabaseRequest = angular.copy(ngAppSettings.request); - ($scope.additionalDatabaseRequest.searchColumns = "Type"), - ($scope.additionalDatabaseRequest.searchMethod = "Equal"), - ($scope.additionalDatabaseRequest.keyword = "AdditionalData"); - $scope.canDrag = - $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - $scope.loadPosts = async function () { - $rootScope.isBusy = true; - var id = $routeParams.id; - $scope.postRequest.query += "&page_id=" + id; - var response = await pagePostRestService.getList($scope.postRequest); - - if (response.success) { - $scope.pageData.posts = response.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - $scope.$watch("additionalDatabase", function (newValue, oldValue) { - console.log(newValue, oldValue); - }); - $scope.init = async function () { - await $scope.loadAdditionalDatabases(); - await $scope.getSingle(); - }; - $scope.initList = function () { - $scope.additionalDatabases.splice(0, 0, { - systemName: "", - displayName: "All", - id: 0, - }); - $scope.getList(); + $scope.request.queries = []; + $scope.request.metadataQueries = []; + $scope.defaultQuery = { + fieldName: "", + compareOperator: "Equal", + value: "", }; - $scope.getSingleSuccessCallback = function () { - mixDbService.initDbName($scope.viewmodel.mixDatabaseName); - $scope.additionalDatabase = $rootScope.findObjectByKey( - $scope.additionalDatabases, - "systemName", - $scope.viewmodel.mixDatabaseName - ); - if ($scope.additionalDatabase) { - $scope.loadAdditionalData(); - } + $scope.viewmodelType = "post"; + $scope.additionalData = {}; + $scope.createUrl = "/admin/post/create?"; + $scope.postTypeRequest = angular.copy(ngAppSettings.request); + ($scope.postTypeRequest.searchColumns = "Type"), + ($scope.postTypeRequest.searchMethod = "Equal"), + ($scope.postTypeRequest.keyword = "AdditionalData"); + + $scope.initList = async function () { if ($routeParams.template) { - $scope.viewmodel.view = $rootScope.findObjectByKey( - $scope.viewmodel.templates, - "fileName", - $routeParams.template - ); + $scope.createUrl = `${$scope.createUrl}&template=${$routeParams.template}`; } - $scope.$apply(); - }; - $scope.getListSuccessCallback = function () { - $scope.canDrag = - $scope.request.orderBy !== "Priority" || - $scope.request.direction !== "0"; - }; - $scope.loadAdditionalData = async function () { - $scope.loadingData = true; - const getData = await mixDbService.getSingleByParent( - "Page", - $scope.viewmodel.id - ); - if (getData.success) { - $scope.additionalData = getData.data; - $scope.loadingData = false; - } else { - $scope.additionalData = { - parentType: "Page", - }; - $scope.loadingData = false; + if ($routeParams.category) { + $scope.request.category = $routeParams.category; } - $scope.$apply(); + if ($routeParams.type) { + $scope.createUrl = `${$scope.createUrl}&type=${$routeParams.type}`; + $scope.request.additionalDatabase = $routeParams.type; + $scope.request.mixDatabaseName = $routeParams.type; + } + if ($routeParams.layout) { + $scope.createUrl = `${$scope.createUrl}&layout=${$routeParams.layout}`; + } + if ($routeParams.page_ids) { + $scope.createUrl = `${$scope.createUrl}&page_ids=${$routeParams.page_ids}`; + } + $scope.pageName = "postList"; + await $scope.loadAdditionalDatabases(); + $scope.filter(); }; - $scope.showChilds = function (id) { - $("#childs-" + id).toggleClass("collapse"); + + $scope.parseQueryField = function (fieldName, value, operator = "Equal") { + return { + fieldName: fieldName, + value: value, + compareOperator: operator, + }; }; - $scope.updateInfos = async function (index) { - $scope.data.items.splice(index, 1); + $scope.syncProducts = async function () { $rootScope.isBusy = true; - var startIndex = $scope.data.items[0].priority - 1; - for (var i = 0; i < $scope.data.items.length; i++) { - $scope.data.items[i].priority = startIndex + i + 1; + let names = $scope.data.items.map((m) => { + return m.title; + }); + await service.syncProducts(names); + $rootScope.isBusy = false; + }; + $scope.filter = async function (pageIndex) { + $rootScope.isBusy = true; + if (pageIndex !== undefined) { + $scope.request.pageIndex = pageIndex; } - var resp = await service.updateInfos($scope.data.items); + if ($scope.request.fromDate !== null) { + var d = new Date($scope.request.fromDate); + $scope.request.fromDate = d.toISOString(); + } + if ($scope.request.toDate !== null) { + var dt = new Date($scope.request.toDate); + $scope.request.toDate = dt.toISOString(); + } + var resp = await service.filter($scope.request); if (resp && resp.success) { - $scope.activedPage = resp.data; - $rootScope.showMessage("success", "success"); + $scope.data = resp.data; + $.each($scope.data.items, function (i, data) { + $.each($scope.viewmodels, function (i, e) { + if (e.dataContentId === data.id) { + data.isHidden = true; + } + }); + }); + if ($scope.getListSuccessCallback) { + $scope.getListSuccessCallback(); + } + if ($scope.isScrollTop) { + $("html, body").animate({ scrollTop: "0px" }, 500); + } $rootScope.isBusy = false; $scope.$apply(); } else { if (resp) { - $rootScope.showErrors(resp.errors); + $rootScope.showErrors(resp.errors || ["Failed"]); + } + if ($scope.getListFailCallback) { + $scope.getListFailCallback(); } $rootScope.isBusy = false; $scope.$apply(); } }; - $scope.selPageType = function () { - $scope.request.query = "level=0&pageType=" + $scope.pageType; - $scope.getList(); - }; - $scope.selectModule = (associations) => { - if (associations) { - $scope.selectedModules = associations; - } - }; - $scope.goUp = async function (items, index) { - items[index].priority -= 1; - items[index - 1].priority += 1; - }; - - $scope.goDown = async function (items, index) { - items[index].priority += 1; - items[index - 1].priority -= 1; - }; - - $scope.saveSuccessCallback = async function () { - var result = await $scope.savePageModules(); - result = result && (await $scope.saveAdditionalData()); - if (result) { - $rootScope.showMessage("Saved", "success"); - } - $rootScope.isBusy = false; + $scope.loadMetadataDatabase = async function () { + var getMixDatabase = await databaseService.getByName(["Metadata"]); + let typeCol = getMixDatabase.data.columns.find( + (c) => c.systemName == "type" + ); + $scope.lstMetadata = typeCol.columnConfigurations.allowedValues; $scope.$apply(); }; $scope.loadAdditionalDatabases = async function () { - let getTypes = await databaseService.getList( - $scope.additionalDatabaseRequest - ); + let getTypes = await databaseService.getList($scope.postTypeRequest); if (getTypes.success) { $scope.additionalDatabases = getTypes.data.items; $scope.additionalDatabases.splice(0, 0, { @@ -4597,34 +4238,6 @@ app.controller("PageController", [ $scope.$apply(); } }; - $scope.onSelectType = async function () { - if ( - $scope.viewmodel && - $scope.additionalDatabase && - $scope.additionalDatabase.systemName - ) { - $scope.viewmodel.mixDatabaseName = $scope.additionalDatabase.systemName; - mixDbService.initDbName($scope.viewmodel.mixDatabaseName); - await $scope.loadAdditionalData(); - } else { - $scope.viewmodel.mixDatabaseName = null; - $scope.additionalData = null; - } - $scope.request.mixDatabaseName = $scope.additionalDatabase.systemName; - $scope.createUrl = `/admin/page/create?type=${$scope.request.mixDatabaseName}`; - if ($routeParams.template) { - $scope.createUrl += `&template=${$routeParams.template}`; - } - if ( - $scope.additionalDatabase && - (!$scope.viewmodel || !$scope.viewmodel.id) - ) { - await $scope.getDefault($scope.request.mixDatabaseName); - } - if ($scope.pageName == "pageList") { - await $scope.filter(); - } - }; $scope.getDefault = async function (type = null) { $rootScope.isBusy = true; type = type || $routeParams.type; @@ -4645,63 +4258,245 @@ app.controller("PageController", [ $rootScope.isBusy = false; $scope.$apply(); } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - if ($scope.getSingleFailCallback) { - $scope.getSingleFailCallback(); - } + if (resp) { + $rootScope.showErrors(resp.errors); + } + if ($scope.getSingleFailCallback) { + $scope.getSingleFailCallback(); + } + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + $scope.preview = function (item) { + item.editUrl = "/admin/post/details/" + item.id; + $rootScope.preview("post", item, item.title, "modal-lg"); + }; + $scope.onSelectType = function () { + if ($scope.viewmodel) { + $scope.viewmodel.mixDatabaseName = $scope.additionalDatabase.systemName; + mixDbService.initDbName($scope.viewmodel.mixDatabaseName); + $scope.loadAdditionalData(); + } + $scope.request.additionalDatabase = + $scope.additionalDatabase.mixDatabaseName; + $scope.createUrl = `/admin/post/create?type=${$scope.request.additionalDatabase}`; + if ($routeParams.template) { + $scope.createUrl += `&template=${$routeParams.template}`; + } + if ( + $scope.additionalDatabase.mixDatabaseName && + (!$scope.viewmodel || !$scope.viewmodel.id) + ) { + $scope.getDefault($scope.request.additionalDatabase); + } + if ($scope.pageName == "postList") { + $scope.filter(); + } + }; + $scope.getListRelated = async function (pageIndex) { + if (pageIndex !== undefined) { + $scope.request.pageIndex = pageIndex; + } + if ($scope.request.fromDate !== null) { + var d = new Date($scope.request.fromDate); + $scope.request.fromDate = d.toISOString(); + } + if ($scope.request.toDate !== null) { + var d = new Date($scope.request.toDate); + $scope.request.toDate = d.toISOString(); + } + var resp = await service.filter($scope.request); + if (resp && resp.success) { + $scope.relatedData = angular.copy(resp.data); + $scope.relatedData.items = []; + angular.forEach(resp.data.items, (element) => { + let isActive = + null != + $scope.viewmodel.postNavs.find( + (p) => p.destinationId == element.id + ); + if (!isActive) { + var obj = { + description: element.title, + destinationId: element.id, + image: element.image, + isActived: isActive, + sourceId: $scope.viewmodel.id, + specificulture: $scope.viewmodel.specificulture, + status: "Published", + }; + result.push(obj); + } + }); + resp.data.items = result; + $rootScope.isBusy = false; + $scope.$apply(); + return resp.data; + } else { + $rootScope.showErrors(getData.errors); $rootScope.isBusy = false; $scope.$apply(); } }; - $scope.saveAdditionalData = async () => { - if ($scope.additionalDatabase.systemName && $scope.additionalData) { - $scope.additionalData.isClone = $scope.viewmodel.isClone; - $scope.additionalData.cultures = $scope.viewmodel.cultures; - $scope.additionalData.intParentId = $scope.viewmodel.id; - $scope.additionalData.parentType = "Page"; - let result = await dataService.save($scope.additionalData); - if (!result.success) { - $rootScope.showErrors(result.errors); + $scope.saveFailCallback = function () { + angular.forEach($scope.viewmodel.mixDatabaseNavs, function (nav) { + if (nav.isActived) { + $rootScope.decryptMixDatabase( + nav.mixDatabase.attributes, + nav.mixDatabase.postData.items + ); } - return result.success; - } - }; - $scope.savePageModules = async () => { - angular.forEach($scope.selectedModules, (e) => { - e.parentId = $scope.viewmodel.id; }); - var result = await pageModuleService.saveMany($scope.selectedModules); - if (!result.success) { - $rootScope.showErrors(result.errors); + }; + $scope.saveSuccessCallback = async function () { + if ($scope.additionalData && $scope.viewmodel.mixDatabaseName) { + var creating = !$scope.additionalData.parentId; + $scope.additionalData.parentType = "Post"; + $scope.additionalData.parentId = $scope.viewmodel.id; + mixDbService.initDbName($scope.viewmodel.mixDatabaseName); + var saveResult = await mixDbService.save($scope.additionalData); + if (saveResult.success) { + $rootScope.showMessage("Additional Data Saved", "success"); + $scope.additionalData = saveResult.data; + if (creating) { + $location.url(`/admin/post/details/${$scope.viewmodel.id}`); + } + } else { + $rootScope.showErrors(result.errors); + } + // $scope.additionalData.isClone = $scope.viewmodel.isClone; + // $scope.additionalData.cultures = $scope.viewmodel.cultures; + // $scope.additionalData.intParentId = $scope.viewmodel.id; + // $scope.additionalData.parentType = "Post"; + // let result = await dataService.save($scope.additionalData); + // if (!result.success) { + // $rootScope.showErrors(result.errors); + // } else { + // $scope.additionalData = result.data; + // // $scope.saveColumns(); + // } } - return result.success; + $rootScope.showMessage("success", "success"); + $rootScope.isBusy = false; + $scope.$apply(); }; + $scope.saveColumns = async function () { let result = await columnService.saveMany($scope.additionalData.columns); if (result.success) { $rootScope.showMessage("success", "success"); } }; + $scope.getSingleSuccessCallback = async function () { + if (!$scope.viewmodel.id) { + $scope.viewmodel.mixDatabaseName = $routeParams.type; + } + mixDbService.initDbName($scope.viewmodel.mixDatabaseName); + await $scope.loadMetadataDatabase(); + // $scope.defaultThumbnailImgWidth = + // ngAppSettings.mixConfigurations.DefaultThumbnailImgWidth; + // $scope.defaultThumbnailImgHeight = + // ngAppSettings.mixConfigurations.DefaultThumbnailImgHeight; - $scope.validate = async function () { - return true; - // Add default alias if create new page - // if (!$scope.viewmodel.id && !$scope.viewmodel.urlAliases.length) { - // // Ex: en-us/page-seo-name - // // await $scope.addAlias($scope.viewmodel.specificulture + '/' + $scope.viewmodel.seoName); - // return true; - // } else { - // return true; - // } + // $scope.defaultFeatureImgWidth = + // ngAppSettings.mixConfigurations.DefaultFeatureImgWidth; + // $scope.defaultFeatureImgHeight = + // ngAppSettings.mixConfigurations.DefaultFeatureImgHeight; + $scope.request.additionalDatabase = $scope.viewmodel.mixDatabaseName; + var moduleIds = $routeParams.moduleIds; + var pageIds = $routeParams.page_ids; + $scope.additionalDatabase = $rootScope.findObjectByKey( + $scope.additionalDatabases, + "systemName", + $scope.request.additionalDatabase + ); + $scope.loadAdditionalData(); + if (moduleIds) { + for (var moduleContentId of moduleIds.split(",")) { + var moduleNav = $rootScope.findObjectByKey( + $scope.viewmodel.modules, + "moduleContentId", + moduleContentId + ); + if (moduleNav) { + moduleNav.isActived = true; + } + } + } + if (pageIds) { + for (var pageId of pageIds.split(",")) { + var pageNav = $rootScope.findObjectByKey( + $scope.viewmodel.pages, + "pageId", + pageId + ); + if (pageNav) { + pageNav.isActived = true; + } + } + } }; - $scope.addAlias = async function (alias) { + $scope.loadAdditionalData = async function () { + if ($scope.viewmodel.mixDatabaseName) { + $scope.loadingData = true; + mixDbService.initDbName($scope.viewmodel.mixDatabaseName); + if ($scope.viewmodel.id) { + const getData = await mixDbService.getSingleByParent( + "Post", + $scope.viewmodel.id + ); + if (getData.success) { + $scope.additionalData = getData.data; + $scope.loadingData = false; + } + $scope.$apply(); + } else { + $scope.additionalData = { + parentType: "Post", + }; + $scope.loadingData = false; + } + } + }; + $scope.generateSeo = function () { + if ($scope.viewmodel) { + if ( + $scope.viewmodel.seoName === null || + $scope.viewmodel.seoName === "" + ) { + $scope.viewmodel.seoName = $rootScope.generateKeyword( + $scope.viewmodel.title, + "-" + ); + if ($scope.viewmodel.seoName.length > 50) { + $scope.viewmodel.seoName = + $scope.viewmodel.seoName.substring(0, 80) + "..."; + } + } + if ( + $scope.viewmodel.seoTitle === null || + $scope.viewmodel.seoTitle === "" + ) { + $scope.viewmodel.seoTitle = $scope.viewmodel.title; + } + if ( + $scope.viewmodel.seoDescription === null || + $scope.viewmodel.seoDescription === "" + ) { + $scope.viewmodel.seoDescription = $scope.viewmodel.excerpt; + } + if ( + $scope.viewmodel.seoKeywords === null || + $scope.viewmodel.seoKeywords === "" + ) { + $scope.viewmodel.seoKeywords = $scope.viewmodel.title; + } + } + }; + $scope.addAlias = async function () { var getAlias = await urlAliasService.getDefault(); if (getAlias.success) { - if (alias) { - getAlias.data.alias = alias; - } $scope.viewmodel.urlAliases.push(getAlias.data); $rootScope.isBusy = false; $scope.$apply(); @@ -4715,39 +4510,70 @@ app.controller("PageController", [ $scope.viewmodel.urlAliases.splice(index, 1); $scope.$apply(); }; + + $scope.validate = function () { + angular.forEach($scope.viewmodel.mixDatabaseNavs, function (nav) { + if (nav.isActived) { + $rootScope.encryptMixDatabase( + nav.mixDatabase.attributes, + nav.mixDatabase.postData.items + ); + } + }); + return true; + }; }, ]); "use strict"; -app.factory("PageRestService", [ - "$rootScope", - "ApiService", - "CommonService", +app.factory("PostRestService", [ "BaseRestService", - function ($rootScope, apiService, commonService, baseService) { + "ApiService", + function (baseService, apiService) { var serviceFactory = Object.create(baseService); - serviceFactory.init("mix-page-content"); - var _updateInfos = async function (pages) { + serviceFactory.init("mix-post-content"); + var _syncProducts = async function (names) { + var url = `/api/daphale/sync/products`; var req = { + serviceBase: "", method: "POST", - url: this.prefixUrl + "/update-infos", - data: JSON.stringify(pages), + url: url, + data: { + batch: 50, + isScaleImage: true, + isSyncPrice: true, + isSyncAll: false, + productNames: names, + }, }; - return await apiService.sendRequest(req); + return await apiService.sendPureRequest(req); }; - serviceFactory.updateInfos = _updateInfos; + var _filter = async function (request) { + var url = `${this.prefixUrl}/filter`; + var req = { + serviceBase: this.serviceBase, + method: "POST", + url: url, + data: request, + }; + return await this.getRestApiResult(req); + }; + // Define more service methods here + serviceFactory.filter = _filter; + serviceFactory.syncProducts = _syncProducts; return serviceFactory; }, ]); "use strict"; -app.controller("ServiceController", [ +app.controller("PagePostController", [ "$scope", "$rootScope", "ngAppSettings", "$routeParams", "$location", - "RestMixDatabasePortalService", + "PagePostRestService", + "PostRestService", "ApiService", "CommonService", function ( @@ -4757,86 +4583,56 @@ app.controller("ServiceController", [ $routeParams, $location, service, + postService, commonService ) { - BaseODataCtrl.call( + BaseCtrl.call( this, $scope, $rootScope, $routeParams, ngAppSettings, - service - ); - $scope.defaultId = "default"; - $scope.parentId = null; - $scope.parentType = null; + service + ); + $scope.request.culture = $rootScope.globalSettings.defaultCulture; $scope.cates = ["Site", "System"]; $scope.others = []; $scope.mixConfigurations = $rootScope.globalSettings; - $scope.canDrag = - $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; - $scope.init = async function () { - $scope.mixDatabaseId = $routeParams.mixDatabaseId; - $scope.mixDatabaseName = $routeParams.mixDatabaseName; - $scope.dataContentId = $routeParams.dataContentId; - }; - $scope.saveSuccessCallback = function () { - $rootScope.isBusy = false; - $scope.$apply(); - // if($scope.parentId){ - // $location.url('/admin/mix-database-data/details?dataContentId='+ $scope.parentId); - // } - // else{ - // $location.url('/admin/mix-database-data/list?mixDatabaseId='+ $scope.viewmodel.mixDatabaseId); - // } - }; - $scope.getList = async function () { - $rootScope.isBusy = true; - $scope.mixDatabaseId = $routeParams.mixDatabaseId; - $scope.mixDatabaseName = $routeParams.mixDatabaseName; - var type = $routeParams.type; - var parentId = $routeParams.parentId; - var response = await service.getList( - "read", - $scope.request, - $scope.mixDatabaseId, - $scope.mixDatabaseName, - type, - parentId - ); + $scope.init = function () { + $scope.pageId = $routeParams.id; + $scope.type = $routeParams.type || ""; + $scope.template = $routeParams.template || ""; + $scope.pageIds = $routeParams.page_ids || $routeParams.id || ""; + $scope.moduleIds = $routeParams.module_ids || ""; $scope.canDrag = - $scope.request.orderBy !== "Priority" || - $scope.request.direction !== "0"; - if (response) { - $scope.data = response; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors("Failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } + $scope.request.orderBy === "Priority" && + $scope.request.direction === "Asc"; + $scope.createUrl = + $routeParams.post_type === "gallery" + ? "/admin/post/create-gallery" + : `/admin/post/create?page_ids=${$scope.pageIds}&moduleIds=${$scope.moduleIds}&type=${$scope.type}&template=${$scope.template}`; + $scope.updateUrl = + $routeParams.post_type === "gallery" + ? "/admin/post/gallery-details" + : "/admin/post/details"; }; - $scope.getSingle = async function () { + $scope.getList = async function (pageIndex) { + if (pageIndex !== undefined) { + $scope.request.pageIndex = pageIndex; + } $rootScope.isBusy = true; - var id = $routeParams.id || $scope.defaultId; - $scope.mixDatabaseId = $routeParams.mixDatabaseId; - $scope.mixDatabaseName = $routeParams.mixDatabaseName; - var resp = await service.getSingle("portal", [ - id, - $scope.mixDatabaseId, - $scope.mixDatabaseName, - ]); - if (resp) { - $scope.viewmodel = resp; - $scope.viewmodel.parentType = $scope.parentType; - $scope.viewmodel.parentId = $scope.parentId; + var id = $routeParams.id; + $scope.request.query = "&page_id=" + id; + var response = await service.getList($scope.request); + $scope.canDrag = + $scope.request.orderBy === "Priority" && + $scope.request.direction === "Asc"; + if (response.success) { + $scope.data = response.data; $rootScope.isBusy = false; $scope.$apply(); } else { - if (resp) { - $rootScope.showErrors("Failed"); - } + $rootScope.showErrors(response.errors); $rootScope.isBusy = false; $scope.$apply(); } @@ -4845,28 +4641,23 @@ app.controller("ServiceController", [ item.editUrl = "/admin/post/details/" + item.id; $rootScope.preview("post", item, item.title, "modal-lg"); }; - $scope.edit = function (data) { - $scope.goToPath( - "/admin/mix-database-data/details?dataContentId=" + - data.id + - "&mixDatabaseId=" + - $scope.mixDatabaseId - ); - }; - $scope.remove = function (data) { + $scope.remove = function (pageId, postId) { $rootScope.showConfirm( $scope, "removeConfirmed", - [data.id], + [pageId, postId], null, "Remove", "Deleted data will not able to recover, are you sure you want to delete this item?" ); }; + $scope.back = function () { + window.history.back(); + }; - $scope.removeConfirmed = async function (dataContentId) { + $scope.removeConfirmed = async function (id) { $rootScope.isBusy = true; - var result = await service.delete([dataContentId]); + var result = await service.delete(id); if (result.success) { if ($scope.removeCallback) { $rootScope.executeFunctionByName( @@ -4894,6 +4685,58 @@ app.controller("ServiceController", [ $scope.$apply(); } }; + $scope.updateInfos = async function (index) { + $scope.data.items.splice(index, 1); + $rootScope.isBusy = true; + var startIndex = $scope.data.items[0].priority - 1; + for (var i = 0; i < $scope.data.items.length; i++) { + $scope.data.items[i].priority = startIndex + i + 1; + } + var resp = await service.updateInfos($scope.data.items); + if (resp && resp.success) { + $scope.activedPage = resp.data; + $rootScope.showMessage("success", "success"); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + if (resp) { + $rootScope.showErrors(resp.errors); + } + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + }, +]); + +"use strict"; +app.factory("PagePostRestService", [ + "$rootScope", + "ApiService", + "CommonService", + "BaseRestService", + function ($rootScope, apiService, commonService, baseService) { + var serviceFactory = Object.create(baseService); + serviceFactory.init("mix-page-post"); + var _delete = async function (id) { + var url = this.prefixUrl + "/delete/" + id; + var req = { + method: "GET", + url: url, + }; + return await apiService.getApiResult(req); + }; + var _updateInfos = async function (pages) { + var req = { + method: "POST", + url: this.prefixUrl + "/update-infos", + data: JSON.stringify(pages), + }; + return await apiService.getApiResult(req); + }; + serviceFactory.delete = _delete; + serviceFactory.updateInfos = _updateInfos; + return serviceFactory; }, ]); @@ -4982,112 +4825,20 @@ app.factory("QueueLogRestService", [ url += "?"; url = url.concat(data); if (queries) { - url += "&"; - var extraQueries = serviceFactory.parseQuery(queries); - url = url.concat(extraQueries); - } - } - var req = { - serviceBase: this.serviceBase, - apiVersion: this.apiVersion, - method: "GET", - url: url, - }; - return await this.getRestApiResult(req); - }; - serviceFactory.getList = _search; - return serviceFactory; - }, -]); - -"use strict"; -app.controller("RoleController", [ - "$scope", - "$rootScope", - "$location", - "$routeParams", - "ngAppSettings", - "RestMixDatabaseDataPortalService", - "RestMixDatabaseColumnPortalService", - "RoleService", - function ( - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - dataService, - columnService, - service - ) { - BaseRestCtrl.call( - this, - $scope, - $rootScope, - $location, - $routeParams, - ngAppSettings, - service - ); - $scope.role = { name: "" }; - $scope.initPermissions = async function () { - let backUrl = "/admin/role/list"; - $scope.createUrl = `/admin/mix-database-data/create?mixDatabaseName=sysPermission&dataContentId=default&guidParentId=${$scope.viewmodel.id}&parentType=Role&backUrl=${backUrl}`; - $scope.updateUrl = "/admin/mix-database-data/details"; - }; - - $scope.createRole = async function () { - $rootScope.isBusy = true; - var result = await service.createRole($scope.role.name); - if (result.success) { - $scope.role.name = ""; - $scope.getList(); - } else { - $rootScope.showErrors(result.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, -]); - -"use strict"; -app.factory("RoleService", [ - "BaseRestService", - "ApiService", - "CommonService", - function (baseService, apiService, commonService) { - var serviceFactory = Object.create(baseService); - serviceFactory.initService("/rest/mix-account", "role", true); - - var _getPermissions = async function () { - var req = { - method: "GET", - url: this.prefixUrl + "/permissions", - }; - return await apiService.sendRequest(req); - }; - - var _updatePermission = async function (permission) { - var req = { - method: "POST", - url: this.prefixUrl + "/update-permission", - data: JSON.stringify(permission), - }; - return await apiService.sendRequest(req); - }; - var _createRole = function (name) { + url += "&"; + var extraQueries = serviceFactory.parseQuery(queries); + url = url.concat(extraQueries); + } + } var req = { - method: "POST", - url: this.prefixUrl + "/create", - data: JSON.stringify(name), + serviceBase: this.serviceBase, + apiVersion: this.apiVersion, + method: "GET", + url: url, }; - - return apiService.sendRequest(req); + return await this.getRestApiResult(req); }; - serviceFactory.createRole = _createRole; - serviceFactory.getPermissions = _getPermissions; - serviceFactory.updatePermission = _updatePermission; + serviceFactory.getList = _search; return serviceFactory; }, ]); @@ -5426,37 +5177,286 @@ app.factory("SchedulerService", [ return resp; }); }; - var _parseQuery = function (req) { - var result = ""; - if (req) { - for (var key in req) { - if (angular.isObject(req.query)) { - req.query = JSON.stringify(req.query); - } - if (req.hasOwnProperty(key) && req[key]) { - if (result != "") { - result += "&"; - } - result += `${key}=${req[key]}`; - } + var _parseQuery = function (req) { + var result = ""; + if (req) { + for (var key in req) { + if (angular.isObject(req.query)) { + req.query = JSON.stringify(req.query); + } + if (req.hasOwnProperty(key) && req[key]) { + if (result != "") { + result += "&"; + } + result += `${key}=${req[key]}`; + } + } + return result; + } else { + return result; + } + }; + serviceFactory.execute = _execute; + serviceFactory.parseQuery = _parseQuery; + serviceFactory.getRestApiResult = _getRestApiResult; + serviceFactory.createSchedule = _createSchedule; + serviceFactory.reschedule = _reschedule; + serviceFactory.getJobs = _getJobs; + serviceFactory.deleteJob = _deleteJob; + serviceFactory.getTrigger = _getTrigger; + serviceFactory.getTriggers = _getTriggers; + serviceFactory.pauseTrigger = _pauseTrigger; + serviceFactory.resumeTrigger = _resumeTrigger; + return serviceFactory; + }, +]); + +"use strict"; +app.controller("RoleController", [ + "$scope", + "$rootScope", + "$location", + "$routeParams", + "ngAppSettings", + "RestMixDatabaseDataPortalService", + "RestMixDatabaseColumnPortalService", + "RoleService", + function ( + $scope, + $rootScope, + $location, + $routeParams, + ngAppSettings, + dataService, + columnService, + service + ) { + BaseRestCtrl.call( + this, + $scope, + $rootScope, + $location, + $routeParams, + ngAppSettings, + service + ); + $scope.role = { name: "" }; + $scope.initPermissions = async function () { + let backUrl = "/admin/role/list"; + $scope.createUrl = `/admin/mix-database-data/create?mixDatabaseName=sysPermission&dataContentId=default&guidParentId=${$scope.viewmodel.id}&parentType=Role&backUrl=${backUrl}`; + $scope.updateUrl = "/admin/mix-database-data/details"; + }; + + $scope.createRole = async function () { + $rootScope.isBusy = true; + var result = await service.createRole($scope.role.name); + if (result.success) { + $scope.role.name = ""; + $scope.getList(); + } else { + $rootScope.showErrors(result.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + }, +]); + +"use strict"; +app.factory("RoleService", [ + "BaseRestService", + "ApiService", + "CommonService", + function (baseService, apiService, commonService) { + var serviceFactory = Object.create(baseService); + serviceFactory.initService("/rest/mix-account", "role", true); + + var _getPermissions = async function () { + var req = { + method: "GET", + url: this.prefixUrl + "/permissions", + }; + return await apiService.sendRequest(req); + }; + + var _updatePermission = async function (permission) { + var req = { + method: "POST", + url: this.prefixUrl + "/update-permission", + data: JSON.stringify(permission), + }; + return await apiService.sendRequest(req); + }; + var _createRole = function (name) { + var req = { + method: "POST", + url: this.prefixUrl + "/create", + data: JSON.stringify(name), + }; + + return apiService.sendRequest(req); + }; + serviceFactory.createRole = _createRole; + serviceFactory.getPermissions = _getPermissions; + serviceFactory.updatePermission = _updatePermission; + return serviceFactory; + }, +]); + +"use strict"; +app.controller("ServiceController", [ + "$scope", + "$rootScope", + "ngAppSettings", + "$routeParams", + "$location", + "RestMixDatabasePortalService", + "ApiService", + "CommonService", + function ( + $scope, + $rootScope, + ngAppSettings, + $routeParams, + $location, + service, + commonService + ) { + BaseODataCtrl.call( + this, + $scope, + $rootScope, + $routeParams, + ngAppSettings, + service + ); + $scope.defaultId = "default"; + $scope.parentId = null; + $scope.parentType = null; + $scope.cates = ["Site", "System"]; + $scope.others = []; + $scope.mixConfigurations = $rootScope.globalSettings; + $scope.canDrag = + $scope.request.orderBy !== "Priority" || $scope.request.direction !== "0"; + $scope.init = async function () { + $scope.mixDatabaseId = $routeParams.mixDatabaseId; + $scope.mixDatabaseName = $routeParams.mixDatabaseName; + $scope.dataContentId = $routeParams.dataContentId; + }; + $scope.saveSuccessCallback = function () { + $rootScope.isBusy = false; + $scope.$apply(); + // if($scope.parentId){ + // $location.url('/admin/mix-database-data/details?dataContentId='+ $scope.parentId); + // } + // else{ + // $location.url('/admin/mix-database-data/list?mixDatabaseId='+ $scope.viewmodel.mixDatabaseId); + // } + }; + $scope.getList = async function () { + $rootScope.isBusy = true; + $scope.mixDatabaseId = $routeParams.mixDatabaseId; + $scope.mixDatabaseName = $routeParams.mixDatabaseName; + var type = $routeParams.type; + var parentId = $routeParams.parentId; + var response = await service.getList( + "read", + $scope.request, + $scope.mixDatabaseId, + $scope.mixDatabaseName, + type, + parentId + ); + $scope.canDrag = + $scope.request.orderBy !== "Priority" || + $scope.request.direction !== "0"; + if (response) { + $scope.data = response; + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showErrors("Failed"); + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + $scope.getSingle = async function () { + $rootScope.isBusy = true; + var id = $routeParams.id || $scope.defaultId; + $scope.mixDatabaseId = $routeParams.mixDatabaseId; + $scope.mixDatabaseName = $routeParams.mixDatabaseName; + var resp = await service.getSingle("portal", [ + id, + $scope.mixDatabaseId, + $scope.mixDatabaseName, + ]); + if (resp) { + $scope.viewmodel = resp; + $scope.viewmodel.parentType = $scope.parentType; + $scope.viewmodel.parentId = $scope.parentId; + $rootScope.isBusy = false; + $scope.$apply(); + } else { + if (resp) { + $rootScope.showErrors("Failed"); + } + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + $scope.preview = function (item) { + item.editUrl = "/admin/post/details/" + item.id; + $rootScope.preview("post", item, item.title, "modal-lg"); + }; + $scope.edit = function (data) { + $scope.goToPath( + "/admin/mix-database-data/details?dataContentId=" + + data.id + + "&mixDatabaseId=" + + $scope.mixDatabaseId + ); + }; + $scope.remove = function (data) { + $rootScope.showConfirm( + $scope, + "removeConfirmed", + [data.id], + null, + "Remove", + "Deleted data will not able to recover, are you sure you want to delete this item?" + ); + }; + + $scope.removeConfirmed = async function (dataContentId) { + $rootScope.isBusy = true; + var result = await service.delete([dataContentId]); + if (result.success) { + if ($scope.removeCallback) { + $rootScope.executeFunctionByName( + "removeCallback", + $scope.removeCallbackArgs, + $scope + ); } - return result; + $scope.getList(); } else { - return result; + $rootScope.showErrors(result.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + + $scope.saveOthers = async function () { + var response = await service.saveList($scope.others); + if (response.success) { + $scope.getList(); + $scope.$apply(); + } else { + $rootScope.showErrors(response.errors); + $rootScope.isBusy = false; + $scope.$apply(); } }; - serviceFactory.execute = _execute; - serviceFactory.parseQuery = _parseQuery; - serviceFactory.getRestApiResult = _getRestApiResult; - serviceFactory.createSchedule = _createSchedule; - serviceFactory.reschedule = _reschedule; - serviceFactory.getJobs = _getJobs; - serviceFactory.deleteJob = _deleteJob; - serviceFactory.getTrigger = _getTrigger; - serviceFactory.getTriggers = _getTriggers; - serviceFactory.pauseTrigger = _pauseTrigger; - serviceFactory.resumeTrigger = _resumeTrigger; - return serviceFactory; }, ]); @@ -7057,37 +7057,6 @@ app.component("appSettingsAuth", { }, }); -app.component("appSettingsGeneral", { - templateUrl: - "/mix-app/views/app-portal/pages/app-settings/components/general/view.html", - controller: [ - "$rootScope", - "$scope", - "CryptoService", - "CommonService", - function ($rootScope, $scope, cryptoService, commonService) { - var ctrl = this; - ctrl.$onInit = () => { - var key = cryptoService.parseKeys(ctrl.appSettings.apiEncryptKey); - ctrl.apiKey = key.key; - ctrl.iv = key.iv; - }; - ctrl.stopApplication = async function () { - $rootScope.isBusy = true; - await commonService.stopApplication(); - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - }; - }, - ], - bindings: { - appSettings: "=", - onDelete: "&", - onUpdate: "&", - }, -}); - app.component("appSettingsDefault", { templateUrl: "/mix-app/views/app-portal/pages/app-settings/components/default/view.html", @@ -7132,36 +7101,35 @@ app.component("appSettingsDefault", { }, }); -modules.component("portalMenus", { +app.component("appSettingsGeneral", { templateUrl: - "/mix-app/views/app-portal/pages/app-settings/components/portal-menus/view.html", - bindings: { - data: "=", - allowedTypes: "=", - }, + "/mix-app/views/app-portal/pages/app-settings/components/general/view.html", controller: [ "$rootScope", "$scope", - "$location", - "ApiService", + "CryptoService", "CommonService", - "ngAppSettings", - function ( - $rootScope, - $scope, - $location, - apiService, - commonService, - ngAppSettings - ) { + function ($rootScope, $scope, cryptoService, commonService) { var ctrl = this; - // ctrl.icons = []; - ctrl.translate = $rootScope.translate; - ctrl.init = function () { - ctrl.icons = ngAppSettings.icons; + ctrl.$onInit = () => { + var key = cryptoService.parseKeys(ctrl.appSettings.apiEncryptKey); + ctrl.apiKey = key.key; + ctrl.iv = key.iv; + }; + ctrl.stopApplication = async function () { + $rootScope.isBusy = true; + await commonService.stopApplication(); + $rootScope.showMessage("success", "success"); + $rootScope.isBusy = false; + $scope.$apply(); }; }, ], + bindings: { + appSettings: "=", + onDelete: "&", + onUpdate: "&", + }, }); app.component("appSettingsHeart", { @@ -7201,6 +7169,38 @@ app.component("appSettingsHeart", { ], }); +modules.component("portalMenus", { + templateUrl: + "/mix-app/views/app-portal/pages/app-settings/components/portal-menus/view.html", + bindings: { + data: "=", + allowedTypes: "=", + }, + controller: [ + "$rootScope", + "$scope", + "$location", + "ApiService", + "CommonService", + "ngAppSettings", + function ( + $rootScope, + $scope, + $location, + apiService, + commonService, + ngAppSettings + ) { + var ctrl = this; + // ctrl.icons = []; + ctrl.translate = $rootScope.translate; + ctrl.init = function () { + ctrl.icons = ngAppSettings.icons; + }; + }, + ], +}); + app.component("appSettingsSmtp", { templateUrl: "/mix-app/views/app-portal/pages/app-settings/components/smtp/view.html", @@ -7257,110 +7257,390 @@ app.component("customerOrders", { }; }, ], - bindings: { - customer: "=", - onDelete: "&", - onUpdate: "&", - }, + bindings: { + customer: "=", + onDelete: "&", + onUpdate: "&", + }, +}); + +app.component("mixDatabaseEdm", { + templateUrl: + "/mix-app/views/app-portal/pages/mix-database/components/edm/view.html", + controller: [ + "$rootScope", + function ($rootScope) { + var ctrl = this; + ctrl.mixConfigurations = $rootScope.globalSettings; + }, + ], + bindings: { + model: "=", + }, +}); + +app.component("mixDatabaseMain", { + templateUrl: + "/mix-app/views/app-portal/pages/mix-database/components/main/view.html", + controller: [ + "$rootScope", + function ($rootScope) { + var ctrl = this; + + ctrl.$onInit = () => { + ctrl.globalSettings = $rootScope.globalSettings; + ctrl.isInRole = $rootScope.isInRole; + }; + ctrl.gennerateName = function (type) { + if ( + !ctrl.model.id || + ctrl.model.systemName === null || + ctrl.model.systemName === "" + ) { + let prefix = ctrl.model.type == "System" ? "sys" : ""; + ctrl.model.systemName = $rootScope.generateKeyword( + `${prefix} ${ctrl.model.displayName}`, + "", + true, + true + ); + if (ctrl.schema) { + ctrl.model.systemName = `${ctrl.schema}_${ctrl.model.systemName}`; + } + } + }; + }, + ], + bindings: { + model: "=", + schema: "=?", + }, +}); + +app.component("mixdbContextDatabases", { + bindings: { + model: "=", + }, + templateUrl: + "/mix-app/views/app-portal/pages/mixdb-context/components/mix-databases/view.html", + controller: [ + "$rootScope", + "$scope", + "RestMixDatabasePortalService", + function ($rootScope, $scope, databaseService) { + var ctrl = this; + ctrl.request = $rootScope.getRequest(); + ctrl.$onInit = () => { + ctrl.globalSettings = $rootScope.globalSettings; + ctrl.isInRole = $rootScope.isInRole; + ctrl.request.mixDatabaseContextId = ctrl.model.id; + ctrl.loadDatabases(); + }; + ctrl.loadDatabases = async function () { + if (ctrl.model.id) { + var resp = await databaseService.getList(ctrl.request); + if (resp && resp.success) { + ctrl.data = resp.data; + $scope.$apply(); + } + } + }; + }, + ], }); -app.component("mixDatabaseMain", { +app.component("moduleMain", { templateUrl: - "/mix-app/views/app-portal/pages/mix-database/components/main/view.html", + "/mix-app/views/app-portal/pages/module/components/main/main.html", controller: [ "$rootScope", function ($rootScope) { var ctrl = this; - - ctrl.$onInit = () => { - ctrl.globalSettings = $rootScope.globalSettings; - ctrl.isInRole = $rootScope.isInRole; - }; - ctrl.gennerateName = function (type) { + ctrl.localizeSettings = $rootScope.globalSettings; + ctrl.isInRole = $rootScope.isInRole; + ctrl.gennerateName = function () { if ( - !ctrl.model.id || - ctrl.model.systemName === null || - ctrl.model.systemName === "" + !ctrl.module.id || + ctrl.module.systemName === null || + ctrl.module.systemName === "" ) { - let prefix = ctrl.model.type == "System" ? "sys" : ""; - ctrl.model.systemName = $rootScope.generateKeyword( - `${prefix} ${ctrl.model.displayName}`, - "", + ctrl.module.systemName = $rootScope.generateKeyword( + ctrl.module.title, + "_", true, true ); - if (ctrl.schema) { - ctrl.model.systemName = `${ctrl.schema}_${ctrl.model.systemName}`; - } } }; }, ], bindings: { - model: "=", - schema: "=?", + module: "=", }, }); -app.component("mixDatabaseEdm", { +app.component("moduleAdvanced", { templateUrl: - "/mix-app/views/app-portal/pages/mix-database/components/edm/view.html", + "/mix-app/views/app-portal/pages/module/components/module-advanced/view.html", + bindings: { + model: "=", + additionalData: "=", + }, controller: [ "$rootScope", function ($rootScope) { var ctrl = this; ctrl.mixConfigurations = $rootScope.globalSettings; + ctrl.$onInit = function () { + ctrl.isAdmin = $rootScope.isAdmin; + }; }, ], +}); + +app.component("moduleContent", { + templateUrl: + "/mix-app/views/app-portal/pages/module/components/module-content/view.html", bindings: { model: "=", + additionalData: "=", }, + controller: [ + "$rootScope", + function ($rootScope) { + var ctrl = this; + ctrl.$onInit = function () { + ctrl.backUrl = `/admin/module/details`; + }; + ctrl.mixConfigurations = $rootScope.globalSettings; + }, + ], }); -app.component("mixdbContextDatabases", { +app.component("moduleType", { + templateUrl: + "/mix-app/views/app-portal/pages/module/components/module-type/view.html", + controller: [ + "$rootScope", + function ($rootScope) { + var ctrl = this; + ctrl.mixConfigurations = $rootScope.globalSettings; + }, + ], bindings: { model: "=", }, +}); + +app.component("pageGeneral", { templateUrl: - "/mix-app/views/app-portal/pages/mixdb-context/components/mix-databases/view.html", + "/mix-app/views/app-portal/pages/page/components/general/general.html", + controller: function ($rootScope) { + var ctrl = this; + ctrl.isInRole = $rootScope.isInRole; + ctrl.dataTypes = [ + { + title: "String", + value: "text", + }, + { + title: "Int", + value: "int", + }, + { + title: "Image", + value: "image", + }, + { + title: "Boolean", + value: "boolean", + }, + ]; + ctrl.configurations = { + core: {}, + plugins: { + btnsDef: { + // Customizables dropdowns + image: { + dropdown: ["insertImage", "upload", "base64", "noembed"], + ico: "insertImage", + }, + }, + btns: [ + ["viewHTML"], + ["undo", "redo"], + ["formatting"], + ["strong", "em", "del", "underline"], + ["link"], + ["image"], + ["justifyLeft", "justifyCenter", "justifyRight", "justifyFull"], + ["unorderedList", "orderedList"], + ["foreColor", "backColor"], + ["preformatted"], + ["horizontalRule"], + ["fullscreen"], + ], + plugins: { + // Add imagur parameters to upload plugin + upload: { + serverPath: "https://api.imgur.com/3/image", + fileFieldName: "image", + headers: { + Authorization: "Client-ID 9e57cb1c4791cea", + }, + urlPropertyName: "data.link", + }, + }, + }, + }; + ctrl.addProperty = function (type) { + var i = $(".property").length; + ctrl.page.properties.push({ + priority: 0, + name: "", + value: null, + dataType: 0, + }); + }; + ctrl.initEditor = function () { + setTimeout(function () { + // Init Code editor + $.each($(".code-editor"), function (i, e) { + var container = $(this); + var editor = ace.edit(e); + if (container.hasClass("json")) { + editor.session.setMode("ace/mode/json"); + } else { + editor.session.setMode("ace/mode/razor"); + } + editor.setTheme("ace/theme/chrome"); + //editor.setReadOnly(true); + + editor.session.setUseWrapMode(true); + editor.setOptions({ + maxLines: Infinity, + }); + editor.getSession().on("change", function (e) { + // e.type, etc + $(container).parent().find(".code-content").val(editor.getValue()); + }); + }); + $.each($(".editor-content"), function (i, e) { + var $demoTextarea = $(e); + $demoTextarea.quill(ctrl.configurations.plugins); + }); + }, 200); + }; + }, + bindings: { + page: "=", + onDelete: "&", + onUpdate: "&", + }, +}); + +app.component("pageMain", { + templateUrl: "/mix-app/views/app-portal/pages/page/components/main/main.html", controller: [ "$rootScope", "$scope", - "RestMixDatabasePortalService", - function ($rootScope, $scope, databaseService) { + "ngAppSettings", + function ($rootScope, $scope) { var ctrl = this; - ctrl.request = $rootScope.getRequest(); - ctrl.$onInit = () => { - ctrl.globalSettings = $rootScope.globalSettings; - ctrl.isInRole = $rootScope.isInRole; - ctrl.request.mixDatabaseContextId = ctrl.model.id; - ctrl.loadDatabases(); + ctrl.mixConfigurations = $rootScope.globalSettings; + // ctrl.setPageType = function (type) { + // ctrl.page.type = $index; + // } + ctrl.generateSeo = function () { + if (ctrl.page) { + if (ctrl.page.seoName === null || ctrl.page.seoName === "") { + ctrl.page.seoName = $rootScope.generateKeyword( + ctrl.page.title, + "-" + ); + } + if (ctrl.page.seoTitle === null || ctrl.page.seoTitle === "") { + ctrl.page.seoTitle = ctrl.page.title; + } + if ( + ctrl.page.seoDescription === null || + ctrl.page.seoDescription === "" + ) { + ctrl.page.seoDescription = ctrl.page.excerpt; + } + if (ctrl.page.seoKeywords === null || ctrl.page.seoKeywords === "") { + ctrl.page.seoKeywords = ctrl.page.title; + } + } + }; + }, + ], + bindings: { + page: "=", + onDelete: "&", + onUpdate: "&", + }, +}); + +app.component("pageModules", { + templateUrl: + "/mix-app/views/app-portal/pages/page/components/modules/modules.html", + bindings: { + page: "=", + onDelete: "&?", + onUpdate: "&?", + }, + controller: [ + "$scope", + "ngAppSettings", + "ModuleRestService", + function ($scope, ngAppSettings, moduleService) { + var ctrl = this; + ctrl.modules = []; + ctrl.request = angular.copy(ngAppSettings.request); + + ctrl.$onInit = async () => { + ctrl.request.columns = [ + "id", + "title", + "systemName", + "createdDateTime", + "type", + ]; + ctrl.request.culture = ctrl.page.specificulture; + ctrl.loadModules(); }; - ctrl.loadDatabases = async function () { - if (ctrl.model.id) { - var resp = await databaseService.getList(ctrl.request); - if (resp && resp.success) { - ctrl.data = resp.data; - $scope.$apply(); - } + ctrl.loadModules = async () => { + let getModules = await moduleService.getList(ctrl.request); + if (getModules.success) { + ctrl.modules = getModules.data.items; + $scope.$apply(); + } + }; + ctrl.select = async (associations) => { + ctrl.associations = associations; + if (ctrl.onUpdate) { + ctrl.onUpdate({ associations: associations }); } }; }, ], }); -app.component("moduleAdvanced", { +app.component("pageAdvanced", { templateUrl: - "/mix-app/views/app-portal/pages/module/components/module-advanced/view.html", + "/mix-app/views/app-portal/pages/page/components/page-advanced/view.html", bindings: { model: "=", additionalData: "=", }, controller: [ "$rootScope", - function ($rootScope) { + "$scope", + function ($rootScope, $scope) { var ctrl = this; - ctrl.mixConfigurations = $rootScope.globalSettings; + + ctrl.translate = $rootScope.translate; ctrl.$onInit = function () { ctrl.isAdmin = $rootScope.isAdmin; }; @@ -7368,73 +7648,69 @@ app.component("moduleAdvanced", { ], }); -app.component("moduleMain", { +app.component("pageContent", { templateUrl: - "/mix-app/views/app-portal/pages/module/components/main/main.html", - controller: [ - "$rootScope", - function ($rootScope) { - var ctrl = this; - ctrl.localizeSettings = $rootScope.globalSettings; - ctrl.isInRole = $rootScope.isInRole; - ctrl.gennerateName = function () { - if ( - !ctrl.module.id || - ctrl.module.systemName === null || - ctrl.module.systemName === "" - ) { - ctrl.module.systemName = $rootScope.generateKeyword( - ctrl.module.title, - "_", - true, - true - ); - } - }; - }, - ], + "/mix-app/views/app-portal/pages/page/components/page-content/view.html", bindings: { - module: "=", + additionalData: "=", + model: "=", }, -}); - -app.component("moduleType", { - templateUrl: - "/mix-app/views/app-portal/pages/module/components/module-type/view.html", controller: [ "$rootScope", - function ($rootScope) { + "$scope", + function ($rootScope, $scope) { var ctrl = this; - ctrl.mixConfigurations = $rootScope.globalSettings; + ctrl.translate = $rootScope.translate; + ctrl.$onInit = function () { + ctrl.backUrl = `/admin/page/details`; + }; + ctrl.generateSeo = function () { + if ($scope.viewmodel) { + if (ctrl.model.seoName === null || ctrl.model.seoName === "") { + ctrl.model.seoName = $rootScope.generateKeyword( + ctrl.model.title, + "-" + ); + } + if (ctrl.model.seoTitle === null || ctrl.model.seoTitle === "") { + ctrl.model.seoTitle = ctrl.model.title; + } + if ( + ctrl.model.seoDescription === null || + ctrl.model.seoDescription === "" + ) { + ctrl.model.seoDescription = ctrl.model.excerpt; + } + if ( + ctrl.model.seoKeywords === null || + ctrl.model.seoKeywords === "" + ) { + ctrl.model.seoKeywords = ctrl.model.title; + } + } + }; }, ], - bindings: { - model: "=", - }, }); -app.component("moduleContent", { +app.component("pageType", { templateUrl: - "/mix-app/views/app-portal/pages/module/components/module-content/view.html", + "/mix-app/views/app-portal/pages/page/components/page-type/view.html", bindings: { model: "=", - additionalData: "=", }, controller: [ "$rootScope", function ($rootScope) { var ctrl = this; - ctrl.$onInit = function () { - ctrl.backUrl = `/admin/module/details`; - }; - ctrl.mixConfigurations = $rootScope.globalSettings; + ctrl.localizeSettings = $rootScope.globalSettings; }, ], }); -app.component("permissionParents", { +app.component("pageParents", { templateUrl: - "/mix-app/views/app-portal/pages/permission/components/parents/parents.html", + "/mix-app/views/app-portal/pages/page/components/parents/parents.html", bindings: { page: "=", onDelete: "&", @@ -7442,37 +7718,9 @@ app.component("permissionParents", { }, }); -app.component("permissionMain", { +app.component("pagePlugPlay", { templateUrl: - "/mix-app/views/app-portal/pages/permission/components/main/main.html", - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "$routeParams", - function ($rootScope, $scope, ngAppSettings, $routeParams) { - var ctrl = this; - ctrl.mixConfigurations = $rootScope.globalSettings; - ctrl.icons = ngAppSettings.icons; - ctrl.setPageType = function (type) { - ctrl.page.type = $index; - }; - ctrl.generateKeyword = function (text) { - if (!$routeParams.id && text) { - ctrl.page.textKeyword = - "portal_" + - text - .replace(/[^a-zA-Z0-9]+/g, "_") - .replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2") - .replace(/([a-z])([A-Z])/g, "$1-$2") - .replace(/([0-9])([^0-9])/g, "$1-$2") - .replace(/([^0-9])([0-9])/g, "$1-$2") - .replace(/-+/g, "_") - .toLowerCase(); - } - }; - }, - ], + "/mix-app/views/app-portal/pages/page/components/plug-play/plug-play.html", bindings: { page: "=", onDelete: "&", @@ -7480,103 +7728,106 @@ app.component("permissionMain", { }, }); -app.component("permissionPlugPlay", { +app.component("productRelated", { templateUrl: - "/mix-app/views/app-portal/pages/permission/components/plug-play/plug-play.html", + "/mix-app/views/app-portal/pages/product/components/related/productRelated.html", + controller: function () { + var ctrl = this; + ctrl.activeProduct = function (pr) { + var currentItem = null; + $.each(ctrl.product.productNavs, function (i, e) { + if (e.relatedProductId === pr.id) { + e.isActived = pr.isActived; + currentItem = e; + return false; + } + }); + if (currentItem === null) { + currentItem = { + relatedProductId: pr.id, + sourceProductId: ctrl.product.id, + specificulture: ctrl.product.specificulture, + priority: ctrl.product.productNavs.length + 1, + relatedProduct: pr, + isActived: true, + }; + pr.isHidden = true; + ctrl.product.productNavs.push(currentItem); + } + }; + }, bindings: { - page: "=", - prefixParent: "=", - prefixChild: "=", - searchText: "=", + product: "=", + list: "=", onDelete: "&", onUpdate: "&", }, +}); + +app.component("pageSeo", { + templateUrl: "/mix-app/views/app-portal/pages/page/components/seo/seo.html", controller: [ "$rootScope", - "$scope", - "$location", - "$element", - "PermissionService", - function ($rootScope, $scope, $location, $element, service) { + function ($rootScope) { var ctrl = this; - ctrl.type = "Children"; - ctrl.goToPath = $rootScope.goToPath; - ctrl.request = { - pageSize: "5", - pageIndex: 0, - status: "Published", - orderBy: "CreatedDateTime", - direction: "Desc", - fromDate: null, - toDate: null, - }; - ctrl.pages = []; - ctrl.init = function () { - if (ctrl.page) { - ctrl.request.exceptIds = ctrl.page.parentNavs - .map((p) => p.pageId) - .concat(ctrl.page.childNavs.map((p) => p.pageId)); - if (ctrl.request.exceptIds.indexOf(ctrl.page.id) === -1) { - ctrl.request.exceptIds.push(ctrl.page.id); - } - ctrl.getList(); - } - }; - ctrl.selectPane = function (pane) { - if (ctrl.page) { - ctrl.type = pane.header; - ctrl.request.keyword = ""; - ctrl.init(); - } - }; - - ctrl.selectItem = (nav) => { - if (ctrl.type == "Parents") { - if ( - !$rootScope.findObjectByKey(ctrl.page.parentNavs, "pageId", nav.id) - ) { - ctrl.page.parentNavs.push({ - isActived: true, - pageId: ctrl.page.id, - parentId: nav.id, - description: nav.textDefault, - status: "Published", - parent: nav, - }); - } - } else { - if ( - !$rootScope.findObjectByKey(ctrl.page.childNavs, "pageId", nav.id) - ) { - ctrl.page.childNavs.push({ - isActived: true, - pageId: nav.id, - parentId: ctrl.page.id, - description: nav.textDefault, - status: "Published", - page: nav, - }); - } - } + ctrl.translate = function (keyword) { + return $rootScope.translate(keyword); }; + }, + ], + bindings: { + page: "=", + onDelete: "&", + onUpdate: "&", + }, +}); - ctrl.getList = async function () { - $rootScope.isBusy = true; - var resp = await service.getList(ctrl.request); - if (resp && resp.success) { - ctrl.pages = resp.data; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors || ["Failed"]); - } - $rootScope.isBusy = false; - $scope.$apply(); +app.component("permissionMain", { + templateUrl: + "/mix-app/views/app-portal/pages/permission/components/main/main.html", + controller: [ + "$rootScope", + "$scope", + "ngAppSettings", + "$routeParams", + function ($rootScope, $scope, ngAppSettings, $routeParams) { + var ctrl = this; + ctrl.mixConfigurations = $rootScope.globalSettings; + ctrl.icons = ngAppSettings.icons; + ctrl.setPageType = function (type) { + ctrl.page.type = $index; + }; + ctrl.generateKeyword = function (text) { + if (!$routeParams.id && text) { + ctrl.page.textKeyword = + "portal_" + + text + .replace(/[^a-zA-Z0-9]+/g, "_") + .replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2") + .replace(/([a-z])([A-Z])/g, "$1-$2") + .replace(/([0-9])([^0-9])/g, "$1-$2") + .replace(/([^0-9])([0-9])/g, "$1-$2") + .replace(/-+/g, "_") + .toLowerCase(); } }; }, ], + bindings: { + page: "=", + onDelete: "&", + onUpdate: "&", + }, +}); + +app.component("permissionParents", { + templateUrl: + "/mix-app/views/app-portal/pages/permission/components/parents/parents.html", + bindings: { + page: "=", + onDelete: "&", + onUpdate: "&", + }, }); modules.component("postFilterList", { @@ -7669,148 +7920,96 @@ modules.component("postFilterList", { ], }); -app.component("postGeneral", { +app.component("permissionPlugPlay", { templateUrl: - "/mix-app/views/app-portal/pages/post/components/general/view.html", - controller: [ - "$rootScope", - "ngAppSettings", - function ($rootScope, ngAppSettings) { - var ctrl = this; - ctrl.dataTypes = $rootScope.globalSettings.dataTypes; - ctrl.$onInit = function () {}; - ctrl.addProperty = function (type) { - var i = $(".property").length; - ctrl.post.properties.push({ - title: "", - name: "", - value: null, - dataType: "text", - }); - }; - }, - ], + "/mix-app/views/app-portal/pages/permission/components/plug-play/plug-play.html", bindings: { - post: "=", - isAdmin: "=", + page: "=", + prefixParent: "=", + prefixChild: "=", + searchText: "=", onDelete: "&", onUpdate: "&", }, -}); - -app.component("postMain", { - templateUrl: "/mix-app/views/app-portal/pages/post/components/main/view.html", - bindings: { - post: "=", - }, - controller: [ - "$rootScope", - "$scope", - function ($rootScope, $scope) { - var ctrl = this; - ctrl.translate = $rootScope.translate; - ctrl.generateSeo = function () { - if (ctrl.post) { - if (!ctrl.post.seoName) { - ctrl.post.seoName = $rootScope.generateKeyword( - ctrl.post.title, - "-" - ); - } - if (!ctrl.post.seoTitle) { - ctrl.post.seoTitle = ctrl.post.title; - } - if (!ctrl.post.seoDescription === null) { - ctrl.post.seoDescription = ctrl.post.excerpt; - } - if (!ctrl.post.seoKeywords) { - ctrl.post.seoKeywords = ctrl.post.title; - } - } - }; - }, - ], -}); - -app.component("postModules", { - templateUrl: - "/mix-app/views/app-portal/pages/post/components/modules/view.html", controller: [ "$rootScope", "$scope", - "ngAppSettings", - "SharedModuleDataService", - function ($rootScope, $scope, ngAppSettings, moduleDataService) { + "$location", + "$element", + "PermissionService", + function ($rootScope, $scope, $location, $element, service) { var ctrl = this; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.translate = function (keyword, wrap, defaultValue) { - return $rootScope.translate(keyword, wrap, defaultValue); - }; - - ctrl.removeData = function (id, moduleContentId) { - $rootScope.showConfirm( - ctrl, - "removeDataConfirmed", - [id, moduleContentId], - null, - "Remove Data", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); + ctrl.type = "Children"; + ctrl.goToPath = $rootScope.goToPath; + ctrl.request = { + pageSize: "5", + pageIndex: 0, + status: "Published", + orderBy: "CreatedDateTime", + direction: "Desc", + fromDate: null, + toDate: null, }; - ctrl.removeDataConfirmed = async function (id, moduleContentId) { - $rootScope.isBusy = true; - var result = await moduleDataService.removeModuleData(id); - if (result.success) { - ctrl.loadModuleDatas(moduleContentId); - } else { - $rootScope.showErrors(result.errors); - $rootScope.isBusy = false; - $scope.$apply(); + ctrl.pages = []; + ctrl.init = function () { + if (ctrl.page) { + ctrl.request.exceptIds = ctrl.page.parentNavs + .map((p) => p.pageId) + .concat(ctrl.page.childNavs.map((p) => p.pageId)); + if (ctrl.request.exceptIds.indexOf(ctrl.page.id) === -1) { + ctrl.request.exceptIds.push(ctrl.page.id); + } + ctrl.getList(); } }; - ctrl.saveDataCallback = function (data) { - if (data) { - ctrl.loadModuleDatas(data.moduleContentId); + ctrl.selectPane = function (pane) { + if (ctrl.page) { + ctrl.type = pane.header; + ctrl.request.keyword = ""; + ctrl.init(); } }; - ctrl.loadModuleDatas = async function (id, pageIndex) { - $rootScope.isBusy = true; - $scope.dataColumns = []; - var request = angular.copy(ngAppSettings.request); - request.query = "?moduleContentId=" + id + "&post_id=" + ctrl.post.id; - if (pageIndex) { - request.pageIndex = pageIndex; - } - var response = await moduleDataService.getModuleDatas(request); - if (response.success) { - var nav = $rootScope.findObjectByKey( - ctrl.post.moduleNavs, - "moduleContentId", - id - ); - if (nav) { - nav.module.data = response.data; + + ctrl.selectItem = (nav) => { + if (ctrl.type == "Parents") { + if ( + !$rootScope.findObjectByKey(ctrl.page.parentNavs, "pageId", nav.id) + ) { + ctrl.page.parentNavs.push({ + isActived: true, + pageId: ctrl.page.id, + parentId: nav.id, + description: nav.textDefault, + status: "Published", + parent: nav, + }); } - $rootScope.isBusy = false; - $scope.$apply(); } else { - $rootScope.showErrors(response.errors); - $rootScope.isBusy = false; - $scope.$apply(); + if ( + !$rootScope.findObjectByKey(ctrl.page.childNavs, "pageId", nav.id) + ) { + ctrl.page.childNavs.push({ + isActived: true, + pageId: nav.id, + parentId: ctrl.page.id, + description: nav.textDefault, + status: "Published", + page: nav, + }); + } } }; - ctrl.updateDataInfos = async function (items) { + ctrl.getList = async function () { $rootScope.isBusy = true; - var resp = await moduleDataService.updateInfos(items); + var resp = await service.getList(ctrl.request); if (resp && resp.success) { - $scope.activedPage = resp.data; - $rootScope.showMessage("success", "success"); + ctrl.pages = resp.data; $rootScope.isBusy = false; $scope.$apply(); } else { if (resp) { - $rootScope.showErrors(resp.errors); + $rootScope.showErrors(resp.errors || ["Failed"]); } $rootScope.isBusy = false; $scope.$apply(); @@ -7818,8 +8017,32 @@ app.component("postModules", { }; }, ], +}); + +app.component("postGeneral", { + templateUrl: + "/mix-app/views/app-portal/pages/post/components/general/view.html", + controller: [ + "$rootScope", + "ngAppSettings", + function ($rootScope, ngAppSettings) { + var ctrl = this; + ctrl.dataTypes = $rootScope.globalSettings.dataTypes; + ctrl.$onInit = function () {}; + ctrl.addProperty = function (type) { + var i = $(".property").length; + ctrl.post.properties.push({ + title: "", + name: "", + value: null, + dataType: "text", + }); + }; + }, + ], bindings: { post: "=", + isAdmin: "=", onDelete: "&", onUpdate: "&", }, @@ -7868,440 +8091,146 @@ app.component("postMedias", { }, }); -app.component("postParents", { - templateUrl: - "/mix-app/views/app-portal/pages/post/components/parents/view.html", - bindings: { - post: "=", - onDelete: "&", - onUpdate: "&", - }, -}); - -app.component("postAdvanced", { - templateUrl: - "/mix-app/views/app-portal/pages/post/components/post-advanced/view.html", - bindings: { - model: "=", - additionalData: "=", - }, - controller: [ - "$rootScope", - "$scope", - "$routeParams", - function ($rootScope, $scope, $routeParams) { - var ctrl = this; - ctrl.translate = $rootScope.translate; - ctrl.$onInit = function () { - ctrl.isAdmin = $rootScope.isAdmin; - if ($routeParams.template) { - ctrl.defaultTemplate = $routeParams.template; - } - if ($routeParams.layout) { - ctrl.defaultLayout = $routeParams.layout; - } - }; - }, - ], -}); - -app.component("postContent", { +app.component("postModules", { templateUrl: - "/mix-app/views/app-portal/pages/post/components/post-content/view.html", - bindings: { - model: "=", - additionalData: "=", - loadingData: "=", - }, + "/mix-app/views/app-portal/pages/post/components/modules/view.html", controller: [ "$rootScope", "$scope", "ngAppSettings", - "PostRestService", - function ($rootScope, $scope, ngAppSettings, service) { + "SharedModuleDataService", + function ($rootScope, $scope, ngAppSettings, moduleDataService) { var ctrl = this; ctrl.request = angular.copy(ngAppSettings.request); - ctrl.translate = $rootScope.translate; - ctrl.relatedData = {}; - ctrl.$onInit = function () { - ctrl.backUrl = `/admin/post/details`; - }; - ctrl.generateSeo = function () { - if (ctrl.model) { - if (ctrl.model.seoName === null || ctrl.model.seoName === "") { - ctrl.model.seoName = $rootScope.generateKeyword( - ctrl.model.title, - "-" - ); - } - if (ctrl.model.seoTitle === null || ctrl.model.seoTitle === "") { - ctrl.model.seoTitle = ctrl.model.title; - } - if ( - ctrl.model.seoDescription === null || - ctrl.model.seoDescription === "" - ) { - ctrl.model.seoDescription = ctrl.model.excerpt; - } - if ( - ctrl.model.seoKeywords === null || - ctrl.model.seoKeywords === "" - ) { - ctrl.model.seoKeywords = ctrl.model.title; - } - } + ctrl.translate = function (keyword, wrap, defaultValue) { + return $rootScope.translate(keyword, wrap, defaultValue); }; - ctrl.getListRelated = async function (pageIndex) { - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; - } - if (ctrl.request.fromDate !== null) { - var d = new Date(ctrl.request.fromDate); - ctrl.request.fromDate = d.toISOString(); - } - if (ctrl.request.toDate !== null) { - var d = new Date(ctrl.request.toDate); - ctrl.request.toDate = d.toISOString(); - } - var resp = await service.getList(ctrl.request); - if (resp && resp.success) { - ctrl.relatedData = angular.copy(resp.data); - ctrl.relatedData.items = []; - angular.forEach(resp.data.items, (element) => { - var existed = $rootScope.findObjectByKey( - ctrl.model.postNavs, - ["sourceId", "destinationId"], - [ctrl.model.id, element.id] - ); - - var obj = { - description: element.title, - destinationId: element.id, - image: element.image, - isActived: existed !== null, - sourceId: ctrl.model.id, - specificulture: ctrl.model.specificulture, - status: "Published", - }; - ctrl.relatedData.items.push(obj); - }); - console.log(ctrl.relatedData); - $rootScope.isBusy = false; - $scope.$apply(); + ctrl.removeData = function (id, moduleContentId) { + $rootScope.showConfirm( + ctrl, + "removeDataConfirmed", + [id, moduleContentId], + null, + "Remove Data", + "Deleted data will not able to recover, are you sure you want to delete this item?" + ); + }; + ctrl.removeDataConfirmed = async function (id, moduleContentId) { + $rootScope.isBusy = true; + var result = await moduleDataService.removeModuleData(id); + if (result.success) { + ctrl.loadModuleDatas(moduleContentId); } else { - $rootScope.showErrors(getData.errors); + $rootScope.showErrors(result.errors); $rootScope.isBusy = false; $scope.$apply(); } }; - }, - ], -}); - -app.component("postSeo", { - templateUrl: "/mix-app/views/app-portal/pages/post/components/seo/view.html", - bindings: { - post: "=", - onDelete: "&", - onUpdate: "&", - }, -}); - -modules.component("relatedPosts", { - templateUrl: - "/mix-app/views/app-portal/pages/post/components/related-navigations/view.html", - bindings: { - title: "=", - parentId: "=", - parentType: "=", - description: "=?", - postTypes: "=?", - mixDatabaseName: "=?", - image: "=?", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "PostPostRestService", - "PostRestService", - function ($rootScope, $scope, ngAppSettings, service, postService) { - var ctrl = this; - ctrl.selected = null; - ctrl.posts = { - items: [], - }; - ctrl.data = { - items: [], - }; - ctrl.$onInit = async () => { - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.postRequest = angular.copy(ngAppSettings.request); - ctrl.postRequest.searchColumns = "title,excerpt"; - if (ctrl.mixDatabaseName) { - ctrl.postRequest.mixDatabaseName = ctrl.mixDatabaseName; - } - ctrl.postRequest.pageSize = 5; - await ctrl.loadRelatedPosts(); - await ctrl.loadPosts(); - }; - ctrl.addRelatedPost = async (post) => { - var tmp = ctrl.data.items.find( - (m) => m.child.id == post.id || m.parentId == post.id - ); - if (!tmp) { - if (post) { - let dto = { - parentId: ctrl.parentId, - childId: post.id, - }; - var resp = await service.create(dto); - if (resp.success) { - $rootScope.showMessage("Success", "success"); - await ctrl.loadRelatedPosts(); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(resp.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - } - } else { - $rootScope.showMessage(`${post.title} is existed`, "warning"); - } - }; - - ctrl.remove = function (id) { - if ( - confirm( - "Deleted data will not able to recover, are you sure you want to delete this item?" - ) - ) { - ctrl.removeConfirmed(id); + ctrl.saveDataCallback = function (data) { + if (data) { + ctrl.loadModuleDatas(data.moduleContentId); } }; - - ctrl.removeConfirmed = async function (id) { + ctrl.loadModuleDatas = async function (id, pageIndex) { $rootScope.isBusy = true; - var result = await service.delete([id]); - if (result.success) { - ctrl.loadRelatedPosts(); + $scope.dataColumns = []; + var request = angular.copy(ngAppSettings.request); + request.query = "?moduleContentId=" + id + "&post_id=" + ctrl.post.id; + if (pageIndex) { + request.pageIndex = pageIndex; + } + var response = await moduleDataService.getModuleDatas(request); + if (response.success) { + var nav = $rootScope.findObjectByKey( + ctrl.post.moduleNavs, + "moduleContentId", + id + ); + if (nav) { + nav.module.data = response.data; + } + $rootScope.isBusy = false; + $scope.$apply(); } else { - $rootScope.showErrors(result.errors); + $rootScope.showErrors(response.errors); $rootScope.isBusy = false; $scope.$apply(); } }; - ctrl.loadPosts = async (pageIndex) => { + ctrl.updateDataInfos = async function (items) { $rootScope.isBusy = true; - if (pageIndex !== undefined) { - ctrl.postRequest.pageIndex = pageIndex; - } - if (ctrl.postRequest.fromDate !== null) { - var d = new Date(ctrl.postRequest.fromDate); - ctrl.postRequest.fromDate = d.toISOString(); - } - if (ctrl.postRequest.toDate !== null) { - var dt = new Date(ctrl.postRequest.toDate); - ctrl.postRequest.toDate = dt.toISOString(); - } - let getData = await postService.filter(ctrl.postRequest); - if (getData.success) { - ctrl.posts = getData.data; + var resp = await moduleDataService.updateInfos(items); + if (resp && resp.success) { + $scope.activedPage = resp.data; + $rootScope.showMessage("success", "success"); $rootScope.isBusy = false; + $scope.$apply(); } else { - $rootScope.isBusy = false; - $rootScope.showErrors(getData.errors); - } - $scope.$apply(); - }; - - ctrl.loadRelatedPosts = async (pageIndex) => { - if (ctrl.parentId) { - $rootScope.isBusy = true; - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; - } - if (ctrl.request.fromDate !== null) { - var d = new Date(ctrl.postRequest.fromDate); - ctrl.request.fromDate = d.toISOString(); - } - if (ctrl.request.toDate !== null) { - var dt = new Date(ctrl.postRequest.toDate); - ctrl.postRequest.toDate = dt.toISOString(); - } - ctrl.request.parentId = ctrl.parentId; - let getData = await service.search(ctrl.request); - if (getData.success) { - ctrl.data = getData.data; - $rootScope.isBusy = false; - } else { - $rootScope.isBusy = false; - $rootScope.showErrors(getData.errors); + if (resp) { + $rootScope.showErrors(resp.errors); } + $rootScope.isBusy = false; $scope.$apply(); } }; }, ], + bindings: { + post: "=", + onDelete: "&", + onUpdate: "&", + }, }); -app.component("pageMain", { - templateUrl: "/mix-app/views/app-portal/pages/page/components/main/main.html", +app.component("postMain", { + templateUrl: "/mix-app/views/app-portal/pages/post/components/main/view.html", + bindings: { + post: "=", + }, controller: [ "$rootScope", "$scope", - "ngAppSettings", function ($rootScope, $scope) { var ctrl = this; - ctrl.mixConfigurations = $rootScope.globalSettings; - // ctrl.setPageType = function (type) { - // ctrl.page.type = $index; - // } + ctrl.translate = $rootScope.translate; ctrl.generateSeo = function () { - if (ctrl.page) { - if (ctrl.page.seoName === null || ctrl.page.seoName === "") { - ctrl.page.seoName = $rootScope.generateKeyword( - ctrl.page.title, + if (ctrl.post) { + if (!ctrl.post.seoName) { + ctrl.post.seoName = $rootScope.generateKeyword( + ctrl.post.title, "-" ); } - if (ctrl.page.seoTitle === null || ctrl.page.seoTitle === "") { - ctrl.page.seoTitle = ctrl.page.title; + if (!ctrl.post.seoTitle) { + ctrl.post.seoTitle = ctrl.post.title; } - if ( - ctrl.page.seoDescription === null || - ctrl.page.seoDescription === "" - ) { - ctrl.page.seoDescription = ctrl.page.excerpt; + if (!ctrl.post.seoDescription === null) { + ctrl.post.seoDescription = ctrl.post.excerpt; } - if (ctrl.page.seoKeywords === null || ctrl.page.seoKeywords === "") { - ctrl.page.seoKeywords = ctrl.page.title; + if (!ctrl.post.seoKeywords) { + ctrl.post.seoKeywords = ctrl.post.title; } } }; }, ], - bindings: { - page: "=", - onDelete: "&", - onUpdate: "&", - }, }); -app.component("pageGeneral", { +app.component("postParents", { templateUrl: - "/mix-app/views/app-portal/pages/page/components/general/general.html", - controller: function ($rootScope) { - var ctrl = this; - ctrl.isInRole = $rootScope.isInRole; - ctrl.dataTypes = [ - { - title: "String", - value: "text", - }, - { - title: "Int", - value: "int", - }, - { - title: "Image", - value: "image", - }, - { - title: "Boolean", - value: "boolean", - }, - ]; - ctrl.configurations = { - core: {}, - plugins: { - btnsDef: { - // Customizables dropdowns - image: { - dropdown: ["insertImage", "upload", "base64", "noembed"], - ico: "insertImage", - }, - }, - btns: [ - ["viewHTML"], - ["undo", "redo"], - ["formatting"], - ["strong", "em", "del", "underline"], - ["link"], - ["image"], - ["justifyLeft", "justifyCenter", "justifyRight", "justifyFull"], - ["unorderedList", "orderedList"], - ["foreColor", "backColor"], - ["preformatted"], - ["horizontalRule"], - ["fullscreen"], - ], - plugins: { - // Add imagur parameters to upload plugin - upload: { - serverPath: "https://api.imgur.com/3/image", - fileFieldName: "image", - headers: { - Authorization: "Client-ID 9e57cb1c4791cea", - }, - urlPropertyName: "data.link", - }, - }, - }, - }; - ctrl.addProperty = function (type) { - var i = $(".property").length; - ctrl.page.properties.push({ - priority: 0, - name: "", - value: null, - dataType: 0, - }); - }; - ctrl.initEditor = function () { - setTimeout(function () { - // Init Code editor - $.each($(".code-editor"), function (i, e) { - var container = $(this); - var editor = ace.edit(e); - if (container.hasClass("json")) { - editor.session.setMode("ace/mode/json"); - } else { - editor.session.setMode("ace/mode/razor"); - } - editor.setTheme("ace/theme/chrome"); - //editor.setReadOnly(true); - - editor.session.setUseWrapMode(true); - editor.setOptions({ - maxLines: Infinity, - }); - editor.getSession().on("change", function (e) { - // e.type, etc - $(container).parent().find(".code-content").val(editor.getValue()); - }); - }); - $.each($(".editor-content"), function (i, e) { - var $demoTextarea = $(e); - $demoTextarea.quill(ctrl.configurations.plugins); - }); - }, 200); - }; - }, + "/mix-app/views/app-portal/pages/post/components/parents/view.html", bindings: { - page: "=", + post: "=", onDelete: "&", onUpdate: "&", }, }); -app.component("pageAdvanced", { +app.component("postAdvanced", { templateUrl: - "/mix-app/views/app-portal/pages/page/components/page-advanced/view.html", + "/mix-app/views/app-portal/pages/post/components/post-advanced/view.html", bindings: { model: "=", additionalData: "=", @@ -8309,80 +8238,46 @@ app.component("pageAdvanced", { controller: [ "$rootScope", "$scope", - function ($rootScope, $scope) { - var ctrl = this; - - ctrl.translate = $rootScope.translate; - ctrl.$onInit = function () { - ctrl.isAdmin = $rootScope.isAdmin; - }; - }, - ], -}); - -app.component("pageModules", { - templateUrl: - "/mix-app/views/app-portal/pages/page/components/modules/modules.html", - bindings: { - page: "=", - onDelete: "&?", - onUpdate: "&?", - }, - controller: [ - "$scope", - "ngAppSettings", - "ModuleRestService", - function ($scope, ngAppSettings, moduleService) { + "$routeParams", + function ($rootScope, $scope, $routeParams) { var ctrl = this; - ctrl.modules = []; - ctrl.request = angular.copy(ngAppSettings.request); - - ctrl.$onInit = async () => { - ctrl.request.columns = [ - "id", - "title", - "systemName", - "createdDateTime", - "type", - ]; - ctrl.request.culture = ctrl.page.specificulture; - ctrl.loadModules(); - }; - ctrl.loadModules = async () => { - let getModules = await moduleService.getList(ctrl.request); - if (getModules.success) { - ctrl.modules = getModules.data.items; - $scope.$apply(); + ctrl.translate = $rootScope.translate; + ctrl.$onInit = function () { + ctrl.isAdmin = $rootScope.isAdmin; + if ($routeParams.template) { + ctrl.defaultTemplate = $routeParams.template; } - }; - ctrl.select = async (associations) => { - ctrl.associations = associations; - if (ctrl.onUpdate) { - ctrl.onUpdate({ associations: associations }); + if ($routeParams.layout) { + ctrl.defaultLayout = $routeParams.layout; } }; }, ], }); -app.component("pageContent", { +app.component("postContent", { templateUrl: - "/mix-app/views/app-portal/pages/page/components/page-content/view.html", + "/mix-app/views/app-portal/pages/post/components/post-content/view.html", bindings: { - additionalData: "=", model: "=", + additionalData: "=", + loadingData: "=", }, controller: [ "$rootScope", "$scope", - function ($rootScope, $scope) { + "ngAppSettings", + "PostRestService", + function ($rootScope, $scope, ngAppSettings, service) { var ctrl = this; + ctrl.request = angular.copy(ngAppSettings.request); ctrl.translate = $rootScope.translate; + ctrl.relatedData = {}; ctrl.$onInit = function () { - ctrl.backUrl = `/admin/page/details`; + ctrl.backUrl = `/admin/post/details`; }; ctrl.generateSeo = function () { - if ($scope.viewmodel) { + if (ctrl.model) { if (ctrl.model.seoName === null || ctrl.model.seoName === "") { ctrl.model.seoName = $rootScope.generateKeyword( ctrl.model.title, @@ -8406,120 +8301,201 @@ app.component("pageContent", { } } }; + ctrl.getListRelated = async function (pageIndex) { + if (pageIndex !== undefined) { + ctrl.request.pageIndex = pageIndex; + } + if (ctrl.request.fromDate !== null) { + var d = new Date(ctrl.request.fromDate); + ctrl.request.fromDate = d.toISOString(); + } + if (ctrl.request.toDate !== null) { + var d = new Date(ctrl.request.toDate); + ctrl.request.toDate = d.toISOString(); + } + var resp = await service.getList(ctrl.request); + if (resp && resp.success) { + ctrl.relatedData = angular.copy(resp.data); + ctrl.relatedData.items = []; + angular.forEach(resp.data.items, (element) => { + var existed = $rootScope.findObjectByKey( + ctrl.model.postNavs, + ["sourceId", "destinationId"], + [ctrl.model.id, element.id] + ); + + var obj = { + description: element.title, + destinationId: element.id, + image: element.image, + isActived: existed !== null, + sourceId: ctrl.model.id, + specificulture: ctrl.model.specificulture, + status: "Published", + }; + + ctrl.relatedData.items.push(obj); + }); + console.log(ctrl.relatedData); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showErrors(getData.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + }; }, ], }); -app.component("pageType", { +modules.component("relatedPosts", { templateUrl: - "/mix-app/views/app-portal/pages/page/components/page-type/view.html", + "/mix-app/views/app-portal/pages/post/components/related-navigations/view.html", bindings: { - model: "=", + title: "=", + parentId: "=", + parentType: "=", + description: "=?", + postTypes: "=?", + mixDatabaseName: "=?", + image: "=?", }, controller: [ "$rootScope", - function ($rootScope) { + "$scope", + "ngAppSettings", + "PostPostRestService", + "PostRestService", + function ($rootScope, $scope, ngAppSettings, service, postService) { var ctrl = this; - ctrl.localizeSettings = $rootScope.globalSettings; - }, - ], -}); + ctrl.selected = null; + ctrl.posts = { + items: [], + }; + ctrl.data = { + items: [], + }; + ctrl.$onInit = async () => { + ctrl.request = angular.copy(ngAppSettings.request); + ctrl.postRequest = angular.copy(ngAppSettings.request); + ctrl.postRequest.searchColumns = "title,excerpt"; + if (ctrl.mixDatabaseName) { + ctrl.postRequest.mixDatabaseName = ctrl.mixDatabaseName; + } + ctrl.postRequest.pageSize = 5; + await ctrl.loadRelatedPosts(); + await ctrl.loadPosts(); + }; + ctrl.addRelatedPost = async (post) => { + var tmp = ctrl.data.items.find( + (m) => m.child.id == post.id || m.parentId == post.id + ); + if (!tmp) { + if (post) { + let dto = { + parentId: ctrl.parentId, + childId: post.id, + }; + var resp = await service.create(dto); + if (resp.success) { + $rootScope.showMessage("Success", "success"); + await ctrl.loadRelatedPosts(); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showErrors(resp.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + } + } else { + $rootScope.showMessage(`${post.title} is existed`, "warning"); + } + }; -app.component("pageParents", { - templateUrl: - "/mix-app/views/app-portal/pages/page/components/parents/parents.html", - bindings: { - page: "=", - onDelete: "&", - onUpdate: "&", - }, -}); + ctrl.remove = function (id) { + if ( + confirm( + "Deleted data will not able to recover, are you sure you want to delete this item?" + ) + ) { + ctrl.removeConfirmed(id); + } + }; -app.component("pagePlugPlay", { - templateUrl: - "/mix-app/views/app-portal/pages/page/components/plug-play/plug-play.html", - bindings: { - page: "=", - onDelete: "&", - onUpdate: "&", - }, -}); + ctrl.removeConfirmed = async function (id) { + $rootScope.isBusy = true; + var result = await service.delete([id]); + if (result.success) { + ctrl.loadRelatedPosts(); + } else { + $rootScope.showErrors(result.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + }; -app.component("productRelated", { - templateUrl: - "/mix-app/views/app-portal/pages/product/components/related/productRelated.html", - controller: function () { - var ctrl = this; - ctrl.activeProduct = function (pr) { - var currentItem = null; - $.each(ctrl.product.productNavs, function (i, e) { - if (e.relatedProductId === pr.id) { - e.isActived = pr.isActived; - currentItem = e; - return false; + ctrl.loadPosts = async (pageIndex) => { + $rootScope.isBusy = true; + if (pageIndex !== undefined) { + ctrl.postRequest.pageIndex = pageIndex; } - }); - if (currentItem === null) { - currentItem = { - relatedProductId: pr.id, - sourceProductId: ctrl.product.id, - specificulture: ctrl.product.specificulture, - priority: ctrl.product.productNavs.length + 1, - relatedProduct: pr, - isActived: true, - }; - pr.isHidden = true; - ctrl.product.productNavs.push(currentItem); - } - }; - }, - bindings: { - product: "=", - list: "=", - onDelete: "&", - onUpdate: "&", - }, -}); + if (ctrl.postRequest.fromDate !== null) { + var d = new Date(ctrl.postRequest.fromDate); + ctrl.postRequest.fromDate = d.toISOString(); + } + if (ctrl.postRequest.toDate !== null) { + var dt = new Date(ctrl.postRequest.toDate); + ctrl.postRequest.toDate = dt.toISOString(); + } + let getData = await postService.filter(ctrl.postRequest); + if (getData.success) { + ctrl.posts = getData.data; + $rootScope.isBusy = false; + } else { + $rootScope.isBusy = false; + $rootScope.showErrors(getData.errors); + } + $scope.$apply(); + }; -app.component("pageSeo", { - templateUrl: "/mix-app/views/app-portal/pages/page/components/seo/seo.html", - controller: [ - "$rootScope", - function ($rootScope) { - var ctrl = this; - ctrl.translate = function (keyword) { - return $rootScope.translate(keyword); + ctrl.loadRelatedPosts = async (pageIndex) => { + if (ctrl.parentId) { + $rootScope.isBusy = true; + if (pageIndex !== undefined) { + ctrl.request.pageIndex = pageIndex; + } + if (ctrl.request.fromDate !== null) { + var d = new Date(ctrl.postRequest.fromDate); + ctrl.request.fromDate = d.toISOString(); + } + if (ctrl.request.toDate !== null) { + var dt = new Date(ctrl.postRequest.toDate); + ctrl.postRequest.toDate = dt.toISOString(); + } + ctrl.request.parentId = ctrl.parentId; + let getData = await service.search(ctrl.request); + if (getData.success) { + ctrl.data = getData.data; + $rootScope.isBusy = false; + } else { + $rootScope.isBusy = false; + $rootScope.showErrors(getData.errors); + } + $scope.$apply(); + } }; }, ], - bindings: { - page: "=", - onDelete: "&", - onUpdate: "&", - }, }); -app.component("serviceMain", { - templateUrl: - "/mix-app/views/app-portal/pages/service/components/main/view.html", - controller: [ - "$rootScope", - function ($rootScope) { - var ctrl = this; - ctrl.mixConfigurations = $rootScope.globalSettings; - ctrl.gennerateName = function () { - if ( - !ctrl.model.id || - ctrl.model.name === null || - ctrl.model.name === "" - ) { - ctrl.model.name = $rootScope.generateKeyword(ctrl.model.title, "_"); - } - }; - }, - ], +app.component("postSeo", { + templateUrl: "/mix-app/views/app-portal/pages/post/components/seo/view.html", bindings: { - model: "=", + post: "=", + onDelete: "&", + onUpdate: "&", }, }); @@ -8564,6 +8540,30 @@ modules.component("rolePageNav", { ], }); +app.component("serviceMain", { + templateUrl: + "/mix-app/views/app-portal/pages/service/components/main/view.html", + controller: [ + "$rootScope", + function ($rootScope) { + var ctrl = this; + ctrl.mixConfigurations = $rootScope.globalSettings; + ctrl.gennerateName = function () { + if ( + !ctrl.model.id || + ctrl.model.name === null || + ctrl.model.name === "" + ) { + ctrl.model.name = $rootScope.generateKeyword(ctrl.model.title, "_"); + } + }; + }, + ], + bindings: { + model: "=", + }, +}); + app.component("themeExportCultures", { templateUrl: "/mix-app/views/app-portal/pages/theme/components/theme-export-cultures/view.html", @@ -9151,25 +9151,25 @@ app.component("themeImportMixDatabases", { ], }); -app.component("themeImportPages", { +app.component("themeImportModules", { templateUrl: - "/mix-app/views/app-portal/pages/theme-import/components/theme-import-pages/view.html", + "/mix-app/views/app-portal/pages/theme-import/components/theme-import-modules/view.html", controller: [ "$rootScope", "$scope", "ngAppSettings", function ($rootScope, $scope, ngAppSettings) { var ctrl = this; - var service = $rootScope.getRestService("mix-page"); + var service = $rootScope.getRestService("mix-module"); ctrl.selectAllContent = false; ctrl.selectAllData = false; ctrl.request = angular.copy(ngAppSettings.request); ctrl.$onInit = async () => { ctrl.getList(); }; - ctrl.getList = async (pageIndex) => { - if (pageIndex !== undefined) { - ctrl.request.pageIndex = pageIndex; + ctrl.getList = async (moduleIndex) => { + if (moduleIndex !== undefined) { + ctrl.request.moduleIndex = moduleIndex; } if (ctrl.request.fromDate !== null) { var d = new Date(ctrl.request.fromDate); @@ -9184,39 +9184,39 @@ app.component("themeImportPages", { ctrl.data = getData.data; } }; - ctrl.selectContent = (page, selected) => { + ctrl.selectContent = (module, selected) => { ctrl.selectAllContent = ctrl.selectAllContent && selected; ctrl.selectAllData = ctrl.selectAllData && selected; - page.isImportData = selected && page.isImportData; - let contentIds = page.contents.map(function (obj) { + module.isImportData = selected && module.isImportData; + let contentIds = module.contents.map(function (obj) { return obj.id; }); - ctrl.importThemeDto.content.pageIds = ctrl.updateArray( - ctrl.importThemeDto.content.pageIds, - [page.id], + ctrl.importThemeDto.content.moduleIds = ctrl.updateArray( + ctrl.importThemeDto.content.moduleIds, + [module.id], selected ); - ctrl.importThemeDto.content.pageContentIds = ctrl.updateArray( - ctrl.importThemeDto.content.pageContentIds, + ctrl.importThemeDto.content.moduleContentIds = ctrl.updateArray( + ctrl.importThemeDto.content.moduleContentIds, contentIds, selected ); if (!selected) { - ctrl.selectData(page, false); + ctrl.selectData(module, false); } }; - ctrl.selectData = (page, selected) => { + ctrl.selectData = (module, selected) => { ctrl.selectAllData = ctrl.selectAllData && selected; - let contentIds = page.contents.map(function (obj) { + let contentIds = module.contents.map(function (obj) { return obj.id; }); - ctrl.importThemeDto.associations.pageIds = ctrl.updateArray( - ctrl.importThemeDto.associations.pageIds, - [page.id], + ctrl.importThemeDto.associations.moduleIds = ctrl.updateArray( + ctrl.importThemeDto.associations.moduleIds, + [module.id], selected ); - ctrl.importThemeDto.associations.pageContentIds = ctrl.updateArray( - ctrl.importThemeDto.associations.pageContentIds, + ctrl.importThemeDto.associations.moduleContentIds = ctrl.updateArray( + ctrl.importThemeDto.associations.moduleContentIds, contentIds, selected ); @@ -9247,25 +9247,25 @@ app.component("themeImportPages", { }, }); -app.component("themeImportModules", { +app.component("themeImportPages", { templateUrl: - "/mix-app/views/app-portal/pages/theme-import/components/theme-import-modules/view.html", + "/mix-app/views/app-portal/pages/theme-import/components/theme-import-pages/view.html", controller: [ "$rootScope", "$scope", "ngAppSettings", function ($rootScope, $scope, ngAppSettings) { var ctrl = this; - var service = $rootScope.getRestService("mix-module"); + var service = $rootScope.getRestService("mix-page"); ctrl.selectAllContent = false; ctrl.selectAllData = false; ctrl.request = angular.copy(ngAppSettings.request); ctrl.$onInit = async () => { ctrl.getList(); }; - ctrl.getList = async (moduleIndex) => { - if (moduleIndex !== undefined) { - ctrl.request.moduleIndex = moduleIndex; + ctrl.getList = async (pageIndex) => { + if (pageIndex !== undefined) { + ctrl.request.pageIndex = pageIndex; } if (ctrl.request.fromDate !== null) { var d = new Date(ctrl.request.fromDate); @@ -9280,39 +9280,39 @@ app.component("themeImportModules", { ctrl.data = getData.data; } }; - ctrl.selectContent = (module, selected) => { + ctrl.selectContent = (page, selected) => { ctrl.selectAllContent = ctrl.selectAllContent && selected; ctrl.selectAllData = ctrl.selectAllData && selected; - module.isImportData = selected && module.isImportData; - let contentIds = module.contents.map(function (obj) { + page.isImportData = selected && page.isImportData; + let contentIds = page.contents.map(function (obj) { return obj.id; }); - ctrl.importThemeDto.content.moduleIds = ctrl.updateArray( - ctrl.importThemeDto.content.moduleIds, - [module.id], + ctrl.importThemeDto.content.pageIds = ctrl.updateArray( + ctrl.importThemeDto.content.pageIds, + [page.id], selected ); - ctrl.importThemeDto.content.moduleContentIds = ctrl.updateArray( - ctrl.importThemeDto.content.moduleContentIds, + ctrl.importThemeDto.content.pageContentIds = ctrl.updateArray( + ctrl.importThemeDto.content.pageContentIds, contentIds, selected ); if (!selected) { - ctrl.selectData(module, false); + ctrl.selectData(page, false); } }; - ctrl.selectData = (module, selected) => { + ctrl.selectData = (page, selected) => { ctrl.selectAllData = ctrl.selectAllData && selected; - let contentIds = module.contents.map(function (obj) { + let contentIds = page.contents.map(function (obj) { return obj.id; }); - ctrl.importThemeDto.associations.moduleIds = ctrl.updateArray( - ctrl.importThemeDto.associations.moduleIds, - [module.id], + ctrl.importThemeDto.associations.pageIds = ctrl.updateArray( + ctrl.importThemeDto.associations.pageIds, + [page.id], selected ); - ctrl.importThemeDto.associations.moduleContentIds = ctrl.updateArray( - ctrl.importThemeDto.associations.moduleContentIds, + ctrl.importThemeDto.associations.pageContentIds = ctrl.updateArray( + ctrl.importThemeDto.associations.pageContentIds, contentIds, selected ); @@ -9713,6 +9713,113 @@ modules.component("layoutPortalSidebar", { bindings: {}, }); +modules.component("aceEditor", { + templateUrl: + "/mix-app/views/app-portal/components/ace-editor/ace-editor.html", + controller: [ + "$rootScope", + "$scope", + "ngAppSettings", + function ($rootScope, $scope, ngAppSettings) { + var ctrl = this; + ctrl.previousId = null; + ctrl.editor = null; + ctrl.id = Math.floor(Math.random() * 100) + 1; + ctrl.$onChanges = (changes) => { + if (changes.content) { + ctrl.updateEditors(); + } + }; + + this.$doCheck = function () { + if (ctrl.previousId != null && ctrl.previousId !== ctrl.contentId) { + ctrl.previousId = ctrl.contentId; + ctrl.updateEditors(); + } + }.bind(this); + ctrl.initAce = function () { + setTimeout(() => { + ctrl.previousId = ctrl.contentId; + ctrl.updateEditors(); + $scope.$apply(); + }, 200); + }; + ctrl.updateContent = function (content) { + ctrl.editor.setValue(content); + }; + ctrl.updateEditors = function () { + $.each($("#code-editor-" + ctrl.id), function (i, e) { + //var container = $(this); + ace.require("ace/ext/language_tools"); + if (e) { + var editor = ace.edit(e); + switch (ctrl.ext) { + case ".json": + editor.session.setMode("ace/mode/json"); + break; + case ".js": + editor.session.setMode("ace/mode/javascript"); + break; + case ".css": + editor.session.setMode("ace/mode/css"); + break; + case ".cshtml": + editor.session.setMode("ace/mode/razor"); + break; + case ".cs": + editor.session.setMode("ace/mode/csharp"); + break; + default: + editor.session.setMode("ace/mode/razor"); + break; + } + editor.setTheme("ace/theme/chrome"); + //editor.setReadOnly(true); + if (ctrl.content) { + editor.setValue(ctrl.content); + } + editor.$blockScrolling = Infinity; + editor.session.setUseWrapMode(true); + editor.setOptions({ + enableBasicAutocompletion: true, + enableSnippets: true, + enableLiveAutocompletion: false, + maxLines: 50, + fontSize: 11, + }); + editor.getSession().on("change", function (e) { + // e.type, etc + ctrl.content = editor.getValue(); + }); + editor.getSession().on("paste", function (e) { + // e.type, etc + ctrl.content = editor.getValue(); + }); + editor.commands.addCommand({ + name: "saveFile", + bindKey: { + win: "Ctrl-S", + mac: "Command-S", + sender: "editor|cli", + }, + exec: function (env, args, request) { + var btn = document.getElementById("btnToSubmit"); + btn.click(); + }, + }); + ctrl.editor = editor; + } + }); + }; + }, + ], + bindings: { + content: "=", + contentId: "=", + ext: "=", + }, +}); + modules.component("actions", { templateUrl: "/mix-app/views/app-portal/components/actions/actions.html", bindings: { @@ -9891,262 +9998,39 @@ modules.component("additionalValue", { "RestMixDatabaseDataPortalService", function ($rootScope, $scope, dataService) { var ctrl = this; - ctrl.value = {}; - ctrl.column = { dataType: "Text" }; - ctrl.selectedCol = null; - ctrl.mixConfigurations = $rootScope.globalSettings; - ctrl.$onInit = async function () { - if (!ctrl.additionalData) { - if (!ctrl.additionalDataId) { - const obj = { - parentType: ctrl.parentType, - parentId: ctrl.parentId, - databaseName: ctrl.mixDatabaseName, - }; - const getData = await dataService.getAdditionalData(obj); - if (getData.success) { - ctrl.additionalData = getData.data; - ctrl.additionalData.mixDatabaseName = ctrl.mixDatabaseName; - ctrl.additionalData.parentType = ctrl.parentType; - $scope.$apply(); - } else { - $rootScope.showErrors(getData.errors); - } - } else { - var getData = await dataService.getSingle([ctrl.additionalDataId]); - ctrl.additionalData = getData.data; - $scope.$apply(); - } - } - if (ctrl.additionalData.id == "00000000-0000-0000-0000-000000000000") { - ctrl.additionalData.id = null; - } - }; - }, - ], -}); - -modules.component("filterList", { - templateUrl: - "/mix-app/views/app-portal/components/filter-list/filter-list.html", - controller: [ - "$scope", - "$rootScope", - "ngAppSettings", - "CultureService", - function ($scope, $rootScope, ngAppSettings, cultureService) { - var ctrl = this; - ctrl.dateRange = { - fromDate: null, - toDate: null, - }; - ctrl.searchMethods = ["Equal", "Like"]; - ctrl.init = async function () { - if (!ctrl.arrOrderby) { - ctrl.arrOrderby = [ - "Title", - "Priority", - "CreatedDateTime", - "LastModified", - "Status", - ]; - } - ctrl.request.orderBy = ctrl.request.orderBy || ctrl.arrOrderby[0]; - ctrl.directions = ["Asc", "Desc"]; - ctrl.pageSizes = [5, 10, 15, 20]; - ctrl.statuses = $rootScope.globalSettings.statuses; - }; - ctrl.changeLang = function (culture) { - if (culture) { - ctrl.selectedCulture = culture; - ctrl.request.culture = culture.specificulture; - } else { - ctrl.selectedCulture = null; - ctrl.request.culture = null; - } - ctrl.apply(0); - }; - ctrl.apply = function (pageIndex) { - $rootScope.setRequest(ctrl.request, ctrl.key); - ctrl.callback({ pageIndex: pageIndex }); - }; - ctrl.updateDate = function () { - ctrl.request.pageIndex = 0; - if (Date.parse(ctrl.dateRange.fromDate)) { - ctrl.request.fromDate = new Date( - ctrl.dateRange.fromDate - ).toISOString(); - } else { - $scope.request.fromDate = null; - } - if (Date.parse(ctrl.dateRange.toDate)) { - ctrl.request.toDate = new Date(ctrl.dateRange.toDate).toISOString(); - } else { - ctrl.request.toDate = null; - } - $rootScope.setRequest(ctrl.request, ctrl.key); - ctrl.callback({ pageIndex: 0 }); - }; - }, - ], - bindings: { - request: "=", - key: "=?", - arrOrderby: "=?", - createUrl: "=", - createText: "=", - callback: "&", - }, -}); - -modules.component("aceEditor", { - templateUrl: - "/mix-app/views/app-portal/components/ace-editor/ace-editor.html", - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - function ($rootScope, $scope, ngAppSettings) { - var ctrl = this; - ctrl.previousId = null; - ctrl.editor = null; - ctrl.id = Math.floor(Math.random() * 100) + 1; - ctrl.$onChanges = (changes) => { - if (changes.content) { - ctrl.updateEditors(); - } - }; - - this.$doCheck = function () { - if (ctrl.previousId != null && ctrl.previousId !== ctrl.contentId) { - ctrl.previousId = ctrl.contentId; - ctrl.updateEditors(); - } - }.bind(this); - ctrl.initAce = function () { - setTimeout(() => { - ctrl.previousId = ctrl.contentId; - ctrl.updateEditors(); - $scope.$apply(); - }, 200); - }; - ctrl.updateContent = function (content) { - ctrl.editor.setValue(content); - }; - ctrl.updateEditors = function () { - $.each($("#code-editor-" + ctrl.id), function (i, e) { - //var container = $(this); - ace.require("ace/ext/language_tools"); - if (e) { - var editor = ace.edit(e); - switch (ctrl.ext) { - case ".json": - editor.session.setMode("ace/mode/json"); - break; - case ".js": - editor.session.setMode("ace/mode/javascript"); - break; - case ".css": - editor.session.setMode("ace/mode/css"); - break; - case ".cshtml": - editor.session.setMode("ace/mode/razor"); - break; - case ".cs": - editor.session.setMode("ace/mode/csharp"); - break; - default: - editor.session.setMode("ace/mode/razor"); - break; - } - editor.setTheme("ace/theme/chrome"); - //editor.setReadOnly(true); - if (ctrl.content) { - editor.setValue(ctrl.content); - } - editor.$blockScrolling = Infinity; - editor.session.setUseWrapMode(true); - editor.setOptions({ - enableBasicAutocompletion: true, - enableSnippets: true, - enableLiveAutocompletion: false, - maxLines: 50, - fontSize: 11, - }); - editor.getSession().on("change", function (e) { - // e.type, etc - ctrl.content = editor.getValue(); - }); - editor.getSession().on("paste", function (e) { - // e.type, etc - ctrl.content = editor.getValue(); - }); - editor.commands.addCommand({ - name: "saveFile", - bindKey: { - win: "Ctrl-S", - mac: "Command-S", - sender: "editor|cli", - }, - exec: function (env, args, request) { - var btn = document.getElementById("btnToSubmit"); - btn.click(); - }, - }); - ctrl.editor = editor; - } - }); - }; - }, - ], - bindings: { - content: "=", - contentId: "=", - ext: "=", - }, -}); - -modules.component("funding", { - templateUrl: "/mix-app/views/app-portal/components/funding/view.html", - controller: [ - "$rootScope", - "$http", - function ($rootScope, $http) { - var ctrl = this; - ctrl.items = [ - { - title: "opencollective.com/mixcore", - href: "https://opencollective.com/mixcore", - logo: - "https://github.githubassets.com/images/modules/site/icons/funding_platforms/open_collective.svg", - }, - { - title: "funding.communitybridge.org/projects/mixcore", - href: "https://crowdfunding.lfx.linuxfoundation.org/projects/mixcore", - logo: - "https://github.githubassets.com/images/modules/site/icons/funding_platforms/community_bridge.svg", - }, - { - title: "patreon.com/mixcore", - href: "https://www.patreon.com/mixcore/creators", - logo: - "https://github.githubassets.com/images/modules/site/icons/funding_platforms/patreon.svg", - }, - { - title: "paypalme/mixcore", - href: "https://www.paypal.me/mixcore", - logo: "/mix-app/assets/img/svg/heart.svg", - }, - { - title: "buymeacoffee.com/mixcore", - href: "https://www.buymeacoffee.com/mixcore", - logo: "/mix-app/assets/img/svg/heart.svg", - }, - ]; - ctrl.init = function () {}; + ctrl.value = {}; + ctrl.column = { dataType: "Text" }; + ctrl.selectedCol = null; + ctrl.mixConfigurations = $rootScope.globalSettings; + ctrl.$onInit = async function () { + if (!ctrl.additionalData) { + if (!ctrl.additionalDataId) { + const obj = { + parentType: ctrl.parentType, + parentId: ctrl.parentId, + databaseName: ctrl.mixDatabaseName, + }; + const getData = await dataService.getAdditionalData(obj); + if (getData.success) { + ctrl.additionalData = getData.data; + ctrl.additionalData.mixDatabaseName = ctrl.mixDatabaseName; + ctrl.additionalData.parentType = ctrl.parentType; + $scope.$apply(); + } else { + $rootScope.showErrors(getData.errors); + } + } else { + var getData = await dataService.getSingle([ctrl.additionalDataId]); + ctrl.additionalData = getData.data; + $scope.$apply(); + } + } + if (ctrl.additionalData.id == "00000000-0000-0000-0000-000000000000") { + ctrl.additionalData.id = null; + } + }; }, ], - bindings: {}, }); modules.component("confirm", { @@ -10178,81 +10062,6 @@ modules.component("confirm", { }, }); -modules.component("githubReleases", { - templateUrl: "/mix-app/views/app-portal/components/github-releases/view.html", - controller: [ - "$rootScope", - "$http", - function ($rootScope, $http) { - var ctrl = this; - ctrl.items = []; - ctrl.init = function () { - var req = { - method: "GET", - url: "https://api.github.com/repos/mixcore/mix.core/releases", - }; - ctrl.getGithubApiResult(req); - }; - - ctrl.getGithubApiResult = async function (req) { - return $http(req).then( - function (resp) { - if (resp.status == "200") { - ctrl.items = resp.data; - } else { - } - }, - function (error) { - return { - success: false, - errors: [error.statusText || error.status], - }; - } - ); - }; - }, - ], - bindings: {}, -}); - -modules.component("githubContributers", { - templateUrl: - "/mix-app/views/app-portal/components/github-contributers/view.html", - controller: [ - "$rootScope", - "$http", - function ($rootScope, $http) { - var ctrl = this; - ctrl.items = []; - ctrl.init = function () { - var req = { - method: "GET", - url: "https://api.github.com/repos/mixcore/mix.core/contributors", - }; - ctrl.getGithubApiResult(req); - }; - - ctrl.getGithubApiResult = async function (req) { - return $http(req).then( - function (resp) { - if (resp.status == "200") { - ctrl.items = resp.data; - } else { - } - }, - function (error) { - return { - success: false, - errors: [error.statusText || error.status], - }; - } - ); - }; - }, - ], - bindings: {}, -}); - modules.component("customImage", { templateUrl: "/mix-app/views/app-portal/components/custom-image/custom-image.html", @@ -10420,109 +10229,159 @@ modules.component("customImage", { ], }); -(function (angular) { - app.component("headerNav", { - templateUrl: - "/mix-app/views/app-portal/components/header-nav/headerNav.html", - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "localStorageService", - "CommonService", - "ApiService", - "AuthService", - "CultureService", - function ( - $rootScope, - $scope, - ngAppSettings, - localStorageService, - commonService, - apiService, - authService, - cultureService - ) { - var ctrl = this; - ctrl.appSettings = $rootScope.globalSettings; - ctrl.isInRole = $rootScope.isInRole; - this.$onInit = function () { - ctrl.isAdmin = $rootScope.isAdmin; - ctrl.mixConfigurations = $rootScope.mixConfigurations; - cultureService.getList(ngAppSettings.request).then((resp) => { - ctrl.cultures = resp.data.items; - ctrl.selectedCulture = ctrl.cultures.find( - (m) => - m.specificulture == $rootScope.globalSettings.defaultCulture - ); - $scope.$apply(); - }); - authService.fillAuthData().then(() => { - if ( - authService.authentication && - authService.authentication.info.userData - ) { - ctrl.avatar = authService.authentication.info.userData.avatar; - } - }); - }; - ctrl.translate = $rootScope.translate; - ctrl.getConfiguration = function (keyword, isWrap, defaultText) { - return $rootScope.getConfiguration(keyword, isWrap, defaultText); - }; - ctrl.changeLang = function (culture) { - $rootScope.globalSettings.defaultCulture = culture.specificulture; - localStorageService.set("globalSettings", $rootScope.globalSettings); - window.top.location = location.href; - }; - ctrl.logOut = function () { - $rootScope.logOut(); - }; - ctrl.addPermission = function () { - $("#dlg-permission").modal("show"); - }; - ctrl.addBookmark = function () { - $("#dlg-bookmark").modal("show"); - }; - ctrl.toggleSidebar = function () { - $(".main-sidebar").toggle(); - $(".sub-sidebar").toggle(); - // $('.navbar-brand').toggle(); - }; - ctrl.clearCache = async function () { - $rootScope.isBusy = true; - await commonService.clearCache(); - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - }; - ctrl.showHelper = function (url) { - $rootScope.helperUrl = url; - $("#dev-helper-modal").modal("show"); +modules.component("filterList", { + templateUrl: + "/mix-app/views/app-portal/components/filter-list/filter-list.html", + controller: [ + "$scope", + "$rootScope", + "ngAppSettings", + "CultureService", + function ($scope, $rootScope, ngAppSettings, cultureService) { + var ctrl = this; + ctrl.dateRange = { + fromDate: null, + toDate: null, + }; + ctrl.searchMethods = ["Equal", "Like"]; + ctrl.init = async function () { + if (!ctrl.arrOrderby) { + ctrl.arrOrderby = [ + "Title", + "Priority", + "CreatedDateTime", + "LastModified", + "Status", + ]; + } + ctrl.request.orderBy = ctrl.request.orderBy || ctrl.arrOrderby[0]; + ctrl.directions = ["Asc", "Desc"]; + ctrl.pageSizes = [5, 10, 15, 20]; + ctrl.statuses = $rootScope.globalSettings.statuses; + }; + ctrl.changeLang = function (culture) { + if (culture) { + ctrl.selectedCulture = culture; + ctrl.request.culture = culture.specificulture; + } else { + ctrl.selectedCulture = null; + ctrl.request.culture = null; + } + ctrl.apply(0); + }; + ctrl.apply = function (pageIndex) { + $rootScope.setRequest(ctrl.request, ctrl.key); + ctrl.callback({ pageIndex: pageIndex }); + }; + ctrl.updateDate = function () { + ctrl.request.pageIndex = 0; + if (Date.parse(ctrl.dateRange.fromDate)) { + ctrl.request.fromDate = new Date( + ctrl.dateRange.fromDate + ).toISOString(); + } else { + $scope.request.fromDate = null; + } + if (Date.parse(ctrl.dateRange.toDate)) { + ctrl.request.toDate = new Date(ctrl.dateRange.toDate).toISOString(); + } else { + ctrl.request.toDate = null; + } + $rootScope.setRequest(ctrl.request, ctrl.key); + ctrl.callback({ pageIndex: 0 }); + }; + }, + ], + bindings: { + request: "=", + key: "=?", + arrOrderby: "=?", + createUrl: "=", + createText: "=", + callback: "&", + }, +}); + +modules.component("funding", { + templateUrl: "/mix-app/views/app-portal/components/funding/view.html", + controller: [ + "$rootScope", + "$http", + function ($rootScope, $http) { + var ctrl = this; + ctrl.items = [ + { + title: "opencollective.com/mixcore", + href: "https://opencollective.com/mixcore", + logo: + "https://github.githubassets.com/images/modules/site/icons/funding_platforms/open_collective.svg", + }, + { + title: "funding.communitybridge.org/projects/mixcore", + href: "https://crowdfunding.lfx.linuxfoundation.org/projects/mixcore", + logo: + "https://github.githubassets.com/images/modules/site/icons/funding_platforms/community_bridge.svg", + }, + { + title: "patreon.com/mixcore", + href: "https://www.patreon.com/mixcore/creators", + logo: + "https://github.githubassets.com/images/modules/site/icons/funding_platforms/patreon.svg", + }, + { + title: "paypalme/mixcore", + href: "https://www.paypal.me/mixcore", + logo: "/mix-app/assets/img/svg/heart.svg", + }, + { + title: "buymeacoffee.com/mixcore", + href: "https://www.buymeacoffee.com/mixcore", + logo: "/mix-app/assets/img/svg/heart.svg", + }, + ]; + ctrl.init = function () {}; + }, + ], + bindings: {}, +}); + +modules.component("githubContributers", { + templateUrl: + "/mix-app/views/app-portal/components/github-contributers/view.html", + controller: [ + "$rootScope", + "$http", + function ($rootScope, $http) { + var ctrl = this; + ctrl.items = []; + ctrl.init = function () { + var req = { + method: "GET", + url: "https://api.github.com/repos/mixcore/mix.core/contributors", }; - ctrl.generateSitemap = async function () { - $rootScope.isBusy = true; - var resp = await commonService.genrateSitemap(); - if (resp) { - window.top.location.href = - "/admin/file/details?folder=" + - resp.fileFolder + - "&filename=" + - resp.filename + - resp.extension; - } else { - $rootScope.isBusy = false; - $rootScope.showErrors(["Server error"]); + ctrl.getGithubApiResult(req); + }; + + ctrl.getGithubApiResult = async function (req) { + return $http(req).then( + function (resp) { + if (resp.status == "200") { + ctrl.items = resp.data; + } else { + } + }, + function (error) { + return { + success: false, + errors: [error.statusText || error.status], + }; } - }; - }, - ], - bindings: { - breadCrumbs: "=", - settings: "=", + ); + }; }, - }); -})(window.angular); + ], + bindings: {}, +}); modules.component("googleAnalytic", { templateUrl: "/mix-app/views/app-portal/components/google-analytic/view.html", @@ -10730,6 +10589,147 @@ modules.component("googleAnalytic", { ], }); +modules.component("githubReleases", { + templateUrl: "/mix-app/views/app-portal/components/github-releases/view.html", + controller: [ + "$rootScope", + "$http", + function ($rootScope, $http) { + var ctrl = this; + ctrl.items = []; + ctrl.init = function () { + var req = { + method: "GET", + url: "https://api.github.com/repos/mixcore/mix.core/releases", + }; + ctrl.getGithubApiResult(req); + }; + + ctrl.getGithubApiResult = async function (req) { + return $http(req).then( + function (resp) { + if (resp.status == "200") { + ctrl.items = resp.data; + } else { + } + }, + function (error) { + return { + success: false, + errors: [error.statusText || error.status], + }; + } + ); + }; + }, + ], + bindings: {}, +}); + +(function (angular) { + app.component("headerNav", { + templateUrl: + "/mix-app/views/app-portal/components/header-nav/headerNav.html", + controller: [ + "$rootScope", + "$scope", + "ngAppSettings", + "localStorageService", + "CommonService", + "ApiService", + "AuthService", + "CultureService", + function ( + $rootScope, + $scope, + ngAppSettings, + localStorageService, + commonService, + apiService, + authService, + cultureService + ) { + var ctrl = this; + ctrl.appSettings = $rootScope.globalSettings; + ctrl.isInRole = $rootScope.isInRole; + this.$onInit = function () { + ctrl.isAdmin = $rootScope.isAdmin; + ctrl.mixConfigurations = $rootScope.mixConfigurations; + cultureService.getList(ngAppSettings.request).then((resp) => { + ctrl.cultures = resp.data.items; + ctrl.selectedCulture = ctrl.cultures.find( + (m) => + m.specificulture == $rootScope.globalSettings.defaultCulture + ); + $scope.$apply(); + }); + authService.fillAuthData().then(() => { + if ( + authService.authentication && + authService.authentication.info.userData + ) { + ctrl.avatar = authService.authentication.info.userData.avatar; + } + }); + }; + ctrl.translate = $rootScope.translate; + ctrl.getConfiguration = function (keyword, isWrap, defaultText) { + return $rootScope.getConfiguration(keyword, isWrap, defaultText); + }; + ctrl.changeLang = function (culture) { + $rootScope.globalSettings.defaultCulture = culture.specificulture; + localStorageService.set("globalSettings", $rootScope.globalSettings); + window.top.location = location.href; + }; + ctrl.logOut = function () { + $rootScope.logOut(); + }; + ctrl.addPermission = function () { + $("#dlg-permission").modal("show"); + }; + ctrl.addBookmark = function () { + $("#dlg-bookmark").modal("show"); + }; + ctrl.toggleSidebar = function () { + $(".main-sidebar").toggle(); + $(".sub-sidebar").toggle(); + // $('.navbar-brand').toggle(); + }; + ctrl.clearCache = async function () { + $rootScope.isBusy = true; + await commonService.clearCache(); + $rootScope.showMessage("success", "success"); + $rootScope.isBusy = false; + $scope.$apply(); + }; + ctrl.showHelper = function (url) { + $rootScope.helperUrl = url; + $("#dev-helper-modal").modal("show"); + }; + ctrl.generateSitemap = async function () { + $rootScope.isBusy = true; + var resp = await commonService.genrateSitemap(); + if (resp) { + window.top.location.href = + "/admin/file/details?folder=" + + resp.fileFolder + + "&filename=" + + resp.filename + + resp.extension; + } else { + $rootScope.isBusy = false; + $rootScope.showErrors(["Server error"]); + } + }; + }, + ], + bindings: { + breadCrumbs: "=", + settings: "=", + }, + }); +})(window.angular); + modules.component("highFrequencyMessages", { templateUrl: "/mix-app/views/app-portal/components/high-frequency-messages/view.html", @@ -11644,7 +11644,42 @@ app.controller("LogStreamController", [ } }; }, -]); +]); + +modules.component("mainSideBar", { + templateUrl: + "/mix-app/views/app-portal/components/main-side-bar/main-side-bar.html", + controller: [ + "$rootScope", + "$scope", + "ngAppSettings", + "TranslatorService", + "ApiService", + "CommonService", + function ( + $rootScope, + $scope, + ngAppSettings, + translatorService, + apiService, + commonService + ) { + var ctrl = this; + ctrl.items = []; + ctrl.init = async function () { + var resp = await apiService.getPortalMenus(); + if (resp.success && resp.data && resp.data.length) { + ctrl.items = resp.data; + } else { + ctrl.items = JSON.parse($("#portal-menus").val()).items; + } + }; + }, + ], + bindings: { + items: "=?", + }, +}); modules.component("mainSideBarDynamic", { templateUrl: @@ -11687,61 +11722,44 @@ modules.component("mainSideBarDynamic", { }, }); -modules.component("mainSideBarItem", { +modules.component("mainSideBarItemDynamic", { templateUrl: - "/mix-app/views/app-portal/components/main-side-bar-item/main-side-bar-item.html", + "/mix-app/views/app-portal/components/main-side-bar-item-dynamic/main-side-bar-item-dynamic.html", controller: [ "$rootScope", function ($rootScope) { var ctrl = this; ctrl.translate = $rootScope.translate; - ctrl.addClass = function (obj) { - obj.currentTarget.classList.add("btn-group-lg"); - //alert(obj); - }; - ctrl.removeClass = function (obj) { - obj.currentTarget.classList.remove("btn-group-lg"); - //alert(obj); - }; }, ], bindings: { + iconSize: "=", + linkStyle: "=", + itemStyle: "=", item: "=", }, }); -modules.component("mainSideBar", { +modules.component("mainSideBarItem", { templateUrl: - "/mix-app/views/app-portal/components/main-side-bar/main-side-bar.html", + "/mix-app/views/app-portal/components/main-side-bar-item/main-side-bar-item.html", controller: [ "$rootScope", - "$scope", - "ngAppSettings", - "TranslatorService", - "ApiService", - "CommonService", - function ( - $rootScope, - $scope, - ngAppSettings, - translatorService, - apiService, - commonService - ) { + function ($rootScope) { var ctrl = this; - ctrl.items = []; - ctrl.init = async function () { - var resp = await apiService.getPortalMenus(); - if (resp.success && resp.data && resp.data.length) { - ctrl.items = resp.data; - } else { - ctrl.items = JSON.parse($("#portal-menus").val()).items; - } + ctrl.translate = $rootScope.translate; + ctrl.addClass = function (obj) { + obj.currentTarget.classList.add("btn-group-lg"); + //alert(obj); + }; + ctrl.removeClass = function (obj) { + obj.currentTarget.classList.remove("btn-group-lg"); + //alert(obj); }; }, ], bindings: { - items: "=?", + item: "=", }, }); @@ -11971,24 +11989,6 @@ modules.component("mediaUpload", { }, }); -modules.component("mainSideBarItemDynamic", { - templateUrl: - "/mix-app/views/app-portal/components/main-side-bar-item-dynamic/main-side-bar-item-dynamic.html", - controller: [ - "$rootScope", - function ($rootScope) { - var ctrl = this; - ctrl.translate = $rootScope.translate; - }, - ], - bindings: { - iconSize: "=", - linkStyle: "=", - itemStyle: "=", - item: "=", - }, -}); - modules.component("mediumNews", { templateUrl: "/mix-app/views/app-portal/components/medium-news/view.html", controller: [ @@ -12622,51 +12622,283 @@ modules.component("mixDatabaseDataValueEditor", { ctrl.mixDatabaseDataValue.stringValue = ctrl.mixDatabaseDataValue.booleanValue.toString(); } - break; - - default: - break; + break; + + default: + break; + } + }; + + ctrl.updateRefData = function (nav) { + ctrl.goToPath(`/admin/mix-database-data/details?dataContentId=${nav.data.id} + &mixDatabaseId=${nav.data.mixDatabaseId} + &parentId=${ctrl.parentId} + &parentType=${ctrl.parentType}`); + // ctrl.refDataModel = nav; + // var e = $(".pane-form-" + ctrl.mixDatabaseDataValue.column.referenceId)[0]; + // angular.element(e).triggerHandler('click'); + // $location.url('/admin/mix-database-data/details?dataContentId='+ item.id +'&mixDatabaseId=' + item.mixDatabaseId+'&parentType=' + item.parentType+'&parentId=' + item.parentId); + }; + + ctrl.removeRefData = async function (nav) { + $rootScope.showConfirm( + ctrl, + "removeRefDataConfirmed", + [nav], + null, + "Remove", + "Deleted data will not able to recover, are you sure you want to delete this item?" + ); + }; + ctrl.removeRefDataConfirmed = async function (nav) { + $rootScope.isBusy = true; + var result = await navService.delete([ + nav.parentId, + nav.parentType, + nav.id, + ]); + if (result.success) { + $rootScope.removeObjectByKey(ctrl.refData, "id", nav.id); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showErros(result.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + }, + ], +}); + +modules.component("mixDatabaseDataValues", { + templateUrl: + "/mix-app/views/app-portal/components/mix-database-data-values/view.html", + bindings: { + database: "=?", + mixDatabaseName: "=?", + mixDatabaseTitle: "=?", + mixDatabaseId: "=?", + parentName: "=?", + parentId: "=?", + guidParentId: "=?", + header: "=?", + data: "=?", + canDrag: "=?", + queries: "=?", + filterType: "=?", + compareType: "=?", + selectedList: "=?", + selectSingle: "=?", + database: "=?", + onFilterList: "&?", + onApplyList: "&?", + onSendMail: "&?", + onUpdate: "&?", + onDuplicate: "&?", + onDelete: "&?", + }, + controller: [ + "$rootScope", + "$scope", + "$location", + "$routeParams", + "ngAppSettings", + "RestMixDatabasePortalService", + "MixDbService", + function ( + $rootScope, + $scope, + $location, + $routeParams, + ngAppSettings, + databaseService, + dataService + ) { + var ctrl = this; + ctrl.intShowColumn = 3; + ctrl.request = angular.copy(ngAppSettings.request); + ctrl.actions = ["Delete", "SendMail"]; + ctrl.filterTypes = ["contain", "equal"]; + ctrl.compareTypes = ["or", "and"]; + ctrl.selectedProp = null; + ctrl.mixConfigurations = $rootScope.globalSettings; + ctrl.$onInit = async function () { + dataService.initDbName(ctrl.mixDatabaseName); + ctrl.request.name = ctrl.mixDatabaseName; + ctrl.request.parentName = ctrl.parentName; + ctrl.request.parentId = ctrl.parentId; + ctrl.request.guidParentId = ctrl.guidParentId; + if (!ctrl.selectedList) { + ctrl.selectedList = { + action: "Delete", + data: [], + }; + } + if (!ctrl.database) { + var getDatabase = await databaseService.getByName( + ctrl.mixDatabaseName + ); + if (getDatabase.success) { + ctrl.database = getDatabase.data; + $scope.$apply(); + } + } + if (!ctrl.data) { + await ctrl.loadData(); + } + ctrl.createUrl = `/admin/mix-database-data/create?mixDatabaseId=${ + ctrl.database.id + }&mixDatabaseName=${ctrl.database.systemName}&mixDatabaseTitle=${ + ctrl.database.displayName + }&dataContentId=default&guidParentId=${ + ctrl.guidParentId || "" + }&parentId=${ctrl.parentId || ""}&parentName=${ctrl.parentName || ""}`; + $scope.$apply(); + }; + ctrl.loadData = async function () { + dataService.initDbName(ctrl.mixDatabaseName); + ctrl.request.queries = []; + if (ctrl.queries) { + Object.keys(ctrl.queries).forEach((e) => { + if (ctrl.queries[e]) { + ctrl.request.queries.push({ + fieldName: e, + value: ctrl.queries[e], + }); + } + }); + } + var getData = await dataService.filter(ctrl.request); + ctrl.data = getData.data; + ctrl.selectedIds = ctrl.data.items.map((m) => m.id); + $scope.$apply(); + }; + ctrl.select = function (item) { + if (item.isSelected) { + if (ctrl.selectSingle == "true") { + ctrl.selectedList.data.items = []; + ctrl.selectedList.data.items.push(item); + } else { + var current = $rootScope.findObjectByKey( + ctrl.selectedList, + "id", + item.id + ); + if (!current) { + ctrl.selectedList.data.items.push(item); + } + } + } else { + $rootScope.removeObject(ctrl.selectedList, item.id); } }; + ctrl.selectAll = function (isSelected) { + ctrl.selectedList.data.items = []; + angular.forEach(ctrl.data.items, function (e) { + e.isSelected = isSelected; + if (isSelected) { + ctrl.selectedList.data.items.push(e.id); + } + }); + }; + ctrl.filter = function () { + ctrl.data.items = []; + ctrl.loadData(); + }; + ctrl.sendMail = async function (data) { + ctrl.onSendMail({ data: data }); + }; + ctrl.apply = async function () { + ctrl.onApplyList(); + }; - ctrl.updateRefData = function (nav) { - ctrl.goToPath(`/admin/mix-database-data/details?dataContentId=${nav.data.id} - &mixDatabaseId=${nav.data.mixDatabaseId} - &parentId=${ctrl.parentId} - &parentType=${ctrl.parentType}`); - // ctrl.refDataModel = nav; - // var e = $(".pane-form-" + ctrl.mixDatabaseDataValue.column.referenceId)[0]; - // angular.element(e).triggerHandler('click'); - // $location.url('/admin/mix-database-data/details?dataContentId='+ item.id +'&mixDatabaseId=' + item.mixDatabaseId+'&parentType=' + item.parentType+'&parentId=' + item.parentId); + ctrl.duplicate = function (data) { + ctrl.onDuplicate({ data: data }); }; - ctrl.removeRefData = async function (nav) { + ctrl.update = function (data) { + let url = `/admin/mix-database-data/details?dataContentId=${ + data.id + }&mixDatabaseName=${ctrl.mixDatabaseName}&mixDatabaseTitle=${ + ctrl.mixDatabaseTitle + }&guidParentId=${ctrl.guidParentId || ""}&parentId=${ + ctrl.parentId || "" + }&parentName=${ctrl.parentName || ""}`; + $location.url(url); + }; + + ctrl.delete = function (data) { $rootScope.showConfirm( ctrl, - "removeRefDataConfirmed", - [nav], + "removeConfirmed", + [data.id], null, "Remove", "Deleted data will not able to recover, are you sure you want to delete this item?" ); }; - ctrl.removeRefDataConfirmed = async function (nav) { + + ctrl.removeConfirmed = async function (dataContentId) { $rootScope.isBusy = true; - var result = await navService.delete([ - nav.parentId, - nav.parentType, - nav.id, - ]); + var result = await dataService.delete([dataContentId]); if (result.success) { - $rootScope.removeObjectByKey(ctrl.refData, "id", nav.id); + if (ctrl.onDelete) { + ctrl.onDelete({ data: dataContentId }); + } + await ctrl.loadData(); $rootScope.isBusy = false; $scope.$apply(); } else { - $rootScope.showErros(result.errors); + $rootScope.showErrors(result.errors); $rootScope.isBusy = false; $scope.$apply(); } }; + + ctrl.filterData = function (item, attributeName) { + return $rootScope.findObjectByKey( + item.data.items, + "attributeName", + attributeName + ); + }; + + ctrl.dragStart = function (index) { + ctrl.dragStartIndex = index; + ctrl.minPriority = ctrl.data.items[0].priority; + }; + ctrl.updateOrders = function (index, items) { + if (index > ctrl.dragStartIndex) { + ctrl.data.items.splice(ctrl.dragStartIndex, 1); + } else { + ctrl.data.items.splice(ctrl.dragStartIndex + 1, 1); + } + ctrl.updateDataInfos(); + }; + ctrl.updateDataInfos = async function () { + angular.forEach(ctrl.data.items, async function (e, i) { + e.priority = ctrl.minPriority + i; + var resp = await dataService.saveFields(e.id, { + priority: e.priority, + }); + if (resp && resp.success) { + $scope.activedPage = resp.data; + } else { + if (resp) { + $rootScope.showErrors(resp.errors); + } + } + }); + }; + + ctrl.view = function (item) { + var obj = { + columns: ctrl.database.columns, + item: item, + }; + $rootScope.preview("mix-database-data", obj, null, "modal-lg"); + }; }, ], }); @@ -12983,182 +13215,114 @@ modules.component("mixDatabaseForm", { ], }); -modules.component("mixDatabaseDataValues", { +modules.component("mixDatabaseNavData", { templateUrl: - "/mix-app/views/app-portal/components/mix-database-data-values/view.html", + "/mix-app/views/app-portal/components/mix-database-nav-data/view.html", bindings: { - database: "=?", - mixDatabaseName: "=?", - mixDatabaseTitle: "=?", - mixDatabaseId: "=?", - parentName: "=?", - parentId: "=?", - guidParentId: "=?", - header: "=?", - data: "=?", - canDrag: "=?", - queries: "=?", - filterType: "=?", - compareType: "=?", - selectedList: "=?", - selectSingle: "=?", - database: "=?", - onFilterList: "&?", - onApplyList: "&?", - onSendMail: "&?", + nav: "=", + parentId: "=", + parentType: "=", onUpdate: "&?", - onDuplicate: "&?", onDelete: "&?", }, controller: [ "$rootScope", "$scope", - "$location", - "$routeParams", "ngAppSettings", - "RestMixDatabasePortalService", - "MixDbService", - function ( - $rootScope, - $scope, - $location, - $routeParams, - ngAppSettings, - databaseService, - dataService - ) { + "RestRelatedAttributeDataPortalService", + "RestMixDatabaseDataPortalService", + function ($rootScope, $scope, ngAppSettings, navService, dataService) { var ctrl = this; - ctrl.intShowColumn = 3; - ctrl.request = angular.copy(ngAppSettings.request); - ctrl.actions = ["Delete", "SendMail"]; - ctrl.filterTypes = ["contain", "equal"]; - ctrl.compareTypes = ["or", "and"]; - ctrl.selectedProp = null; + ctrl.data = null; + ctrl.selected = null; + ctrl.navRequest = angular.copy(ngAppSettings.request); + ctrl.setRequest = angular.copy(ngAppSettings.request); ctrl.mixConfigurations = $rootScope.globalSettings; - ctrl.$onInit = async function () { - dataService.initDbName(ctrl.mixDatabaseName); - ctrl.request.name = ctrl.mixDatabaseName; - ctrl.request.parentName = ctrl.parentName; - ctrl.request.parentId = ctrl.parentId; - ctrl.request.guidParentId = ctrl.guidParentId; - if (!ctrl.selectedList) { - ctrl.selectedList = { - action: "Delete", - data: [], - }; - } - if (!ctrl.database) { - var getDatabase = await databaseService.getByName( - ctrl.mixDatabaseName - ); - if (getDatabase.success) { - ctrl.database = getDatabase.data; - $scope.$apply(); - } - } - if (!ctrl.data) { - await ctrl.loadData(); - } - ctrl.createUrl = `/admin/mix-database-data/create?mixDatabaseId=${ - ctrl.database.id - }&mixDatabaseName=${ctrl.database.systemName}&mixDatabaseTitle=${ - ctrl.database.displayName - }&dataContentId=default&guidParentId=${ - ctrl.guidParentId || "" - }&parentId=${ctrl.parentId || ""}&parentName=${ctrl.parentName || ""}`; - $scope.$apply(); - }; - ctrl.loadData = async function () { - dataService.initDbName(ctrl.mixDatabaseName); - ctrl.request.queries = []; - if (ctrl.queries) { - Object.keys(ctrl.queries).forEach((e) => { - if (ctrl.queries[e]) { - ctrl.request.queries.push({ - fieldName: e, - value: ctrl.queries[e], - }); - } + ctrl.$onInit = function () { + navService + .getDefault([ctrl.parentId, ctrl.parentType, "default"]) + .then((resp) => { + ctrl.defaultData = resp.data; + ctrl.defaultData.parentId = ctrl.parentId; + ctrl.defaultData.parentType = ctrl.parentType; + ctrl.selected = angular.copy(ctrl.defaultData); + ctrl.loadData(); }); - } - var getData = await dataService.filter(ctrl.request); - ctrl.data = getData.data; - ctrl.selectedIds = ctrl.data.items.map((m) => m.id); - $scope.$apply(); - }; - ctrl.select = function (item) { - if (item.isSelected) { - if (ctrl.selectSingle == "true") { - ctrl.selectedList.data.items = []; - ctrl.selectedList.data.items.push(item); - } else { - var current = $rootScope.findObjectByKey( - ctrl.selectedList, - "id", - item.id - ); - if (!current) { - ctrl.selectedList.data.items.push(item); - } - } - } else { - $rootScope.removeObject(ctrl.selectedList, item.id); - } + ctrl.navRequest.parentType = ctrl.parentType; + ctrl.navRequest.parentId = ctrl.parentId; }; - ctrl.selectAll = function (isSelected) { - ctrl.selectedList.data.items = []; - angular.forEach(ctrl.data.items, function (e) { - e.isSelected = isSelected; - if (isSelected) { - ctrl.selectedList.data.items.push(e.id); + ctrl.selectPane = function (pane) {}; + ctrl.loadData = function () { + navService.getList(ctrl.navRequest).then((resp) => { + if (resp) { + ctrl.data = resp.data; + $scope.$apply(); + } else { + if (resp) { + $rootScope.showErrors(resp.errors); + } + $scope.$apply(); } }); }; - ctrl.filter = function () { - ctrl.data.items = []; - ctrl.loadData(); - }; - ctrl.sendMail = async function (data) { - ctrl.onSendMail({ data: data }); - }; - ctrl.apply = async function () { - ctrl.onApplyList(); - }; - - ctrl.duplicate = function (data) { - ctrl.onDuplicate({ data: data }); + ctrl.updateData = function (nav) { + ctrl.selected = nav; + var e = $(".pane-form-" + ctrl.nav.data.id)[0]; + angular.element(e).triggerHandler("click"); + // $location.url('/admin/mix-database-data/details?dataContentId='+ item.id +'&mixDatabaseId=' + item.mixDatabaseId+'&parentType=' + item.parentType+'&parentId=' + item.parentId); }; - - ctrl.update = function (data) { - let url = `/admin/mix-database-data/details?dataContentId=${ - data.id - }&mixDatabaseName=${ctrl.mixDatabaseName}&mixDatabaseTitle=${ - ctrl.mixDatabaseTitle - }&guidParentId=${ctrl.guidParentId || ""}&parentId=${ - ctrl.parentId || "" - }&parentName=${ctrl.parentName || ""}`; - $location.url(url); + ctrl.saveData = function (data) { + $rootScope.isBusy = true; + ctrl.selected.data = data; + dataService.save(data).then((resp) => { + if (resp.success) { + ctrl.selected.dataContentId = resp.data.id; + ctrl.selected.mixDatabaseId = resp.data.mixDatabaseId; + ctrl.selected.mixDatabaseName = resp.data.mixDatabaseName; + ctrl.selected.attributeData = resp.data; + navService.save(ctrl.selected).then((resp) => { + if (resp.success) { + var tmp = $rootScope.findObjectByKey( + ctrl.data, + ["parentId", "parentType", "id"], + [resp.data.parentId, resp.data.parentType, resp.data.id] + ); + if (!tmp) { + ctrl.data.items.push(resp.data); + var e = $(".pane-data-" + ctrl.nav.data.id)[0]; + angular.element(e).triggerHandler("click"); + } + ctrl.selected = angular.copy(ctrl.defautData); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showMessage(resp.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + }); + } else { + $rootScope.showErrors(resp.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } + }); }; - - ctrl.delete = function (data) { + ctrl.removeData = async function (nav) { $rootScope.showConfirm( ctrl, - "removeConfirmed", - [data.id], + "removeDataConfirmed", + [nav], null, "Remove", "Deleted data will not able to recover, are you sure you want to delete this item?" ); }; - - ctrl.removeConfirmed = async function (dataContentId) { + ctrl.removeDataConfirmed = async function (nav) { $rootScope.isBusy = true; - var result = await dataService.delete([dataContentId]); + var result = await navService.delete([nav.id]); if (result.success) { - if (ctrl.onDelete) { - ctrl.onDelete({ data: dataContentId }); - } - await ctrl.loadData(); + $rootScope.removeObjectByKey(ctrl.data, "id", nav.id); $rootScope.isBusy = false; $scope.$apply(); } else { @@ -13167,49 +13331,36 @@ modules.component("mixDatabaseDataValues", { $scope.$apply(); } }; - - ctrl.filterData = function (item, attributeName) { - return $rootScope.findObjectByKey( - item.data.items, - "attributeName", - attributeName - ); - }; - ctrl.dragStart = function (index) { ctrl.dragStartIndex = index; - ctrl.minPriority = ctrl.data.items[0].priority; + ctrl.minPriority = ctrl.data[0].priority; }; - ctrl.updateOrders = function (index, items) { + ctrl.updateOrders = function (index) { if (index > ctrl.dragStartIndex) { - ctrl.data.items.splice(ctrl.dragStartIndex, 1); + ctrl.data.splice(ctrl.dragStartIndex, 1); } else { - ctrl.data.items.splice(ctrl.dragStartIndex + 1, 1); + ctrl.data.splice(ctrl.dragStartIndex + 1, 1); } - ctrl.updateDataInfos(); - }; - ctrl.updateDataInfos = async function () { - angular.forEach(ctrl.data.items, async function (e, i) { + var arrNavs = []; + angular.forEach(ctrl.data, function (e, i) { e.priority = ctrl.minPriority + i; - var resp = await dataService.saveFields(e.id, { + var keys = { + parentId: e.parentId, + parentType: e.parentType, + id: e.id, + }; + var properties = { priority: e.priority, + }; + arrNavs.push({ + keys: keys, + properties: properties, }); - if (resp && resp.success) { - $scope.activedPage = resp.data; - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - } }); - }; - - ctrl.view = function (item) { - var obj = { - columns: ctrl.database.columns, - item: item, - }; - $rootScope.preview("mix-database-data", obj, null, "modal-lg"); + navService.saveProperties("portal", arrNavs).then((resp) => { + $rootScope.isBusy = false; + $scope.$apply(); + }); }; }, ], @@ -13405,13 +13556,13 @@ modules.component("mixDatabaseNavValues", { ], }); -modules.component("mixDatabaseNavData", { +modules.component("mixDatabaseNavs", { templateUrl: - "/mix-app/views/app-portal/components/mix-database-nav-data/view.html", + "/mix-app/views/app-portal/components/mix-database-navs/view.html", bindings: { - nav: "=", parentId: "=", parentType: "=", + mixDatabaseNavs: "=?", onUpdate: "&?", onDelete: "&?", }, @@ -13419,120 +13570,140 @@ modules.component("mixDatabaseNavData", { "$rootScope", "$scope", "ngAppSettings", - "RestRelatedAttributeDataPortalService", - "RestMixDatabaseDataPortalService", - function ($rootScope, $scope, ngAppSettings, navService, dataService) { + "RestRelatedMixDatabasePortalService", + "RestMixDatabasePortalService", + function ($rootScope, $scope, ngAppSettings, navService, setService) { var ctrl = this; - ctrl.data = null; - ctrl.selected = null; + ctrl.mixDatabaseNavs = ctrl.mixDatabaseNavs || []; + ctrl.selected = {}; + ctrl.defaultData = null; ctrl.navRequest = angular.copy(ngAppSettings.request); ctrl.setRequest = angular.copy(ngAppSettings.request); + ctrl.mixConfigurations = $rootScope.globalSettings; ctrl.$onInit = function () { - navService - .getDefault([ctrl.parentId, ctrl.parentType, "default"]) - .then((resp) => { - ctrl.defaultData = resp.data; - ctrl.defaultData.parentId = ctrl.parentId; - ctrl.defaultData.parentType = ctrl.parentType; - ctrl.selected = angular.copy(ctrl.defaultData); - ctrl.loadData(); - }); - ctrl.navRequest.parentType = ctrl.parentType; - ctrl.navRequest.parentId = ctrl.parentId; + // ctrl.setRequest.type = ctrl.parentType; + navService.getDefault().then((resp) => { + resp.parentId = ctrl.parentId; + resp.parentType = ctrl.parentType; + ctrl.defaultData = resp; + ctrl.loadData(); + }); }; + ctrl.goToPath = $rootScope.goToPath; ctrl.selectPane = function (pane) {}; - ctrl.loadData = function () { - navService.getList(ctrl.navRequest).then((resp) => { + ctrl.loadData = async function () { + // Load attr set navs if not in input + if (!ctrl.mixDatabaseNavs) { + ctrl.navRequest.parentType = ctrl.parentType; + ctrl.navRequest.parentId = ctrl.parentId; + var resp = await navService.getList(ctrl.navRequest); if (resp) { - ctrl.data = resp.data; - $scope.$apply(); + angular.forEach(resp.data.items, (e) => { + e.isActived = true; + ctrl.mixDatabaseNavs.push(e); + }); } else { if (resp) { $rootScope.showErrors(resp.errors); } - $scope.$apply(); } - }); - }; - ctrl.updateData = function (nav) { - ctrl.selected = nav; - var e = $(".pane-form-" + ctrl.nav.data.id)[0]; - angular.element(e).triggerHandler("click"); - // $location.url('/admin/mix-database-data/details?dataContentId='+ item.id +'&mixDatabaseId=' + item.mixDatabaseId+'&parentType=' + item.parentType+'&parentId=' + item.parentId); - }; - ctrl.saveData = function (data) { - $rootScope.isBusy = true; - ctrl.selected.data = data; - dataService.save(data).then((resp) => { - if (resp.success) { - ctrl.selected.dataContentId = resp.data.id; - ctrl.selected.mixDatabaseId = resp.data.mixDatabaseId; - ctrl.selected.mixDatabaseName = resp.data.mixDatabaseName; - ctrl.selected.attributeData = resp.data; - navService.save(ctrl.selected).then((resp) => { - if (resp.success) { - var tmp = $rootScope.findObjectByKey( - ctrl.data, - ["parentId", "parentType", "id"], - [resp.data.parentId, resp.data.parentType, resp.data.id] - ); - if (!tmp) { - ctrl.data.items.push(resp.data); - var e = $(".pane-data-" + ctrl.nav.data.id)[0]; - angular.element(e).triggerHandler("click"); - } - ctrl.selected = angular.copy(ctrl.defautData); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage(resp.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - } else { - $rootScope.showErrors(resp.errors); - $rootScope.isBusy = false; - $scope.$apply(); + } else { + angular.forEach(ctrl.mixDatabaseNavs, (e) => { + e.isActived = true; + }); + } + + var setResult = await setService.getList(ctrl.setRequest); + if (setResult) { + angular.forEach(setResult.data.items, (element) => { + var e = $rootScope.findObjectByKey( + ctrl.mixDatabaseNavs, + "mixDatabaseId", + element.id + ); + if (!e) { + e = angular.copy(ctrl.defaultData); + e.status = "Published"; + e.mixDatabaseId = element.id; + e.specificulture = navService.lang; + e.data = element; + e.isActived = false; + ctrl.mixDatabaseNavs.push(e); + } + }); + } else { + if (setResult) { + $rootScope.showErrors("Others Failed"); } - }); + } + $scope.$apply(); }; - ctrl.removeData = async function (nav) { - $rootScope.showConfirm( - ctrl, - "removeDataConfirmed", - [nav], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); + ctrl.change = async function (nav) { + $rootScope.isBusy = true; + var result; + if (nav.isActived) { + ctrl.active(nav); + } else { + ctrl.deactive(nav); + } }; - ctrl.removeDataConfirmed = async function (nav) { + + ctrl.deactive = async function (nav) { + let result = null; + if (nav.id) { + result = await navService.delete([nav.id]); + $(".pane-container-" + nav.data.id) + .parent() + .remove(); + } + if (result && result.success) { + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showMessage("failed"); + $rootScope.isBusy = false; + } + }; + + ctrl.active = async function (nav) { $rootScope.isBusy = true; - var result = await navService.delete([nav.id]); - if (result.success) { - $rootScope.removeObjectByKey(ctrl.data, "id", nav.id); + var result; + result = await navService.save(nav); + if (result && result.success) { $rootScope.isBusy = false; $scope.$apply(); } else { - $rootScope.showErrors(result.errors); + $rootScope.showMessage("failed"); $rootScope.isBusy = false; $scope.$apply(); } }; + + ctrl.update = function (data) { + ctrl.onUpdate({ + data: data, + }); + }; + + ctrl.delete = function (data) { + ctrl.onDelete({ + data: data, + }); + }; + ctrl.dragStart = function (index) { ctrl.dragStartIndex = index; - ctrl.minPriority = ctrl.data[0].priority; + ctrl.minPriority = ctrl.mixDatabaseNavs[0].priority; }; ctrl.updateOrders = function (index) { if (index > ctrl.dragStartIndex) { - ctrl.data.splice(ctrl.dragStartIndex, 1); + ctrl.mixDatabaseNavs.splice(ctrl.dragStartIndex, 1); } else { - ctrl.data.splice(ctrl.dragStartIndex + 1, 1); + ctrl.mixDatabaseNavs.splice(ctrl.dragStartIndex + 1, 1); } var arrNavs = []; - angular.forEach(ctrl.data, function (e, i) { + angular.forEach(ctrl.mixDatabaseNavs, function (e, i) { e.priority = ctrl.minPriority + i; var keys = { parentId: e.parentId, @@ -13556,8 +13727,9 @@ modules.component("mixDatabaseNavData", { ], }); -modules.component("mixFileUpload", { - templateUrl: "/mix-app/views/app-portal/components/mix-file-upload/view.html", +modules.component("mixFileExtract", { + templateUrl: + "/mix-app/views/app-portal/components/mix-file-extract/view.html", bindings: { folder: "=?", accept: "=?", @@ -13624,7 +13796,7 @@ modules.component("mixFileUpload", { ctrl.uploadFile = async function () { if (ctrl.file) { $rootScope.isBusy = true; - var response = await fileService.uploadFile(ctrl.file, ctrl.folder); + var response = await fileService.extractFile(ctrl.file, ctrl.folder); if (response) { if (ctrl.onSuccess) { ctrl.onSuccess(); @@ -13633,7 +13805,7 @@ modules.component("mixFileUpload", { $rootScope.isBusy = false; $scope.$apply(); } else { - $rootScope.showErrors(['Cannot upload file']); + $rootScope.showErrors(["Cannot upload file"]); $rootScope.isBusy = false; $scope.$apply(); } @@ -13645,9 +13817,8 @@ modules.component("mixFileUpload", { ], }); -modules.component("mixFileExtract", { - templateUrl: - "/mix-app/views/app-portal/components/mix-file-extract/view.html", +modules.component("mixFileUpload", { + templateUrl: "/mix-app/views/app-portal/components/mix-file-upload/view.html", bindings: { folder: "=?", accept: "=?", @@ -13713,194 +13884,23 @@ modules.component("mixFileExtract", { ctrl.uploadFile = async function () { if (ctrl.file) { - $rootScope.isBusy = true; - var response = await fileService.extractFile(ctrl.file, ctrl.folder); - if (response) { - if (ctrl.onSuccess) { - ctrl.onSuccess(); - } - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(["Cannot upload file"]); - $rootScope.isBusy = false; - $scope.$apply(); - } - } else { - $rootScope.showErrors(["Please choose file"]); - } - }; - }, - ], -}); - -modules.component("mixDatabaseNavs", { - templateUrl: - "/mix-app/views/app-portal/components/mix-database-navs/view.html", - bindings: { - parentId: "=", - parentType: "=", - mixDatabaseNavs: "=?", - onUpdate: "&?", - onDelete: "&?", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "RestRelatedMixDatabasePortalService", - "RestMixDatabasePortalService", - function ($rootScope, $scope, ngAppSettings, navService, setService) { - var ctrl = this; - ctrl.mixDatabaseNavs = ctrl.mixDatabaseNavs || []; - ctrl.selected = {}; - ctrl.defaultData = null; - ctrl.navRequest = angular.copy(ngAppSettings.request); - ctrl.setRequest = angular.copy(ngAppSettings.request); - - ctrl.mixConfigurations = $rootScope.globalSettings; - ctrl.$onInit = function () { - // ctrl.setRequest.type = ctrl.parentType; - navService.getDefault().then((resp) => { - resp.parentId = ctrl.parentId; - resp.parentType = ctrl.parentType; - ctrl.defaultData = resp; - ctrl.loadData(); - }); - }; - ctrl.goToPath = $rootScope.goToPath; - ctrl.selectPane = function (pane) {}; - ctrl.loadData = async function () { - // Load attr set navs if not in input - if (!ctrl.mixDatabaseNavs) { - ctrl.navRequest.parentType = ctrl.parentType; - ctrl.navRequest.parentId = ctrl.parentId; - var resp = await navService.getList(ctrl.navRequest); - if (resp) { - angular.forEach(resp.data.items, (e) => { - e.isActived = true; - ctrl.mixDatabaseNavs.push(e); - }); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - } - } else { - angular.forEach(ctrl.mixDatabaseNavs, (e) => { - e.isActived = true; - }); - } - - var setResult = await setService.getList(ctrl.setRequest); - if (setResult) { - angular.forEach(setResult.data.items, (element) => { - var e = $rootScope.findObjectByKey( - ctrl.mixDatabaseNavs, - "mixDatabaseId", - element.id - ); - if (!e) { - e = angular.copy(ctrl.defaultData); - e.status = "Published"; - e.mixDatabaseId = element.id; - e.specificulture = navService.lang; - e.data = element; - e.isActived = false; - ctrl.mixDatabaseNavs.push(e); - } - }); - } else { - if (setResult) { - $rootScope.showErrors("Others Failed"); - } - } - $scope.$apply(); - }; - ctrl.change = async function (nav) { - $rootScope.isBusy = true; - var result; - if (nav.isActived) { - ctrl.active(nav); - } else { - ctrl.deactive(nav); - } - }; - - ctrl.deactive = async function (nav) { - let result = null; - if (nav.id) { - result = await navService.delete([nav.id]); - $(".pane-container-" + nav.data.id) - .parent() - .remove(); - } - if (result && result.success) { - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - } - }; - - ctrl.active = async function (nav) { - $rootScope.isBusy = true; - var result; - result = await navService.save(nav); - if (result && result.success) { - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - - ctrl.update = function (data) { - ctrl.onUpdate({ - data: data, - }); - }; - - ctrl.delete = function (data) { - ctrl.onDelete({ - data: data, - }); - }; - - ctrl.dragStart = function (index) { - ctrl.dragStartIndex = index; - ctrl.minPriority = ctrl.mixDatabaseNavs[0].priority; - }; - ctrl.updateOrders = function (index) { - if (index > ctrl.dragStartIndex) { - ctrl.mixDatabaseNavs.splice(ctrl.dragStartIndex, 1); + $rootScope.isBusy = true; + var response = await fileService.uploadFile(ctrl.file, ctrl.folder); + if (response) { + if (ctrl.onSuccess) { + ctrl.onSuccess(); + } + $rootScope.showMessage("success", "success"); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showErrors(['Cannot upload file']); + $rootScope.isBusy = false; + $scope.$apply(); + } } else { - ctrl.mixDatabaseNavs.splice(ctrl.dragStartIndex + 1, 1); + $rootScope.showErrors(["Please choose file"]); } - var arrNavs = []; - angular.forEach(ctrl.mixDatabaseNavs, function (e, i) { - e.priority = ctrl.minPriority + i; - var keys = { - parentId: e.parentId, - parentType: e.parentType, - id: e.id, - }; - var properties = { - priority: e.priority, - }; - arrNavs.push({ - keys: keys, - properties: properties, - }); - }); - navService.saveProperties("portal", arrNavs).then((resp) => { - $rootScope.isBusy = false; - $scope.$apply(); - }); }; }, ], @@ -14027,141 +14027,6 @@ app.controller("MixNavigationController", [ }, ]); -modules.component("mixValueEditor", { - templateUrl: - "/mix-app/views/app-portal/components/mix-value-editor/view.html", - bindings: { - title: "=?", - isSelect: "=?", - stringValue: "=", - type: "=", - }, - controller: [ - "$rootScope", - "$scope", - "ngAppSettings", - "$location", - "RestMixDatabaseDataPortalService", - function ($rootScope, $scope, ngAppSettings, $location, dataService) { - var ctrl = this; - ctrl.icons = ngAppSettings.icons; - ctrl.refData = []; - ctrl.refRequest = angular.copy(ngAppSettings.request); - ctrl.refRequest.pageSize = 100; - ctrl.dataTypes = $rootScope.globalSettings.dataTypes; - ctrl.previousId = null; - ctrl.initData = async function () { - setTimeout(() => { - switch (ctrl.type) { - case "datetime": - case "date": - case "time": - if (ctrl.stringValue) { - ctrl.dateObj = new Date(ctrl.stringValue); - $scope.$apply(); - } - break; - case "boolean": - if (ctrl.stringValue) { - ctrl.booleanValue = ctrl.stringValue == "true"; - } - break; - - case "reference": // reference - if (ctrl.referenceId) { - ctrl.refRequest.mixDatabaseId = ctrl.referenceId; - ctrl.refRequest.parentType = ctrl.parentType; - ctrl.refRequest.parentId = ctrl.parentId; - - dataService.getList(ctrl.refRequest).then((resp) => { - if (resp) { - ctrl.refData = resp; - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $rootScope.isBusy = false; - $scope.$apply(); - } - }); - } - break; - default: - if (ctrl.isEncrypt && ctrl.encryptValue) { - var encryptedData = { - key: ctrl.encryptKey, - data: ctrl.encryptValue, - }; - ctrl.stringValue = $rootScope.decrypt(encryptedData); - } - break; - } - }, 200); - }; - ctrl.updateStringValue = async function (dataType) { - switch (dataType) { - case "datetime": - case "date": - case "time": - if (ctrl.dateObj != null) { - ctrl.stringValue = ctrl.dateObj.toISOString(); - } else { - ctrl.stringValue = null; - } - break; - case "double": - // ctrl.stringValue = ctrl.doubleValue; - break; - case "boolean": - // ctrl.stringValue = ctrl.booleanValue; - break; - - default: - ctrl.stringValue = ctrl.doubleValue; - break; - } - }; - ctrl.updateRefData = function (item) { - $location.url( - "/admin/mix-database-data/details?dataContentId=" + - item.id + - "&mixDatabaseId=" + - item.mixDatabaseId + - "&parentType=" + - item.parentType + - "&parentId=" + - item.parentId - ); - }; - ctrl.removeRefData = async function (data) { - $rootScope.showConfirm( - ctrl, - "removeRefDataConfirmed", - [data.id], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - }; - ctrl.removeRefDataConfirmed = async function (dataContentId) { - $rootScope.isBusy = true; - var result = await dataService.delete(dataContentId); - if (result.success) { - $rootScope.removeObjectByKey(ctrl.refData, "id", dataContentId); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showErrors(result.errors); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, - ], -}); - modules.component("mixSelectIcons", { templateUrl: "/mix-app/views/app-portal/components/mix-select-icons/mix-select-icons.html", @@ -14266,14 +14131,149 @@ modules.component("mixTemplateEditor", { } } }; - ctrl.updateTemplateContent = function (content) { - ctrl.template.content = content; + ctrl.updateTemplateContent = function (content) { + ctrl.template.content = content; + }; + ctrl.updateStyleContent = function (content) { + ctrl.template.scripts = content; + }; + ctrl.updateScriptContent = function (content) { + ctrl.template.styles = content; + }; + }, + ], +}); + +modules.component("mixValueEditor", { + templateUrl: + "/mix-app/views/app-portal/components/mix-value-editor/view.html", + bindings: { + title: "=?", + isSelect: "=?", + stringValue: "=", + type: "=", + }, + controller: [ + "$rootScope", + "$scope", + "ngAppSettings", + "$location", + "RestMixDatabaseDataPortalService", + function ($rootScope, $scope, ngAppSettings, $location, dataService) { + var ctrl = this; + ctrl.icons = ngAppSettings.icons; + ctrl.refData = []; + ctrl.refRequest = angular.copy(ngAppSettings.request); + ctrl.refRequest.pageSize = 100; + ctrl.dataTypes = $rootScope.globalSettings.dataTypes; + ctrl.previousId = null; + ctrl.initData = async function () { + setTimeout(() => { + switch (ctrl.type) { + case "datetime": + case "date": + case "time": + if (ctrl.stringValue) { + ctrl.dateObj = new Date(ctrl.stringValue); + $scope.$apply(); + } + break; + case "boolean": + if (ctrl.stringValue) { + ctrl.booleanValue = ctrl.stringValue == "true"; + } + break; + + case "reference": // reference + if (ctrl.referenceId) { + ctrl.refRequest.mixDatabaseId = ctrl.referenceId; + ctrl.refRequest.parentType = ctrl.parentType; + ctrl.refRequest.parentId = ctrl.parentId; + + dataService.getList(ctrl.refRequest).then((resp) => { + if (resp) { + ctrl.refData = resp; + $rootScope.isBusy = false; + $scope.$apply(); + } else { + if (resp) { + $rootScope.showErrors(resp.errors); + } + $rootScope.isBusy = false; + $scope.$apply(); + } + }); + } + break; + default: + if (ctrl.isEncrypt && ctrl.encryptValue) { + var encryptedData = { + key: ctrl.encryptKey, + data: ctrl.encryptValue, + }; + ctrl.stringValue = $rootScope.decrypt(encryptedData); + } + break; + } + }, 200); + }; + ctrl.updateStringValue = async function (dataType) { + switch (dataType) { + case "datetime": + case "date": + case "time": + if (ctrl.dateObj != null) { + ctrl.stringValue = ctrl.dateObj.toISOString(); + } else { + ctrl.stringValue = null; + } + break; + case "double": + // ctrl.stringValue = ctrl.doubleValue; + break; + case "boolean": + // ctrl.stringValue = ctrl.booleanValue; + break; + + default: + ctrl.stringValue = ctrl.doubleValue; + break; + } + }; + ctrl.updateRefData = function (item) { + $location.url( + "/admin/mix-database-data/details?dataContentId=" + + item.id + + "&mixDatabaseId=" + + item.mixDatabaseId + + "&parentType=" + + item.parentType + + "&parentId=" + + item.parentId + ); }; - ctrl.updateStyleContent = function (content) { - ctrl.template.scripts = content; + ctrl.removeRefData = async function (data) { + $rootScope.showConfirm( + ctrl, + "removeRefDataConfirmed", + [data.id], + null, + "Remove", + "Deleted data will not able to recover, are you sure you want to delete this item?" + ); }; - ctrl.updateScriptContent = function (content) { - ctrl.template.styles = content; + ctrl.removeRefDataConfirmed = async function (dataContentId) { + $rootScope.isBusy = true; + var result = await dataService.delete(dataContentId); + if (result.success) { + $rootScope.removeObjectByKey(ctrl.refData, "id", dataContentId); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showErrors(result.errors); + $rootScope.isBusy = false; + $scope.$apply(); + } }; }, ], @@ -15770,6 +15770,46 @@ modules.component("navigators", { ], }); +modules.component("portalThemeSettings", { + templateUrl: + "/mix-app/views/app-portal/components/portal-theme-settings/view.html", + bindings: { + showLink: "=", + }, + controller: [ + "$rootScope", + "$scope", + "AppSettingsServices", + function ($rootScope, $scope, appSettingsServices) { + var ctrl = this; + this.$onInit = function () { + ctrl.portalThemeSettings = + $rootScope.globalSettings.portalThemeSettings; + }; + ctrl.applyThemeSettings = function () { + $rootScope.globalSettings.portalThemeSettings = + ctrl.portalThemeSettings; + }; + ctrl.saveThemeSettings = async function () { + var resp = await appSettingsServices.saveAppSettings( + "PortalThemeSettings", + ctrl.portalThemeSettings + ); + if (resp && resp.success) { + $rootScope.showMessage("success", "success"); + $rootScope.isBusy = false; + $scope.$apply(); + } else { + if (resp) { + $rootScope.showErrors(resp.errors); + } + $scope.$apply(); + } + }; + }, + ], +}); + modules.component("propertiesStructure", { templateUrl: "/mix-app/views/app-portal/components/properties-structure/view.html", @@ -15901,6 +15941,75 @@ modules.component("propertiesStructure", { }, }); +modules.component("propertiesValue", { + templateUrl: + "/mix-app/views/app-portal/components/properties-value/view.html", + bindings: { + title: "=", + columns: "=", + properties: "=", + }, + controller: [ + "$rootScope", + "$scope", + function ($rootScope, $scope) { + var ctrl = this; + ctrl.defaultAttr = { + title: "", + name: "", + default: null, + options: [], + priority: 0, + dataType: 7, + isGroupBy: false, + isSelect: false, + isDisplay: true, + width: 3, + }; + ctrl.selectedProp = null; + ctrl.mixConfigurations = $rootScope.globalSettings; + + ctrl.$doCheck = function () { + if ( + angular.toJson(ctrl.columns) != angular.toJson(ctrl.trackedColumns) + ) { + ctrl.trackedColumns = angular.copy(ctrl.columns); + ctrl.trackedProperties = angular.copy(ctrl.properties); + ctrl.loadEditors(); + } + }.bind(ctrl); + + ctrl.loadEditors = function () { + ctrl.properties = []; + for (let i = 0; i < ctrl.columns.length; i++) { + var col = ctrl.columns[i]; + var oldObj = + $rootScope.findObjectByKey( + ctrl.trackedProperties, + "name", + col.systemName + ) || {}; + + ctrl.properties.push({ + title: col.displayName, + name: col.systemName, + dataType: col.dataType, + value: oldObj.value || col.defaultValue, + options: col.options, + }); + } + }; + + ctrl.addAttr = function () { + if (ctrl.columns) { + var t = angular.copy(ctrl.defaultAttr); + ctrl.columns.push(t); + } + }; + }, + ], +}); + modules.component("serviceHubPortal", { templateUrl: "/mix-app/views/app-portal/components/service-hub-portal/view.html", @@ -16018,177 +16127,52 @@ modules.component("serviceHubPortal", { $scope.$apply(); break; case "MemberOffline": - ctrl.removeMember(msg.data); - break; - case "Error": - console.error(msg.data); - break; - } - }; - ctrl.newMessage = function (msg) { - ctrl.messages.items.push(msg); - $scope.$apply(); - }; - ctrl.newMember = function (member) { - var m = $rootScope.findObjectByKey(ctrl.members, "id", member.id); - if (!m) { - ctrl.members.push(member); - } - $scope.$apply(); - }; - ctrl.join = async function () { - ctrl.request.action = "join_group"; - ctrl.request.uid = ctrl.user.connection.id; - ctrl.request.data = ctrl.user.connection; - ctrl.message.connection = ctrl.user.connection; - ctrl.connection.invoke("HandleRequest", JSON.stringify(ctrl.request)); - await ctrl.loadData(); - $scope.$apply(); - }; - ctrl.initListMember = function (data) { - data.forEach((member) => { - var index = ctrl.members.findIndex((x) => x.id === member.id); - if (index < 0) { - ctrl.members.splice(0, 0, member); - } - }); - - $scope.$apply(); - }; - - ctrl.checkLoginStatus = async function () { - var response = await userServices.getMyProfile(); - ctrl.user.connection.name = response.data.username; - ctrl.user.connection.id = response.data.id; - ctrl.user.connection.connectionId = ctrl.connection.connectionId; - ctrl.user.connection.avatar = response.data.avatar; - ctrl.user.loggedIn = true; - ctrl.join(); - }; - }, - ], -}); - -modules.component("portalThemeSettings", { - templateUrl: - "/mix-app/views/app-portal/components/portal-theme-settings/view.html", - bindings: { - showLink: "=", - }, - controller: [ - "$rootScope", - "$scope", - "AppSettingsServices", - function ($rootScope, $scope, appSettingsServices) { - var ctrl = this; - this.$onInit = function () { - ctrl.portalThemeSettings = - $rootScope.globalSettings.portalThemeSettings; - }; - ctrl.applyThemeSettings = function () { - $rootScope.globalSettings.portalThemeSettings = - ctrl.portalThemeSettings; - }; - ctrl.saveThemeSettings = async function () { - var resp = await appSettingsServices.saveAppSettings( - "PortalThemeSettings", - ctrl.portalThemeSettings - ); - if (resp && resp.success) { - $rootScope.showMessage("success", "success"); - $rootScope.isBusy = false; - $scope.$apply(); - } else { - if (resp) { - $rootScope.showErrors(resp.errors); - } - $scope.$apply(); + ctrl.removeMember(msg.data); + break; + case "Error": + console.error(msg.data); + break; } }; - }, - ], -}); - -modules.component("toastHelper", { - templateUrl: - "/mix-app/views/app-portal/components/toast-helper/toast-helper.html", - bindings: { - url: "=?", - title: "=?", - }, - controller: [ - "$rootScope", - function ($rootScope) { - var ctrl = this; - ctrl.visible = $rootScope.visible; - }, - ], -}); - -modules.component("propertiesValue", { - templateUrl: - "/mix-app/views/app-portal/components/properties-value/view.html", - bindings: { - title: "=", - columns: "=", - properties: "=", - }, - controller: [ - "$rootScope", - "$scope", - function ($rootScope, $scope) { - var ctrl = this; - ctrl.defaultAttr = { - title: "", - name: "", - default: null, - options: [], - priority: 0, - dataType: 7, - isGroupBy: false, - isSelect: false, - isDisplay: true, - width: 3, + ctrl.newMessage = function (msg) { + ctrl.messages.items.push(msg); + $scope.$apply(); }; - ctrl.selectedProp = null; - ctrl.mixConfigurations = $rootScope.globalSettings; - - ctrl.$doCheck = function () { - if ( - angular.toJson(ctrl.columns) != angular.toJson(ctrl.trackedColumns) - ) { - ctrl.trackedColumns = angular.copy(ctrl.columns); - ctrl.trackedProperties = angular.copy(ctrl.properties); - ctrl.loadEditors(); + ctrl.newMember = function (member) { + var m = $rootScope.findObjectByKey(ctrl.members, "id", member.id); + if (!m) { + ctrl.members.push(member); } - }.bind(ctrl); - - ctrl.loadEditors = function () { - ctrl.properties = []; - for (let i = 0; i < ctrl.columns.length; i++) { - var col = ctrl.columns[i]; - var oldObj = - $rootScope.findObjectByKey( - ctrl.trackedProperties, - "name", - col.systemName - ) || {}; + $scope.$apply(); + }; + ctrl.join = async function () { + ctrl.request.action = "join_group"; + ctrl.request.uid = ctrl.user.connection.id; + ctrl.request.data = ctrl.user.connection; + ctrl.message.connection = ctrl.user.connection; + ctrl.connection.invoke("HandleRequest", JSON.stringify(ctrl.request)); + await ctrl.loadData(); + $scope.$apply(); + }; + ctrl.initListMember = function (data) { + data.forEach((member) => { + var index = ctrl.members.findIndex((x) => x.id === member.id); + if (index < 0) { + ctrl.members.splice(0, 0, member); + } + }); - ctrl.properties.push({ - title: col.displayName, - name: col.systemName, - dataType: col.dataType, - value: oldObj.value || col.defaultValue, - options: col.options, - }); - } + $scope.$apply(); }; - ctrl.addAttr = function () { - if (ctrl.columns) { - var t = angular.copy(ctrl.defaultAttr); - ctrl.columns.push(t); - } + ctrl.checkLoginStatus = async function () { + var response = await userServices.getMyProfile(); + ctrl.user.connection.name = response.data.username; + ctrl.user.connection.id = response.data.id; + ctrl.user.connection.connectionId = ctrl.connection.connectionId; + ctrl.user.connection.avatar = response.data.avatar; + ctrl.user.loggedIn = true; + ctrl.join(); }; }, ], @@ -16344,6 +16328,83 @@ modules.component("templateEditor", { ], }); +modules.component("toastHelper", { + templateUrl: + "/mix-app/views/app-portal/components/toast-helper/toast-helper.html", + bindings: { + url: "=?", + title: "=?", + }, + controller: [ + "$rootScope", + function ($rootScope) { + var ctrl = this; + ctrl.visible = $rootScope.visible; + }, + ], +}); + +modules.component("urlAlias", { + templateUrl: "/mix-app/views/app-portal/components/url-alias/url-alias.html", + controller: [ + "$rootScope", + "$scope", + "UrlAliasService", + function ($rootScope, $scope, service) { + var ctrl = this; + ctrl.$onInit = function () { + ctrl.updateUrl(); + }; + ctrl.updateUrl = function () { + ctrl.url = + $rootScope.globalSettings.domain + + "/" + + $rootScope.mixConfigurations.lang + + "/" + + ctrl.urlAlias.alias; + }; + ctrl.remove = function () { + if (ctrl.urlAlias.id > 0) { + $rootScope.showConfirm( + ctrl, + "removeConfirmed", + [ctrl.urlAlias.id], + null, + "Remove", + "Deleted data will not able to recover, are you sure you want to delete this item?" + ); + } else { + if (ctrl.removeCallback) { + ctrl.removeCallback({ index: ctrl.index }); + } + } + }; + + ctrl.removeConfirmed = async function (id) { + $rootScope.isBusy = true; + var result = await service.delete(id); + if (result.success) { + if (ctrl.removeCallback) { + ctrl.removeCallback({ index: ctrl.index }); + } + $rootScope.isBusy = false; + $scope.$apply(); + } else { + $rootScope.showMessage("failed"); + $rootScope.isBusy = false; + $scope.$apply(); + } + }; + }, + ], + bindings: { + urlAlias: "=", + index: "=", + callback: "&", + removeCallback: "&", + }, +}); + app.factory("ConnectionManager", [ function () { var serviceFactory = {}; @@ -17196,67 +17257,6 @@ app.factory("ViewModel", [ }, ]); -modules.component("urlAlias", { - templateUrl: "/mix-app/views/app-portal/components/url-alias/url-alias.html", - controller: [ - "$rootScope", - "$scope", - "UrlAliasService", - function ($rootScope, $scope, service) { - var ctrl = this; - ctrl.$onInit = function () { - ctrl.updateUrl(); - }; - ctrl.updateUrl = function () { - ctrl.url = - $rootScope.globalSettings.domain + - "/" + - $rootScope.mixConfigurations.lang + - "/" + - ctrl.urlAlias.alias; - }; - ctrl.remove = function () { - if (ctrl.urlAlias.id > 0) { - $rootScope.showConfirm( - ctrl, - "removeConfirmed", - [ctrl.urlAlias.id], - null, - "Remove", - "Deleted data will not able to recover, are you sure you want to delete this item?" - ); - } else { - if (ctrl.removeCallback) { - ctrl.removeCallback({ index: ctrl.index }); - } - } - }; - - ctrl.removeConfirmed = async function (id) { - $rootScope.isBusy = true; - var result = await service.delete(id); - if (result.success) { - if (ctrl.removeCallback) { - ctrl.removeCallback({ index: ctrl.index }); - } - $rootScope.isBusy = false; - $scope.$apply(); - } else { - $rootScope.showMessage("failed"); - $rootScope.isBusy = false; - $scope.$apply(); - } - }; - }, - ], - bindings: { - urlAlias: "=", - index: "=", - callback: "&", - removeCallback: "&", - }, -}); - !(function (t) { var e = {}; function i(n) { diff --git a/src/applications/Mixcore/wwwroot/mix-app/views/app-portal/pages/application/details.html b/src/applications/Mixcore/wwwroot/mix-app/views/app-portal/pages/application/details.html index 2cd612afa..297c3a6c0 100644 --- a/src/applications/Mixcore/wwwroot/mix-app/views/app-portal/pages/application/details.html +++ b/src/applications/Mixcore/wwwroot/mix-app/views/app-portal/pages/application/details.html @@ -1 +1 @@ -
(Must start with "/app/", ex: '/app/my-app')
{{post.title}}
by {{post.properties.authorName}} in {{post.additionalData.category}}

\ No newline at end of file +
(Must start with "/app/", ex: '/app/my-app')
{{post.title}}
by {{post.properties.authorName}} in {{post.additionalData.category}}

\ No newline at end of file diff --git a/src/applications/Mixcore/wwwroot/mix-app/views/app-portal/pages/application/list.html b/src/applications/Mixcore/wwwroot/mix-app/views/app-portal/pages/application/list.html index b4ed26efe..f6b9b93a3 100644 --- a/src/applications/Mixcore/wwwroot/mix-app/views/app-portal/pages/application/list.html +++ b/src/applications/Mixcore/wwwroot/mix-app/views/app-portal/pages/application/list.html @@ -1 +1 @@ -
Display NameSystem NamePrimary DomainCreatedAuthor
{{item.createdDateTime | utcToLocal:'dd.MM.yy hh:mm a'}}{{item.createdBy}}🟢 🟡 🔴 ⚫️
\ No newline at end of file +
Display NameSystem NamePrimary DomainCreatedAuthor
{{item.createdDateTime | utcToLocal:'dd.MM.yy hh:mm a'}}{{item.createdBy}}🟢 🟡 🔴 ⚫️
\ No newline at end of file diff --git a/src/applications/Mixcore/wwwroot/mix-app/views/app-portal/pages/order-detail/details.html b/src/applications/Mixcore/wwwroot/mix-app/views/app-portal/pages/order-detail/details.html index afcf8d69a..c214e0670 100644 --- a/src/applications/Mixcore/wwwroot/mix-app/views/app-portal/pages/order-detail/details.html +++ b/src/applications/Mixcore/wwwroot/mix-app/views/app-portal/pages/order-detail/details.html @@ -1 +1 @@ -
{{post.title}}
by {{post.properties.authorName}} in {{post.additionalData.category}}
\ No newline at end of file +
{{post.title}}
by {{post.properties.authorName}} in {{post.additionalData.category}}
\ No newline at end of file diff --git a/src/modules/mix.portal/Controllers/MixApplicationController.cs b/src/modules/mix.portal/Controllers/MixApplicationController.cs index a2b597516..9faecefb5 100644 --- a/src/modules/mix.portal/Controllers/MixApplicationController.cs +++ b/src/modules/mix.portal/Controllers/MixApplicationController.cs @@ -38,9 +38,9 @@ public MixApplicationController( [Route("install")] public async Task> Install([FromBody] MixApplicationViewModel app, CancellationToken cancellationToken = default) { - if (_cmsContext.MixApplication.Any(m => m.MixTenantId == CurrentTenant.Id && m.BaseRoute == app.BaseRoute && m.Id != app.Id)) + if (_cmsContext.MixApplication.Any(m => m.MixTenantId == CurrentTenant.Id && m.BaseHref == app.BaseHref && m.Id != app.Id)) { - return BadRequest($"BaseRoute: \"{app.BaseRoute}\" existed"); + return BadRequest($"BaseHref: \"{app.BaseHref}\" existed"); } await _applicationService.Install(app, cancellationToken); @@ -72,7 +72,7 @@ protected override async Task> Sear var result = await base.SearchHandler(req, cancellationToken); foreach (var item in result.Items) { - item.DetailUrl = $"{CurrentTenant.PrimaryDomain}{item.BaseRoute}"; + item.DetailUrl = $"{CurrentTenant.PrimaryDomain}{item.BaseHref}"; } return result; } diff --git a/src/modules/mix.portal/Domain/Services/MixApplicationService.cs b/src/modules/mix.portal/Domain/Services/MixApplicationService.cs index a2fd9570c..7cd3485af 100644 --- a/src/modules/mix.portal/Domain/Services/MixApplicationService.cs +++ b/src/modules/mix.portal/Domain/Services/MixApplicationService.cs @@ -43,15 +43,14 @@ public MixApplicationService( public async Task Install(MixApplicationViewModel app, CancellationToken cancellationToken = default) { string name = SeoHelper.GetSEOString(app.DisplayName); - string appFolder = $"{MixFolders.StaticFiles}/{MixFolders.MixApplications}/{name}"; - string filePath = await DownloadPackage(name, app.PackageFilePath, appFolder); - await AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Extract Package {filePath} Successfully"); - MixFileHelper.UnZipFile(filePath, appFolder); - await AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Extract Package {filePath} Successfully"); - app.TemplateId = await SaveTemplate(app.TemplateId, name, appFolder, app.BaseRoute); + string deployUrl = $"{MixFolders.StaticFiles}/{MixFolders.MixApplications}/{name}"; + string filePath = await DownloadPackage(name, app.PackageFilePath, deployUrl); + _ = AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Extract Package {filePath} Successfully"); + MixFileHelper.UnZipFile(filePath, deployUrl); + _ = AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Extract Package {filePath} Successfully"); + app.TemplateId = await SaveTemplate(app.TemplateId, name, deployUrl, app.BaseHref); app.SetUowInfo(_cmsUow, CacheService); - app.BaseRoute ??= name; - app.BaseHref = appFolder; + app.DeployUrl = deployUrl; app.MixTenantId = CurrentTenant.Id; app.CreatedBy = _mixIdentityService.GetClaim(HttpContextAccessor.HttpContext?.User, MixClaims.Username); app.AppSettings["activePackage"] = filePath; @@ -63,18 +62,18 @@ public async Task Install(MixApplicationViewModel app, return app; } - private async Task SaveTemplate(int? templateId, string name, string appFolder, string baseRoute) + private async Task SaveTemplate(int? templateId, string name, string deployUrl, string baseHref) { try { - templateId = await ReplaceIndex(templateId, name, appFolder, baseRoute); - var files = MixFileHelper.GetTopFiles(appFolder, true); - var folders = string.Join('|', MixFileHelper.GetTopDirectories(appFolder)); + templateId = await ReplaceIndex(templateId, name, deployUrl, baseHref); + var files = MixFileHelper.GetTopFiles(deployUrl, true); + var folders = string.Join('|', MixFileHelper.GetTopDirectories(deployUrl)); foreach (var file in files) { if (file.Extension == MixFileExtensions.Js || file.Extension == MixFileExtensions.Css) { - await ReplaceContent(file, folders, appFolder); + await ReplaceContent(file, folders, deployUrl); } } return templateId; @@ -85,27 +84,29 @@ public async Task Install(MixApplicationViewModel app, } } - private async Task ReplaceIndex(int? templateId, string name, string appFolder, string baseRoute) + private async Task ReplaceIndex(int? templateId, string name, string deployUrl, string baseHref) { try { - var indexFile = MixFileHelper.GetFileByFullName($"{appFolder}/index.html"); + _ = AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Modifying {name}.cshtml"); + + var indexFile = MixFileHelper.GetFileByFullName($"{deployUrl}/index.html"); if (string.IsNullOrEmpty(indexFile.Content)) { throw new MixException(MixErrorStatus.Badrequest, "Invalid Application Package"); } - await AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Modifying {name}.cshtml"); + Regex regex = new("((?<=src=\")|(?<=href=\"))(?!(http[^\\s]+))(.+?)(\\.+?)"); Regex baseHrefRegex = new("(base href=\"(.+?)\")"); indexFile.Content = indexFile.Content.Replace("[basePath]/", string.Empty); - indexFile.Content = regex.Replace(indexFile.Content, $"/{appFolder}/$3$4"); - indexFile.Content = baseHrefRegex.Replace(indexFile.Content, $"base href=\"{baseRoute}\"") - .Replace("[baseRoute]", baseRoute) + indexFile.Content = regex.Replace(indexFile.Content, $"/{deployUrl}/$3$4"); + indexFile.Content = baseHrefRegex.Replace(indexFile.Content, $"base href=\"{baseHref}\"") + .Replace("[baseRoute]", deployUrl) - .Replace("options['baseRoute']", $"'{baseRoute}'") - .Replace("options['baseHref']", $"'/{appFolder}'"); + .Replace("options['baseRoute']", $"'{deployUrl}'") + .Replace("options['baseHref']", $"'/{baseHref}'"); var activeTheme = await _themeService.GetActiveTheme(); MixTemplateViewModel template = await MixTemplateViewModel.GetRepository(_cmsUow, CacheService).GetSingleAsync(m => m.Id == templateId); @@ -125,7 +126,7 @@ public async Task Install(MixApplicationViewModel app, await template.SaveAsync(); _queueService.PushQueue(CurrentTenant.Id, MixQueueTopics.MixViewModelChanged, MixRestAction.Post.ToString(), template); MixFileHelper.SaveFile(indexFile); - await AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Modified {name}.cshtml successfully"); + _ = AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Modified {name}.cshtml successfully"); return template.Id; } catch (Exception) @@ -135,11 +136,11 @@ public async Task Install(MixApplicationViewModel app, } } - private async Task ReplaceContent(FileModel file, string folders, string appFolder) + private Task ReplaceContent(FileModel file, string folders, string appFolder) { if (!string.IsNullOrEmpty(file.Content)) { - await AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Modifying {file.Filename}{file.Extension}"); + _ = AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Modifying {file.Filename}{file.Extension}"); Regex rg = new($"((\\\"|\\')(({folders})))"); Regex rgSplash = new($"((\\.\\/)({folders}))"); Regex rgSplash1 = new($"((\\(\\/|\\`\\/)(({folders})))"); @@ -159,6 +160,7 @@ private async Task ReplaceContent(FileModel file, string folders, string appFold MixFileHelper.SaveFile(file); } + return Task.CompletedTask; } private async Task DownloadPackage(string name, string packageUrl, string appFolder) @@ -201,10 +203,10 @@ public async Task UpdatePackage(MixApplicationViewModel string name = SeoHelper.GetSEOString(app.DisplayName); var packages = app.AppSettings.Value("packages") ?? new(); - string appFolder = $"{MixFolders.StaticFiles}/{MixFolders.MixApplications}/{name}"; - string package = await DownloadPackage(name, app.PackageFilePath, appFolder); - MixFileHelper.UnZipFile(package, appFolder); - await SaveTemplate(app.TemplateId, name, appFolder, app.BaseRoute); + string deployUrl = $"{MixFolders.StaticFiles}/{MixFolders.MixApplications}/{name}"; + string package = await DownloadPackage(name, app.PackageFilePath, deployUrl); + MixFileHelper.UnZipFile(package, deployUrl); + await SaveTemplate(app.TemplateId, name, deployUrl, app.BaseHref); packages.Add(package); app.AppSettings["activePackage"] = package; app.AppSettings["packages"] = packages; @@ -224,7 +226,7 @@ public async Task RestorePackage(RestoreMixApplicationP { try { - await AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Extract Package {dto.PackageFilePath}"); + _ = AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Extract Package {dto.PackageFilePath}"); var app = await MixApplicationViewModel.GetRepository(_cmsUow, CacheService).GetSingleAsync(m => m.Id == dto.AppId); if (app == null) { @@ -235,11 +237,11 @@ public async Task RestorePackage(RestoreMixApplicationP throw new MixException(MixErrorStatus.NotFound, $"Package {dto.PackageFilePath} Not Found"); } string name = SeoHelper.GetSEOString(app.DisplayName); - string appFolder = $"{MixFolders.StaticFiles}/{MixFolders.MixApplications}/{name}"; - MixFileHelper.UnZipFile(dto.PackageFilePath, appFolder); + string deployUrl = $"{MixFolders.StaticFiles}/{MixFolders.MixApplications}/{name}"; + MixFileHelper.UnZipFile(dto.PackageFilePath, deployUrl); - await AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Extract Package {dto.PackageFilePath} Successfully"); - await SaveTemplate(app.TemplateId, name, appFolder, app.BaseRoute); + _ = AlertAsync(_hubContext.Clients.Group("Theme"), "Status", 200, $"Extract Package {dto.PackageFilePath} Successfully"); + await SaveTemplate(app.TemplateId, name, deployUrl, app.BaseHref); app.AppSettings["activePackage"] = dto.PackageFilePath; await app.SaveAsync(cancellationToken); diff --git a/src/modules/mix.portal/Domain/ViewModels/MixApplicationViewModel.cs b/src/modules/mix.portal/Domain/ViewModels/MixApplicationViewModel.cs index 75245bae0..afa81d350 100644 --- a/src/modules/mix.portal/Domain/ViewModels/MixApplicationViewModel.cs +++ b/src/modules/mix.portal/Domain/ViewModels/MixApplicationViewModel.cs @@ -6,7 +6,7 @@ public sealed class MixApplicationViewModel #region Properties public string BaseHref { get; set; } - public string BaseRoute { get; set; } + public string DeployUrl { get; set; } public JObject AppSettings { get; set; } = new(); public string Domain { get; set; } public string BaseApiUrl { get; set; } @@ -41,7 +41,7 @@ public MixApplicationViewModel(UnitOfWorkInfo unitOfWorkInfo) : base(unitOfWorkI public override async Task Validate(CancellationToken cancellationToken) { - if (Context.MixApplication.Any(m => m.BaseRoute == BaseRoute && m.MixTenantId == MixTenantId && m.Id != Id)) + if (Context.MixApplication.Any(m => m.DeployUrl == DeployUrl && m.MixTenantId == MixTenantId && m.Id != Id)) { IsValid = false; Errors.Add(new("BaseRoute existed")); diff --git a/src/platform/mix.database/Entities/Cms/EntityConfigurations/MixApplicationConfiguration.cs b/src/platform/mix.database/Entities/Cms/EntityConfigurations/MixApplicationConfiguration.cs index 6f7e0acdd..eb4c060e7 100644 --- a/src/platform/mix.database/Entities/Cms/EntityConfigurations/MixApplicationConfiguration.cs +++ b/src/platform/mix.database/Entities/Cms/EntityConfigurations/MixApplicationConfiguration.cs @@ -26,7 +26,7 @@ public override void Configure(EntityTypeBuilder builder) builder.Property(e => e.BaseHref) .HasColumnType($"{Config.String}{Config.MediumLength}") .HasCharSet(Config.CharSet); - builder.Property(e => e.BaseRoute) + builder.Property(e => e.DeployUrl) .HasColumnType($"{Config.String}{Config.MediumLength}") .HasCharSet(Config.CharSet); builder.Property(e => e.Domain) diff --git a/src/platform/mix.database/Entities/Cms/MixApplication.cs b/src/platform/mix.database/Entities/Cms/MixApplication.cs index 51ae1f9a4..4c3e63ddd 100644 --- a/src/platform/mix.database/Entities/Cms/MixApplication.cs +++ b/src/platform/mix.database/Entities/Cms/MixApplication.cs @@ -5,7 +5,7 @@ namespace Mix.Database.Entities.Cms public class MixApplication : TenantEntityBase { public string BaseHref { get; set; } - public string BaseRoute { get; set; } + public string DeployUrl { get; set; } public JObject AppSettings { get; set; } public string Domain { get; set; } public string BaseApiUrl { get; set; } diff --git a/src/platform/mix.database/Migrations/Cms/MySqlMixCms/20231016051353_UpdateMixAppBaseHref.Designer.cs b/src/platform/mix.database/Migrations/Cms/MySqlMixCms/20231016051353_UpdateMixAppBaseHref.Designer.cs new file mode 100644 index 000000000..f844482a8 --- /dev/null +++ b/src/platform/mix.database/Migrations/Cms/MySqlMixCms/20231016051353_UpdateMixAppBaseHref.Designer.cs @@ -0,0 +1,2882 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Mix.Database.Entities.Cms; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Mix.Database.Migrations.Cms.MySqlMixCms +{ + [DbContext(typeof(MySqlMixCmsContext))] + [Migration("20231016051353_UpdateMixAppBaseHref")] + partial class UpdateMixAppBaseHref + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.9") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("AppSettings") + .HasColumnType("longtext"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("AppSettings"), "utf8"); + + b.Property("BaseApiUrl") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("BaseApiUrl"), "utf8"); + + b.Property("BaseHref") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("BaseHref"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DeployUrl") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DeployUrl"), "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("Domain") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Domain"), "utf8"); + + b.Property("Image") + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixDatabaseName") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("MixDatabaseName"), "utf8"); + + b.Property("MixDbId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.HasKey("Id") + .HasName("PK_MixApplication"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixApplication"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SystemName"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixConfiguration"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixConfiguration"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfigurationContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Category") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Category"), "utf8"); + + b.Property("Content") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Content"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DataType") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DataType"), "utf8"); + + b.Property("DefaultContent") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DefaultContent"), "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Icon"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixConfigurationId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Specificulture"), "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SystemName"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixConfigurationContent"); + + b.HasIndex("MixConfigurationId"); + + b.HasIndex("MixCultureId"); + + b.ToTable("MixConfigurationContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixContributor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ContentType") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("ContentType"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("GuidContentId") + .HasColumnType("char(36)"); + + b.Property("IntContentId") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("IsOwner") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id") + .HasName("PK_MixContributor"); + + b.ToTable("MixContributor"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixCulture", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Alias") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Alias"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(4000)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Icon"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("Lcid") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Lcid"), "utf8"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Specificulture") + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Specificulture"), "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixCulture"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixCulture"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabase", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatePermissions") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("CreatePermissions"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DeletePermissions") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DeletePermissions"), "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixDatabaseContextId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("ReadPermissions") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("ReadPermissions"), "utf8"); + + b.Property("SelfManaged") + .HasColumnType("tinyint(1)"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SystemName"), "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Type"), "utf8"); + + b.Property("UpdatePermissions") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("UpdatePermissions"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabase"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixDatabase"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasDefaultValueSql("(uuid())"); + + b.Property("ChildDatabaseName") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("ChildDatabaseName"), "utf8"); + + b.Property("ChildId") + .HasColumnType("int"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("GuidChildId") + .HasColumnType("char(36)"); + + b.Property("GuidParentId") + .HasColumnType("char(36)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentDatabaseName") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("ParentDatabaseName"), "utf8"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseAssociation"); + + b.ToTable("MixDatabaseAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseColumn", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Configurations") + .HasColumnType("varchar(4000)"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DataType") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DataType"), "utf8"); + + b.Property("DefaultValue") + .HasColumnType("longtext") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DefaultValue"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixDatabaseId") + .HasColumnType("int"); + + b.Property("MixDatabaseName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("MixDatabaseName"), "utf8"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("ReferenceId") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SystemName"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseColumn"); + + b.HasIndex("MixDatabaseId"); + + b.ToTable("MixDatabaseColumn"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseContext", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ConnectionString") + .IsRequired() + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("ConnectionString"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DatabaseProvider") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DatabaseProvider"), "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Schema") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Schema"), "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SystemName"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseContext"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixDatabaseContext"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseRelationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ChildId") + .HasColumnType("int"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DestinateDatabaseName") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DestinateDatabaseName"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("SourceDatabaseName") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SourceDatabaseName"), "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Type"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseRelationship"); + + b.HasIndex("ChildId"); + + b.HasIndex("ParentId"); + + b.ToTable("MixDatabaseRelationship"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDiscussion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Content") + .IsRequired() + .HasColumnType("longtext"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Content"), "utf8"); + + b.Property("ContentType") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("ContentType"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("GuidContentId") + .HasColumnType("char(36)"); + + b.Property("IntContentId") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id") + .HasName("PK_MixDiscussion"); + + b.ToTable("MixDiscussion"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDomain", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("Host") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Host"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDomain"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixDomain"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SystemName"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixLanguage"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixLanguage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguageContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Category") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Category"), "utf8"); + + b.Property("Content") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Content"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DataType") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DataType"), "utf8"); + + b.Property("DefaultContent") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DefaultContent"), "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Icon"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixCultureId") + .HasColumnType("int"); + + b.Property("MixLanguageId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Specificulture"), "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SystemName"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixLanguageContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixLanguageId"); + + b.ToTable("MixLanguageContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)") + .HasDefaultValueSql("(uuid())"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("Extension") + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Extension"), "utf8"); + + b.Property("FileFolder") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("FileFolder"), "utf8"); + + b.Property("FileName") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("FileName"), "utf8"); + + b.Property("FileProperties") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("FileProperties"), "utf8"); + + b.Property("FileSize") + .HasColumnType("bigint"); + + b.Property("FileType") + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("FileType"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Source"), "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("Tags") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Tags"), "utf8"); + + b.Property("TargetUrl") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("TargetUrl"), "utf8"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Title"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixMedia"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixMedia"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SystemName"), "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Type"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixModule"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixModule"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClassName") + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("ClassName"), "utf8"); + + b.Property("Content") + .HasColumnType("longtext") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Content"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Excerpt") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Excerpt"), "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Icon"), "utf8"); + + b.Property("Image") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Image"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("LayoutId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("int"); + + b.Property("MixDatabaseName") + .HasColumnType("longtext"); + + b.Property("MixDbId") + .HasColumnType("int"); + + b.Property("MixModuleId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PageSize") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PublishedDateTime") + .HasColumnType("datetime"); + + b.Property("SeoDescription") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SeoDescription"), "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SeoKeywords"), "utf8"); + + b.Property("SeoName") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SeoName"), "utf8"); + + b.Property("SeoTitle") + .HasColumnType("longtext"); + + b.Property("SimpleDataColumns") + .HasColumnType("longtext"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Source"), "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Specificulture"), "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("SystemName") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SystemName"), "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Title"), "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Type"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixModuleContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixModuleId"); + + b.ToTable("MixModuleContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Content") + .HasColumnType("longtext") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Content"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Excerpt") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Excerpt"), "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Icon"), "utf8"); + + b.Property("Image") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Image"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("LayoutId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("int"); + + b.Property("MixModuleContentId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PublishedDateTime") + .HasColumnType("datetime"); + + b.Property("SeoDescription") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SeoDescription"), "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SeoKeywords"), "utf8"); + + b.Property("SeoName") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SeoName"), "utf8"); + + b.Property("SeoTitle") + .HasColumnType("longtext"); + + b.Property("SimpleDataColumns") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SimpleDataColumns"), "utf8"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Source"), "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Specificulture"), "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Title"), "utf8"); + + b.Property("Value") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Value"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixModuleData"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixModuleContentId"); + + b.ToTable("MixModuleData"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModulePostAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ChildId") + .HasColumnType("int"); + + b.Property("CreatedBy") + .HasColumnType("longtext"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime(6)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("MixModuleContentId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("longtext"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("MixModuleContentId"); + + b.ToTable("MixModulePostAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixPostContentId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPage"); + + b.HasIndex("MixPostContentId"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixPage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClassName") + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("ClassName"), "utf8"); + + b.Property("Content") + .HasColumnType("longtext") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Content"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Excerpt") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Excerpt"), "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Icon"), "utf8"); + + b.Property("Image") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Image"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("LayoutId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("int"); + + b.Property("MixDatabaseName") + .HasColumnType("longtext"); + + b.Property("MixDbId") + .HasColumnType("int"); + + b.Property("MixPageId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PageSize") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PublishedDateTime") + .HasColumnType("datetime"); + + b.Property("SeoDescription") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SeoDescription"), "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SeoKeywords"), "utf8"); + + b.Property("SeoName") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SeoName"), "utf8"); + + b.Property("SeoTitle") + .HasColumnType("longtext"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Source"), "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Specificulture"), "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Title"), "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Type"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPageContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixPageId"); + + b.ToTable("MixPageContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageModuleAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ChildId") + .HasColumnType("int"); + + b.Property("CreatedBy") + .HasColumnType("longtext"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime(6)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("MixPageContentId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("longtext"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("MixPageContentId"); + + b.ToTable("MixPageModuleAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPagePostAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ChildId") + .HasColumnType("int"); + + b.Property("CreatedBy") + .HasColumnType("longtext"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime(6)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("MixPageContentId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("longtext"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("MixPageContentId"); + + b.ToTable("MixPagePostAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPost"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixPost"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClassName") + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("ClassName"), "utf8"); + + b.Property("Content") + .HasColumnType("longtext") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Content"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Excerpt") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Excerpt"), "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Icon"), "utf8"); + + b.Property("Image") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Image"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("LayoutId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("int"); + + b.Property("MixDatabaseName") + .HasColumnType("longtext"); + + b.Property("MixDbId") + .HasColumnType("int"); + + b.Property("MixPostContentId") + .HasColumnType("int"); + + b.Property("MixPostId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PublishedDateTime") + .HasColumnType("datetime"); + + b.Property("SeoDescription") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SeoDescription"), "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SeoKeywords"), "utf8"); + + b.Property("SeoName") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SeoName"), "utf8"); + + b.Property("SeoTitle") + .HasColumnType("longtext"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Source"), "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Specificulture"), "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Title"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPostContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixPostContentId"); + + b.HasIndex("MixPostId"); + + b.ToTable("MixPostContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostPostAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ChildId") + .HasColumnType("int"); + + b.Property("CreatedBy") + .HasColumnType("longtext"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime(6)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime(6)"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("longtext"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("MixPostPostAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Content") + .HasColumnType("longtext") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Content"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Extension") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Extension"), "utf8"); + + b.Property("FileFolder") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("FileFolder"), "utf8"); + + b.Property("FileName") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("FileName"), "utf8"); + + b.Property("FolderType") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("FolderType"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("MixThemeId") + .HasColumnType("int"); + + b.Property("MixThemeName") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("MixThemeName"), "utf8"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Scripts") + .IsRequired() + .HasColumnType("longtext") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Scripts"), "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("Styles") + .IsRequired() + .HasColumnType("longtext") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Styles"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixTemplate"); + + b.HasIndex("MixThemeId"); + + b.ToTable("MixViewTemplate"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PrimaryDomain") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("PrimaryDomain"), "utf8"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("SystemName"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixTenant"); + + b.ToTable("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTheme", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("AssetFolder") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("AssetFolder"), "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("ImageUrl") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("ImageUrl"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixDatabaseName") + .HasColumnType("longtext"); + + b.Property("MixDbId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PreviewUrl") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("PreviewUrl"), "utf8"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("SystemName") + .HasColumnType("longtext"); + + b.Property("TemplateFolder") + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("TemplateFolder"), "utf8"); + + b.HasKey("Id") + .HasName("PK_MixTheme"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixTheme"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixUrlAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Alias") + .HasColumnType("longtext"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Description"), "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("utf8_unicode_ci"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DisplayName"), "utf8"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("SourceContentGuidId") + .HasColumnType("char(36)"); + + b.Property("SourceContentId") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("Status"), "utf8"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id") + .HasName("PK_MixUrlAlias"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixUrlAlias"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixApplication", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfiguration", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfigurationContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixConfiguration", "MixConfiguration") + .WithMany("MixConfigurationContents") + .HasForeignKey("MixConfigurationId"); + + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixConfiguration"); + + b.Navigation("MixCulture"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixCulture", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabase", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", null) + .WithMany("MixDatabases") + .HasForeignKey("MixTenantId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseColumn", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixDatabase", "MixDatabase") + .WithMany("MixDatabaseColumns") + .HasForeignKey("MixDatabaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixDatabase"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseContext", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseRelationship", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixDatabase", "DestinateDatabase") + .WithMany("DestinateRelationships") + .HasForeignKey("ChildId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixDatabase", "SourceDatabase") + .WithMany("SourceRelationships") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("DestinateDatabase"); + + b.Navigation("SourceDatabase"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDomain", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguage", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguageContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixLanguage", "MixLanguage") + .WithMany("MixLanguageContents") + .HasForeignKey("MixLanguageId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixLanguage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixMedia", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModule", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany("MixModules") + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixModule", "MixModule") + .WithMany("MixModuleContents") + .HasForeignKey("MixModuleId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixModule"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleData", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixModuleContent", "MixModuleContent") + .WithMany() + .HasForeignKey("MixModuleContentId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixModuleContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModulePostAssociation", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixModuleContent", null) + .WithMany("MixPostContents") + .HasForeignKey("MixModuleContentId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPage", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixPostContent", null) + .WithMany("MixPages") + .HasForeignKey("MixPostContentId"); + + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany("MixPages") + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixPage", "MixPage") + .WithMany("MixPageContents") + .HasForeignKey("MixPageId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixPage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageModuleAssociation", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixPageContent", null) + .WithMany("MixModuleContents") + .HasForeignKey("MixPageContentId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPagePostAssociation", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixPageContent", null) + .WithMany("MixPostContents") + .HasForeignKey("MixPageContentId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPost", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany("MixPosts") + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixPostContent", null) + .WithMany("MixPostContents") + .HasForeignKey("MixPostContentId"); + + b.HasOne("Mix.Database.Entities.Cms.MixPost", "MixPost") + .WithMany("MixPostContents") + .HasForeignKey("MixPostId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixPost"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTemplate", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTheme", "MixTheme") + .WithMany("MixViewTemplates") + .HasForeignKey("MixThemeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTheme"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTheme", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixUrlAlias", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfiguration", b => + { + b.Navigation("MixConfigurationContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabase", b => + { + b.Navigation("DestinateRelationships"); + + b.Navigation("MixDatabaseColumns"); + + b.Navigation("SourceRelationships"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguage", b => + { + b.Navigation("MixLanguageContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModule", b => + { + b.Navigation("MixModuleContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleContent", b => + { + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPage", b => + { + b.Navigation("MixPageContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageContent", b => + { + b.Navigation("MixModuleContents"); + + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPost", b => + { + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostContent", b => + { + b.Navigation("MixPages"); + + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTenant", b => + { + b.Navigation("MixDatabases"); + + b.Navigation("MixModules"); + + b.Navigation("MixPages"); + + b.Navigation("MixPosts"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTheme", b => + { + b.Navigation("MixViewTemplates"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/platform/mix.database/Migrations/Cms/MySqlMixCms/20231016051353_UpdateMixAppBaseHref.cs b/src/platform/mix.database/Migrations/Cms/MySqlMixCms/20231016051353_UpdateMixAppBaseHref.cs new file mode 100644 index 000000000..20f402080 --- /dev/null +++ b/src/platform/mix.database/Migrations/Cms/MySqlMixCms/20231016051353_UpdateMixAppBaseHref.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Mix.Database.Migrations.Cms.MySqlMixCms +{ + /// + public partial class UpdateMixAppBaseHref : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "BaseRoute", + table: "MixApplication", + newName: "DeployUrl"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "DeployUrl", + table: "MixApplication", + newName: "BaseRoute"); + } + } +} diff --git a/src/platform/mix.database/Migrations/Cms/MySqlMixCms/MySqlMixCmsContextModelSnapshot.cs b/src/platform/mix.database/Migrations/Cms/MySqlMixCms/MySqlMixCmsContextModelSnapshot.cs index a1f05bce6..db11c1d83 100644 --- a/src/platform/mix.database/Migrations/Cms/MySqlMixCms/MySqlMixCmsContextModelSnapshot.cs +++ b/src/platform/mix.database/Migrations/Cms/MySqlMixCms/MySqlMixCmsContextModelSnapshot.cs @@ -42,17 +42,17 @@ protected override void BuildModel(ModelBuilder modelBuilder) MySqlPropertyBuilderExtensions.HasCharSet(b.Property("BaseHref"), "utf8"); - b.Property("BaseRoute") - .HasColumnType("varchar(250)"); - - MySqlPropertyBuilderExtensions.HasCharSet(b.Property("BaseRoute"), "utf8"); - b.Property("CreatedBy") .HasColumnType("varchar(250)"); b.Property("CreatedDateTime") .HasColumnType("datetime"); + b.Property("DeployUrl") + .HasColumnType("varchar(250)"); + + MySqlPropertyBuilderExtensions.HasCharSet(b.Property("DeployUrl"), "utf8"); + b.Property("Description") .HasColumnType("varchar(4000)") .UseCollation("utf8_unicode_ci"); diff --git a/src/platform/mix.database/Migrations/Cms/PostgresqlMixCms/20231016051055_UpdateMixAppBaseHref.Designer.cs b/src/platform/mix.database/Migrations/Cms/PostgresqlMixCms/20231016051055_UpdateMixAppBaseHref.Designer.cs new file mode 100644 index 000000000..b32f47966 --- /dev/null +++ b/src/platform/mix.database/Migrations/Cms/PostgresqlMixCms/20231016051055_UpdateMixAppBaseHref.Designer.cs @@ -0,0 +1,2736 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Mix.Database.Entities.Cms; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Mix.Database.Migrations.PostgresqlMixCms +{ + [DbContext(typeof(PostgresqlMixCmsContext))] + [Migration("20231016051055_UpdateMixAppBaseHref")] + partial class UpdateMixAppBaseHref + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.9") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AppSettings") + .HasColumnType("text") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("BaseApiUrl") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("BaseHref") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("DeployUrl") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Domain") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("text"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixDatabaseName") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("MixDbId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("integer"); + + b.HasKey("Id") + .HasName("PK_MixApplication"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixApplication"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixConfiguration"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixConfiguration"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfigurationContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Category") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("DataType") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DefaultContent") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublic") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixConfigurationId") + .HasColumnType("integer"); + + b.Property("MixCultureId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixConfigurationContent"); + + b.HasIndex("MixConfigurationId"); + + b.HasIndex("MixCultureId"); + + b.ToTable("MixConfigurationContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixContributor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContentType") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("GuidContentId") + .HasColumnType("uuid"); + + b.Property("IntContentId") + .HasColumnType("integer"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsOwner") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id") + .HasName("PK_MixContributor"); + + b.ToTable("MixContributor"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixCulture", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Alias") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(4000)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Lcid") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Specificulture") + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixCulture"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixCulture"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabase", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatePermissions") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletePermissions") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixDatabaseContextId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("ReadPermissions") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SelfManaged") + .HasColumnType("boolean"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("UpdatePermissions") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabase"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixDatabase"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasDefaultValueSql("gen_random_uuid()"); + + b.Property("ChildDatabaseName") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ChildId") + .HasColumnType("integer"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("GuidChildId") + .HasColumnType("uuid"); + + b.Property("GuidParentId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentDatabaseName") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseAssociation"); + + b.ToTable("MixDatabaseAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseColumn", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Configurations") + .HasColumnType("varchar(4000)"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("DataType") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DefaultValue") + .HasColumnType("text") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixDatabaseId") + .HasColumnType("integer"); + + b.Property("MixDatabaseName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("ReferenceId") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseColumn"); + + b.HasIndex("MixDatabaseId"); + + b.ToTable("MixDatabaseColumn"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseContext", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ConnectionString") + .IsRequired() + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("DatabaseProvider") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Schema") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseContext"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixDatabaseContext"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseRelationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChildId") + .HasColumnType("integer"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("DestinateDatabaseName") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("SourceDatabaseName") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseRelationship"); + + b.HasIndex("ChildId"); + + b.HasIndex("ParentId"); + + b.ToTable("MixDatabaseRelationship"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDiscussion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Content") + .IsRequired() + .HasColumnType("text") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ContentType") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("GuidContentId") + .HasColumnType("uuid"); + + b.Property("IntContentId") + .HasColumnType("integer"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id") + .HasName("PK_MixDiscussion"); + + b.ToTable("MixDiscussion"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDomain", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Host") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDomain"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixDomain"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixLanguage"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixLanguage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguageContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Category") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("DataType") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DefaultContent") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublic") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixCultureId") + .HasColumnType("integer"); + + b.Property("MixLanguageId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixLanguageContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixLanguageId"); + + b.ToTable("MixLanguageContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasDefaultValueSql("gen_random_uuid()"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Extension") + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileFolder") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileName") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileProperties") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileSize") + .HasColumnType("bigint"); + + b.Property("FileType") + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Tags") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TargetUrl") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixMedia"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixMedia"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixModule"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixModule"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClassName") + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("text") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Excerpt") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublic") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("LayoutId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("integer"); + + b.Property("MixDatabaseName") + .HasColumnType("text"); + + b.Property("MixDbId") + .HasColumnType("integer"); + + b.Property("MixModuleId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PageSize") + .HasColumnType("integer"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PublishedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("SeoDescription") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoName") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoTitle") + .HasColumnType("text"); + + b.Property("SimpleDataColumns") + .HasColumnType("text"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixModuleContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixModuleId"); + + b.ToTable("MixModuleContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Content") + .HasColumnType("text") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Excerpt") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublic") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("LayoutId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("integer"); + + b.Property("MixModuleContentId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PublishedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("SeoDescription") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoName") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoTitle") + .HasColumnType("text"); + + b.Property("SimpleDataColumns") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Value") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixModuleData"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixModuleContentId"); + + b.ToTable("MixModuleData"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModulePostAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChildId") + .HasColumnType("integer"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixModuleContentId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("text"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("MixModuleContentId"); + + b.ToTable("MixModulePostAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixPostContentId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPage"); + + b.HasIndex("MixPostContentId"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixPage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClassName") + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("text") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Excerpt") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublic") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("LayoutId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("integer"); + + b.Property("MixDatabaseName") + .HasColumnType("text"); + + b.Property("MixDbId") + .HasColumnType("integer"); + + b.Property("MixPageId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PageSize") + .HasColumnType("integer"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PublishedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("SeoDescription") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoName") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoTitle") + .HasColumnType("text"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPageContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixPageId"); + + b.ToTable("MixPageContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageModuleAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChildId") + .HasColumnType("integer"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixPageContentId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("text"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("MixPageContentId"); + + b.ToTable("MixPageModuleAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPagePostAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChildId") + .HasColumnType("integer"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixPageContentId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("text"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("MixPageContentId"); + + b.ToTable("MixPagePostAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("DisplayName") + .HasColumnType("text"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPost"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixPost"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClassName") + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("text") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Excerpt") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("IsPublic") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("LayoutId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("integer"); + + b.Property("MixDatabaseName") + .HasColumnType("text"); + + b.Property("MixDbId") + .HasColumnType("integer"); + + b.Property("MixPostContentId") + .HasColumnType("integer"); + + b.Property("MixPostId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PublishedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("SeoDescription") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoName") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoTitle") + .HasColumnType("text"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPostContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixPostContentId"); + + b.HasIndex("MixPostId"); + + b.ToTable("MixPostContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostPostAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChildId") + .HasColumnType("integer"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("text"); + + b.Property("ParentId") + .HasColumnType("integer"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("MixPostPostAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Content") + .HasColumnType("text") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Extension") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileFolder") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileName") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FolderType") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("MixThemeId") + .HasColumnType("integer"); + + b.Property("MixThemeName") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Scripts") + .IsRequired() + .HasColumnType("text") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Styles") + .IsRequired() + .HasColumnType("text") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixTemplate"); + + b.HasIndex("MixThemeId"); + + b.ToTable("MixViewTemplate"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PrimaryDomain") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixTenant"); + + b.ToTable("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTheme", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AssetFolder") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ImageUrl") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixDatabaseName") + .HasColumnType("text"); + + b.Property("MixDbId") + .HasColumnType("integer"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PreviewUrl") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .HasColumnType("text"); + + b.Property("TemplateFolder") + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixTheme"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixTheme"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixUrlAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Alias") + .HasColumnType("text"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("und-x-icu") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastModified") + .HasColumnType("timestamp with time zone"); + + b.Property("MixTenantId") + .HasColumnType("integer"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("SourceContentGuidId") + .HasColumnType("uuid"); + + b.Property("SourceContentId") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id") + .HasName("PK_MixUrlAlias"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixUrlAlias"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixApplication", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfiguration", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfigurationContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixConfiguration", "MixConfiguration") + .WithMany("MixConfigurationContents") + .HasForeignKey("MixConfigurationId"); + + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixConfiguration"); + + b.Navigation("MixCulture"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixCulture", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabase", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", null) + .WithMany("MixDatabases") + .HasForeignKey("MixTenantId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseColumn", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixDatabase", "MixDatabase") + .WithMany("MixDatabaseColumns") + .HasForeignKey("MixDatabaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixDatabase"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseContext", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseRelationship", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixDatabase", "DestinateDatabase") + .WithMany("DestinateRelationships") + .HasForeignKey("ChildId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixDatabase", "SourceDatabase") + .WithMany("SourceRelationships") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("DestinateDatabase"); + + b.Navigation("SourceDatabase"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDomain", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguage", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguageContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixLanguage", "MixLanguage") + .WithMany("MixLanguageContents") + .HasForeignKey("MixLanguageId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixLanguage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixMedia", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModule", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany("MixModules") + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixModule", "MixModule") + .WithMany("MixModuleContents") + .HasForeignKey("MixModuleId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixModule"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleData", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixModuleContent", "MixModuleContent") + .WithMany() + .HasForeignKey("MixModuleContentId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixModuleContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModulePostAssociation", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixModuleContent", null) + .WithMany("MixPostContents") + .HasForeignKey("MixModuleContentId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPage", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixPostContent", null) + .WithMany("MixPages") + .HasForeignKey("MixPostContentId"); + + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany("MixPages") + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixPage", "MixPage") + .WithMany("MixPageContents") + .HasForeignKey("MixPageId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixPage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageModuleAssociation", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixPageContent", null) + .WithMany("MixModuleContents") + .HasForeignKey("MixPageContentId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPagePostAssociation", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixPageContent", null) + .WithMany("MixPostContents") + .HasForeignKey("MixPageContentId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPost", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany("MixPosts") + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixPostContent", null) + .WithMany("MixPostContents") + .HasForeignKey("MixPostContentId"); + + b.HasOne("Mix.Database.Entities.Cms.MixPost", "MixPost") + .WithMany("MixPostContents") + .HasForeignKey("MixPostId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixPost"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTemplate", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTheme", "MixTheme") + .WithMany("MixViewTemplates") + .HasForeignKey("MixThemeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTheme"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTheme", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixUrlAlias", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfiguration", b => + { + b.Navigation("MixConfigurationContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabase", b => + { + b.Navigation("DestinateRelationships"); + + b.Navigation("MixDatabaseColumns"); + + b.Navigation("SourceRelationships"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguage", b => + { + b.Navigation("MixLanguageContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModule", b => + { + b.Navigation("MixModuleContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleContent", b => + { + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPage", b => + { + b.Navigation("MixPageContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageContent", b => + { + b.Navigation("MixModuleContents"); + + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPost", b => + { + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostContent", b => + { + b.Navigation("MixPages"); + + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTenant", b => + { + b.Navigation("MixDatabases"); + + b.Navigation("MixModules"); + + b.Navigation("MixPages"); + + b.Navigation("MixPosts"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTheme", b => + { + b.Navigation("MixViewTemplates"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/platform/mix.database/Migrations/Cms/PostgresqlMixCms/20231016051055_UpdateMixAppBaseHref.cs b/src/platform/mix.database/Migrations/Cms/PostgresqlMixCms/20231016051055_UpdateMixAppBaseHref.cs new file mode 100644 index 000000000..74d6284f6 --- /dev/null +++ b/src/platform/mix.database/Migrations/Cms/PostgresqlMixCms/20231016051055_UpdateMixAppBaseHref.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Mix.Database.Migrations.PostgresqlMixCms +{ + /// + public partial class UpdateMixAppBaseHref : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "BaseRoute", + table: "MixApplication", + newName: "DeployUrl"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "DeployUrl", + table: "MixApplication", + newName: "BaseRoute"); + } + } +} diff --git a/src/platform/mix.database/Migrations/Cms/PostgresqlMixCms/PostgresqlMixCmsContextModelSnapshot.cs b/src/platform/mix.database/Migrations/Cms/PostgresqlMixCms/PostgresqlMixCmsContextModelSnapshot.cs index d3d767c1e..7cc5855b3 100644 --- a/src/platform/mix.database/Migrations/Cms/PostgresqlMixCms/PostgresqlMixCmsContextModelSnapshot.cs +++ b/src/platform/mix.database/Migrations/Cms/PostgresqlMixCms/PostgresqlMixCmsContextModelSnapshot.cs @@ -42,16 +42,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("varchar(250)") .HasAnnotation("MySql:CharSet", "utf8"); - b.Property("BaseRoute") - .HasColumnType("varchar(250)") - .HasAnnotation("MySql:CharSet", "utf8"); - b.Property("CreatedBy") .HasColumnType("varchar(250)"); b.Property("CreatedDateTime") .HasColumnType("timestamp with time zone"); + b.Property("DeployUrl") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + b.Property("Description") .HasColumnType("varchar(4000)") .UseCollation("und-x-icu") diff --git a/src/platform/mix.database/Migrations/Cms/SqlServerMixCms/20231016051506_UpdateMixAppBaseHref.Designer.cs b/src/platform/mix.database/Migrations/Cms/SqlServerMixCms/20231016051506_UpdateMixAppBaseHref.Designer.cs new file mode 100644 index 000000000..ef85239bf --- /dev/null +++ b/src/platform/mix.database/Migrations/Cms/SqlServerMixCms/20231016051506_UpdateMixAppBaseHref.Designer.cs @@ -0,0 +1,2761 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Mix.Database.Entities.Cms; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Mix.Database.Migrations.SqlServerMixCms +{ + [DbContext(typeof(SqlServerMixCmsContext))] + [Migration("20231016051506_UpdateMixAppBaseHref")] + partial class UpdateMixAppBaseHref + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.9") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AppSettings") + .HasColumnType("ntext") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("BaseApiUrl") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("BaseHref") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DeployUrl") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Domain") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixDatabaseName") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("MixDbId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.HasKey("Id") + .HasName("PK_MixApplication"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixApplication"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixConfiguration"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixConfiguration"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfigurationContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Category") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DataType") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DefaultContent") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixConfigurationId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixConfigurationContent"); + + b.HasIndex("MixConfigurationId"); + + b.HasIndex("MixCultureId"); + + b.ToTable("MixConfigurationContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixContributor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ContentType") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("GuidContentId") + .HasColumnType("uniqueidentifier"); + + b.Property("IntContentId") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsOwner") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id") + .HasName("PK_MixContributor"); + + b.ToTable("MixContributor"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixCulture", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Alias") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("nvarchar(4000)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("Lcid") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Specificulture") + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixCulture"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixCulture"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabase", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatePermissions") + .HasColumnType("nvarchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DeletePermissions") + .HasColumnType("nvarchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixDatabaseContextId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("ReadPermissions") + .HasColumnType("nvarchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SelfManaged") + .HasColumnType("bit"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("UpdatePermissions") + .HasColumnType("nvarchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabase"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixDatabase"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasDefaultValueSql("newid()"); + + b.Property("ChildDatabaseName") + .HasColumnType("nvarchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ChildId") + .HasColumnType("int"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("GuidChildId") + .HasColumnType("uniqueidentifier"); + + b.Property("GuidParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentDatabaseName") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseAssociation"); + + b.ToTable("MixDatabaseAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseColumn", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Configurations") + .HasColumnType("varchar(4000)"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DataType") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DefaultValue") + .HasColumnType("ntext") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixDatabaseId") + .HasColumnType("int"); + + b.Property("MixDatabaseName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("ReferenceId") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseColumn"); + + b.HasIndex("MixDatabaseId"); + + b.ToTable("MixDatabaseColumn"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseContext", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ConnectionString") + .IsRequired() + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DatabaseProvider") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Schema") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseContext"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixDatabaseContext"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseRelationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ChildId") + .HasColumnType("int"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DestinateDatabaseName") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("SourceDatabaseName") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseRelationship"); + + b.HasIndex("ChildId"); + + b.HasIndex("ParentId"); + + b.ToTable("MixDatabaseRelationship"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDiscussion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Content") + .IsRequired() + .HasColumnType("ntext") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ContentType") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("GuidContentId") + .HasColumnType("uniqueidentifier"); + + b.Property("IntContentId") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id") + .HasName("PK_MixDiscussion"); + + b.ToTable("MixDiscussion"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDomain", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Host") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDomain"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixDomain"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixLanguage"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixLanguage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguageContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Category") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DataType") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DefaultContent") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixCultureId") + .HasColumnType("int"); + + b.Property("MixLanguageId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixLanguageContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixLanguageId"); + + b.ToTable("MixLanguageContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier") + .HasDefaultValueSql("newid()"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Extension") + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileFolder") + .HasColumnType("nvarchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileName") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileProperties") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileSize") + .HasColumnType("bigint"); + + b.Property("FileType") + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Source") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Tags") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TargetUrl") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Title") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixMedia"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixMedia"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixModule"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixModule"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClassName") + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("ntext") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Excerpt") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("LayoutId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("int"); + + b.Property("MixDatabaseName") + .HasColumnType("nvarchar(max)"); + + b.Property("MixDbId") + .HasColumnType("int"); + + b.Property("MixModuleId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PageSize") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PublishedDateTime") + .HasColumnType("datetime"); + + b.Property("SeoDescription") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoName") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("SimpleDataColumns") + .HasColumnType("nvarchar(max)"); + + b.Property("Source") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixModuleContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixModuleId"); + + b.ToTable("MixModuleContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Content") + .HasColumnType("ntext") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Excerpt") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("LayoutId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("int"); + + b.Property("MixModuleContentId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PublishedDateTime") + .HasColumnType("datetime"); + + b.Property("SeoDescription") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoName") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("SimpleDataColumns") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Source") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixModuleData"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixModuleContentId"); + + b.ToTable("MixModuleData"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModulePostAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ChildId") + .HasColumnType("int"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("MixModuleContentId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("MixModuleContentId"); + + b.ToTable("MixModulePostAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixPostContentId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPage"); + + b.HasIndex("MixPostContentId"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixPage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClassName") + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("ntext") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Excerpt") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("LayoutId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("int"); + + b.Property("MixDatabaseName") + .HasColumnType("nvarchar(max)"); + + b.Property("MixDbId") + .HasColumnType("int"); + + b.Property("MixPageId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PageSize") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PublishedDateTime") + .HasColumnType("datetime"); + + b.Property("SeoDescription") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoName") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("Source") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPageContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixPageId"); + + b.ToTable("MixPageContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageModuleAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ChildId") + .HasColumnType("int"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("MixPageContentId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("MixPageContentId"); + + b.ToTable("MixPageModuleAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPagePostAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ChildId") + .HasColumnType("int"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("MixPageContentId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("MixPageContentId"); + + b.ToTable("MixPagePostAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPost"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixPost"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ClassName") + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("ntext") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Excerpt") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("LayoutId") + .HasColumnType("int"); + + b.Property("MixCultureId") + .HasColumnType("int"); + + b.Property("MixDatabaseName") + .HasColumnType("nvarchar(max)"); + + b.Property("MixDbId") + .HasColumnType("int"); + + b.Property("MixPostContentId") + .HasColumnType("int"); + + b.Property("MixPostId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("PublishedDateTime") + .HasColumnType("datetime"); + + b.Property("SeoDescription") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoName") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoTitle") + .HasColumnType("nvarchar(max)"); + + b.Property("Source") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPostContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixPostContentId"); + + b.HasIndex("MixPostId"); + + b.ToTable("MixPostContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostPostAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ChildId") + .HasColumnType("int"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime2"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("int"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("MixPostPostAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Content") + .HasColumnType("ntext") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Extension") + .IsRequired() + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileFolder") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileName") + .IsRequired() + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FolderType") + .IsRequired() + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("MixThemeId") + .HasColumnType("int"); + + b.Property("MixThemeName") + .IsRequired() + .HasColumnType("nvarchar(50)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Scripts") + .IsRequired() + .HasColumnType("ntext") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Styles") + .IsRequired() + .HasColumnType("ntext") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixTemplate"); + + b.HasIndex("MixThemeId"); + + b.ToTable("MixViewTemplate"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PrimaryDomain") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixTenant"); + + b.ToTable("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTheme", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AssetFolder") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ImageUrl") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixDatabaseName") + .HasColumnType("nvarchar(max)"); + + b.Property("MixDbId") + .HasColumnType("int"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PreviewUrl") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .HasColumnType("nvarchar(max)"); + + b.Property("TemplateFolder") + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixTheme"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixTheme"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixUrlAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Alias") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("nvarchar(4000)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(250)") + .UseCollation("Vietnamese_CI_AS") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("SourceContentGuidId") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceContentId") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id") + .HasName("PK_MixUrlAlias"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixUrlAlias"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixApplication", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfiguration", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfigurationContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixConfiguration", "MixConfiguration") + .WithMany("MixConfigurationContents") + .HasForeignKey("MixConfigurationId"); + + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixConfiguration"); + + b.Navigation("MixCulture"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixCulture", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabase", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", null) + .WithMany("MixDatabases") + .HasForeignKey("MixTenantId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseColumn", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixDatabase", "MixDatabase") + .WithMany("MixDatabaseColumns") + .HasForeignKey("MixDatabaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixDatabase"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseContext", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseRelationship", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixDatabase", "DestinateDatabase") + .WithMany("DestinateRelationships") + .HasForeignKey("ChildId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixDatabase", "SourceDatabase") + .WithMany("SourceRelationships") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("DestinateDatabase"); + + b.Navigation("SourceDatabase"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDomain", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguage", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguageContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixLanguage", "MixLanguage") + .WithMany("MixLanguageContents") + .HasForeignKey("MixLanguageId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixLanguage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixMedia", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModule", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany("MixModules") + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixModule", "MixModule") + .WithMany("MixModuleContents") + .HasForeignKey("MixModuleId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixModule"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleData", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixModuleContent", "MixModuleContent") + .WithMany() + .HasForeignKey("MixModuleContentId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixModuleContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModulePostAssociation", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixModuleContent", null) + .WithMany("MixPostContents") + .HasForeignKey("MixModuleContentId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPage", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixPostContent", null) + .WithMany("MixPages") + .HasForeignKey("MixPostContentId"); + + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany("MixPages") + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixPage", "MixPage") + .WithMany("MixPageContents") + .HasForeignKey("MixPageId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixPage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageModuleAssociation", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixPageContent", null) + .WithMany("MixModuleContents") + .HasForeignKey("MixPageContentId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPagePostAssociation", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixPageContent", null) + .WithMany("MixPostContents") + .HasForeignKey("MixPageContentId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPost", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany("MixPosts") + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixPostContent", null) + .WithMany("MixPostContents") + .HasForeignKey("MixPostContentId"); + + b.HasOne("Mix.Database.Entities.Cms.MixPost", "MixPost") + .WithMany("MixPostContents") + .HasForeignKey("MixPostId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixPost"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTemplate", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTheme", "MixTheme") + .WithMany("MixViewTemplates") + .HasForeignKey("MixThemeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTheme"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTheme", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixUrlAlias", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfiguration", b => + { + b.Navigation("MixConfigurationContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabase", b => + { + b.Navigation("DestinateRelationships"); + + b.Navigation("MixDatabaseColumns"); + + b.Navigation("SourceRelationships"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguage", b => + { + b.Navigation("MixLanguageContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModule", b => + { + b.Navigation("MixModuleContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleContent", b => + { + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPage", b => + { + b.Navigation("MixPageContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageContent", b => + { + b.Navigation("MixModuleContents"); + + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPost", b => + { + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostContent", b => + { + b.Navigation("MixPages"); + + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTenant", b => + { + b.Navigation("MixDatabases"); + + b.Navigation("MixModules"); + + b.Navigation("MixPages"); + + b.Navigation("MixPosts"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTheme", b => + { + b.Navigation("MixViewTemplates"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/platform/mix.database/Migrations/Cms/SqlServerMixCms/20231016051506_UpdateMixAppBaseHref.cs b/src/platform/mix.database/Migrations/Cms/SqlServerMixCms/20231016051506_UpdateMixAppBaseHref.cs new file mode 100644 index 000000000..5d7c2dd8e --- /dev/null +++ b/src/platform/mix.database/Migrations/Cms/SqlServerMixCms/20231016051506_UpdateMixAppBaseHref.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Mix.Database.Migrations.SqlServerMixCms +{ + /// + public partial class UpdateMixAppBaseHref : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "BaseRoute", + table: "MixApplication", + newName: "DeployUrl"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "DeployUrl", + table: "MixApplication", + newName: "BaseRoute"); + } + } +} diff --git a/src/platform/mix.database/Migrations/Cms/SqlServerMixCms/SqlServerMixCmsContextModelSnapshot.cs b/src/platform/mix.database/Migrations/Cms/SqlServerMixCms/SqlServerMixCmsContextModelSnapshot.cs index 67d1d7d24..577495c49 100644 --- a/src/platform/mix.database/Migrations/Cms/SqlServerMixCms/SqlServerMixCmsContextModelSnapshot.cs +++ b/src/platform/mix.database/Migrations/Cms/SqlServerMixCms/SqlServerMixCmsContextModelSnapshot.cs @@ -44,16 +44,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("varchar(250)") .HasAnnotation("MySql:CharSet", "utf8"); - b.Property("BaseRoute") - .HasColumnType("varchar(250)") - .HasAnnotation("MySql:CharSet", "utf8"); - b.Property("CreatedBy") .HasColumnType("varchar(250)"); b.Property("CreatedDateTime") .HasColumnType("datetime"); + b.Property("DeployUrl") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + b.Property("Description") .HasColumnType("nvarchar(4000)") .UseCollation("Vietnamese_CI_AS") diff --git a/src/platform/mix.database/Migrations/Cms/SqliteMixCms/20231016050432_UpdateMixAppBaseHref.Designer.cs b/src/platform/mix.database/Migrations/Cms/SqliteMixCms/20231016050432_UpdateMixAppBaseHref.Designer.cs new file mode 100644 index 000000000..0db5806bd --- /dev/null +++ b/src/platform/mix.database/Migrations/Cms/SqliteMixCms/20231016050432_UpdateMixAppBaseHref.Designer.cs @@ -0,0 +1,2700 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Mix.Database.Entities.Cms; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Mix.Database.Migrations.Cms.SqliteMixCms +{ + [DbContext(typeof(SqliteMixCmsContext))] + [Migration("20231016050432_UpdateMixAppBaseHref")] + partial class UpdateMixAppBaseHref + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "7.0.9"); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("AppSettings") + .HasColumnType("ntext") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("BaseApiUrl") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("BaseHref") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DeployUrl") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Domain") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("TEXT"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixDatabaseName") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("MixDbId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("INTEGER"); + + b.HasKey("Id") + .HasName("PK_MixApplication"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixApplication"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixConfiguration"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixConfiguration"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfigurationContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Category") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DataType") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DefaultContent") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("IsPublic") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixConfigurationId") + .HasColumnType("INTEGER"); + + b.Property("MixCultureId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixConfigurationContent"); + + b.HasIndex("MixConfigurationId"); + + b.HasIndex("MixCultureId"); + + b.ToTable("MixConfigurationContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixContributor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ContentType") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("GuidContentId") + .HasColumnType("TEXT"); + + b.Property("IntContentId") + .HasColumnType("INTEGER"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("IsOwner") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id") + .HasName("PK_MixContributor"); + + b.ToTable("MixContributor"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixCulture", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Alias") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(4000)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("Lcid") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Specificulture") + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixCulture"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixCulture"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabase", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatePermissions") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DeletePermissions") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixDatabaseContextId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("ReadPermissions") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SelfManaged") + .HasColumnType("INTEGER"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("UpdatePermissions") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabase"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixDatabase"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasDefaultValueSql("(newid())"); + + b.Property("ChildDatabaseName") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ChildId") + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("GuidChildId") + .HasColumnType("TEXT"); + + b.Property("GuidParentId") + .HasColumnType("TEXT"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentDatabaseName") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseAssociation"); + + b.ToTable("MixDatabaseAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseColumn", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Configurations") + .HasColumnType("varchar(4000)"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DataType") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DefaultValue") + .HasColumnType("ntext") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixDatabaseId") + .HasColumnType("INTEGER"); + + b.Property("MixDatabaseName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("ReferenceId") + .HasColumnType("INTEGER"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseColumn"); + + b.HasIndex("MixDatabaseId"); + + b.ToTable("MixDatabaseColumn"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseContext", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ConnectionString") + .IsRequired() + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DatabaseProvider") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Schema") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseContext"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixDatabaseContext"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseRelationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ChildId") + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DestinateDatabaseName") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("SourceDatabaseName") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDatabaseRelationship"); + + b.HasIndex("ChildId"); + + b.HasIndex("ParentId"); + + b.ToTable("MixDatabaseRelationship"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDiscussion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Content") + .IsRequired() + .HasColumnType("ntext") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ContentType") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("GuidContentId") + .HasColumnType("TEXT"); + + b.Property("IntContentId") + .HasColumnType("INTEGER"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id") + .HasName("PK_MixDiscussion"); + + b.ToTable("MixDiscussion"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDomain", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Host") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixDomain"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixDomain"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixLanguage"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixLanguage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguageContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Category") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("DataType") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DefaultContent") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("IsPublic") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixCultureId") + .HasColumnType("INTEGER"); + + b.Property("MixLanguageId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixLanguageContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixLanguageId"); + + b.ToTable("MixLanguageContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT") + .HasDefaultValueSql("(newid())"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Extension") + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileFolder") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileName") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileProperties") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileSize") + .HasColumnType("INTEGER"); + + b.Property("FileType") + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Tags") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TargetUrl") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixMedia"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixMedia"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixModule"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixModule"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClassName") + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("ntext") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Excerpt") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("IsPublic") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("LayoutId") + .HasColumnType("integer"); + + b.Property("MixCultureId") + .HasColumnType("INTEGER"); + + b.Property("MixDatabaseName") + .HasColumnType("TEXT"); + + b.Property("MixDbId") + .HasColumnType("INTEGER"); + + b.Property("MixModuleId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PageSize") + .HasColumnType("INTEGER"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("PublishedDateTime") + .HasColumnType("datetime"); + + b.Property("SeoDescription") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoName") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoTitle") + .HasColumnType("TEXT"); + + b.Property("SimpleDataColumns") + .HasColumnType("TEXT"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixModuleContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixModuleId"); + + b.ToTable("MixModuleContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Content") + .HasColumnType("ntext") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Excerpt") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("IsPublic") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("LayoutId") + .HasColumnType("integer"); + + b.Property("MixCultureId") + .HasColumnType("INTEGER"); + + b.Property("MixModuleContentId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("PublishedDateTime") + .HasColumnType("datetime"); + + b.Property("SeoDescription") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoName") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoTitle") + .HasColumnType("TEXT"); + + b.Property("SimpleDataColumns") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Value") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixModuleData"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixModuleContentId"); + + b.ToTable("MixModuleData"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModulePostAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChildId") + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedDateTime") + .HasColumnType("TEXT"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("TEXT"); + + b.Property("MixModuleContentId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("TEXT"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("INTEGER"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("MixModuleContentId"); + + b.ToTable("MixModulePostAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixPostContentId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPage"); + + b.HasIndex("MixPostContentId"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixPage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClassName") + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("ntext") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Excerpt") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("IsPublic") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("LayoutId") + .HasColumnType("integer"); + + b.Property("MixCultureId") + .HasColumnType("INTEGER"); + + b.Property("MixDatabaseName") + .HasColumnType("TEXT"); + + b.Property("MixDbId") + .HasColumnType("INTEGER"); + + b.Property("MixPageId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PageSize") + .HasColumnType("INTEGER"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("PublishedDateTime") + .HasColumnType("datetime"); + + b.Property("SeoDescription") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoName") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoTitle") + .HasColumnType("TEXT"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPageContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixPageId"); + + b.ToTable("MixPageContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageModuleAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChildId") + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedDateTime") + .HasColumnType("TEXT"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("TEXT"); + + b.Property("MixPageContentId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("TEXT"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("INTEGER"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("MixPageContentId"); + + b.ToTable("MixPageModuleAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPagePostAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChildId") + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedDateTime") + .HasColumnType("TEXT"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("TEXT"); + + b.Property("MixPageContentId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("TEXT"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("INTEGER"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("MixPageContentId"); + + b.ToTable("MixPagePostAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("DisplayName") + .HasColumnType("TEXT"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPost"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixPost"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClassName") + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Content") + .HasColumnType("ntext") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Excerpt") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Icon") + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Image") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("IsPublic") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("LayoutId") + .HasColumnType("integer"); + + b.Property("MixCultureId") + .HasColumnType("INTEGER"); + + b.Property("MixDatabaseName") + .HasColumnType("TEXT"); + + b.Property("MixDbId") + .HasColumnType("INTEGER"); + + b.Property("MixPostContentId") + .HasColumnType("INTEGER"); + + b.Property("MixPostId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("PublishedDateTime") + .HasColumnType("datetime"); + + b.Property("SeoDescription") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoKeywords") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoName") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SeoTitle") + .HasColumnType("TEXT"); + + b.Property("Source") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Specificulture") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("TemplateId") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixPostContent"); + + b.HasIndex("MixCultureId"); + + b.HasIndex("MixPostContentId"); + + b.HasIndex("MixPostId"); + + b.ToTable("MixPostContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostPostAssociation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("ChildId") + .HasColumnType("INTEGER"); + + b.Property("CreatedBy") + .HasColumnType("TEXT"); + + b.Property("CreatedDateTime") + .HasColumnType("TEXT"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("TEXT"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("TEXT"); + + b.Property("ParentId") + .HasColumnType("INTEGER"); + + b.Property("Priority") + .HasColumnType("INTEGER"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("MixPostPostAssociation"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Content") + .HasColumnType("ntext") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Extension") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileFolder") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FileName") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("FolderType") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("MixThemeId") + .HasColumnType("INTEGER"); + + b.Property("MixThemeName") + .IsRequired() + .HasColumnType("varchar(50)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Scripts") + .IsRequired() + .HasColumnType("ntext") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Styles") + .IsRequired() + .HasColumnType("ntext") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixTemplate"); + + b.HasIndex("MixThemeId"); + + b.ToTable("MixViewTemplate"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PrimaryDomain") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixTenant"); + + b.ToTable("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTheme", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("AssetFolder") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("ImageUrl") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixDatabaseName") + .HasColumnType("TEXT"); + + b.Property("MixDbId") + .HasColumnType("INTEGER"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("PreviewUrl") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("SystemName") + .HasColumnType("TEXT"); + + b.Property("TemplateFolder") + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.HasKey("Id") + .HasName("PK_MixTheme"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixTheme"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixUrlAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("Alias") + .HasColumnType("TEXT"); + + b.Property("CreatedBy") + .HasColumnType("varchar(250)"); + + b.Property("CreatedDateTime") + .HasColumnType("datetime"); + + b.Property("Description") + .HasColumnType("varchar(4000)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("varchar(250)") + .UseCollation("NOCASE") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("IsDeleted") + .HasColumnType("INTEGER"); + + b.Property("LastModified") + .HasColumnType("datetime"); + + b.Property("MixTenantId") + .HasColumnType("INTEGER"); + + b.Property("ModifiedBy") + .HasColumnType("varchar(250)"); + + b.Property("Priority") + .HasColumnType("integer"); + + b.Property("SourceContentGuidId") + .HasColumnType("TEXT"); + + b.Property("SourceContentId") + .HasColumnType("INTEGER"); + + b.Property("Status") + .IsRequired() + .HasColumnType("varchar(50)") + .HasAnnotation("MySql:CharSet", "utf8"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.HasKey("Id") + .HasName("PK_MixUrlAlias"); + + b.HasIndex("MixTenantId"); + + b.ToTable("MixUrlAlias"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixApplication", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfiguration", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfigurationContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixConfiguration", "MixConfiguration") + .WithMany("MixConfigurationContents") + .HasForeignKey("MixConfigurationId"); + + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixConfiguration"); + + b.Navigation("MixCulture"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixCulture", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabase", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", null) + .WithMany("MixDatabases") + .HasForeignKey("MixTenantId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseColumn", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixDatabase", "MixDatabase") + .WithMany("MixDatabaseColumns") + .HasForeignKey("MixDatabaseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixDatabase"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseContext", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabaseRelationship", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixDatabase", "DestinateDatabase") + .WithMany("DestinateRelationships") + .HasForeignKey("ChildId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixDatabase", "SourceDatabase") + .WithMany("SourceRelationships") + .HasForeignKey("ParentId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("DestinateDatabase"); + + b.Navigation("SourceDatabase"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDomain", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguage", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguageContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixLanguage", "MixLanguage") + .WithMany("MixLanguageContents") + .HasForeignKey("MixLanguageId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixLanguage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixMedia", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModule", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany("MixModules") + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixModule", "MixModule") + .WithMany("MixModuleContents") + .HasForeignKey("MixModuleId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixModule"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleData", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixModuleContent", "MixModuleContent") + .WithMany() + .HasForeignKey("MixModuleContentId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixModuleContent"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModulePostAssociation", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixModuleContent", null) + .WithMany("MixPostContents") + .HasForeignKey("MixModuleContentId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPage", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixPostContent", null) + .WithMany("MixPages") + .HasForeignKey("MixPostContentId"); + + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany("MixPages") + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixPage", "MixPage") + .WithMany("MixPageContents") + .HasForeignKey("MixPageId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixPage"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageModuleAssociation", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixPageContent", null) + .WithMany("MixModuleContents") + .HasForeignKey("MixPageContentId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPagePostAssociation", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixPageContent", null) + .WithMany("MixPostContents") + .HasForeignKey("MixPageContentId"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPost", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany("MixPosts") + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostContent", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixCulture", "MixCulture") + .WithMany() + .HasForeignKey("MixCultureId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mix.Database.Entities.Cms.MixPostContent", null) + .WithMany("MixPostContents") + .HasForeignKey("MixPostContentId"); + + b.HasOne("Mix.Database.Entities.Cms.MixPost", "MixPost") + .WithMany("MixPostContents") + .HasForeignKey("MixPostId"); + + b.Navigation("MixCulture"); + + b.Navigation("MixPost"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTemplate", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTheme", "MixTheme") + .WithMany("MixViewTemplates") + .HasForeignKey("MixThemeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTheme"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTheme", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixUrlAlias", b => + { + b.HasOne("Mix.Database.Entities.Cms.MixTenant", "MixTenant") + .WithMany() + .HasForeignKey("MixTenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MixTenant"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixConfiguration", b => + { + b.Navigation("MixConfigurationContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixDatabase", b => + { + b.Navigation("DestinateRelationships"); + + b.Navigation("MixDatabaseColumns"); + + b.Navigation("SourceRelationships"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixLanguage", b => + { + b.Navigation("MixLanguageContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModule", b => + { + b.Navigation("MixModuleContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixModuleContent", b => + { + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPage", b => + { + b.Navigation("MixPageContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPageContent", b => + { + b.Navigation("MixModuleContents"); + + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPost", b => + { + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixPostContent", b => + { + b.Navigation("MixPages"); + + b.Navigation("MixPostContents"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTenant", b => + { + b.Navigation("MixDatabases"); + + b.Navigation("MixModules"); + + b.Navigation("MixPages"); + + b.Navigation("MixPosts"); + }); + + modelBuilder.Entity("Mix.Database.Entities.Cms.MixTheme", b => + { + b.Navigation("MixViewTemplates"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/platform/mix.database/Migrations/Cms/SqliteMixCms/20231016050432_UpdateMixAppBaseHref.cs b/src/platform/mix.database/Migrations/Cms/SqliteMixCms/20231016050432_UpdateMixAppBaseHref.cs new file mode 100644 index 000000000..bb7cfa9b6 --- /dev/null +++ b/src/platform/mix.database/Migrations/Cms/SqliteMixCms/20231016050432_UpdateMixAppBaseHref.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Mix.Database.Migrations.Cms.SqliteMixCms +{ + /// + public partial class UpdateMixAppBaseHref : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "BaseRoute", + table: "MixApplication", + newName: "DeployUrl"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "DeployUrl", + table: "MixApplication", + newName: "BaseRoute"); + } + } +} diff --git a/src/platform/mix.database/Migrations/Cms/SqliteMixCms/SqliteMixCmsContextModelSnapshot.cs b/src/platform/mix.database/Migrations/Cms/SqliteMixCms/SqliteMixCmsContextModelSnapshot.cs index ddb034047..b83a65f04 100644 --- a/src/platform/mix.database/Migrations/Cms/SqliteMixCms/SqliteMixCmsContextModelSnapshot.cs +++ b/src/platform/mix.database/Migrations/Cms/SqliteMixCms/SqliteMixCmsContextModelSnapshot.cs @@ -37,16 +37,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("varchar(250)") .HasAnnotation("MySql:CharSet", "utf8"); - b.Property("BaseRoute") - .HasColumnType("varchar(250)") - .HasAnnotation("MySql:CharSet", "utf8"); - b.Property("CreatedBy") .HasColumnType("varchar(250)"); b.Property("CreatedDateTime") .HasColumnType("datetime"); + b.Property("DeployUrl") + .HasColumnType("varchar(250)") + .HasAnnotation("MySql:CharSet", "utf8"); + b.Property("Description") .HasColumnType("varchar(4000)") .UseCollation("NOCASE")