Compare commits

..

No commits in common. "6b11034b8d7c0bf8b78f5583aebde72210fc9fe5" and "da2a2c5c0147fef94ba879812bce78125e37f3f8" have entirely different histories.

12 changed files with 23 additions and 396 deletions

File diff suppressed because one or more lines are too long

View File

@ -32,12 +32,11 @@ var hub = new HubRegistry(['./src/customApi/gulpfile.js',
// './src/modules/taskStatus/gulpfile.js', // './src/modules/taskStatus/gulpfile.js',
// './src/modules/taskEmail/gulpfile.js', // './src/modules/taskEmail/gulpfile.js',
// './src/modules/customChangeProblemLink/gulpfile.js', // './src/modules/customChangeProblemLink/gulpfile.js',
'./src/modules/homeButton/gulpfile.js', // './src/modules/homeButton/gulpfile.js',
//'./src/modules/test/gulpfile.js', //'./src/modules/test/gulpfile.js',
'./src/modules/ccsServiceNtt/gulpfile.js', './src/modules/ccsServiceNtt/gulpfile.js',
'./src/modules/routeModifier/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 */ /* tell gulp to use the tasks just loaded */
gulp.registry(hub); gulp.registry(hub);

View File

@ -711,8 +711,6 @@
<script src="NTTDATA/modules/ccsServiceNtt/ntt.smartit.ccsServiceNtt.js"></script> <script src="NTTDATA/modules/ccsServiceNtt/ntt.smartit.ccsServiceNtt.js"></script>
<script src="NTTDATA/modules/routeModifier/ntt.smartit.routeModifier.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/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 --> <!-- DRSMX-79147: changes for favicon -->
<script type="text/javascript"> <script type="text/javascript">

View File

@ -56,7 +56,6 @@
<script src="NTTDATA/modules/ccsServiceNtt/ntt.smartit.ccsServiceNtt.js"></script> <script src="NTTDATA/modules/ccsServiceNtt/ntt.smartit.ccsServiceNtt.js"></script>
<script src="NTTDATA/modules/routeModifier/ntt.smartit.routeModifier.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/navigationModifier/ntt.smartit.navigationModifier.js"></script>
<script src="NTTDATA/modules/removeChat/ntt.smartit.removeChat.js"></script>
<!-- DRSMX-79147: changes for favicon --> <!-- DRSMX-79147: changes for favicon -->
<script type="text/javascript"> <script type="text/javascript">

View File

@ -219,65 +219,6 @@ 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){ /*angular.module("myitsmApp").config(function(ModuleConfigService){
for(var i = 0; i < nttSmartitModules.length; i++) { for(var i = 0; i < nttSmartitModules.length; i++) {
var moduleConfigPath = modulesPath+nttSmartitModules[i].name()+"/config.json"; var moduleConfigPath = modulesPath+nttSmartitModules[i].name()+"/config.json";

View File

@ -1,3 +1,3 @@
{ {
"homeButtonState":"ticketConsoleStudioPV" "homeButtonState":"ticketConsole"
} }

View File

@ -6,7 +6,6 @@ angular.module('myitsmApp')
compile: function(element, attributes, transclude){ compile: function(element, attributes, transclude){
return { return {
pre: function preLink(scope, iElement, iAttrs, controller) { pre: function preLink(scope, iElement, iAttrs, controller) {
var ccsService = angular.element(document).injector().get("ccsService");
let hState = ModuleConfigService.getModuleConfig("homeButton")["homeButtonState"]; let hState = ModuleConfigService.getModuleConfig("homeButton")["homeButtonState"];
iAttrs.uiSref=hState; iAttrs.uiSref=hState;
}, },

View File

@ -1,32 +0,0 @@
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;
});
}]
}
}]);

View File

@ -2,7 +2,6 @@
//require('./services/custom-asset-link-service'); //require('./services/custom-asset-link-service');
require('./directives/ntt-custom-home-button-directive'); require('./directives/ntt-custom-home-button-directive');
//require('./directives/ntt-scopecontroller-ci-relations-directive'); //require('./directives/ntt-scopecontroller-ci-relations-directive');
require('./directives/scope-controller-home-button');
export class homeButton extends ntt.smartit.api.ICustomModule { export class homeButton extends ntt.smartit.api.ICustomModule {
@ -14,45 +13,32 @@ export class homeButton extends ntt.smartit.api.ICustomModule {
injectTemplates() { injectTemplates() {
return { return {
"views/navigation/header-navigation.html": [ "views/navigation/header-navigation.html": [
// { /*{
// id:"homeButton", id: "homeButton",
// mode: "attribute", //es soll nur ein attribute überschreiben werden method: "replace",
// attributes: { mode: "partial",
// "add": { type: "jquery",
// "custom-home-button": "" selector: function ($jqueryTemplate) {
// } return $jqueryTemplate.find(".header__link");;
// }, },
// //method: "replace", snippet: '<a custom-problem-change-link class="ticket__name-link" aria-label="{{ fullDetailsText }}" ticket="ticket">{{ fullDetailsText }}</a>',
// type: "jquery", },*/
// selector: function($jqueryTemplate) { {
// return $jqueryTemplate.find(".header__link"); id:"homeButton",
// },
// },
{
id:"homeButtonScopeController",
mode: "attribute", //es soll nur ein attribute überschreiben werden mode: "attribute", //es soll nur ein attribute überschreiben werden
attributes: { attributes: {
"add": { "add": {
"scope-controller-home-button": "" "custom-home-button": ""
} }
}, },
//method: "replace", //method: "replace",
type: "jquery", type: "jquery",
selector: function($jqueryTemplate) { selector: function($jqueryTemplate) {
return $jqueryTemplate.find(".header__navigation-bar_item"); return $jqueryTemplate.find(".header__link");
}, },
}, //snippet: '<scope-extender-assignment ticket="ticket" ng-If="true"></scope-extender-assignment>',
{
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>'
}
]
} }
} }

View File

@ -1,37 +0,0 @@
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'));

View File

@ -1,86 +0,0 @@
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());

View File

@ -1,99 +0,0 @@
// 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',
})*/
//]
}