dm-code/dm-web-assets/src/main/controllers/ObjectStatusBodyController.js
/**
         * Updates existing rows' statuses based on the current
         * businessObjectDataAvailabilities.
         */
Updates existing rows' statuses based on the current
businessObjectDataAvailabilities.
Updates existing rows ' statuses based on the current businessObjectDataAvailabilities .
function updateRows()
        {
            _(vm.rows).each(function(row)
            {
                row.statuses.splice(0); 
                _(vm.partitionValues).each(function(partitionValue)
                {
                    row.statuses.push({
                        id : partitionValue,
                        isNotExpected : !expectedPartitionValueLookup[partitionValue]
                    });
                });
            });
            _(vm.businessObjectDataAvailabilities).each(function(businessObjectDataAvailability)
            {
                var availableStatuses = {};
                _(businessObjectDataAvailability.availableStatuses).each(function(availableStatus)
                {
                    availableStatuses[availableStatus.partitionValue] = true;
                });
                var row = rowLookup[getRowId(businessObjectDataAvailability)];
                if (row && !row.isError)
                {
                    row.isError = businessObjectDataAvailability.isError === true;
                    var statusLookup = {};
                    _(row.statuses).each(function(status)
                    {
                        statusLookup[status.id] = status;
                    });
                    _(vm.partitionValues).each(function(partitionValue)
                    {
                        var imageUrl = null;
                        if (availableStatuses[partitionValue])
                        {
                            imageUrl = vm.properties['opsStatus.status.image.available'];
                        }
                        statusLookup[partitionValue].imageUrl = imageUrl;
                    });
                }
            });
        }
function updateRows ( ) { _ ( vm . rows ) . each ( function ( row ) { row . statuses . splice ( 0 ) ; _ ( vm . partitionValues ) . each ( function ( partitionValue ) { row . statuses . push ( { id : partitionValue , isNotExpected : ! expectedPartitionValueLookup [ partitionValue ] } ) ; } ) ; } ) ; _ ( vm . businessObjectDataAvailabilities ) . each ( function ( businessObjectDataAvailability ) { var availableStatuses = { } ; _ ( businessObjectDataAvailability . availableStatuses ) . each ( function ( availableStatus ) { availableStatuses [ availableStatus . partitionValue ] = true ; } ) ; var row = rowLookup [ getRowId ( businessObjectDataAvailability ) ] ; if ( row && ! row . isError ) { row . isError = businessObjectDataAvailability . isError === true ; var statusLookup = { } ; _ ( row . statuses ) . each ( function ( status ) { statusLookup [ status . id ] = status ; } ) ; _ ( vm . partitionValues ) . each ( function ( partitionValue ) { var imageUrl = null ; if ( availableStatuses [ partitionValue ] ) { imageUrl = vm . properties [ 'opsStatus.status.image.available' ] ; } statusLookup [ partitionValue ] . imageUrl = imageUrl ; } ) ; } } ) ; }
Updates existing rows' statuses based on the current
 businessObjectDataAvailabilities.
Updates existing rows ' statuses based on the current businessObjectDataAvailabilities .
/*
             * For each row, populate the list of statuses based on the current
             * partition values and expected partition values.
             * 
             * This is done separately from the availabilities loop because the
             * list of availabilities are expected to be populated later. We
             * want to pre-populate the statuses with as much information we
             * have at this point of execution which does not depend on
             * availabilities.
             */ // reset statuses /*
                     * Add status without any image url. ID is the partition
                     * value.
                     */ /*
             * For each availability, find the row which contains the format,
             * and update the statuses.
             */ /*
                 * Create a lookup of availability statuses by the partition
                 * value.
                 */ // Find the row which contains the availability's format // If row exists /*
                     * Create a lookup of statuses by its ID.
                     */ /*
                     * For each partition value currently in the context.
                     */ /*
                         * Check whether an available status exists for the
                         * partition value, and set an image if exists.
                         */ // Set the image of the status