Skip to content

Commit

Permalink
update p4p
Browse files Browse the repository at this point in the history
  • Loading branch information
eric4ps committed Jul 15, 2024
1 parent ff39371 commit c048bd7
Show file tree
Hide file tree
Showing 70 changed files with 2,002 additions and 550 deletions.
4 changes: 1 addition & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ var pump = require("pump");

var minify = composer(uglifyjs, console);
var dest = "."; //For publish folder use "./bin/Release/PublishOutput/";
//C:\\Git\\GitHub\\Queen-Beauty\\QueenBeauty\\

var paths = {
//webroot: "./dist/Mix.Cms.Web/wwwroot/", // Use for current repo dist
webroot: "../mix.core/src/applications/Mixcore/wwwroot/mix-app/", // Use for mix.core repo
webroot: "../p4ps-portal/src/applications/p4ps/wwwroot/mix-app/", // Use for mix.core repo
webapp: "./src/app/", //app
libs: "./src/lib/",
nodeModules: "./node_modules/",
Expand Down
2 changes: 1 addition & 1 deletion src/app/app-portal/components/filter-list/filter-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
ng-change="$ctrl.apply(0)"
>
<option
ng-repeat="item in $ctrl.arrOrderby track by $index"
ng-repeat="item in $ctrl.arrOrderBy track by $index"
value="{{item}}"
>
{{item}}
Expand Down
8 changes: 4 additions & 4 deletions src/app/app-portal/components/filter-list/filter-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
};
ctrl.searchMethods = ["Equal", "Like"];
ctrl.init = async function () {
if (!ctrl.arrOrderby) {
ctrl.arrOrderby = [
if (!ctrl.arrOrderBy) {
ctrl.arrOrderBy = [
"Title",
"Priority",
"CreatedDateTime",
"LastModified",
"Status",
];
}
ctrl.request.orderBy = ctrl.request.orderBy || ctrl.arrOrderby[0];
ctrl.request.orderBy = ctrl.request.orderBy || ctrl.arrOrderBy[0];
ctrl.directions = ["Asc", "Desc"];
ctrl.pageSizes = [5, 10, 15, 20];
ctrl.statuses = $rootScope.globalSettings.statuses;
Expand Down Expand Up @@ -64,7 +64,7 @@
bindings: {
request: "=",
key: "=?",
arrOrderby: "=?",
arrOrderBy: "=?",
createUrl: "=",
createText: "=",
callback: "&",
Expand Down
8 changes: 4 additions & 4 deletions src/app/app-portal/components/header-nav/headerNav.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ <h1 class="d-flex align-items-center fs-4 text-white mb-0">
width: 120px;
height: 30px;
background-color: hsla(
var(--primary-color-hue, 211),
var(--primary-color-hue, 235),
var(--primary-color-saturation, 100%),
var(--primary-color-brightness, 50%),
1
);
-webkit-mask: url(../mix-app/assets/mixcore-logo-red-2.svg)
-webkit-mask: url(https://p4ps-portal.vercel.app/assets/images/mixcore-logo.svg)
no-repeat 50% 50%;
mask: url(https://p4ps-portal.vercel.app/assets/images/mixcore-logo.svg)
no-repeat 50% 50%;
mask: url(../mix-app/assets/mixcore-logo-red-2.svg) no-repeat 50%
50%;
"
></div>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ app.controller("HighFrequencyMessagesController", [
msg.style = $scope.getMessageType(msg.type);
$scope.messages.push(msg);
if (
!msg.from ||
msg.from ||
msg.from.connectionId != $scope.hubRequest.from.connectionId
) {
$scope.newMsgCount += 1;
Expand Down
6 changes: 3 additions & 3 deletions src/app/app-portal/components/hub-messages/hub-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ app.controller("HubMessagesController", [
"$rootScope",
"AuthService",
function ($scope, $rootScope, authService) {
BaseHub.call(this, $scope);

var endpoints = JSON.parse(localStorage.getItem("ls.endpoints") || "{}");
BaseHub.call(this, $scope, endpoints.Messenger);
authService.fillAuthData();
$scope.newMsgCount = 0;
$scope.messages = [];
Expand Down Expand Up @@ -76,7 +76,7 @@ app.controller("HubMessagesController", [
}
$scope.messages.push(msg);
if (
!msg.from ||
msg.from ||
msg.from.connectionId != $scope.hubRequest.from.connectionId
) {
$scope.newMsgCount += 1;
Expand Down
26 changes: 22 additions & 4 deletions src/app/app-portal/components/list-mix-column/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ modules.component("listMixColumn", {
columns: "=",
relationships: "=",
removeAttributes: "=",
namingConvention: "=?",
},
controller: [
"$rootScope",
Expand All @@ -28,7 +29,7 @@ modules.component("listMixColumn", {
var ctrl = this;
ctrl.request = angular.copy(ngAppSettings.request);
ctrl.selectedCol = null;
ctrl.relationshipTypes = ["OneToMany"];
ctrl.relationshipTypes = ["OneToMany", "ManyToMany"];
ctrl.defaultRelationship = {
parentId: null,
type: "OneToMany",
Expand Down Expand Up @@ -57,6 +58,9 @@ modules.component("listMixColumn", {
ctrl.columns.push(t);
}
};
ctrl.showModal = (id) => {
$(`#advance-${id}`).modal("toggle");
};
ctrl.selectReferenceDb = function (relationship) {
relationship.childId = relationship.database.id;
relationship.destinateDatabaseName = relationship.database.systemName;
Expand All @@ -68,6 +72,20 @@ modules.component("listMixColumn", {
ctrl.relationships.push(t);
}
};
ctrl.alterColumn = async function (col) {
if (confirm("Alter this column ?")) {
if (col) {
col.isDrop = true;
$rootScope.isBusy = true;
var result = await service.alterColumn(col);
if (result.success) {
$rootScope.showMessage("success", "success");
}
$rootScope.isBusy = false;
$scope.$apply();
}
}
};
ctrl.removeAttribute = async function (attr, index) {
if (confirm("Remove this column ?")) {
if (attr.id) {
Expand Down Expand Up @@ -168,9 +186,9 @@ modules.component("listMixColumn", {
if (isForce || !col.systemName) {
col.systemName = $rootScope.generateKeyword(
col.displayName,
"_",
true,
true
ctrl.namingConvention == "TitleCase" ? "" : "_",
ctrl.namingConvention == "TitleCase",
false
);
}
};
Expand Down
10 changes: 9 additions & 1 deletion src/app/app-portal/components/list-mix-column/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,19 @@ <h6 class="m-0">
<span ng-if="col.showAdvanced" class="mi mi-ChevronDownSmall"></span>
</a> -->
<a
ng-if="col.id"
ng-click="$ctrl.alterColumn(col)"
class="btn-link"
target="_blank"
>
<span class="fas fa-save"></span>
</a>
<button
type="button"
class="btn btn-primary"
data-bs-toggle="modal"
data-bs-target="#advance-{{$index}}"
ng-click="$ctrl.showModal($index)"
>
<svg
class="svg-inline--fa fa-tools fa-w-16"
Expand Down
3 changes: 2 additions & 1 deletion src/app/app-portal/components/log-stream/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ app.controller("LogStreamController", [
"$rootScope",
"AuthService",
function ($scope, $rootScope, authService) {
BaseHub.call(this, $scope);
var endpoints = JSON.parse(localStorage.getItem("ls.endpoints") || "{}");
BaseHub.call(this, $scope, endpoints.Messenger);

authService.fillAuthData();
$scope.keyword = "";
Expand Down
1 change: 0 additions & 1 deletion src/app/app-portal/components/media-file-upload/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function () {
debugger;
if (ctrl.fileModel) {
ctrl.fileModel.filename = file.name.substring(
0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ modules.component("mixDatabaseColumn", {
};

ctrl.generateName = function (col) {
col.systemName = $rootScope.generateKeyword(col.displayName, "_");
col.systemName = $rootScope.generateKeyword(col.displayName, "_", true);
};
ctrl.showReferences = function (col) {
ctrl.colRef = col;
Expand Down
49 changes: 49 additions & 0 deletions src/app/app-portal/components/mix-database-data-filter/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,55 @@
ctrl.navs = [];
ctrl.data = { items: [] };
ctrl.goToPath = $rootScope.goToPath;
ctrl.fieldNames = {
id: ctrl.database.namingConvention == "TitleCase" ? "Id" : "id",
parentId:
ctrl.database.namingConvention == "TitleCase"
? "ParentId"
: "parent_id",
parentDatabaseName:
ctrl.database.namingConvention == "TitleCase"
? "ParentDatabaseName"
: "parent_database_name",
childId:
ctrl.database.namingConvention == "TitleCase"
? "ChildId"
: "child_id",
childDatabaseName:
ctrl.database.namingConvention == "TitleCase"
? "ChildDatabaseName"
: "child_database_name",
createdDateTime:
ctrl.database.namingConvention == "TitleCase"
? "CreatedDateTime"
: "created_date_time",
lastModified:
ctrl.database.namingConvention == "TitleCase"
? "LastModified"
: "last_modified",
tenantId:
ctrl.database.namingConvention == "TitleCase"
? "MixTenantId"
: "mix_tenant_id",
createdBy:
ctrl.database.namingConvention == "TitleCase"
? "CreatedBy"
: "created_by",
modifiedBy:
ctrl.database.namingConvention == "TitleCase"
? "ModifiedBy"
: "modified_by",
priority:
ctrl.database.namingConvention == "TitleCase"
? "Priority"
: "priority",
status:
ctrl.database.namingConvention == "TitleCase" ? "Status" : "status",
isDeleted:
ctrl.database.namingConvention == "TitleCase"
? "IsDeleted"
: "is_deleted",
};
ctrl.$onInit = function () {
if (ctrl.initData) {
ctrl.data = ctrl.initData;
Expand Down
82 changes: 71 additions & 11 deletions src/app/app-portal/components/mix-database-data-values/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ modules.component("mixDatabaseDataValues", {
mixDatabaseName: "=?",
mixDatabaseTitle: "=?",
mixDatabaseId: "=?",
relationship: "=?",
parentName: "=?",
parentId: "=?",
guidParentId: "=?",
Expand All @@ -17,7 +18,6 @@ modules.component("mixDatabaseDataValues", {
compareType: "=?",
selectedList: "=?",
selectSingle: "=?",
database: "=?",
onFilterList: "&?",
onApplyList: "&?",
onSendMail: "&?",
Expand Down Expand Up @@ -50,12 +50,10 @@ modules.component("mixDatabaseDataValues", {
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",
Expand All @@ -68,22 +66,84 @@ modules.component("mixDatabaseDataValues", {
);
if (getDatabase.success) {
ctrl.database = getDatabase.data;
$scope.$apply();
}
}

ctrl.fieldNames = {
id: ctrl.database.namingConvention == "TitleCase" ? "Id" : "id",
parentId:
ctrl.database.namingConvention == "TitleCase"
? "ParentId"
: "parent_id",
parentDatabaseName:
ctrl.database.namingConvention == "TitleCase"
? "ParentDatabaseName"
: "parent_database_name",
childId:
ctrl.database.namingConvention == "TitleCase"
? "ChildId"
: "child_id",
childDatabaseName:
ctrl.database.namingConvention == "TitleCase"
? "ChildDatabaseName"
: "child_database_name",
createdDateTime:
ctrl.database.namingConvention == "TitleCase"
? "CreatedDateTime"
: "created_date_time",
lastModified:
ctrl.database.namingConvention == "TitleCase"
? "LastModified"
: "last_modified",
tenantId:
ctrl.database.namingConvention == "TitleCase"
? "MixTenantId"
: "mix_tenant_id",
createdBy:
ctrl.database.namingConvention == "TitleCase"
? "CreatedBy"
: "created_by",
modifiedBy:
ctrl.database.namingConvention == "TitleCase"
? "ModifiedBy"
: "modified_by",
priority:
ctrl.database.namingConvention == "TitleCase"
? "Priority"
: "priority",
status:
ctrl.database.namingConvention == "TitleCase" ? "Status" : "status",
isDeleted:
ctrl.database.namingConvention == "TitleCase"
? "IsDeleted"
: "is_deleted",
};
ctrl.request.name = ctrl.mixDatabaseName;
ctrl.request.sortBy = ctrl.fieldNames.createdDateTime;
ctrl.request.parentName = ctrl.parentName;
ctrl.request.parentId = ctrl.parentId;
ctrl.request.relationship = ctrl.relationship;
ctrl.request.guidParentId = ctrl.guidParentId;
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();
}&dataContentId=default&relationship=${
ctrl.relationship || ""
}&parentId=${ctrl.parentId || ctrl.guidParentId || ""}&parentName=${
ctrl.parentName || ""
}`;
};
ctrl.loadData = async function () {
ctrl.toCamelCase = (txt) => {
return txt.charAt(0).toLowerCase() + txt.substr(1);
};
ctrl.loadData = async function (pageIndex) {
if (pageIndex !== undefined) {
ctrl.request.pageIndex = pageIndex;
}
dataService.initDbName(ctrl.mixDatabaseName);
ctrl.request.queries = [];
if (ctrl.queries) {
Expand Down
Loading

0 comments on commit c048bd7

Please sign in to comment.