All files / web/bundles/pimui/js/form registry.js

100% Statements 10/10
100% Branches 0/0
100% Functions 7/7
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24    1184x     1184x 103093x 149659418x       1184x 110933x 77017112x       1184x            
'use strict';
 
define(
    ['jquery', 'pim/form-config-provider'],
    function ($, ConfigProvider) {
        const getFormExtensions = (formMeta) => {
            return ConfigProvider.getExtensionMap().then((extensionMap) => {
                return extensionMap.filter(extension => extension.parent === formMeta.code);
            });
        };
 
        const getFormMeta = (formName) => {
            return ConfigProvider.getExtensionMap().then((extensionMap) => {
                return extensionMap.find(extension => extension.code === formName);
            });
        };
 
        return {
            getFormExtensions,
            getFormMeta
        };
    }
);