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

Campaign Index and Create/Edit form #411

Merged
merged 35 commits into from
Feb 21, 2022

Conversation

luigibesani
Copy link
Collaborator

@luigibesani luigibesani commented Feb 20, 2022

Closes #384
Closes #386

Description

  • Users can see a list of all the campaigns they are registered in.
  • Users can create and edit campaigns from the campaign index page.

Changes made

  • Add the CampaignCreateForm component
  • Add the CampaignTable component
  • Update the Campaign index page to show the table of campaigns
  • Adjust CampaignController

luigibesani and others added 24 commits February 18, 2022 00:47
@luigibesani luigibesani self-assigned this Feb 20, 2022
@luigibesani luigibesani added front end task This issue represents a task belonging to a story labels Feb 20, 2022
@luigibesani luigibesani added this to the Sprint #7 milestone Feb 20, 2022
@luigibesani luigibesani marked this pull request as ready for review February 20, 2022 19:46
@luigibesani luigibesani marked this pull request as draft February 20, 2022 19:48
@luigibesani luigibesani changed the base branch from 31-campaign-management to main February 20, 2022 19:48
@luigibesani luigibesani marked this pull request as ready for review February 20, 2022 19:50
@luigibesani luigibesani marked this pull request as draft February 20, 2022 19:50
characters,
}: CampaignCreateFormPropType) => {
const CAMPAIGN_CREATE_FORM_INITIAL_VALUE: CampaignFormDataType = {
title: '',
Copy link
Contributor

Choose a reason for hiding this comment

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

use undefined instead

useForm<CampaignFormDataType>(CAMPAIGN_INITIAL_VALUE)

return (
<>
Copy link
Contributor

Choose a reason for hiding this comment

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

dont need this empty tag

</Grid>
<Grid container spacing={4}>
<Grid item xs={4}>
<Button onClick={() => onCloseDrawer && onCloseDrawer()} fullWidth>
Copy link
Contributor

Choose a reason for hiding this comment

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

dont think this covers when you cancel from create view


const Campaign = ({campaigns, characters, adventures}: CampaignPropType) => {
const [isEditDrawerOpen, setIsEditDrawerOpen] = useState<boolean>(false)
Copy link
Contributor

Choose a reason for hiding this comment

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

please use useEditDrawer

@luigibesani luigibesani reopened this Feb 20, 2022
@luigibesani luigibesani changed the base branch from main to 31-campaign-management February 20, 2022 23:09
@@ -1,2 +1,5 @@
export const itemFormatter = (items: any[]) =>
items.map((item: any) => item.name).join(', ')

export const characterNameFormatter = (characters: any[]) =>
characters.map((character: any) => character.name).join(', ')
Copy link
Contributor

Choose a reason for hiding this comment

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

if these are the same as itemFormatter, I think you can write a more generic function to accommodate both

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right, Ill join these two and update it in both the Campaign table and Item table

@luigibesani luigibesani changed the base branch from 31-campaign-management to main February 20, 2022 23:43
@willyyhuang willyyhuang changed the base branch from main to feat-campaign-management February 21, 2022 00:36
@@ -76,7 +76,7 @@ const EntryTable = ({
{
property: 'items',
title: 'Magic Items',
render: (value: any) => itemFormatter(value),
render: (value: any) => objectArrayFormatter(value),
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for this!

@sonarcloud
Copy link

sonarcloud bot commented Feb 21, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@luigibesani luigibesani marked this pull request as ready for review February 21, 2022 02:58
@willyyhuang willyyhuang merged commit 7fbbcab into feat-campaign-management Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front end task This issue represents a task belonging to a story
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Campaign create/edit form Campaign index page
3 participants