Exemple #1
0
      self.save = function () {
        var body = {};

        _.forOwn(mapping, function (fieldMapping, fieldName) {
          if (self[fieldName] != null) {
            body[fieldName] = (fieldMapping._serialize)
              ? fieldMapping._serialize(self[fieldName])
              : self[fieldName];
          }
        });

        if (self.searchSource) {
          body.kibanaSavedObjectMeta = {
            searchSourceJSON: JSON.stringify(_.omit(self.searchSource.toJSON(), ['sort', 'size']))
          };
        }


        // Slugify the object id
        self.id = slugifyId(self.id);

        // ensure that the docSource has the current self.id
        docSource.id(self.id);

        // index the document
        return self.saveSource(body);
      };
      self.save = function () {

        var body = self.serialize();

        // Slugify the object id
        self.id = slugifyId(self.id);

        // ensure that the docSource has the current self.id
        docSource.id(self.id);

        // index the document
        return self.saveSource(body);
      };
 dashboardGroup.save().then(function (groupId) {
   notify.info('Dashboard Group ' + dashboardGroup.title + ' was successfuly saved');
   $rootScope.$emit('kibi:dashboardgroup:changed', groupId);
   kbnUrl.change('settings/dashboardgroups/' + slugifyId(dashboardGroup.id));
 });
 savedDashboardGroupClone.save().then(function (resp) {
   notify.info('Dashboard Group ' + savedDashboardGroupClone.title + ' was successfuly cloned');
   $rootScope.$emit('kibi:dashboardgroup:changed', resp);
   kbnUrl.change('settings/dashboardgroups/' + slugifyId(savedDashboardGroupClone.id));
 });
Exemple #5
0
 it('should do nothing if the id is undefined', function () {
   expect(slugifyId(undefined)).to.be(undefined);
 });
Exemple #6
0
 it(msg, function () {
   var results = slugifyId(fixture[0]);
   expect(results).to.be(fixture[1]);
 });