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

Lending system frontend #4219

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open

Lending system frontend #4219

wants to merge 47 commits into from

Conversation

eikhr
Copy link
Member

@eikhr eikhr commented Oct 20, 2023

Description

Result

Testing

  • I have thoroughly tested my changes.

Please describe what and how the changes have been tested, and provide instructions to reproduce if necessary.


Resolves ABA-613

@linear
Copy link

linear bot commented Oct 20, 2023

ABA-613 Lending system

Backup has requested a lending system, as Abakus has a lot of objects that could be lent out to Ababeads if we just had a good system for it. Arrkom also wants this system to make it easier to administrate Soundboks and grill lending.

@github-actions github-actions bot added the review-needed Pull requests that need review label Oct 20, 2023
@eikhr eikhr force-pushed the lending-system branch 2 times, most recently from 5a81cca to 96b9d4f Compare October 20, 2023 13:15
Copy link
Member

@ivarnakken ivarnakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get that it's a WIP but I'm bored

app/routes/lending/LendableObjectsList.css Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsList.css Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsList.css Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsAdmin.css Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectEdit.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectDetail.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectAdminDetail.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectAdminDetail.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectAdminDetail.tsx Outdated Show resolved Hide resolved
@eikhr
Copy link
Member Author

eikhr commented Oct 20, 2023

Haha, It's very WIP. How do you think we should do the colors in the calendar? I'm not sure if css variables work there, but now that I think of it I don't believe we tried🤔

app/styles/globals.css Show resolved Hide resolved
app/routes/lending/LendableObjectEdit.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectDetail.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectDetail.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectAdminDetail.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectAdminDetail.tsx Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
app/actions/LendableObjectActions.ts Show resolved Hide resolved
app/actions/ActionTypes.ts Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsList.css Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsAdmin.css Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsList.tsx Outdated Show resolved Hide resolved
@ivarnakken ivarnakken added do-not-merge/WIP Pull requests that are "work in progress", and should not be merged new-feature Pull requests that introduce a new feature changes-requested Pull requests with requested changes labels Nov 7, 2023
Copy link
Member

@ivarnakken ivarnakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought I'd give another review on this hehe

app/routes/lending/LendableObjectEdit.tsx Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
app/routes/lending/LendableObjectsAdmin.css Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsAdmin.css Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsAdmin.css Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsList.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsList.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsList.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsList.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsList.tsx Outdated Show resolved Hide resolved
@ivarnakken ivarnakken added priority:high Pull requests that have high priority, and should therefore be prioritized need-before-2050 Pull requests that have been in progress for far too long labels Feb 1, 2024
Copy link
Member

@ivarnakken ivarnakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you go

app/routes/index.tsx Outdated Show resolved Hide resolved
app/store/models/LendableObject.d.ts Show resolved Hide resolved
app/styles/globals.css Show resolved Hide resolved
app/routes/lending/index.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsList.tsx Outdated Show resolved Hide resolved
app/actions/LendableObjectActions.ts Show resolved Hide resolved
app/routes/lending/LendableObjectsList.css Outdated Show resolved Hide resolved
app/routes/lending/components/LendingRequest.css Outdated Show resolved Hide resolved
app/routes/lending/components/LendingRequest.tsx Outdated Show resolved Hide resolved
app/store/models/LendableObject.d.ts Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsAdmin.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendingRequest.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsList.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendingRequest.tsx Outdated Show resolved Hide resolved
app/routes/lending/LendableObjectsList.tsx Outdated Show resolved Hide resolved
app/actions/LendableObjectActions.ts Outdated Show resolved Hide resolved
app/actions/LendableObjectActions.ts Outdated Show resolved Hide resolved
app/actions/LendableObjectActions.ts Outdated Show resolved Hide resolved
app/actions/LendingRequestActions.ts Outdated Show resolved Hide resolved
export const lendableObjectSchema = new schema.Entity(EntityType.LendableObjects, {
responsibleGroups: [groupSchema],
});
export const lendingRequestSchema = new schema.Entity(EntityType.LendingRequests);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normalize the nested lendableObject in lendingRequest?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean to add a lendableObject field to the schema like this:

Suggested change
export const lendingRequestSchema = new schema.Entity(EntityType.LendingRequests);
export const lendingRequestSchema = new schema.Entity(EntityType.LendingRequests, {
lendableObject: lendableObjectSchema,
});

app/reducers/lendableObjects.ts Outdated Show resolved Hide resolved
app/reducers/lendingRequests.ts Outdated Show resolved Hide resolved
app/routes/lending/components/LendableObjectEdit.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendableObjectEdit.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendableObjectsList.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendableObjectsList.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/RequestItem.tsx Outdated Show resolved Hide resolved
app/actions/LendableObjectActions.ts Outdated Show resolved Hide resolved
app/actions/LendableObjectActions.ts Outdated Show resolved Hide resolved
app/actions/LendableObjectActions.ts Outdated Show resolved Hide resolved
app/actions/LendableObjectActions.ts Outdated Show resolved Hide resolved
app/actions/LendingRequestActions.ts Outdated Show resolved Hide resolved
app/routes/lending/components/LendingRequestAdmin.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendingRequestAdmin.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendingRequestAdmin.tsx Outdated Show resolved Hide resolved
Comment on lines +41 to +46
let url = `/lending/request/${request.id}`;
if (isAdmin) {
url += '/admin';
}
return (
<Link to={url} className={styles.requestItem} key={request.id}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit weird ux

app/routes/lending/components/RequestItem.tsx Outdated Show resolved Hide resolved
@ivarnakken
Copy link
Member

ivarnakken commented Apr 30, 2024

This system does not seem to support contracts, like I know Arrkom uses when lending stuff out. I don't think we need to upload contracts for each object, but there should be some responsibility acknowledgement info and button or something. Talk to Arrkom about how they would like this

@itsisak
Copy link
Contributor

itsisak commented Apr 30, 2024

This system does not seem to support contracts, like I know Arrkom uses when lending stuff out. I don't think we need to upload contracts for each object, but there should be some responsibility acknowledgement info and button or something. Talk to Arrkom about how they would like this

I think the plan was to add some support for contracts, but we can consider a different approach, like you suggest. For now we want to finalize the current functionality and get it merged to master (but disable link to this page) and then iterate on further funtionality like this later in order to avoid to much rebasing and try and get a mvp working.

@Bestem0r Bestem0r marked this pull request as ready for review April 30, 2024 20:20
app/actions/LendingRequestActions.ts Outdated Show resolved Hide resolved
app/actions/LendingRequestActions.ts Outdated Show resolved Hide resolved
app/components/Search/utils.tsx Outdated Show resolved Hide resolved
Comment on lines 16 to 19
import type { Params } from 'react-router-dom';

const LendableObjectAdminDetail = () => {
const { lendableObjectId } = useParams<Params>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not resolved

app/routes/lending/components/LendableObjectEdit.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendableObjectsList.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendableObjectsList.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendingAdmin.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendingRequestAdmin.tsx Outdated Show resolved Hide resolved
app/store/models/LendingRequest.ts Outdated Show resolved Hide resolved
Copy link
Member

@ivarnakken ivarnakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Bestem0r I see that a lot of comments here have been set as resolved without any changes. Have you pushed everything?

app/routes/lending/components/LendingRequestAdmin.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendingRequest.tsx Outdated Show resolved Hide resolved
app/routes/lending/components/LendingAdmin.tsx Outdated Show resolved Hide resolved
Copy link
Member

@ivarnakken ivarnakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work guys! 😄 I think this is looking really good - sorry for all the nitpicking. We should probably merge it in (squashed) as soon as possible! 🥳

@ivarnakken ivarnakken added approved Pull requests that have been approved and removed priority:high Pull requests that have high priority, and should therefore be prioritized do-not-merge/WIP Pull requests that are "work in progress", and should not be merged changes-requested Pull requests with requested changes labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Pull requests that have been approved need-before-2050 Pull requests that have been in progress for far too long new-feature Pull requests that introduce a new feature review-needed Pull requests that need review
Projects
None yet
6 participants