Skip to content

Commit 8c5bacc

Browse files
Sebastian Florekmaciaszczykm
authored andcommitted
Fix issue with edit dialog on details page (#874)
1 parent 5d5e59e commit 8c5bacc

File tree

7 files changed

+69
-3
lines changed

7 files changed

+69
-3
lines changed

i18n/messages-en.xtb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,5 @@
363363
<translation id="8808405168042160441" key="MSG_RC_LIST_EDIT_POD_COUNT_ACTION" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Action 'Edit Pod Count' on the drop down menu for a single replication controller (replication controller list page).">Scale</translation>
364364
<translation id="1811662550159188281" key="MSG_POD_LIST_CPU_USAGE_LABEL" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Label which appears as a column label in the table of pods">CPU (cores)</translation>
365365
<translation id="9149343004693743620" key="MSG_POD_LIST_MEMORY_USAGE_LABEL" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Label which appears as a column label in the table of pods">Memory (bytes)</translation>
366+
<translation id="2278267472990776370" key="MSG_JOB_DETAIL_JOB_LABEL" source="/home/floreks/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Job' which appears at the top of the dialog, opened from a job details page.">Job</translation>
366367
</translationbundle>

i18n/messages-ja.xtb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,4 +363,5 @@
363363
<translation id="8808405168042160441" key="MSG_RC_LIST_EDIT_POD_COUNT_ACTION" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Action 'Edit Pod Count' on the drop down menu for a single replication controller (replication controller list page).">Scale</translation>
364364
<translation id="1811662550159188281" key="MSG_POD_LIST_CPU_USAGE_LABEL" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Label which appears as a column label in the table of pods">CPU (cores)</translation>
365365
<translation id="9149343004693743620" key="MSG_POD_LIST_MEMORY_USAGE_LABEL" source="/usr/local/google/home/bryk/src/github.com/dashboard/.tmp/serve/app-dev.js" desc="Label which appears as a column label in the table of pods">Memory (bytes)</translation>
366+
<translation id="2278267472990776370" key="MSG_JOB_DETAIL_JOB_LABEL" source="/home/floreks/Projects/dashboard/.tmp/serve/app-dev.js" desc="Label 'Job' which appears at the top of the dialog, opened from a job details page.">Job</translation>
366367
</translationbundle>

src/app/backend/resource/common/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ var kindToAPIMapping = map[string]struct {
129129
ResourceKindReplicationController: {"replicationcontrollers", ClientTypeDefault},
130130
ResourceKindDeployment: {"deployments", ClientTypeExtensionClient},
131131
ResourceKindReplicaSet: {"replicasets", ClientTypeExtensionClient},
132-
ResourceKindDaemonSet: {"daemonsets", ClientTypeDefault},
132+
ResourceKindDaemonSet: {"daemonsets", ClientTypeExtensionClient},
133133
ResourceKindPetSet: {"petsets", ClientTypeAppsClient},
134134
ResourceKindJob: {"jobs", ClientTypeBatchClient},
135135
ResourceKindNode: {"nodes", ClientTypeDefault},
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
<kd-actionbar-detail-buttons
18+
resource-kind-name="{{::$ctrl.i18n.MSG_JOB_DETAIL_JOB_LABEL}}"
19+
type-meta="$ctrl.details.typeMeta"
20+
object-meta="$ctrl.details.objectMeta">
21+
</kd-actionbar-detail-buttons>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 ActionBarController {
19+
/**
20+
* @param {!backendApi.JobDetail} jobDetail
21+
* @ngInject
22+
*/
23+
constructor(jobDetail) {
24+
/** @export {!backendApi.JobDetail} */
25+
this.details = jobDetail;
26+
27+
/** @export */
28+
this.i18n = i18n;
29+
}
30+
}
31+
32+
const i18n = {
33+
/** @export {string} @desc Label 'Job' which appears at the top of the
34+
dialog, opened from a job details page. */
35+
MSG_JOB_DETAIL_JOB_LABEL: goog.getMsg('Job'),
36+
};

src/app/frontend/jobdetail/jobdetail_stateconfig.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {actionbarViewName, stateName as chromeStateName} from 'chrome/chrome_sta
1616
import {breadcrumbsConfig} from 'common/components/breadcrumbs/breadcrumbs_service';
1717
import {appendDetailParamsToUrl} from 'common/resource/resourcedetail';
1818
import {stateName as jobList, stateUrl} from 'joblist/joblist_state';
19-
19+
import {ActionBarController} from './actionbar_controller';
2020
import {JobDetailController} from './jobdetail_controller';
2121
import {stateName} from './jobdetail_state';
2222

@@ -46,7 +46,11 @@ export default function stateConfig($stateProvider) {
4646
controllerAs: 'ctrl',
4747
templateUrl: 'jobdetail/jobdetail.html',
4848
},
49-
[actionbarViewName]: {},
49+
[actionbarViewName]: {
50+
templateUrl: 'jobdetail/actionbar.html',
51+
controller: ActionBarController,
52+
controllerAs: '$ctrl',
53+
},
5054
},
5155
});
5256
}

src/app/frontend/replicationcontrollerdetail/actionbar_controller.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,7 @@ const i18n = {
5050
/** @export {string} @desc Tooltip for the 'scale' button on the action bar of a replication
5151
controller details view.*/
5252
MSG_RC_DETAIL_ACTION_BAR_EDIT_PODS_LABEL: goog.getMsg('Scale'),
53+
/** @export {string} @desc Label 'Replication Controller' which appears at the top of the
54+
edit dialog, opened from a replication controller details page. */
55+
MSG_RC_DETAIL_REPLICATION_CONTROLLER_LABEL: goog.getMsg('Replication Controller'),
5356
};

0 commit comments

Comments
 (0)