Support applink tags

This commit is contained in:
Johannes Zellner
2022-07-07 19:11:54 +02:00
parent 7aec21d830
commit a9cc3c7ccc
2 changed files with 20 additions and 2 deletions

View File

@@ -94,12 +94,14 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
busy: false,
upstreamUri: '',
label: '',
tags: '',
show: function () {
$scope.applinksAdd.error = {};
$scope.applinksAdd.busy = false;
$scope.applinksAdd.upstreamUri = '';
$scope.applinksAdd.label = '';
$scope.applinksAdd.tags = '';
$scope.applinksAddForm.$setUntouched();
$scope.applinksAddForm.$setPristine();
@@ -116,7 +118,8 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
var data = {
upstreamUri: $scope.applinksAdd.upstreamUri,
label: $scope.applinksAdd.label
label: $scope.applinksAdd.label,
tags: $scope.applinksAdd.tags.split(' ').map(function (t) { return t.trim(); }).filter(function (t) { return !!t; })
};
Client.addApplink(data, function (error) {
@@ -138,6 +141,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
id: '',
upstreamUri: '',
label: '',
tags: '',
show: function (applink) {
$scope.applinksEdit.error = {};
@@ -147,6 +151,9 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
$scope.applinksEdit.upstreamUri = applink.upstreamUri;
$scope.applinksEdit.label = applink.label;
// translate for tag-input
$scope.applinksEdit.tags = applink.tags ? applink.tags.join(' ') : '';
$scope.applinksEditForm.$setUntouched();
$scope.applinksEditForm.$setPristine();
@@ -160,7 +167,8 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
var data = {
upstreamUri: $scope.applinksEdit.upstreamUri,
label: $scope.applinksEdit.label
label: $scope.applinksEdit.label,
tags: $scope.applinksEdit.tags.split(' ').map(function (t) { return t.trim(); }).filter(function (t) { return !!t; })
};
Client.updateApplink($scope.applinksEdit.id, data, function (error) {