File tree Expand file tree Collapse file tree 16 files changed +202
-27
lines changed
test/frontend/common/components/labels Expand file tree Collapse file tree 16 files changed +202
-27
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ function getFileList() {
4949 */
5050module . exports = function ( config ) {
5151 let configuration = {
52- basePath : conf . paths . base ,
52+ basePath : '.' ,
5353
5454 files : getFileList ( ) ,
5555
@@ -109,7 +109,8 @@ module.exports = function(config) {
109109 // karma-ng-html2js-preprocessor plugin config.
110110 ngHtml2JsPreprocessor : {
111111 stripPrefix : `${ conf . paths . frontendSrc } /` ,
112- moduleName : conf . frontend . moduleName ,
112+ // Load all template related stuff under ng module as it's loaded with every module.
113+ moduleName : 'ng' ,
113114 } ,
114115 } ;
115116
Original file line number Diff line number Diff line change 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+ import labelsDirective from './labels/labels_directive' ;
16+
17+ /**
18+ * Module containing common components for the application.
19+ */
20+ export default angular . module (
21+ 'kubernetesDashboard.common.components' ,
22+ [
23+ 'ngMaterial' ,
24+ ] )
25+ . directive ( 'kdLabels' , labelsDirective ) ;
Original file line number Diff line number Diff line change 1+ <!--
2+ Copyright 2015 Google Inc. All Rights Reserved.
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+ -->
16+
17+ < md-content >
18+ < div class ="kd-labels " ng-repeat ="(key, value) in ::labelsCtrl.labels ">
19+ {{key}}={{value}}
20+ </ div >
21+ </ md-content >
Original file line number Diff line number Diff line change 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+ @import ' ../../../variables' ;
16+
17+ $label-height : $caption-font-size-base + 6 ;
18+ $label-margin : 0 $baseline-grid $baseline-grid 0 ;
19+
20+ // Style taken(mostly) from angular material md-chip style.
21+ .kd-labels {
22+ background-color : $body ;
23+ border-radius : $label-height / 2 ;
24+ display : inline-block ;
25+ font-size : $caption-font-size-base ;
26+ line-height : $label-height ;
27+ margin : $label-margin ;
28+ padding : 0 $baseline-grid ;
29+ vertical-align : middle ;
30+ }
Original file line number Diff line number Diff line change 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 default class LabelsController {
19+ /**
20+ * Constructs labels controller.
21+ * @ngInject
22+ */
23+ constructor ( ) {
24+ /** @export {Object<string, string>} Initialized from the scope. */
25+ this . labels ;
26+ }
27+ }
Original file line number Diff line number Diff line change 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+ import LabelsController from './labels_controller' ;
16+
17+ /**
18+ * Returns directive definition for label.
19+ *
20+ * @return {!angular.Directive }
21+ */
22+ export default function labelsDirective ( ) {
23+ return {
24+ controller : LabelsController ,
25+ controllerAs : 'labelsCtrl' ,
26+ templateUrl : 'common/components/labels/labels.html' ,
27+ scope : { } ,
28+ bindToController : {
29+ 'labels' : '=' ,
30+ } ,
31+ } ;
32+ }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import relativeTimeFilter from './relativetime_filter';
1919 * Module containing common filters for the application.
2020 */
2121export default angular . module (
22- 'kubernetesDashboard.common.flters ' ,
22+ 'kubernetesDashboard.common.filters ' ,
2323 [
2424 'ngMaterial' ,
2525 ] )
Original file line number Diff line number Diff line change @@ -42,4 +42,4 @@ export default angular.module(
4242 . directive ( 'kdUniqueName' , uniqueNameDirective )
4343 . directive ( 'kdFileReader' , fileReaderDirective )
4444 . directive ( 'kdUpload' , uploadDirective )
45- . directive ( 'kdLabel ' , deployLabelDirective ) ;
45+ . directive ( 'kdDeployLabel ' , deployLabelDirective ) ;
Original file line number Diff line number Diff line change 110110 < p flex > Value</ p >
111111 </ div >
112112 < div ng-repeat ="label in ctrl.labels ">
113- < kd-label layout ="row " flex label ="label " labels ="ctrl.labels "> </ kd-label >
113+ < kd-deploy- label layout ="row " flex label ="label " labels ="ctrl.labels "> </ kd-deploy -label >
114114 </ div >
115115 </ div >
116116 </ div >
Original file line number Diff line number Diff line change 4848 </ span >
4949 < span class ="kd-replicasetdetail-sidebar-line "> Label selector</ span >
5050 < span class ="kd-replicasetdetail-sidebar-subline ">
51- {{ ctrl.formatLabelString(ctrl. replicaSetDetail.labelSelector)}}
51+ < kd-labels labels =" :: ctrl.replicaSetDetail.labelSelector" > </ kd-labels >
5252 </ span >
5353 < span class ="kd-replicasetdetail-sidebar-title "> Replica Sets</ span >
5454 < span class ="kd-replicasetdetail-sidebar-line "> Labels</ span >
5555 < span class ="kd-replicasetdetail-sidebar-subline ">
56- {{ ctrl.formatLabelString(ctrl. replicaSetDetail.labels)}}
56+ < kd-labels labels =" :: ctrl.replicaSetDetail.labels" > </ kd-labels >
5757 </ span >
5858 < span class ="kd-replicasetdetail-sidebar-line "> Images</ span >
5959 < span class ="kd-replicasetdetail-sidebar-subline "
6565 < span class ="kd-replicasetdetail-sidebar-line "> Label selector</ span >
6666 < span class ="kd-replicasetdetail-sidebar-subline "
6767 ng-repeat ="service in ::ctrl.replicaSetDetail.services ">
68- {{::ctrl.formatLabelString( service.selector)}}
68+ < kd-labels labels =" :: service.selector" > </ kd-labels >
6969 </ span >
7070 < span class ="kd-replicasetdetail-sidebar-line "> Internal endpoint</ span >
7171 < div class ="kd-replicasetdetail-sidebar-subline "
You can’t perform that action at this time.
0 commit comments