Skip to content
This repository has been archived by the owner on Oct 25, 2019. It is now read-only.

Commit

Permalink
Merge pull request #30 from xebialabs-community/tile
Browse files Browse the repository at this point in the history
Tile
  • Loading branch information
jdewinne committed Jun 8, 2018
2 parents 168fa0b + ca3d50b commit 495dfee
Show file tree
Hide file tree
Showing 19 changed files with 152 additions and 159 deletions.
24 changes: 24 additions & 0 deletions .travis.yml
@@ -1,5 +1,29 @@
language: java
sudo: false
addons:
chrome: stable
apt:
packages:
- httpie
- jq
env:
global:
- WEB_SERVER=http://localhost:5516
- BROWSER=chrome
- secure: XPCc0BKkBkxZ0yxadNfHgnO8/z/uiRXDLWVFM2zUgHFdsIO0dGCR9yCZ29oQEZq5mQNTBXHMlWUtyWWIuh0dI6Unqf9t6NXwM3Rrdt+5nrspVuVU8rlbZk5VL4qwlDyCMy0C7Jt6UkGQm07BB2wm1iWwosU85haK66qBKKXCJoA=
- secure: Y2vWbrGiUn98si2mooO02v00ksleu4GYSZhZHmgznNXvzH1ruPpC+fzE23foSkb2vvM1os86tmxeOy+MCJsPoOLF1hI8cJKm8UjBJZX595Pli8YwJcmtdCLsmT+W1u+iDm7mUlMJtFRr9EkDZ1Kuou7a76N/R8xaBTKJc/n8sUs=
script:
- mkdir -p ./xl-licenses
- http --check-status --print=b --auth $username:$password --json POST https://download.xebialabs.com/api/temporary/xl-release
firstName=xlc lastName=xlc email=xlc@xebialabs.com company=xebialabs | jq --raw-output
'.license' > ./xl-licenses/xl-release-license.lic
- "./gradlew clean assemble"
- docker run --rm -d -v $PWD/build/libs/.:/opt/xlr/server/plugins/__local__ -v $PWD/xl-licenses:/license
-p 5516:5516 --name xlr xebialabs/xl-docker-demo-xlr:latest
- sleep 60
- docker logs xlr
- "./gradlew itest"
- docker stop xlr
notifications:
slack:
secure: WzdS5sSSQziwbZwqW8nCddRGC8SSrgcPyVn9NbV2MOkqa4mFawQOL05CCOc0RfV7otCCqxsDqXAehuyKzEVA8VrQ1g10Eelppbnv9WxDYzIj1M2MPmyo4RzHK6+aw0KRIujufgYQdxit+N/J2xATnUy+3hiXBQprCnIGXYaNk2w=
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,20 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).


## [Unreleased]

## v4.1.14

### Fixed
- fixed broken loading gif on details page
- fixed broken loading gif on summary page
- Made details page columns dynamic

### Improvement
- Added automated test to check presence shared configuration
- Updated Gradle wrapper

2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -73,7 +73,7 @@ The ServiceNow plugin integrates with the SNOW REST API v1 (i.e. `/api/now/v1/`)

The current status and ticket number are returned once the requred value has been set.

### Change Tasks###
### Change Tasks ###

+ **Create Change Task** - This task will create a change task associated with a change request in ServiceNow.

Expand Down
27 changes: 24 additions & 3 deletions build.gradle
Expand Up @@ -11,9 +11,9 @@ apply plugin: 'maven'

xlDocker {
compileImage = 'xebialabs/xlr_dev_compile'
compileVersion = 'v7.2.0.2'
compileVersion = 'v8.0.0.1'
runImage = 'xebialabs/xlr_dev_run'
runVersion = 'v7.2.0.1'
runVersion = 'v8.0.0.2'
runPortMapping = '15516:5516'
}

Expand All @@ -25,9 +25,30 @@ if (!project.hasProperty('release.useLastTag')) {
project.ext['release.useLastTag'] = true
}

repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://dist.xebialabs.com/public/maven2'
}
}

dependencies {
testCompile "com.xebialabs.gradle.plugins:xl-test-api:0.0.3"
}

task itest(type: Test) {
useTestNG() {
//set TestNG output dir
outputDirectory = file("$project.buildDir//testngOutput")
//required to turn on TestNG reports
useDefaultListeners = true
}
}

