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 scheme rights form/report, #151 #180

Merged
merged 35 commits into from
Jan 30, 2025
Merged

Add scheme rights form/report, #151 #180

merged 35 commits into from
Jan 30, 2025

Conversation

njkim
Copy link
Contributor

@njkim njkim commented Jan 9, 2025

Add the scheme rights and the right statement cards to the scheme report/editor.
Two cardinality-1 cards are treated as one card.

@chrabyrd
Copy link
Contributor

@njkim when able, could you rebase this? Looks like there's a lot of leakage from Johnathan's work.

@njkim njkim force-pushed the 151_scheme_rights_form branch from b889521 to 79a9a92 Compare January 22, 2025 19:33
Copy link
Contributor

@chrabyrd chrabyrd left a comment

Choose a reason for hiding this comment

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

looks pretty good so far, just a few things 👍

arches_lingo/src/arches_lingo/constants.ts Outdated Show resolved Hide resolved
todo
</SchemeReportSection>
<div>
<div v-if="!mode || mode === VIEW">
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason this section is divided by mode? Shouldn't it just be an arg fed into sub components, or am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

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

I may be missing something here... could it not be 1 set of components? eg

          <div>
                <h4>{{ $gettext("Rights Holders") }}</h4>
                <ResourceInstanceRelationships
                    :value="schemeRights?.right_holder"
                    :options="actorRdmOptions"
                    :mode="mode"
                    @update="
                        (val) =>
                            onUpdateResourceInstance(
                                'right_holder',
                                val,
                                actorRdmOptions ?? [],
                            )
                    "
                />
                <h4>{{ $gettext("Rights Type") }}</h4>
                <ReferenceDatatype
                    :value="schemeRights?.right_type"
                    :options="rightTypeOptions"
                    :multi-value="false"
                    :mode="mode"
                    @update="
                        (val) =>
                            onUpdateSchemeRightReferenceDatatype(
                                'right_type',
                                val,
                            )
                    "
                />
            </div>
            <div>
                <h4>{{ $gettext("Statement") }}</h4>
                <NonLocalizedString
                    :value="schemeRightStatement?.right_statement_content"
                    :mode="mode"
                    @update="
                        (val) => onUpdateString('right_statement_content', val)
                    "
                />
                <h4>{{ $gettext("Statement Language") }}</h4>
                <ReferenceDatatype
                    :value="schemeRightStatement?.right_statement_language"
                    :mode="mode"
                    :multi-value="false"
                    :options="languageOptions"
                    @update="
                        (val) =>
                            onUpdateSchemeRightStatementReferenceDatatype(
                                'right_statement_language',
                                val,
                            )
                    "
                />
                <h4>{{ $gettext("Statement Type") }}</h4>
                <ReferenceDatatype
                    :value="schemeRightStatement?.right_statement_type"
                    :mode="mode"
                    :multi-value="false"
                    :options="noteOptions"
                    @update="
                        (val) =>
                            onUpdateSchemeRightStatementReferenceDatatype(
                                'right_statement_type',
                                val,
                            )
                    "
                />
                <h4>{{ $gettext("Statement Type Metatype") }}</h4>
                <ReferenceDatatype
                    :value="schemeRightStatement?.right_statement_type_metatype"
                    :mode="mode"
                    :multi-value="false"
                    :options="metatypesOptions"
                    @update="
                        (val) =>
                            onUpdateSchemeRightStatementReferenceDatatype(
                                'right_statement_type_metatype',
                                val,
                            )
                    "
                />
                <Button
                    v-if="mode === EDIT"
                    :label="$gettext('Update')"
                    @click="saveRights"
                ></Button>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chrabyrd Ah, I see what you mean. That makes sense. Thought they looked different enough but I can see that they can be combined.

@njkim njkim requested a review from chrabyrd January 25, 2025 02:44
@njkim njkim changed the title 151 scheme rights form Add scheme rights form/report, #151 Jan 25, 2025
@chrabyrd
Copy link
Contributor

@njkim this appears to be failing builds. It looks like something the pre-commit hooks would catch, but if not mind running npm run ts:check and npm run eslint:check?

