Skip to content

Commit

Permalink
issue #544
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldoakes committed Nov 1, 2018
1 parent 2d5a743 commit cd2f3ae
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
3 changes: 2 additions & 1 deletion mdw-hub/web/js/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ assetMod.controller('AssetController', ['$scope', '$cookieStore', '$routeParams'
$scope.assetName = $routeParams.assetName;
if ($scope.assetName.endsWith('.proc')) {
$scope.process = {packageName: $scope.packageName, name: $scope.assetName.substring(0, $scope.assetName.length - 5)};
}else if($scope.assetName.endsWith('.task')){
}
else if($scope.assetName.endsWith('.task')){
$scope.task = true;
}

Expand Down
2 changes: 1 addition & 1 deletion mdw-hub/web/js/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ testingMod.filter('assetLinks', function($sce) {
var slash = path.lastIndexOf('/');
if (slash < 0)
path = pkg + '/' + path;
if (match[2] == 'process')
if (match[2] == 'process' && !path.endsWith('.proc'))
path += '.proc';
var quot = regex == regex2 ? '"' : "'";
output += match[1] + match[2] + '(' + start + quot + '<a href="#/asset/' + path + '">' + match[3] + '</a>' + quot + end + ')';
Expand Down
14 changes: 6 additions & 8 deletions mdw-hub/web/js/ui/configurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,6 @@ configMod.factory('Configurator', ['$injector', '$http', 'mdw', 'util', 'Assets'
};

Configurator.prototype.initSubprocBindings = function(widget, subproc) {
var spaceV = subproc.lastIndexOf(' v');
if (spaceV > 0)
subproc = subproc(0, spaceV);

var configurator = this;
$http.get(mdw.roots.services + '/services/Workflow/' + subproc + "?app=mdw-admin").then(function(res) {
if (res.data.variables) {
Expand Down Expand Up @@ -292,11 +288,13 @@ configMod.factory('Configurator', ['$injector', '$http', 'mdw', 'util', 'Assets'
var selectAsset = null;
if (widget.value) {
var spaceV = widget.value.lastIndexOf(' v');
if (spaceV > 0)
if (spaceV > 0 && spaceV < widget.value.length - 2 && !isNaN(parseFloat(widget.value.substring(spaceV + 2)))) {
selectAsset = widget.value.substring(0, spaceV);
else
}
else {
selectAsset = widget.value;
if (widget.source == 'proc')
}
if (widget.source == 'proc' && !selectAsset.endsWith('.proc'))
selectAsset += '.proc'; // process attrs saved without ext
}
selectAssets.push(selectAsset);
Expand Down Expand Up @@ -584,7 +582,7 @@ configMod.factory('Configurator', ['$injector', '$http', 'mdw', 'util', 'Assets'
var asset = value;
var version;
var spaceV = value.lastIndexOf(' v');
if (spaceV > 0) {
if (spaceV > 0 && spaceV < value.length - 2 && !isNaN(parseFloat(value.substring(spaceV + 2)))) {
var minVer = asset.substring(spaceV + 2);
var dot = minVer.indexOf('.');
var major = dot > 0 ? parseInt(minVer.substring(0, dot)) : 0;
Expand Down
2 changes: 1 addition & 1 deletion mdw-hub/web/js/ui/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ inspectMod.controller('MdwInspectorController', ['$scope', '$http', '$parse', 'm
else if (prop == 'processname') {
val.name = 'Process';
val.asset = {
path: val.value + '.proc',
path: val.value + (val.value.endsWith('.proc') ? '' : '.proc'),
version: 'v' + tabInfo.processversion
};
}
Expand Down
2 changes: 1 addition & 1 deletion mdw-hub/web/ui/widgets/asset.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
class="mdw-widget-dropdown">
<option ng-repeat="option in widget.options" value="{{option}}">{{option}}</option>
</select>
<a href="{{widget.assetUrl}}" ng-if="widget.value" target="_blank" style="top:0;">{{widget.readonly ? widget.value : 'Open'}}</a>
<a href="{{widget.assetUrl}}" ng-if="widget.value" target="_blank" style="top:2px;">{{widget.readonly ? widget.value : 'Open'}}</a>
<a href="" ng-if="!widget.readonly && !widget.value" ng-click="newAsset(widget.source)" target="_blank" style="top:0;">New...</a>

0 comments on commit cd2f3ae

Please sign in to comment.