How to use the @esri/solution-common.setProp 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 / simple-types / src / webmappingapplication.ts View on Github external
templatizedUrl.indexOf("/", iSep + 2),
          templatizedUrl.lastIndexOf("=") + 1
        ) +
        itemTemplate.item.id; // templatized id

      portalUrl = templatizedUrl.replace(
        templatizedUrl.substring(templatizedUrl.indexOf("/", iSep + 2)),
        ""
      );
    }

    // Extract dependencies
    itemTemplate.dependencies = _extractDependencies(itemTemplate);

    // Set the folder
    common.setProp(itemTemplate, "data.folderId", "{{folderId}}");
    // Set the map or group after we've extracted them as dependencies
    _templatizeIdPaths(itemTemplate, [
      "data.map.itemId",
      "data.map.appProxy.mapItemId",
      "data.appItemId",
      "data.values.webmap",
      "data.values.group"
    ]);

    setValues(
      itemTemplate,
      [
        "data.logo",
        "data.map.portalUrl",
        "data.portalUrl",
        "data.httpProxy.url"
github Esri / solution.js / packages / simple-types / src / webmap.ts View on Github external
obj.layerDefinition,
          ds.basePath,
          fieldNames
        );

        common._templatizeDefinitionExpression(
          obj.layerDefinition,
          ds.basePath,
          fieldNames
        );
      }

      // used for applicationProperties search layers
      const fieldName: any = common.getProp(obj, "field.name");
      if (fieldName) {
        common.setProp(
          obj,
          "field.name",
          common._templatizeFieldName(fieldName, obj, ds.itemId, ds.basePath)
        );
      }
    }
  });
github Esri / solution.js / packages / simple-types / src / webmappingapplication.ts View on Github external
];
  paths.forEach(path => {
    const widgets = common.getProp(solutionTemplate, path);
    if (widgets) {
      common.setProp(
        solutionTemplate,
        path,
        _templatizeObjectArray(widgets, datasourceInfos)
      );
    }
  });

  // handle values common for web app templates
  const values: any = common.getProp(solutionTemplate, "data.values");
  if (values) {
    common.setProp(
      solutionTemplate,
      "data.values",
      _templatizeObject(values, datasourceInfos)
    );
  }

  return solutionTemplate;
}
github Esri / solution.js / packages / simple-types / src / webmappingapplication.ts View on Github external
"data.values.webmap",
      "data.values.group"
    ]);

    setValues(
      itemTemplate,
      [
        "data.logo",
        "data.map.portalUrl",
        "data.portalUrl",
        "data.httpProxy.url"
      ],
      common.PLACEHOLDER_SERVER_NAME
    );

    common.setProp(
      itemTemplate,
      "data.geometryService",
      common.PLACEHOLDER_GEOMETRY_SERVER_NAME
    );

    templatizeDatasources(itemTemplate, authentication, portalUrl).then(
      () => {
        templatizeWidgets(
          itemTemplate,
          authentication,
          portalUrl,
          "data.widgetPool.widgets"
        ).then(
          _itemTemplate => {
            templatizeWidgets(
              _itemTemplate,
github Esri / solution.js / packages / simple-types / src / dashboard.ts View on Github external
export function _templatize(
  itemTemplate: common.IItemTemplate,
  path: string,
  datasourceInfos: common.IDatasourceInfo[]
) {
  const obj: any[] = common.getProp(itemTemplate, path);
  if (obj) {
    common.setProp(
      itemTemplate,
      path,
      _templatizeByDatasource(obj, datasourceInfos)
    );
  }
}
github Esri / solution.js / packages / simple-types / src / webmappingapplication.ts View on Github external
response => {
          common.setProp(itemTemplate, widgetPath, JSON.parse(response));
          resolve(itemTemplate);
        },
        e => reject(common.fail(e))
github Esri / solution.js / packages / simple-types / src / webmappingapplication.ts View on Github external
paths.forEach(path => {
    const url: string = common.getProp(itemTemplate, path);
    if (url) {
      const subString: string = url.substring(
        url.indexOf("/", url.indexOf("//") + 2)
      );
      common.setProp(
        itemTemplate,
        path,
        subString !== url ? base + subString : base
      );
    }
  });
}
github Esri / solution.js / packages / simple-types / src / webmappingapplication.ts View on Github external
paths.forEach(path => {
    const id: any = common.getProp(itemTemplate, path);
    common.setProp(
      itemTemplate,
      path,
      common.templatizeTerm(id, id, ".itemId")
    );
  });
}
github Esri / solution.js / packages / simple-types / src / webmappingapplication.ts View on Github external
response => {
          common.setProp(itemTemplate, widgetPath, JSON.parse(response));
          resolve(itemTemplate);
        },
        e => reject(common.fail(e))