Skip to content

Commit

Permalink
fix(ui): move current carrier info into form
Browse files Browse the repository at this point in the history
  • Loading branch information
zack9433 committed Jun 23, 2017
1 parent b372a32 commit c672c8e
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 25 deletions.
4 changes: 4 additions & 0 deletions src/component/form/form.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<md-zippy ng-if="$ctrl.carrier.switchable" title="{{'CELLULAR_FORM_SWITCH_CARRIER' | translate}}">
<div layout="column" layout-padding novalidate>
<p translate="CELLULAR_FORM_SWITCH_CARRIER_MSG"></p>
<p>
<span translate="CELLULAR_FORM_CURRENT_CARRIER"></span>
<span>{{': ' + $ctrl.carrier.current.carrier}}</span>
</p>
<md-input-container class="md-block">
<label translate="CELLULAR_FORM_CARRIER"></label>
<md-select ng-model="$ctrl.currentCarrier" aria-label="select carrier">
Expand Down
2 changes: 0 additions & 2 deletions src/component/info/container.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import CellularInfoContainerController from './container.controller';

const CellularInfoContainerComponent = {
template: `<sanji-cellular-info data="$ctrl.data"
carrier="$ctrl.carrier"
on-fetch-carrier="$ctrl.onFetchCarrier($event)"
tab-index="$ctrl.sanjiWindowMgr.tabIndex"></sanji-cellular-info>`,
controller: CellularInfoContainerController
};
Expand Down
4 changes: 0 additions & 4 deletions src/component/info/container.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ class CellularInfoContainerController {
};
}

onFetchCarrier(event) {
return this.getCellularCarrier(event.id);
}

onRefresh(event, args) {
if (args.id === WINDOW_ID) {
this.sanjiWindowMgr.promise = this.getCellulars({ force: true });
Expand Down
2 changes: 0 additions & 2 deletions src/component/info/info.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import CellularInfoController from './info.controller';
const CellularInfoComponent = {
bindings: {
tabs: '<data',
carrier: '<',
onFetchCarrier: '&',
tabIndex: '='
},
templateUrl: 'sanji-cellular-info.tpl.html',
Expand Down
11 changes: 0 additions & 11 deletions src/component/info/info.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ class CellularInfoController {
constructor(...injects) {
CellularInfoController.$inject.forEach((item, index) => (this[item] = injects[index]));
}

$onInit() {
this.currentCarrier = {};
this.onFetchCarrier({
$event: {
id: (this.tabIndex || 0) + 1
}
}).then(carrier => {
this.currentCarrier = carrier.current;
});
}
}
CellularInfoController.$inject = $inject;
export default CellularInfoController;
4 changes: 0 additions & 4 deletions src/component/info/info.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
<p class="md-body-2" translate="CELLULAR_INFO_OPERATOR"></p>
<span ng-bind="tab.content.operatorName"></span>
</md-list-item>
<md-list-item ng-if="$ctrl.carrier.switchable">
<p class="md-body-2" translate="CELLULAR_FORM_CARRIER"></p>
<span ng-bind="$ctrl.currentCarrier.carrier"></span>
</md-list-item>
<div ng-if="tab.content.pdpContext.static">
<md-list-item>
<p class="md-body-2" translate="CELLULAR_INFO_PRIMARY_APN"></p>
Expand Down
3 changes: 2 additions & 1 deletion src/component/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"CELLULAR_FORM_SWITCH_CARRIER": "Switch Carrier",
"CELLULAR_FORM_CARRIER": "Carrier",
"CELLULAR_FORM_APPLY": "Apply",
"CELLULAR_FORM_SWITCH_CARRIER_MSG": "This operation will take several minutes and cellular module may not be available during operation, please ensure stable power supply."
"CELLULAR_FORM_SWITCH_CARRIER_MSG": "This operation will take several minutes and cellular module may not be available during operation, please ensure stable power supply.",
"CELLULAR_FORM_CURRENT_CARRIER": "Current Carrier"
}
3 changes: 2 additions & 1 deletion src/component/lang/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"CELLULAR_FORM_SWITCH_CARRIER": "切換電信商",
"CELLULAR_FORM_CARRIER": "電信商",
"CELLULAR_FORM_APPLY": "套用",
"CELLULAR_FORM_SWITCH_CARRIER_MSG": "這個動作需要數分鐘,過程中模組可能無法被正常存取,請保持電源的穩定供應."
"CELLULAR_FORM_SWITCH_CARRIER_MSG": "這個動作需要數分鐘,過程中模組可能無法被正常存取,請保持電源的穩定供應.",
"CELLULAR_FORM_CURRENT_CARRIER": "目前的電信商"
}

0 comments on commit c672c8e

Please sign in to comment.