How to use the @esri/solution-common.createPlaceholderTemplate 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 / creator / src / createItemTemplate.ts View on Github external
() => {
            _replaceTemplate(
              existingTemplates,
              itemId,
              common.createPlaceholderTemplate(itemId, "unknown")
            );
            console.log(
              "!----- " +
                itemId +
                " ----- FAILED Id not found or item is not accessible -----"
            ); // ???
            resolve(true);
          }
        );
github Esri / solution.js / packages / creator / src / createItemTemplate.ts View on Github external
.catch(() => {
          // If item query fails, try fetching item as a group
          // Change its placeholder from an empty type to the Group type so that we can later distinguish
          // between items and groups (the base info for a group doesn't include a type property)
          _replaceTemplate(
            existingTemplates,
            itemId,
            common.createPlaceholderTemplate(itemId, "Group")
          );
          return common.getGroup(itemId, authentication);
        })
        .then(
github Esri / solution.js / packages / creator / src / createItemTemplate.ts View on Github external
return new Promise(resolve => {
    // Check if item and its dependents are already in list or are queued
    if (common.findTemplateInList(existingTemplates, itemId)) {
      resolve(true);
    } else {
      // Add the id as a placeholder to show that it is being fetched
      existingTemplates.push(common.createPlaceholderTemplate(itemId));

      // Fetch the item
      common
        .getItem(itemId, authentication)
        .catch(() => {
          // If item query fails, try fetching item as a group
          // Change its placeholder from an empty type to the Group type so that we can later distinguish
          // between items and groups (the base info for a group doesn't include a type property)
          _replaceTemplate(
            existingTemplates,
            itemId,
            common.createPlaceholderTemplate(itemId, "Group")
          );
          return common.getGroup(itemId, authentication);
        })
        .then(