Skip to content

Commit

Permalink
Before merge
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafabarmshory committed Mar 1, 2021
1 parent af4098f commit d341d29
Show file tree
Hide file tree
Showing 27 changed files with 953 additions and 774 deletions.
13 changes: 13 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
"@babel/preset-env"
],
"plugins": [
[
"angularjs-annotate",
{
"explicitOnly" : false
}
]
]
}
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@
"url": "https://github.com/viraweb123/vw-dashboard/issues"
},
"scripts": {
"build": "webpack --mode production --bail --progress --profile",
"build": "webpack --config webpack.prod.js",
"serve": "webpack serve --history-api-fallback --inline --progress --config webpack.dev.js",
"test": "karma start",
"test-watch": "karma start --auto-watch --no-single-run",
"serve": "webpack serve --mode development --history-api-fallback --inline --progress"
"test-watch": "karma start --auto-watch --no-single-run"
},
"devDependencies": {
"@babel/core": "^7.13",
"@babel/preset-env": "^7.13",
"@babel/plugin-transform-modules-commonjs": "^7.13",
"@babel/core": "7.2.0",
"@babel/preset-env": "7.2.0",
"@babel/plugin-transform-modules-commonjs": "7.2.0",
"babel-plugin-angularjs-annotate": "^0.10",

"autoprefixer": "^10.2.4",
"postcss": "^8.2.6",
"postcss-preset-env": "^6.7",

"webpack": "^5.24.1",
"webpack-cli": "^4.5.0",
Expand All @@ -35,7 +37,6 @@
"html-loader": "^2.1",
"file-loader": "^6.2",

"babel-plugin-angularjs-annotate": "^0.10",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^7.0.0",
"html-webpack-plugin": "^5.2.0",
Expand Down
8 changes: 8 additions & 0 deletions spa.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "vw-dashboard",
"version": "7.0.0",
"title": "ViraWeb Dashboard",
"description": "Modern webpage editor",
"homepage": "https://viraweb123.ir",
"license": "MIT"
}
1 change: 0 additions & 1 deletion src/app-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export default function(
$mbTranslateSanitizationProvider, $mbTranslateProvider,
$mbStorageProvider, $locationProvider) {


//
// $mbAction: manages all actions
//
Expand Down
2 changes: 1 addition & 1 deletion src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<meta name="robots" content="noindex, nofollow">

<!-- injector:base-tag -->
<base href="/" >
<!--<base href="/" >-->
<!-- endinjector -->

</head>
Expand Down
50 changes: 0 additions & 50 deletions src/modules/spa/index.js

This file was deleted.

5 changes: 5 additions & 0 deletions src/modules/tenant/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default {
TENANT_TENANTS_RT: '/tenant/tenants',
// AMD_CMS_METADATA_RT: '/cms/metadata',
// AMD_CMS_TERMTAXONOMIES_RT: '/cms/term-taxonomies',
TENANT_SPAS_RT: '/tenant/spas',


//------------------------------------------------------------
Expand All @@ -14,6 +15,7 @@ export default {
// AMD_CMS_METADATA_SP: '/cms/metadata',
// AMD_CMS_TERMTAXONOMIES_SP: '/cms/term-taxonomies',
// AMD_CMS_TERMS_SP: '/cms/terms',
TENANT_SPAS_SP: '/tenant/spas',


//------------------------------------------------------------
Expand All @@ -23,6 +25,9 @@ export default {
// AMD_CMS_VIEW_CONTENTS_PATH: '/cms/contents',
// AMD_CMS_VIEW_TERMS_PATH: '/cms/terms',
// AMD_CMS_VIEW_TERM_TAXONOMIES_PATH: '/cms/term-taxonomies',
TENANT_SPAS_VIEW: '/tenant/spas',
TENANT_SPAS_UPLOAD_VIEW: '/tenant/spas-upload',
TENANT_REPOSITORYSPAS_VIEW: '/tentan/repository-spas',


//------------------------------------------------------------
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<md-content
mb-preloading="ctrl.working"
layout="column"
layout-padding
flex>
layout="column">
<mb-titled-block
layout="column">
<div layout="row" layout-padding>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
mblowfish.addEditor('/spas/:spaId', {
templateUrl: 'scripts/module-spa/editors/spa.html',

import templateUrl from './spa.html';

export default {
templateUrl: templateUrl,
controllerAs: 'ctrl',
controller: function($scope, $tenant, $state, $controller, $editor) {
'ngInject';

// Extends with ItemsController
angular.extend(this, $controller('SeenAbstractItemEditorCtrl', {
angular.extend(this, $controller('MbSeenAbstractItemEditorCtrl', {
$scope: $scope,
$editor: $editor
}));
Expand Down Expand Up @@ -34,4 +36,4 @@ mblowfish.addEditor('/spas/:spaId', {

this.reload();
},
});
}
5 changes: 5 additions & 0 deletions src/modules/tenant/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ import invoiceEditor from './editors/invoice';
import reciptEditor from './editors/receipt';
import tenantEditor from './editors/tenant';
import ticketEditor from './editors/ticket';
import spaEditor from './editors/spa';
// >> filters
// >> services
import mbTenantService from './services/mbTenant';
// >> views
import invoiceView from './views/invoices';
import tenatnsView from './views/tenants';
import spasView from './views/spas';


import Constants from './Constants';
Expand All @@ -56,13 +58,16 @@ mblowfish
.editor('/receipts/:id', reciptEditor)
.editor('/tenant/tenants/:tenantId', tenantEditor)
.editor('/tenant/tickets/:ticketId', ticketEditor)
.addEditor('/spas/:spaId', spaEditor)

// >> filters
// >> services
.provider('$mbTenant', mbTenantService)

// >> views
.view('/tenant/invoices', invoiceView)
.view(TENANT_TENANTS_VIEW_PATH, tenatnsView)
.view(TENANT_SPAS_VIEW, spasView)

/**
Integerate wtih
Expand Down
172 changes: 85 additions & 87 deletions src/modules/tenant/services/mbTenant.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,94 +7,92 @@ export default function() {
//---------------------------------------
var provider;
var service;
// var rootScope;


// //---------------------------------------
// // variables
// //---------------------------------------
// // var TENANT_GRAPHQL = '{id,title,description,' +
// // 'account' + USER_DETAIL_GRAPHQL +
// // 'configurations{key,value}' +
// // 'settings{key,value}' +
// // '}';
//
//
// //---------------------------------------
// // functions
// //---------------------------------------
// /*
// * Stores app configuration on the back end
// */
// function storeApplicationConfig() {
// if (!$rootScope.__account.permissions.tenant_owner) {
// return;
// }
// if (appConfigurationContent) { // content loaded
// return appConfigurationContent.uploadValue($rootScope.__app.configs);
// }
// // create content
// promise = $cms.putContent({
// name: $rootScope.__app.configs_key,
// mimetype: APP_CNF_MIMETYPE
// })
// .then(function(content) {
// appConfigurationContent = content;
// return appConfigurationContent.uploadValue($rootScope.__app.configs);
// });
// };
//
// /*
// * Check a module to see if it is enable or not
// */
// // TODO: Masood, 2019: Improve the function to check based on tenant setting
// function isEnable(moduleName) {
// return $rootScope.__tenant.domains[moduleName];
// }
//
//
// function parsTenantConfiguration(configs) {
// $rootScope.__tenant.configs = keyValueToMap(configs);
// var $event = {
// src: this,
// type: 'update',
// value: $rootScope.__tenant.configs
// };
// $dispatcher.dispatch('/tenant/configs', $event);
//
// // load domains
// var domains = {};
// var regex = new RegExp('^module\.(.*)\.enable$', 'i');
// for (var i = 0; i < configs.length; i++) {
// var config = configs[i];
// var match = regex.exec(config.key);
// if (match) {
// var key = match[1].toLowerCase();
// domains[key] = parseBooleanValue(config.value);
// }
// }
// $rootScope.__tenant.domains = domains;
// // Flux: fire account change
// var $event = {
// src: this,
// type: 'update',
// value: $rootScope.__tenant.domains
// };
// $dispatcher.dispatch('/tenant/domains', $event);
// }
//
// function parsTenantSettings(settings) {
// $rootScope.__tenant.settings = keyValueToMap(settings);
// $rootScope.__app.options = $rootScope.__tenant.settings;
//
// // Flux: fire setting change
// var $event = {
// src: this,
// type: 'update',
// value: $rootScope.__account
// };
// $dispatcher.dispatch('/tenant/settings', $event);
// }
// //---------------------------------------
// // variables
// //---------------------------------------
// // var TENANT_GRAPHQL = '{id,title,description,' +
// // 'account' + USER_DETAIL_GRAPHQL +
// // 'configurations{key,value}' +
// // 'settings{key,value}' +
// // '}';
//
//
// //---------------------------------------
// // functions
// //---------------------------------------
// /*
// * Stores app configuration on the back end
// */
// function storeApplicationConfig() {
// if (!$rootScope.__account.permissions.tenant_owner) {
// return;
// }
// if (appConfigurationContent) { // content loaded
// return appConfigurationContent.uploadValue($rootScope.__app.configs);
// }
// // create content
// promise = $cms.putContent({
// name: $rootScope.__app.configs_key,
// mimetype: APP_CNF_MIMETYPE
// })
// .then(function(content) {
// appConfigurationContent = content;
// return appConfigurationContent.uploadValue($rootScope.__app.configs);
// });
// };
//
// /*
// * Check a module to see if it is enable or not
// */
// // TODO: Masood, 2019: Improve the function to check based on tenant setting
// function isEnable(moduleName) {
// return $rootScope.__tenant.domains[moduleName];
// }
//
//
// function parsTenantConfiguration(configs) {
// $rootScope.__tenant.configs = keyValueToMap(configs);
// var $event = {
// src: this,
// type: 'update',
// value: $rootScope.__tenant.configs
// };
// $dispatcher.dispatch('/tenant/configs', $event);
//
// // load domains
// var domains = {};
// var regex = new RegExp('^module\.(.*)\.enable$', 'i');
// for (var i = 0; i < configs.length; i++) {
// var config = configs[i];
// var match = regex.exec(config.key);
// if (match) {
// var key = match[1].toLowerCase();
// domains[key] = parseBooleanValue(config.value);
// }
// }
// $rootScope.__tenant.domains = domains;
// // Flux: fire account change
// var $event = {
// src: this,
// type: 'update',
// value: $rootScope.__tenant.domains
// };
// $dispatcher.dispatch('/tenant/domains', $event);
// }
//
// function parsTenantSettings(settings) {
// $rootScope.__tenant.settings = keyValueToMap(settings);
// $rootScope.__app.options = $rootScope.__tenant.settings;
//
// // Flux: fire setting change
// var $event = {
// src: this,
// type: 'update',
// value: $rootScope.__account
// };
// $dispatcher.dispatch('/tenant/settings', $event);
// }

function reload() {
return true;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit d341d29

Please sign in to comment.