Skip to content

Commit

Permalink
Rework Create & Manage modals into one, fix bug with ExternalEventForm
Browse files Browse the repository at this point in the history
ExternalEventForm's calculated attributes for the given event are now reactive to fix a bug where attributes didn't update when the selected event was switched
  • Loading branch information
JosephVolosin committed Nov 25, 2024
1 parent 165a8b8 commit 546ed67
Show file tree
Hide file tree
Showing 7 changed files with 262 additions and 283 deletions.
4 changes: 2 additions & 2 deletions src/components/external-events/ExternalEventForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
export let externalEvent: ExternalEvent;
export let showHeader: boolean = true;
const externalEventAttributes: ArgumentsMap = translateJsonSchemaArgumentsToValueSchema(externalEvent.attributes);
let externalEventAttributes: ArgumentsMap = {};
let externalEventType: ExternalEventType | undefined = undefined;
let externalEventTypeParametersMap: ParametersMap = {};
let startTimeField: FieldStore<string>;
$: externalEventType = $externalEventTypes.find(eventType => eventType.name === externalEvent.pkey.event_type_name);
$: externalEventAttributes = translateJsonSchemaArgumentsToValueSchema(externalEvent.attributes);
$: if (externalEventType !== undefined) {
// Create a ParametersMap for the External Event Type
Expand Down Expand Up @@ -95,7 +96,6 @@
/>
</Input>
</Collapse>

<Collapse defaultExpanded={false} title="Attributes" tooltipContent="View External Event Attributes">
<div class="st-typography-body">
<Parameters
Expand Down
19 changes: 2 additions & 17 deletions src/components/external-source/ExternalSourceManager.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,6 @@
effects.manageGroupsAndTypes(user);
}
function onCreateGroupsOrTypes() {
effects.createGroupsOrTypes(user);
}
function hasDeleteExternalSourcePermissionOnRow(user: User | null, externalSource: ExternalSourceSlim | undefined) {
if (externalSource === undefined) {
return false;
Expand Down Expand Up @@ -788,23 +784,12 @@
</slot>
<slot name="right">
<button
name="create-groups-or-types"
class="st-button secondary"
on:click|stopPropagation={onCreateGroupsOrTypes}
use:tooltip={{
content: 'Create external source types or external event types.',
placement: 'top',
}}
>
Create New Groups or Types
</button>
<button
name="manage-groups-or-types"
name="manage-groups-and-types"
class="st-button active"
on:click|stopPropagation={onManageGroupsAndTypes}
use:tooltip={{
content:
'Manage and inspect existing derivation groups, external source types, and external event types.',
'Manage, create, and inspect existing derivation groups, external source types, and external event types.',
placement: 'top',
}}
>
Expand Down
203 changes: 0 additions & 203 deletions src/components/modals/CreateGroupsOrTypesModal.svelte

This file was deleted.

Loading

0 comments on commit 546ed67

Please sign in to comment.