private function handleLegendCollapsed(array $fieldSets)
    {
        $editInformation = $GLOBALS['container']['dc-general.edit-information'];
        if (!$editInformation->hasAnyModelError()) {
            return $fieldSets;
        }

        foreach (\array_keys($fieldSets) as $index) {
            if ($editInformation->getModelError($fieldSets[$index]['model'])) {
                continue;
            }

            $fieldSets[$index]['class'] .= ' collapsed';
        }

        return $fieldSets;
    }