hunk.code_window:       let details = axiosError.response?.data.details;
         const { creds = {} } = options;
         // If no credentials were provided alter error from git to indicate repository is not found or is private
         if (
           !(creds.username && creds.password) &&
           details ===
             'authentication failed, please ensure that the git credentials are correct'
         ) {
           details =
  
hunk.labels: keep keep keep keep keep replace keep keep keep keep
hunk.after_edit:         (!(creds.username && creds.password) || !creds.gitCredentialId) &&
  
hunk.file_path: app/react/portainer/gitops/queries/useCheckRepo.ts
hunk.type: replace
file: import _ from 'lodash-es';
  
  import { KubernetesPortainerConfigMapAccessKey } from 'Kubernetes/models/config-map/models';
  import { UserAccessViewModel, TeamAccessViewModel } from 'Portainer/models/access';
  
  class KubernetesConfigMapHelper {
    static parseJSONData(configMap) {
      _.forIn(configMap.Data, (value, key) => {
        try {
          configMap.Data[key] = JSON.parse(value);
        } catch (err) {
          configMap.Data[key] = value;
        }
      });
      return configMap;
    }
  
    static modifiyNamespaceAccesses(configMap, namespace, accesses) {
      configMap.Data[KubernetesPortainerConfigMapAccessKey][namespace] = {
        UserAccessPolicies: {},
        TeamAccessPolicies: {},
      };
      _.forEach(accesses, (item) => {
        if (item instanceof UserAccessViewModel) {
          configMap.Data[KubernetesPortainerConfigMapAccessKey][namespace].UserAccessPolicies[item.Id] = { RoleId: 0 };
        } else if (item instanceof TeamAccessViewModel) {
          configMap.Data[KubernetesPortainerConfigMapAccessKey][namespace].TeamAccessPolicies[item.Id] = { RoleId: 0 };
        }
      });
      _.forIn(configMap.Data, (value, key) => {
        configMap.Data[key] = JSON.stringify(value);
      });
      return configMap;
    }
  }
  export default KubernetesConfigMapHelper;
  