todo
</SchemeReportSection>
<div>
<div v-if="!mode || mode === VIEW">
Copy link
Contributor

Choose a reason for hiding this comment

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

I may be missing something here... could it not be 1 set of components? eg

          <div>
                <h4>{{ $gettext("Rights Holders") }}</h4>
                <ResourceInstanceRelationships
                    :value="schemeRights?.right_holder"
                    :options="actorRdmOptions"
                    :mode="mode"
                    @update="
                        (val) =>
                            onUpdateResourceInstance(
                                'right_holder',
                                val,
                                actorRdmOptions ?? [],
                            )
                    "
                />
                <h4>{{ $gettext("Rights Type") }}</h4>
                <ReferenceDatatype
                    :value="schemeRights?.right_type"
                    :options="rightTypeOptions"
                    :multi-value="false"
                    :mode="mode"
                    @update="
                        (val) =>
                            onUpdateSchemeRightReferenceDatatype(
                                'right_type',
                                val,
                            )
                    "
                />
            </div>
            <div>
                <h4>{{ $gettext("Statement") }}</h4>
                <NonLocalizedString
                    :value="schemeRightStatement?.right_statement_content"
                    :mode="mode"
                    @update="
                        (val) => onUpdateString('right_statement_content', val)
                    "
                />
                <h4>{{ $gettext("Statement Language") }}</h4>
                <ReferenceDatatype
                    :value="schemeRightStatement?.right_statement_language"
                    :mode="mode"
                    :multi-value="false"
                    :options="languageOptions"
                    @update="
                        (val) =>
                            onUpdateSchemeRightStatementReferenceDatatype(
                                'right_statement_language',
                                val,
                            )
                    "
                />
                <h4>{{ $gettext("Statement Type") }}</h4>
                <ReferenceDatatype
                    :value="schemeRightStatement?.right_statement_type"
                    :mode="mode"
                    :multi-value="false"
                    :options="noteOptions"
                    @update="
                        (val) =>
                            onUpdateSchemeRightStatementReferenceDatatype(
                                'right_statement_type',
                                val,
                            )
                    "
                />
                <h4>{{ $gettext("Statement Type Metatype") }}</h4>
                <ReferenceDatatype
                    :value="schemeRightStatement?.right_statement_type_metatype"
                    :mode="mode"
                    :multi-value="false"
                    :options="metatypesOptions"
                    @update="
                        (val) =>
                            onUpdateSchemeRightStatementReferenceDatatype(
                                'right_statement_type_metatype',
                                val,
                            )
                    "
                />
                <Button
                    v-if="mode === EDIT"
                    :label="$gettext('Update')"
                    @click="saveRights"
                ></Button>

Comment on lines 110 to 111
ontologyProperty: "ac41d9be-79db-4256-b368-2f4559cfbe55",
inverseOntologyProperty: "ac41d9be-79db-4256-b368-2f4559cfbe55",
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a way to not hardcode UUIDs on the frontend? If not addressed here, could you file a followup ticket for this?

Copy link
Contributor Author

@njkim njkim Jan 28, 2025

Choose a reason for hiding this comment

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

@chrabyrd The uuids are removed because the ontology on the current models are actually not assigned (though I believe they should be).

I agree that they should not be hard-coded here, especially since the graph can change.
I think we need more discussion where/how it should get. I feel the related resource object should not be built at all in the front-end but I am not sure.
Here is a new ticket. #191

const metatypesOptions = ref<ControlledListItem[]>();
const parentExists = ref(false);

withDefaults(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: props go just under imports

@njkim njkim requested a review from chrabyrd January 28, 2025 17:13
Copy link
Contributor

@chrabyrd chrabyrd left a comment

Choose a reason for hiding this comment

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

lgtm -- thanks for writing the followup tickets! 🚀

@robgaston robgaston merged commit 9668167 into main Jan 30, 2025
5 of 6 checks passed
@njkim njkim linked an issue Jan 31, 2025 that may be closed by this pull request
@jacobtylerwalls jacobtylerwalls deleted the 151_scheme_rights_form branch January 31, 2025 17:08
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.

"Scheme Rights" forms/reports section
4 participants