|
| 1 | +// Copyright 2015 Google Inc. All Rights Reserved. |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +/** |
| 16 | + * @final |
| 17 | + */ |
| 18 | +export class ZeroStateController { |
| 19 | + /** |
| 20 | + * @ngInject |
| 21 | + */ |
| 22 | + constructor() { |
| 23 | + /** @export */ |
| 24 | + this.i18n = i18n; |
| 25 | + } |
| 26 | +} |
| 27 | + |
| 28 | +/** |
| 29 | + * Returns zero state component. |
| 30 | + * |
| 31 | + * @return {!angular.Directive} |
| 32 | + */ |
| 33 | +export const zeroStateComponent = { |
| 34 | + templateUrl: 'common/components/zerostate/zerostate.html', |
| 35 | + transclude: true, |
| 36 | + controller: ZeroStateController, |
| 37 | +}; |
| 38 | + |
| 39 | +const i18n = { |
| 40 | + /** @export {string} @desc Title text which appears on zero state view. */ |
| 41 | + MSG_ZERO_STATE_TITLE: goog.getMsg('There is nothing to display here'), |
| 42 | + /** @export {string} @desc Text which appears on zero state view under the title. It provides |
| 43 | + * to deploy view or offers user to take the Dashboard Tour. */ |
| 44 | + MSG_ZERO_STATE_TEXT: goog.getMsg( |
| 45 | + 'Let\'s {$createNewLink} create a new app {$createNewCloseLink} or learn more' + |
| 46 | + ' and {$openLink} take the Dashboard Tour {$linkIcon} {$closeLink}', |
| 47 | + { |
| 48 | + 'createNewLink': `<a href="#/deploy/file">`, |
| 49 | + 'createNewCloseLink': `</a>`, |
| 50 | + 'openLink': `<a href="http://kubernetes.io/docs/user-guide/ui/" target="_blank">`, |
| 51 | + 'linkIcon': `<i class="material-icons kd-zerostate-icon">open_in_new</i>`, |
| 52 | + 'closeLink': `</a>`, |
| 53 | + }), |
| 54 | +}; |
0 commit comments