license {
header rootProject.file('License.md')
strictCheck false
strictCheck true
ext.year = Calendar.getInstance().get(Calendar.YEAR)
ext.name = 'XEBIALABS'
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
#Thu May 25 14:56:49 PDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
26 changes: 17 additions & 9 deletions gradlew
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
6 changes: 0 additions & 6 deletions gradlew.bat
Expand Up @@ -49,7 +49,6 @@ goto fail
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
Expand All @@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/synthetic.xml
Expand Up @@ -331,7 +331,7 @@
# ServiceNow Server Configuration
#######################################################################################################################
-->
<type type="servicenow.Server" extends="configuration.HttpConnection">
<type type="servicenow.Server" label="ServiceNow: Server" extends="configuration.HttpConnection">
<property name="changeRecordTableName"
label="Change Record Table Name (Required for Generate Release)"
required="true"
Expand Down Expand Up @@ -403,8 +403,8 @@
<property category="input" name="tableName" required="true" default="incident"
description="ServiceNow table name (in lower case) (for example problem, change_request etc) Default value: incident"/>
<property category="input" name="query" required="false" size="large" description="ServiceNow query"/>
<property category="input" name="detailsViewColumns" hidden="true" kind="map_string_string"
default="number:number,short_description,priority:priority,state:state,assigned_to:assigned_to.display_value"
<property category="input" name="detailsViewColumns" hidden="false" kind="map_string_string"
default="number:number,short_description:short_description,priority:priority,state:state,assigned_to:assigned_to.display_value"
description="Map of columns displayed in details view of tile. For a referenced type column, display_value should be in the value of key:value pair separated by . (eg. assigned_to:assigned_to.display_value)"/>
</type>

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Expand Up @@ -14,7 +14,7 @@
var ServiceNowQueryTileViewController = function ($scope, ServiceNowQueryService, XlrTileHelper) {
var vm = this;
var tile;

var config;
var predefinedColors = [];
predefinedColors['New'] = '#7E827A';
predefinedColors['Active'] = '#4AA0C8';
Expand Down Expand Up @@ -48,7 +48,6 @@
}

function tileConfigurationIsPopulated() {
var config;
// old style pre 7.0
if (tile.properties == null) {
config = tile.configurationProperties;
Expand Down Expand Up @@ -142,49 +141,22 @@
}

function createGridOptions(serviceNowData) {
var filterHeaderTemplate = "<div data-ng-include=\"'partials/releases/grid/templates/name-filter-template.html'\"></div>";
var filterHeaderTemplate = `<div data-ng-include="partials/releases/grid/templates/name-filter-template.html"></div>`;
var columnDefs = [
{
displayName: "Number",
field: "number",
cellTemplate: "static/@project.version@/include/ServiceNowQueryTile/grid/number-cell-template.html",
filterHeaderTemplate: filterHeaderTemplate,
enableColumnMenu: false,
width: '18%'
},
{
displayName: "Short description",
field: "short_description",
cellTemplate: "static/@project.version@/include/ServiceNowQueryTile/grid/short-description-cell-template.html",
filterHeaderTemplate: filterHeaderTemplate,
enableColumnMenu: false,
width: '25%'
},
{
displayName: "Priority",
field: "priority",
cellTemplate: "static/@project.version@/include/ServiceNowQueryTile/grid/priority-cell-template.html",
filterHeaderTemplate: filterHeaderTemplate,
enableColumnMenu: false,
enableColumnMenu: true,
width: '18%'
},
{
displayName: "State",
field: "state",
cellTemplate: "static/@project.version@/include/ServiceNowQueryTile/grid/state-cell-template.html",
filterHeaderTemplate: filterHeaderTemplate,
enableColumnMenu: false,
width: '19%'
},
{
displayName: "Assigned To",
field: "assigned_to",
cellTemplate: "static/@project.version@/include/ServiceNowQueryTile/grid/assigned-to-cell-template.html",
filterHeaderTemplate: filterHeaderTemplate,
enableColumnMenu: false,
width: '20%'
}
];
for (var key in config.detailsViewColumns['value']) {
if (key != "number") {
columnDefs.push({displayName: key, field: key, filterHeaderTemplate: filterHeaderTemplate, enableColumnMenu: true})
}
};
return XlrTileHelper.getGridOptions(serviceNowData, columnDefs);
}

Expand Down
37 changes: 37 additions & 0 deletions src/test/java/com.xebialabs.xlr.xlrelease.test/LoginTest.java
@@ -0,0 +1,37 @@
/**
* Copyright 2018 XEBIALABS
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package com.xebialabs.xlr.xlrelease.test;

import com.xebialabs.pages.*;
import com.xebialabs.specs.BaseTest;
import org.testng.annotations.*;

public class LoginTest extends BaseTest {

@BeforeMethod
public void testStartUp(){
System.out.println("called before method");
LoginPage.login("admin","admin");
}

@Test
public void openConfigurationServiceNow(){
MainMenu.clickMenu("Settings");
SubMenu.clickSubMenu("Shared configuration");
SharedConfigurationPage.openSharedConfiguration("ServiceNow: Server");
SharedConfigurationPropertiesPage.checkSharedConfigurationHeader("ServiceNow");
}

@AfterMethod
public void logout(){
System.out.println("called after method");
MainMenu.logout();
}
}

0 comments on commit 495dfee

Please sign in to comment.