Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Redux] Refactor user slices to reduce the code #98

Open
carma12 opened this issue May 4, 2023 · 2 comments
Open

[Redux] Refactor user slices to reduce the code #98

carma12 opened this issue May 4, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@carma12
Copy link
Collaborator

carma12 commented May 4, 2023

Currently, there are a lot of variables composing the User data type:

export interface User {
  // identity
  title: string;
  givenname: string;
  sn: string;
  displayname: string;
  initials: string;
  gecos: string;
  userclass: string;
  // account
  uid: string;
  has_password: boolean;
  krbpasswordexpiration: string;
  uidnumber: string;
  gidnumber: string;
  krbprincipalname: string;
  krbprincipalexpiration: string;
  loginshell: string;
  homedirectory: string;
  ipasshpubkey: string[]; // multivalue
  usercertificate: string[]; // multivalue
  ipacertmapdata: string[]; // multivalue
  ipauserauthtype: UserAuthTypes;
  ipatokenradiusconfiglink: string[];
  ipatokenradiususername: string;
  ipaidpconfiglink: string[];
  ipaidpsub: string;
  // pwpolicy
  krbmaxpwdlife: string;
  krbminpwdlife: string;
  krbpwdhistorylength: string;
  krbpwdmindiffchars: string;
  krbpwdminlength: string;
  krbpwdmaxfailure: string;
  krbpwdfailurecountinterval: string;
  krbpwdlockoutduration: string;
  passwordgracelimit: string;
  // krbtpolicy
  krbmaxrenewableage: string;
  krbmaxticketlife: string;
  // contact
  mail: string[]; // multivalue
  telephonenumber: string[]; // multivalue
  pager: string[]; // multivalue
  mobile: string[]; // multivalue
  facsimiletelephonenumber: string[]; // multivalue
  // mailing
  street: string;
  l: string;
  st: string;
  postalcode: string;
  // employee
  ou: string;
  manager: string[]; // multivalue
  departmentnumber: string[]; // multivalue
  employeenumber: string;
  employeetype: string;
  preferredlanguage: string;
  // misc
  carlicense: string[]; // multivalue
  // smb_attributes
  ipantlogonscript: string;
  ipantprofilepath: string;
  ipanthomedirectory: string;
  ipanthomedirectorydrive: string;
  // 'Member of' data
  memberof_group: string[]; // multivalue
  // 'Managed by' data
  mepmanagedentry: string[];
  // other
  cn: string;
  krbcanonicalname: string[];
  nsaccountlock: boolean; // status (Enable: False | Disabled: True)
  objectclass: any[];
  ipauniqueid: string;
  ipantsecurityidentifier: string;
  attributelevelrights: Record<string, unknown>; // Generic, any type of object
  has_keytab: boolean;
  preserved: boolean;
  dn: string;
}

This User data type is used in the user Redux slices (activeUsers-slice, stageUsers-slice, preservedUsers-slice) to manage the user data in the following components: ActiveUsers, StageUsers, and PreservedUsers. But this structure is used on each reducer to perform certain operations, replicating the same code over the functions.

RFE: Refactor the user slices to make the code more readable and maintainable.

@carma12 carma12 added the enhancement New feature or request label May 4, 2023
Copy link

This issue has not received any attention in 120 days.

@github-actions github-actions bot added the stale This PR/issue is stale and will be closed label Dec 11, 2023
@carma12 carma12 removed the stale This PR/issue is stale and will be closed label Dec 11, 2023
Copy link

This issue has not received any attention in 365 days.

@github-actions github-actions bot added the stale This PR/issue is stale and will be closed label Dec 11, 2024
@carma12 carma12 removed the stale This PR/issue is stale and will be closed label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant