Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h4 class="modal-title" ng-if="isEditMode">
<div class="modal-body">
<loading name="isNewTaskPageLoading" size="large" type="block" align="center"></loading>
<div class="row new-task-wrapper" ng-show="!isNewTaskPageLoading">
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12 border no-padding">
<div class="col-lg-5 col-md-5 col-sm-12 col-xs-12 border no-padding">
<section class="jobDetailsBox">
<header class="jobDetailsHeader">
<h5>Job Details</h5>
Expand Down Expand Up @@ -49,6 +49,34 @@ <h5>Job Details</h5>
<input type="text" name="taskName" class="form-control" required autofocus ng-model="name" maxlength="50" />
</span>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 margintop15">
<label class="control-label">Bot Type
<span class="control-label red">&nbsp;*</span>
<span ng-show="newTaskForm.botType.$touched && newTaskForm.botType.$invalid" class="inputValidationMsg">required
</span>
</label>
<br />
<span class="col-md-12 col-sm-12 col-xs-12 no-padding">
<select name="botType" class="form-control" ng-model="botType" ng-disabled="isEditMode" required>
<option selected="selected" value="Task">Task</option>
<option ng-show="!createChefJob" value="Check">Check</option>
<option ng-show="!createChefJob" value="Learning">Learning</option>
<option ng-show="!createChefJob" value="Composite">Composite</option>
<option ng-show="!createChefJob" value="Built with other">Built with other</option>
</select>
</span>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 margintop15">
<label class="control-label">Short Description
<span class="control-label red">&nbsp;*</span>
<span ng-show="newTaskForm.shortDesc.$touched && newTaskForm.shortDesc.$invalid" class="inputValidationMsg">required
</span>
</label>
<br />
<span class="col-md-12 col-sm-12 col-xs-12 no-padding">
<input type="text" name="shortDesc" class="form-control" required autofocus ng-model="shortDesc" maxlength="50" />
</span>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 margintop15" ng-if="taskType==='jenkins'">
<label class="control-label">Server
<span class="control-label red">&nbsp;*</span>
Expand Down Expand Up @@ -106,23 +134,23 @@ <h5>Job Details</h5>
</div>
</div>
<!--scriptType ending here -->
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 margintop15">
<div class="col-lg-12 col-md-12col-sm-12 col-xs-12 margintop15">
<label class="control-label">Job Description</label>
<textarea id="chefDescription" rows="9" cols="15" name="description" ng-model="description"></textarea>
</div>
</div>
</section>
</div>
<!--Second Column:Chef -->
<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12 left-padding">
<div class="col-lg-7 col-md-7 col-sm-12 col-xs-12 left-padding">
<div class="col-md-12 col-sm-12 col-xs-12 border no-padding" ng-if="taskType==='chef'">
<section class="Chef">
<header class="jobDetailsHeader">
<h5>Chef Server Details for - RLChefServer</h5>
</header>
<div class="jobDetailsContent">
<div class="chef-details-top">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12">
<loading name="isTargetTypesLoading" size="medium" type="block" align="left"></loading>
<div ng-show="!isTargetTypesLoading" class="row margin0">

Expand Down Expand Up @@ -183,7 +211,7 @@ <h5>Chef Server Details for - RLChefServer</h5>

</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
<label>
<i class="fa fa-list-ul addRunList-icon"></i>
<lable class="control-label" ng-if="!isEditMode">Add Runlist</lable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@
var taskJSON = {
taskType: $scope.taskType,
name: $scope.name,
botType: $scope.botType,
shortDesc: $scope.shortDesc,
description: $scope.description,
};
//checking for name of the task
Expand All @@ -257,6 +259,11 @@
$scope.taskSaving = false;
return false;
}
if (!taskJSON.shortDesc.trim()) {
$scope.inputValidationMsg='Please enter the short Description of the task.';
$scope.taskSaving = false;
return false;
}
//validating the task selections values and taking selected values from chef components
if ($scope.taskType === "composite") {
taskJSON.assignTasks = [];
Expand Down Expand Up @@ -407,7 +414,9 @@
}
});
$scope.name = "";
$scope.shortDesc = "";
$scope.taskType = "chef";//default Task type selection;
$scope.botType = "Task";//default Task type selection;
$scope.isEditMode = false;//default edit mode is false;
$scope.taskSaving = false;//to disable submit button, dfault false
$scope.autoSync = {
Expand Down Expand Up @@ -435,7 +444,6 @@
workzoneServices.getEnvironmentTaskList().then(function (response) {
var data, selectorList = [],
optionList = [];

if (response.data) {
data = response.data;
} else {
Expand Down Expand Up @@ -563,6 +571,8 @@
$scope.description = items.description;
$scope.taskType = items.taskType;
$scope.name = items.name;
$scope.botType = items.botType;
$scope.shortDesc = items.shortDesc;
//properties specific to jenkins
if (items.taskType === "jenkins") {
$scope.jobUrl = items.taskConfig.jobURL;
Expand Down
8 changes: 8 additions & 0 deletions server/app/model/classes/tasks/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ var taskSchema = new Schema({
required: true,
trim: true
},
shortDesc: {
type: String
},
botType: {
type: String
},
description: {
type: String
},
Expand Down Expand Up @@ -650,6 +656,8 @@ taskSchema.statics.updateTaskById = function(taskId, taskData, callback) {
name: taskData.name,
taskConfig: taskConfig,
taskType: taskData.taskType,
shortDesc: taskData.shortDesc,
botType: taskData.botType,
description: taskData.description,
jobResultURLPattern: taskData.jobResultURL,
blueprintIds: taskData.blueprintIds
Expand Down