Skip to content

Commit

Permalink
Issue 261 - simplify hosts utils and slices
Browse files Browse the repository at this point in the history
fixes: freeipa#261

Signed-off-by: Mark Reynolds <mreynolds@redhat.com>
  • Loading branch information
mreynolds389 authored and miskopo committed Sep 23, 2024
1 parent df25bdb commit 91daa78
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions src/store/Identity/hosts-slice.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import type { RootState } from "src/store/store";
import type { RootState } from "../../store/store";
// Data types
import { Host } from "../../utils/datatypes/globalDataTypes";

Expand All @@ -21,39 +21,7 @@ const hostsSlice = createSlice({
},
addHost: (state, action: PayloadAction<Host>) => {
const newHost = action.payload;
state.hostsList.push({
dn: newHost.dn,
fqdn: newHost.fqdn,
dnsZone: newHost.dnsZone,
userclass: newHost.userclass,
ip_address: newHost.ip_address,
description: newHost.description,
enrolledby: newHost.enrolledby,
force: newHost.force,
has_keytab: newHost.has_keytab,
has_password: newHost.has_password,
krbcanonicalname: newHost.krbcanonicalname,
krbprincipalname: newHost.krbprincipalname,
managedby_host: newHost.managedby_host,
memberof_hostgroup: newHost.memberof_hostgroup,
sshpublickey: newHost.sshpublickey,
macaddress: newHost.macaddress,
sshpubkeyfp: newHost.sshpubkeyfp,
nshostlocation: newHost.nshostlocation,
l: newHost.l,
attributelevelrights: newHost.attributelevelrights,
krbpwdpolicyreference: newHost.krbpwdpolicyreference,
managing_host: newHost.managing_host,
serverhostname: newHost.serverhostname,
ipakrbrequirespreauth: newHost.ipakrbrequirespreauth,
ipakrbokasdelegate: newHost.ipakrbokasdelegate,
ipakrboktoauthasdelegate: newHost.ipakrboktoauthasdelegate,
nsosversion: newHost.nsosversion,
nshardwareplatform: newHost.nshardwareplatform,
krbprincipalauthind: newHost.krbprincipalauthind,
usercertificate: newHost.usercertificate,
});
// Update json file
state.hostsList.push({ ...newHost });
},
removeHost: (state, action: PayloadAction<string>) => {
const hostId = action.payload;
Expand Down

0 comments on commit 91daa78

Please sign in to comment.