Closed Bug 1116748 Opened 9 years ago Closed 6 years ago

[APN][FFOS7715 v2.1] Add a new APN,It can be saved successfully when this new APN content is NULL

Categories

(Firefox OS Graveyard :: Gaia::Settings, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: ffos_st, Unassigned)

References

Details

(Whiteboard: sprd388897)

Description:
Add a new APN,It can be saved successfully when this new APN content is NULL

Device:
SPRD 7715ga

Build Identifier:
20141231182455

Steps to Reproduce:
1)Enter the settings,then enter the Cellular&Data
2)Select a SIM card,enter the SIM Settings,click to enter APNsettings
3)Enter any of settings,for example,Data settings
4)Click Add New APN,click OK to save this new APN
5)Enter any of settings(message setting or IMS settings...),this can be saved successfully too.

Actual Result: 
this new APN saved succcessfully,dispaly a empty APN

Expected Result:
this should  pop up the hint: some field can not be NULL

Repro frequency:
10/10,100%

best
Whiteboard: sprd388897
Summary: [FFOS7715 v2.1] Add a new APN,It can be saved successfully when this new APN content is NULL → [APN][FFOS7715 v2.1] Add a new APN,It can be saved successfully when this new APN content is NULL
expected result:
                apn field can not be null
solution:
1> let all the apn field value stored in the newApnSetting variable

    _exportApnSetting: function aes_exportApnSetting(inputElements) {
      var newApnSetting = {};
      APN_PROPERTIES.forEach(function(name) {
        var inputElement = inputElements[name];
             //  /*&& inputElement.value*/ ffos_st add
            //let all the apn field value stored in the newApnSetting
        if (inputElement && !inputElement.hidden /*&& inputElement.value*/) {  
          newApnSetting[name.toLowerCase()] = this._convertValue(
            inputElement.value, VALUE_CONVERTERS.TO_DATA[name]);
        }
      }, this);
      return newApnSetting;
    },

2>if newApnSetting.apn != '',we will add this APN.
  if newApnSetting.apn == '',this can not add APN and pop up a toast

 _commitNew: function aes_commitNew() {
      var promises = [];
      var newApnSetting = this._exportApnSetting(this._inputElements);
      if(newApnSetting.apn) {  //if(newApnSetting.apn) ffos_st add
          console.log("mapei apn:" + newApnSetting.apn);
          newApnSetting.types.slice().forEach(function (type) {
              newApnSetting.types = [type];
              console.log("mapei type:" + type);
              console.log("mapei newApnSetting.types:" + newApnSetting.types);
              promises.push(
                  ApnSettingsManager.addApn(this._serviceId, newApnSetting));
          }, this);
          console.log("mapei add apn");
          return Promise.all(promises);
      }else{  // if newApnSetting.apn == '',this can not add apn and pop up a toast

              var toast = {
                  messageL10nId: 'apnSettings-not-null',
                  latency: 3000,
                  useTransition: true
              };
              Toaster.showToast(toast);
      }
    },

thanks~
Blocks: 1123554
blocking-b2g: 2.6? → ---
ux-b2g: - → ---
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.