Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 0 additions & 68 deletions Keas.Mvc/ClientApp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Keas.Mvc/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
"@tanstack/react-table": "9.3.1",
"date-fns": "2.14.0",
"isomorphic-fetch": "2.2.1",
"jquery": "3.5.1",
"log4javascript": "1.4.15",
"react": "18.3.1",
"react-calendar": "6.0.1",
"react-date-picker": "12.1.0",
Expand All @@ -29,7 +27,6 @@
"react-router-dom": "5.3.4",
"react-toastify": "11.1.0",
"reactstrap": "9.2.3",
"stacktrace-js": "2.0.2",
"yup": "0.29.1"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { IdentificationIcon } from '@heroicons/react/24/solid';
import { PlusIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { useContext, useEffect, useState } from 'react';
import { useHistory, useParams } from 'react-router';
import { toast } from 'react-toastify';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { Modal, ModalBody, ModalHeading } from '../Shared/AppModal';
import * as React from 'react';
import { Button } from 'reactstrap';
import { IAccess, IAccessAssignment } from '../../models/Access';
import AccessEditValues from './AccessEditValues';
import AccessAssignmentValues from './AccessAssignmentValues';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AssetActions, AssetSummary } from '../Shared/AssetSummary';
import { PencilSquareIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { Button } from 'reactstrap';
import { IAccessAssignment } from '../../models/Access';
import { DateUtil } from '../../util/dates';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { within } from '@testing-library/react';
import * as React from 'react';
import { render, cleanup, act } from '@testing-library/react';
import { MemoryRouter } from 'react-router';
import { Context } from '../../Context';
Expand Down Expand Up @@ -37,7 +36,7 @@ afterEach(() => {

describe('Access Container', () => {
const contextObject = {
fetch: (url: any, index: any) => {},
fetch: (_url: any, _index: any) => {},
permissions: ['DepartmentalAdmin', 'Admin'],
team: { id: 1, name: 'Team', slug: 'team' },
tags: []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { IdentificationIcon } from '@heroicons/react/24/solid';
import { PlusIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { useContext, useEffect, useState } from 'react';
import { useHistory, useParams } from 'react-router';
import { toast } from 'react-toastify';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
PencilSquareIcon,
TrashIcon
} from '@heroicons/react/24/outline';
import * as React from 'react';
import { useContext, useEffect, useState } from 'react';
import { useHistory } from 'react-router-dom';
import { toast } from 'react-toastify';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AssetSummary } from '../Shared/AssetSummary';
import { LinkIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { Button, FormFeedback, FormGroup, Input, Label } from 'reactstrap';
import { IAccess } from '../../models/Access';
import { IValidationError } from '../../models/Shared';
Expand Down
1 change: 0 additions & 1 deletion Keas.Mvc/ClientApp/src/components/Access/AccessList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react';
import { IAccess, IAccessAssignment } from '../../models/Access';
import AccessAssignmentListItem from './AccessListItem';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AssetDetailsLink } from '../Shared/AssetDetailsLink';
import * as React from 'react';
import { IAccess, IAccessAssignment } from '../../models/Access';
import { DateUtil } from '../../util/dates';
import ListActionsDropdown, { IAction } from '../ListActionsDropdown';
Expand Down
3 changes: 1 addition & 2 deletions Keas.Mvc/ClientApp/src/components/Access/AssignAccess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { AssetActions } from '../Shared/AssetSummary';
import { Modal, ModalBody, ModalFooter, ModalHeading } from '../Shared/AppModal';
import { ArrowPathIcon, XMarkIcon } from '@heroicons/react/24/outline';
import { addYears, format, startOfDay } from 'date-fns';
import * as React from 'react';
import { useEffect, useState } from 'react';
import { Button } from 'reactstrap';
import { accessSchema, IAccess, IAccessAssignment } from '../../models/Access';
Expand Down Expand Up @@ -219,7 +218,7 @@ const AssignAccess = (props: IProps) => {
onClick={assignSelected}
disabled={!validState || submitting}
>
Assign {submitting && <ArrowPathIcon data-icon="arrow-path" className='hero-icon size-5 animate-spin' />}
{access?.id ? 'Assign' : 'Save'} {submitting && <ArrowPathIcon data-icon="arrow-path" className='hero-icon size-5 animate-spin' />}
</Button>{' '}
</ModalFooter>
</Modal>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Modal, ModalBody, ModalFooter, ModalHeading } from '../Shared/AppModal';
import { ArrowPathIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { useState } from 'react';
import { Button } from 'reactstrap';
import { IAccess } from '../../models/Access';
Expand Down
1 change: 0 additions & 1 deletion Keas.Mvc/ClientApp/src/components/Access/EditAccess.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Modal, ModalBody, ModalFooter, ModalHeading } from '../Shared/AppModal';
import { ArrowPathIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { useEffect, useState } from 'react';
import { Button } from 'reactstrap';
import { accessSchema, IAccess } from '../../models/Access';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Modal, ModalBody, ModalFooter, ModalHeading } from '../Shared/AppModal';
import { ArrowPathIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { useState } from 'react';
import { Button } from 'reactstrap';
import { IAccess, IAccessAssignment } from '../../models/Access';
Expand Down
3 changes: 1 addition & 2 deletions Keas.Mvc/ClientApp/src/components/Access/SearchAccess.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PlusIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { useContext, useState } from 'react';
import { Highlighter } from '../Shared/SearchCombobox';
import { toast } from 'react-toastify';
Expand Down Expand Up @@ -32,7 +31,7 @@ const SearchAccess = (props: IProps) => {
placeholder='Search for access by name or by serial number'
labelKey='name'
allowNew={false}
renderMenuItemChildren={(option: any, propsData, index) => (
renderMenuItemChildren={(option: any, propsData) => (
<div>
<Highlighter key='name' search={propsData.text}>
{option.name}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { AssetSummary } from '../Shared/AssetSummary';
import { Modal, ModalBody, ModalFooter, ModalHeading } from '../Shared/AppModal';
import { ArrowPathIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { useEffect, useState } from 'react';
import { Button } from 'reactstrap';
import { IAccess, IAccessAssignment, accessSchema } from '../../models/Access';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { Context } from '../../Context';
import { AppContext } from '../../models/Shared';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ModalBody, Modal, ModalFooter, ModalHeading } from '../Shared/AppModal';
import * as React from 'react';
import { useEffect, useContext, useState, useId } from 'react';
import { AppContext } from '../../models/Shared';
import { Context } from '../../Context';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { DocumentTextIcon } from '@heroicons/react/24/solid';
import { PlusIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { IPerson } from '../../models/People';
import { PermissionsUtil } from '../../util/permissions';
import { Context } from '../../Context';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react';
import { IDocument } from '../../models/Document';
import { DateUtil } from '../../util/dates';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { AssetActions } from '../Shared/AssetSummary';
import { Modal, ModalBody, ModalFooter, ModalHeading } from '../Shared/AppModal';
import { ArrowPathIcon, XMarkIcon } from '@heroicons/react/24/outline';
import { addYears, format, startOfDay } from 'date-fns';
import * as React from 'react';
import { useEffect, useState } from 'react';
import { Button, Form } from 'reactstrap';
import {
Expand Down Expand Up @@ -254,7 +253,7 @@ const AssignEquipment = (props: IProps) => {
onClick={assignSelected}
disabled={!validState || submitting}
>
{equipment?.assignment ? 'Save changes' : 'Assign'} {submitting && <ArrowPathIcon data-icon="arrow-path" className='hero-icon size-5 animate-spin' />}
{!equipment?.id ? 'Save' : equipment.assignment ? 'Save changes' : 'Assign'} {submitting && <ArrowPathIcon data-icon="arrow-path" className='hero-icon size-5 animate-spin' />}
</Button>{' '}
</ModalFooter>
</Modal>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Modal, ModalBody, ModalFooter, ModalHeading } from '../Shared/AppModal';
import { ArrowPathIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { useState } from 'react';
import { Button } from 'reactstrap';
import { IEquipment } from '../../models/Equipment';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ const DuplicateEquipment = (props: IProps) => {
{submitting
? <ArrowPathIcon className='hero-icon size-5 animate-spin' aria-hidden='true' />
: <DocumentDuplicateIcon className='hero-icon size-5' aria-hidden='true' />}
{submitting ? 'Saving…' : equipment.id ? 'Save assignment' : 'Save as new equipment'}
{submitting ? 'Saving…' : equipment.id ? 'Save assignment' : 'Save'}
</Button>
</ModalFooter>
</Modal>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Modal, ModalBody, ModalFooter } from '../Shared/AppModal';
import { ArrowPathIcon, XMarkIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { useEffect, useState } from 'react';
import { Button } from 'reactstrap';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { AssetActions } from '../Shared/AssetSummary';
import { PencilSquareIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { Button } from 'reactstrap';
import { IEquipment } from '../../models/Equipment';
import { DateUtil } from '../../util/dates';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TrashIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { IEquipmentAttribute } from '../../models/Equipment';
import SearchDefinedOptions from '../Shared/SearchDefinedOptions';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { InformationCircleIcon, PlusIcon } from '@heroicons/react/24/outline';
import * as React from 'react';
import { Button } from 'reactstrap';
import { IEquipmentAttribute } from '../../models/Equipment';
import EquipmentAttribute from './EquipmentAttribute';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as React from 'react';
import { render, cleanup, act, fireEvent, screen, waitFor, within } from '@testing-library/react';
import { MemoryRouter, Route } from 'react-router';
import { toast } from 'react-toastify';
Expand Down Expand Up @@ -125,7 +124,7 @@ describe('Equipment duplication', () => {
return { source, sourceSnapshot, person, otherPerson, duplicate, assign, details, fetch, assetTotalUpdated, assetInUseUpdated };
};

const saveCopy = () => fireEvent.click(screen.getByRole('button', { name: 'Save as new equipment' }));
const saveCopy = () => fireEvent.click(screen.getByRole('button', { name: 'Save' }));
const selectOtherPerson = async (name: string) => {
fireEvent.change(screen.getByRole('combobox', { name: 'Search for person by name or email' }), { target: { value: name } });
fireEvent.click(await screen.findByRole('option', { name: new RegExp(name) }));
Expand Down Expand Up @@ -187,7 +186,7 @@ describe('Equipment duplication', () => {
fireEvent.change(personSearch, { target: { value: 'Searching' } });
expect(fireEvent.keyDown(personSearch, { key: 'Enter', code: 'Enter' })).toBe(false);
expect(state.duplicate).not.toHaveBeenCalled();
expect(screen.getByRole('button', { name: 'Save as new equipment' })).toBeEnabled();
expect(screen.getByRole('button', { name: 'Save' })).toBeEnabled();
});

it('preserves the new record after assignment fails and retries assignment without creating another copy', async () => {
Expand Down Expand Up @@ -345,7 +344,7 @@ describe('Equipment duplication', () => {
it('does not open an empty duplication dialog when the source is missing', async () => {
await setup({ missing: true });
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
expect(screen.queryByRole('button', { name: 'Save as new equipment' })).not.toBeInTheDocument();
expect(screen.queryByRole('button', { name: 'Save' })).not.toBeInTheDocument();
});
});

Expand All @@ -358,7 +357,7 @@ afterEach(() => {

describe('Equipment Container', () => {
const contextObject = {
fetch: (url: any, index: any) => {},
fetch: (_url: any, _index: any) => {},
permissions: ['DepartmentalAdmin', 'Admin'],
team: { id: 1, name: 'Team', slug: 'team' },
tags: []
Expand Down
Loading
Loading