Compare commits
2 Commits
da2a2c5c01
...
6b11034b8d
| Author | SHA1 | Date |
|---|---|---|
|
|
6b11034b8d | |
|
|
658992af14 |
File diff suppressed because one or more lines are too long
|
|
@ -32,11 +32,12 @@ var hub = new HubRegistry(['./src/customApi/gulpfile.js',
|
|||
// './src/modules/taskStatus/gulpfile.js',
|
||||
// './src/modules/taskEmail/gulpfile.js',
|
||||
// './src/modules/customChangeProblemLink/gulpfile.js',
|
||||
// './src/modules/homeButton/gulpfile.js',
|
||||
'./src/modules/homeButton/gulpfile.js',
|
||||
//'./src/modules/test/gulpfile.js',
|
||||
'./src/modules/ccsServiceNtt/gulpfile.js',
|
||||
'./src/modules/routeModifier/gulpfile.js',
|
||||
'./src/modules/navigationModifier/gulpfile.js']);
|
||||
'./src/modules/navigationModifier/gulpfile.js',
|
||||
'./src/modules/removeChat/gulpfile.js']);
|
||||
|
||||
/* tell gulp to use the tasks just loaded */
|
||||
gulp.registry(hub);
|
||||
|
|
|
|||
|
|
@ -711,6 +711,8 @@
|
|||
<script src="NTTDATA/modules/ccsServiceNtt/ntt.smartit.ccsServiceNtt.js"></script>
|
||||
<script src="NTTDATA/modules/routeModifier/ntt.smartit.routeModifier.js"></script>
|
||||
<script src="NTTDATA/modules/navigationModifier/ntt.smartit.navigationModifier.js"></script>
|
||||
<script src="NTTDATA/modules/removeChat/ntt.smartit.removeChat.js"></script>
|
||||
<script src="NTTDATA/modules/homeButton/ntt.smartit.homeButton.js"></script>
|
||||
|
||||
<!-- DRSMX-79147: changes for favicon -->
|
||||
<script type="text/javascript">
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@
|
|||
<script src="NTTDATA/modules/ccsServiceNtt/ntt.smartit.ccsServiceNtt.js"></script>
|
||||
<script src="NTTDATA/modules/routeModifier/ntt.smartit.routeModifier.js"></script>
|
||||
<script src="NTTDATA/modules/navigationModifier/ntt.smartit.navigationModifier.js"></script>
|
||||
<script src="NTTDATA/modules/removeChat/ntt.smartit.removeChat.js"></script>
|
||||
|
||||
<!-- DRSMX-79147: changes for favicon -->
|
||||
<script type="text/javascript">
|
||||
|
|
|
|||
|
|
@ -219,6 +219,65 @@ angular.module("myitsmApp").config(["$provide",function ($provide) {
|
|||
|
||||
}]);
|
||||
|
||||
// angular.module('myitsmApp')
|
||||
// .provider('ccsProviderNtt',["ccsModel","$q",
|
||||
// function (ccsModel,$q) {
|
||||
|
||||
// var cache=null;
|
||||
|
||||
// return {
|
||||
// $get: function() {
|
||||
// function getNttCCS() {
|
||||
|
||||
// return $q(function (resolve, reject) {
|
||||
// var params = [ccsModel.getCCSParameters()];
|
||||
|
||||
// if(cache!=undefined) {
|
||||
// resolve(cache);
|
||||
|
||||
// }else {
|
||||
// $q.all(params).then(function(data) {
|
||||
|
||||
// var nttParams = _.pickBy(data[0], function(value, key) {
|
||||
// return _.startsWith(key, "ntt.");
|
||||
// });
|
||||
// cache=nttParams;
|
||||
// resolve(nttParams);
|
||||
|
||||
// });
|
||||
// }
|
||||
|
||||
// });
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// // this.getNttCCS = function() {
|
||||
|
||||
// // return $q(function (resolve, reject) {
|
||||
// // var params = [ccsModel.getCCSParameters()];
|
||||
|
||||
// // if(cache!=undefined) {
|
||||
// // resolve(cache);
|
||||
|
||||
// // }else {
|
||||
// // $q.all(params).then(function(data) {
|
||||
|
||||
// // var nttParams = _.pickBy(data[0], function(value, key) {
|
||||
// // return _.startsWith(key, "ntt.");
|
||||
// // });
|
||||
// // cache=nttParams;
|
||||
// // resolve(nttParams);
|
||||
|
||||
// // });
|
||||
// // }
|
||||
|
||||
// // });
|
||||
|
||||
// // }
|
||||
|
||||
// }]);
|
||||
|
||||
/*angular.module("myitsmApp").config(function(ModuleConfigService){
|
||||
for(var i = 0; i < nttSmartitModules.length; i++) {
|
||||
var moduleConfigPath = modulesPath+nttSmartitModules[i].name()+"/config.json";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"homeButtonState":"ticketConsole"
|
||||
"homeButtonState":"ticketConsoleStudioPV"
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ angular.module('myitsmApp')
|
|||
compile: function(element, attributes, transclude){
|
||||
return {
|
||||
pre: function preLink(scope, iElement, iAttrs, controller) {
|
||||
var ccsService = angular.element(document).injector().get("ccsService");
|
||||
let hState = ModuleConfigService.getModuleConfig("homeButton")["homeButtonState"];
|
||||
iAttrs.uiSref=hState;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
angular.module('ticketModule')
|
||||
.directive('scopeControllerHomeButton', ['ccsServiceNtt',
|
||||
function (ccsServiceNtt) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
template: '',
|
||||
replace: true,
|
||||
scope: {
|
||||
data: '='
|
||||
},
|
||||
link: ['scope', 'element', 'attrs', function (scope, element, attrs) {
|
||||
}],
|
||||
controller: ['$scope', '$element', '$attrs', 'ccsServiceNtt', function ($scope, $element, $attrs, ccsServiceNtt) {
|
||||
|
||||
ccsServiceNtt.getNttCCS().then(function(result) {
|
||||
|
||||
let homeButtonState = _.find(result, function(value, key) {
|
||||
if(key == "ntt.homeButton.state")
|
||||
return true;
|
||||
});
|
||||
|
||||
if(homeButtonState) {
|
||||
$scope.$parent.homeState=homeButtonState;
|
||||
}
|
||||
|
||||
$scope.$parent.hLinkReady=true;
|
||||
});
|
||||
|
||||
}]
|
||||
|
||||
}
|
||||
}]);
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
//require('./services/custom-asset-link-service');
|
||||
require('./directives/ntt-custom-home-button-directive');
|
||||
//require('./directives/ntt-scopecontroller-ci-relations-directive');
|
||||
require('./directives/scope-controller-home-button');
|
||||
|
||||
export class homeButton extends ntt.smartit.api.ICustomModule {
|
||||
|
||||
|
|
@ -13,32 +14,45 @@ export class homeButton extends ntt.smartit.api.ICustomModule {
|
|||
injectTemplates() {
|
||||
return {
|
||||
"views/navigation/header-navigation.html": [
|
||||
/*{
|
||||
id: "homeButton",
|
||||
method: "replace",
|
||||
mode: "partial",
|
||||
type: "jquery",
|
||||
selector: function ($jqueryTemplate) {
|
||||
return $jqueryTemplate.find(".header__link");;
|
||||
},
|
||||
snippet: '<a custom-problem-change-link class="ticket__name-link" aria-label="{{ fullDetailsText }}" ticket="ticket">{{ fullDetailsText }}</a>',
|
||||
},*/
|
||||
{
|
||||
id:"homeButton",
|
||||
// {
|
||||
// id:"homeButton",
|
||||
// mode: "attribute", //es soll nur ein attribute überschreiben werden
|
||||
// attributes: {
|
||||
// "add": {
|
||||
// "custom-home-button": ""
|
||||
// }
|
||||
// },
|
||||
// //method: "replace",
|
||||
// type: "jquery",
|
||||
// selector: function($jqueryTemplate) {
|
||||
// return $jqueryTemplate.find(".header__link");
|
||||
// },
|
||||
// },
|
||||
{
|
||||
id:"homeButtonScopeController",
|
||||
mode: "attribute", //es soll nur ein attribute überschreiben werden
|
||||
attributes: {
|
||||
"add": {
|
||||
"custom-home-button": ""
|
||||
"scope-controller-home-button": ""
|
||||
}
|
||||
},
|
||||
//method: "replace",
|
||||
type: "jquery",
|
||||
selector: function($jqueryTemplate) {
|
||||
return $jqueryTemplate.find(".header__link");
|
||||
},
|
||||
//snippet: '<scope-extender-assignment ticket="ticket" ng-If="true"></scope-extender-assignment>',
|
||||
|
||||
}]
|
||||
return $jqueryTemplate.find(".header__navigation-bar_item");
|
||||
},
|
||||
},
|
||||
{
|
||||
id:"homeButton",
|
||||
mode: "partial", //es soll nur ein attribute überschreiben werden
|
||||
method: "replace",
|
||||
type: "jquery",
|
||||
selector: function($jqueryTemplate) {
|
||||
return $jqueryTemplate.find(".header__link");
|
||||
},
|
||||
snippet: '<a ui-sref="{{homeState}}" ng-if="hLinkReady" class="header__link" tabindex="0"><div class="header__logo"></div><div class="header__app-name">{{\'login.productShortName\' | i18n}}</div></a>'
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
var gulp = require('gulp');
|
||||
const webpack = require('webpack-stream');
|
||||
var gulpCopy = require('gulp-copy');
|
||||
|
||||
const sourcePath = "src/modules/removeChat";
|
||||
const destPath = "dist/NTTDATA/modules/removeChat";
|
||||
|
||||
gulp.task('build', function() {
|
||||
return gulp.src('./*')
|
||||
.pipe(webpack(require('./webpack.config.js') ))
|
||||
.pipe(gulp.dest(destPath));
|
||||
});
|
||||
|
||||
|
||||
gulp.task('copyi18n',function(cb) {
|
||||
return gulp.src(sourcePath+'/i18n/**/*')
|
||||
.pipe(gulp.dest(destPath+'/i18n'))
|
||||
});
|
||||
|
||||
gulp.task('copyViews',function(cb) {
|
||||
return gulp.src(sourcePath+'/views/**/*')
|
||||
.pipe(gulp.dest(destPath+'/views'))
|
||||
});
|
||||
|
||||
// gulp.task('copyConfig',function(cb) {
|
||||
// return gulp.src(sourcePath+'/config.json')
|
||||
// .pipe(gulp.dest(destPath))
|
||||
// });
|
||||
|
||||
|
||||
// gulp.task('copyExampleConfig',function(cb) {
|
||||
// return gulp.src(sourcePath+'/example-home-button-state.txt')
|
||||
// .pipe(gulp.dest(destPath))
|
||||
// });
|
||||
|
||||
gulp.task('copyResources', gulp.series('copyi18n','copyViews'));
|
||||
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
export class removeChat extends ntt.smartit.api.ICustomModule {
|
||||
|
||||
name() {
|
||||
return "removeChat";
|
||||
}
|
||||
|
||||
|
||||
injectTemplates() {
|
||||
return {
|
||||
// "views/navigation/header-navigation.html": [
|
||||
// // {
|
||||
// // id: "removeChat",
|
||||
// // method: "remove",
|
||||
// // mode: "partial",
|
||||
// // type: "jquery",
|
||||
// // selector: function ($jqueryTemplate) {
|
||||
// // return $jqueryTemplate.find(".chat-notifications");
|
||||
// // }
|
||||
|
||||
// // },
|
||||
// ]
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
injectDynTemplates() {
|
||||
return {}
|
||||
}
|
||||
|
||||
|
||||
templates() {
|
||||
return []
|
||||
}
|
||||
|
||||
i18nLocales() {
|
||||
|
||||
return {}
|
||||
|
||||
}
|
||||
|
||||
injectServices(services) {
|
||||
|
||||
var ccsModel = services["ccsModel"];
|
||||
|
||||
if(services.chatModel && services.chatModel.openChatConnection) {
|
||||
var oldF = services.chatModel.openChatConnection;
|
||||
|
||||
|
||||
services.chatModel.openChatConnection = function() {
|
||||
var ccsService = angular.element(document).injector().get("ccsService");
|
||||
if (this.connectInProgress) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.connectInProgress=true;
|
||||
|
||||
ccsService.getCCSParameters().then(function(result) {
|
||||
|
||||
let chatModel = angular.element(document).injector().get("chatModel");
|
||||
chatModel.connectInProgress=false;
|
||||
|
||||
let chatEnabledConfig = _.find(result, function(value, key) {
|
||||
if(key == "ntt.chatEnabled")
|
||||
return true;
|
||||
});
|
||||
|
||||
//if no config in ccs exits or is set to true
|
||||
if(chatEnabledConfig && chatEnabledConfig=="false") {
|
||||
chatModel.connected = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
oldF.apply(oldF,arguments);
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
ntt.smartit.api.nttSmartitModules.push(new removeChat());
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
// webpack.config.js
|
||||
var webpack = require('webpack');
|
||||
const path = require('path')
|
||||
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
|
||||
|
||||
|
||||
const env = process.env.WEBPACK_MODE;
|
||||
|
||||
function sourcemapActive() {
|
||||
if(env === "development") {
|
||||
return 'inline-source-map';
|
||||
}
|
||||
else
|
||||
return 'none';
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
removeChat: __dirname + '/index.js',
|
||||
},
|
||||
output: {
|
||||
filename: 'ntt.smartit.removeChat.js',
|
||||
library: ['ntt','smartit','removeChat'],
|
||||
libraryTarget: 'umd'
|
||||
},
|
||||
mode: env || "development",
|
||||
node: {
|
||||
console: false,
|
||||
fs: 'empty',
|
||||
net: 'empty',
|
||||
tls: 'empty'
|
||||
},
|
||||
cache: true,
|
||||
devtool: sourcemapActive(), //'inline-source-map',
|
||||
externals: {
|
||||
jquery: 'jQuery'
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
exclude:/(node_modules|ressources)/ ,
|
||||
query: {
|
||||
presets: ["@babel/preset-env"]
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [ 'style-loader', 'css-loader' ]
|
||||
|
||||
},
|
||||
]
|
||||
},
|
||||
/*resolve: {
|
||||
extensions: ['*', '.js'],
|
||||
alias: {
|
||||
'moment': path.resolve(__dirname, './moment') // <-- When you build or restart dev-server, you'll get an error if the path to your utils.js file is incorrect.
|
||||
}
|
||||
},*/
|
||||
plugins: [
|
||||
|
||||
/* new ExtractTextPlugin({
|
||||
filename: './ntt-ar-js.css'
|
||||
}),*/
|
||||
new webpack.ProvidePlugin({
|
||||
"$":"jquery",
|
||||
"jQuery":"jquery",
|
||||
"window.jQuery":"jquery",
|
||||
//"moment":"moment"
|
||||
}),
|
||||
//new webpack.IgnorePlugin(/(locale)/, /node_modules.+(momentjs)/),
|
||||
//new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
|
||||
// new BundleAnalyzerPlugin({generateStatsFile:true})
|
||||
/*new webpack.IgnorePlugin({
|
||||
resourceRegExp: /ressources/
|
||||
})*/
|
||||
]
|
||||
/*plugins: [
|
||||
//var options = []
|
||||
//options : {};
|
||||
/*options={
|
||||
'[file].map',
|
||||
null,
|
||||
"[absolute-resource-path]",
|
||||
"[absolute-resource-path]"
|
||||
},*/
|
||||
|
||||
/*new webpack.SourceMapDevToolPlugin({
|
||||
filename:'[file].map',
|
||||
|
||||
|
||||
})*/
|
||||
|
||||
//]
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue