How to use the @esri/solution-common.cloneObject function in @esri/solution-common

To help you get started, we’ve selected a few @esri/solution-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Esri / solution.js / packages / feature-layer / src / feature-layer.ts View on Github external
return new Promise((resolve, reject) => {
    const requestOptions: common.IUserRequestOptions = {
      authentication: destinationAuthentication
    };

    let newItemTemplate: common.IItemTemplate = common.cloneObject(template);

    // cache the popup info to be added later
    const popupInfos: common.IPopupInfos = common.cachePopupInfos(
      newItemTemplate.data
    );

    // Create the item, then update its URL with its new id
    common
      .createFeatureService(
        newItemTemplate,
        requestOptions.authentication,
        templateDictionary
      )
      .then(
        createResponse => {
          progressTickCallback();
github Esri / solution.js / packages / simple-types / src / simple-types.ts View on Github external
return new Promise((resolve, reject) => {
    // Replace the templatized symbols in a copy of the template
    let newItemTemplate: common.IItemTemplate = common.cloneObject(template);
    newItemTemplate = common.replaceInTemplate(
      newItemTemplate,
      templateDictionary
    );

    // Create the item, then update its URL with its new id

    // some fieldnames are used as keys for objects
    // when we templatize field references for web applications we first stringify the components of the
    // web application that could contain field references and then serach for them with a regular expression.
    // We also need to stringify the web application when de-templatizing so it will find all of these occurrences as well.
    if (template.type === "Web Mapping Application" && template.data) {
      newItemTemplate = JSON.parse(
        common.replaceInTemplate(
          JSON.stringify(newItemTemplate),
          templateDictionary
github Esri / solution.js / packages / group / src / group.ts View on Github external
return new Promise((resolve, reject) => {
    // Replace the templatized symbols in a copy of the template
    let newItemTemplate: common.IItemTemplate = common.cloneObject(template);
    newItemTemplate = common.replaceInTemplate(
      newItemTemplate,
      templateDictionary
    );

    // handle group
    const title: string = common.getUniqueTitle(
      newItemTemplate.item.title,
      templateDictionary,
      "user.groups"
    );
    // Set the item title with a valid name for the ORG
    newItemTemplate.item.title = title;
    newItemTemplate.item.access = "private";
    common.createGroup(newItemTemplate.item, destinationAuthentication).then(
      createResponse => {