How to use the @esri/solution-common.findTemplateInList 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
itemInfo => {
            const placeholder = common.findTemplateInList(
              existingTemplates,
              itemId
            );
            let itemType = placeholder!.type;
            if (!itemType) {
              // Groups have this defined when fetched above
              itemType = itemInfo.type;
              placeholder!.type = itemType;
            }
            itemInfo.type = itemType; // Groups don't have this property

            const itemHandler = moduleMap[itemType];
            if (!itemHandler) {
              placeholder!.properties["partial"] = true;
              _replaceTemplate(existingTemplates, itemId, placeholder!);
              console.log(
github Esri / solution.js / packages / creator / src / createItemTemplate.ts View on Github external
itemTemplate.dependencies.forEach(dependentId => {
                        if (
                          !common.findTemplateInList(
                            existingTemplates,
                            dependentId
                          )
                        ) {
                          dependentDfds.push(
                            createItemTemplate(
                              solutionItemId,
                              dependentId,
                              templateDictionary,
                              authentication,
                              existingTemplates
                            )
                          );
                        }
                      });
                      // tslint:disable-next-line: no-floating-promises
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")
github Esri / solution.js / packages / deployer / src / deploySolutionItems.ts View on Github external
cloneOrderChecklist.forEach(id => {
      // Get the item's template out of the list of templates
      const template = common.findTemplateInList(templates, id);
      if (!template) {
        reject(common.fail());
      }

      awaitAllItems.push(
        _createItemFromTemplateWhenReady(
          template!,
          common.generateStorageFilePaths(
            portalSharingUrl,
            storageItemId,
            template!.resources || []
          ),
          storageAuthentication,
          templateDictionary,
          destinationAuthentication,
          progressTickCallback