Skip to content

Commit

Permalink
♻️ Update components after changes in admin UI
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm committed Jun 4, 2024
1 parent 62a99f9 commit 433eca1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions frontend/src/pages/destructionlist/Assignees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Errors,
Form,
FormField,
ObjectData,
LabeledAttributeData,
Outline,
SerializedFormData,
} from "@maykin-ui/admin-ui";
Expand Down Expand Up @@ -76,7 +76,7 @@ export function AssigneesForm({
export function AssigneesEditable({ assignees }: AssigneesEditableProps) {
const [isEditing, setIsEditing] = useState(false);

const assigneesData: ObjectData = {};
const assigneesData: LabeledAttributeData = {};
assignees.map((assignee) => {
assigneesData[assignee.user.username] = {
label:
Expand All @@ -87,7 +87,7 @@ export function AssigneesEditable({ assignees }: AssigneesEditableProps) {
};
});

const assigneesDisplay = <AttributeTable object={assigneesData} />;
const assigneesDisplay = <AttributeTable labeledObject={assigneesData} />;

const assigneesForm = (
<AssigneesForm
Expand Down Expand Up @@ -115,7 +115,7 @@ export function AssigneesEditable({ assignees }: AssigneesEditableProps) {

return (
<AttributeTable
object={{
labeledObject={{
assignees: {
label: label,
value: isEditing ? assigneesForm : assigneesDisplay,
Expand Down
10 changes: 7 additions & 3 deletions frontend/src/pages/destructionlist/DestructionListDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Column,
Grid,
H1,
ObjectData,
LabeledAttributeData,
P,
} from "@maykin-ui/admin-ui";
import { ActionFunctionArgs } from "@remix-run/router/utils";
Expand All @@ -28,7 +28,9 @@ import {
} from "./types";
import { formatUser } from "./utils";

function getDisplayableList(destructionList: DestructionListData): ObjectData {
function getDisplayableList(
destructionList: DestructionListData,
): LabeledAttributeData {
const createdOn = new Date(destructionList.created);
const formattedCreatedOn = createdOn.toLocaleString("nl-nl", {
year: "numeric",
Expand Down Expand Up @@ -74,7 +76,9 @@ export function DestructionListDetailPage() {
<P>
<Grid>
<Column span={3}>
<AttributeTable object={getDisplayableList(destructionList)} />
<AttributeTable
labeledObject={getDisplayableList(destructionList)}
/>
</Column>
<Column span={9}>
<AssigneesEditable assignees={destructionList.assignees} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function DestructionListItems({
},
]}
onSelect={onSelect}
customComparisonFunction={(item1, item2) => item1.uuid === item2.uuid}
equalityChecker={(item1, item2) => item1.uuid === item2.uuid}
paginatorProps={{
count: allZaken.count,
pageSize: 100,
Expand Down

0 comments on commit 433eca1

Please sign in to comment.