Merge 1.2.0 changes back to master.

This commit is contained in:
Michael Jumper
2020-06-22 14:36:42 -07:00
25 changed files with 175 additions and 402 deletions

View File

@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
/**
* Controller for the redirect field, which redirects the user to the provided
* URL.
*/
angular.module('form').controller('redirectFieldController', ['$scope','$window',
function redirectFieldController($scope,$window) {
/**
* Redirect the user to the provided URL.
*/
$window.location.href = $scope.field.redirectUrl;
}]);

View File

@@ -192,6 +192,19 @@ angular.module('form').provider('formService', function formServiceProvider() {
module : 'form',
controller : 'terminalColorSchemeFieldController',
templateUrl : 'app/form/templates/terminalColorSchemeField.html'
},
/**
* Field type that supports redirecting the client browser to another
* URL.
*
* @see {@link Field.Type.REDIRECT}
* @type FieldType
*/
'REDIRECT' : {
module : 'form',
controller : 'redirectFieldController',
templateUrl : 'app/form/templates/redirectField.html'
}
};

View File

@@ -0,0 +1,35 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
.redirect-field-container {
height: 100%;
width: 100%;
position: fixed;
left: 0;
top: 0;
display: table;
background: white;
}
.redirect-field {
width: 100%;
display: table-cell;
vertical-align: middle;
text-align: center;
}

View File

@@ -0,0 +1,8 @@
<div class="redirect-field-container">
<div class="redirect-field">
<p ng-show="field.translatableMessage"
translate="{{field.translatableMessage.key}}"
translate-values="{{field.translatableMessage.variables}}">
</p>
</div>
</div>