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

Add event and event series entities #4868

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

pacodelcastillolopez
Copy link
Collaborator

@pacodelcastillolopez pacodelcastillolopez commented Jul 16, 2024

Adding two new ANET entities: event series and events.

  • They have a host organization that can be any organization in ANET and an admin organization which needs to be managed by the user creating the event series or event (superuser or admin).
  • Events have also a location, start date and end date and are searchable.
  • Objectives can be linked to events.
  • Reports can be associated to events. When creating from the Event page it will inherit its location and objectives, the date of the report has to be within the start and end date of the event.
  • Events will be displayed in the organization and location pages.

To do:

  • Add testing once implementation is approved.
  • Add blocking feature (flag in an event that can block a location for the period the event takes place)
  • Add attachments to events (will be done together with adding avatar to events)

Closes AB#1064

User changes

  • Can search for events in ANET.
  • Can associate a report to an event.

Superuser changes

  • Can create event series and events managed by the organizations they manage.
  • Can see the event series and events they manage under "My Events".

Admin changes

  • Can create event series and events managed by any organization.

System admin changes

  • anet.yml or anet-dictionary.yml needs change
  • db needs migration
  • documentation has changed
  • graphql schema has changed

Checklist

  • Described the user behavior in PR body
  • Referenced/updated all related issues
  • commits follow a repo#issue: Title title format and these 7 rules
  • commits have a clean history, otherwise PR may be squash-merged
  • Added and/or updated unit tests
  • Added and/or updated e2e tests
  • Added and/or updated data migrations
  • Updated documentation
  • Resolved all build errors and warnings
  • Opened debt issues for anything not resolved here

@pacodelcastillolopez pacodelcastillolopez changed the title Addind event and event series entities Adding event and event series entities Jul 16, 2024
Copy link

azure-boards bot commented Jul 16, 2024

✅ Successfully linked to Azure Boards work item(s):

@gjvoosten gjvoosten changed the title Adding event and event series entities Add event and event series entities Jul 16, 2024
src/main/resources/migrations.xml Outdated Show resolved Hide resolved
src/main/resources/migrations.xml Outdated Show resolved Hide resolved
src/main/resources/migrations.xml Outdated Show resolved Hide resolved
src/main/resources/migrations.xml Outdated Show resolved Hide resolved
src/main/resources/migrations.xml Outdated Show resolved Hide resolved
src/main/java/mil/dds/anet/resources/EventResource.java Outdated Show resolved Hide resolved
client/src/components/aggregations/utils.js Outdated Show resolved Hide resolved
client/src/components/aggregations/utils.js Outdated Show resolved Hide resolved
title,
start,
end,
url: Event.pathFor(event),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe use different colours for the different types of events, like for reports, where we have:

        classNames: [`event-${Report.getStateForClassName(r)}`],

?

@pacodelcastillolopez pacodelcastillolopez force-pushed the AB-1064_events_entities branch 2 times, most recently from a3abfe2 to de19400 Compare October 8, 2024 07:43
@pacodelcastillolopez pacodelcastillolopez force-pushed the AB-1064_events_entities branch 2 times, most recently from 29b80f4 to 948880d Compare October 8, 2024 11:42
@gjvoosten gjvoosten force-pushed the AB-1064_events_entities branch 3 times, most recently from b782c1e to 2044b1c Compare November 5, 2024 14:22
Comment on lines +19 to +21
@GraphQLQuery
@GraphQLInputField
Instant includeDate;
Copy link
Collaborator

Choose a reason for hiding this comment

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

includeDate appears to be unused; can it be removed?

@@ -1660,6 +1760,30 @@ const Search = ({
/>
</Fieldset>
)}
{queryTypes.includes(SEARCH_OBJECT_TYPES.EVENTS) && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should not show Events search results when the withEmail filter is active.

@pacodelcastillolopez pacodelcastillolopez force-pushed the AB-1064_events_entities branch 7 times, most recently from b63f436 to edaf108 Compare November 11, 2024 08:51
Comment on lines +1281 to +1293
.event-collection header {
margin-bottom: 18px;
}

.event-collection footer {
margin-top: 18px;
}

.event-summary {
margin-top: 25px;
padding-top: 15px;
box-shadow: 0 1px 3px hsla(0, 0%, 0%, 0.15);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This appears to be the exact same styling already present in the main stylesheet above. Why is this here as well?

import { connect } from "react-redux"
import { useLocation, useParams } from "react-router-dom"
import Settings from "settings"
import { FORMAT_TABLE } from "../../components/ReportCollection"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please import directly from "components/ReportCollection" (joined with the import several lines above).

import mil.dds.anet.test.client.PositionType;
import mil.dds.anet.test.client.Status;
import mil.dds.anet.test.client.TaskInput;
import mil.dds.anet.test.client.*;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please avoid wildcard imports.

import java.time.Instant;
import java.util.Collections;
import mil.dds.anet.test.TestData;
import mil.dds.anet.test.client.*;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please avoid wildcard imports.

}
action={action}
/>
<Fieldset id="info" tile="Info">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is the status field?

<Messages error={saveError} />
<Form className="form-horizontal" method="post">
<Fieldset title={title} action={action} />
<Fieldset>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is the status field?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We might want to discuss what is the use case to decide events are active or inactive like People or Organizations, I dont think it makes any sense for events that happened in the past that you can go to edit them and make them inactive. That means they do not show up anymore in searches?

Same for events in the future, if an event gets cancelled maybe we should have the option to delete them or have a "Cancelled" status. The status field, as it is used, for other entities does not really apply that well to events.

}
action={action}
/>
<Fieldset id="info" title="Info">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is the status field?

<Messages error={error} />
<Form className="form-horizontal" method="post">
<Fieldset title={title} action={action} />
<Fieldset>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is the status field?

return (
<div className={`report-preview preview-content-scroll ${className || ""}`}>
<h4 className="ellipsized-text">Event {eventTitle}</h4>
<div className="preview-section">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where are the status and description fields?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is a preview, I do not think we want to have description there in my opinion.

return (
<div className={`report-preview preview-content-scroll ${className || ""}`}>
<h4 className="ellipsized-text">Event Series {eventSeriesTitle}</h4>
<div className="preview-section">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where are the status and description fields?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is a preview, I do not think we want to have description there in my opinion.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Other previews show the profile/description/biography as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great, I still dont think this one should.

@gjvoosten gjvoosten force-pushed the AB-1064_events_entities branch 3 times, most recently from 15168e6 to 8349397 Compare November 26, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants