Skip to content

Conversation

braydencstratusadv
Copy link
Collaborator

  • Add a button to ArchaeologicalSite and SiteVisit detail pages to populate "Entered By" and "Entered On" fields upon clicking it.

Copy link
Collaborator

@bferguso bferguso left a comment

Choose a reason for hiding this comment

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

This is looking really great! I'm only seeing audit columns in the General Remarks table - should I be seeing others? If not we can get this merged in once the minor changes are made and then build on the fields that are displayed in a subsequent PR.

Maybe it's an idea to show/hide the audit columns - we could target them with CSS to manage visibility? Once again - just an idea for a future PR.

Once this is done and working, maybe we should move some of the generic components (view, url) to bcgov-arches-common so that it can be leveraged by other apps.

def _get_nodegroup_id_from_alias(self, graph: str, alias: str) -> str | None:
with connection.cursor() as cursor:
query = """
SELECT DISTINCT n.nodegroupid::text
Copy link
Collaborator

Choose a reason for hiding this comment

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

The graphs are now versioned so we need to filter by graphs.sourceidentifier is null.

Maybe we could use something like this to make it more Django-y?:
https://github.com/archesproject/arches-component-lab/blob/16b55f4a86f0b4c29222cf8baedb86d4aac92408/arches_component_lab/views/node_config_mixin.py#L30-L33


<template>
<Button
:label="loading ? 'Loading...' : 'Populate All Entered On/By Fields'"
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about something like "Audit info" with an open / slash eye?

AliasedNodeData,
} from '@/arches_component_lab/types.ts';

export interface EditLogEntry {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's pull these interfaces out into the src/bcgov_arches_common/types.ts file, and include all attributes that are returned by the view?

Maybe we should extend the AlaisedNodeData to have an audit field (or something similar) so it can be strongly typed in Vue components?.

export function applyEditLogToTile(
tile: AliasedTileData,
editLogData: EditLogData | undefined,
enteredOnField = 'entered_on',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Constants could be pulled out into a constants.ts file at the same level as the types.ts

export function useSingleTileEditLog(
sourceData: Ref<AliasedTileData | undefined>,
editLogData: Ref<EditLogData | undefined>,
options?: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we default this value in the parameter list so we don't have to check for them in the body?

) {
const processedData = ref<AliasedTileData | null>(null);

const enteredOnField = options?.enteredOnField || 'entered_on';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lets use the constants you defined above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants