Skip to content

Refactor fields.inc to be configuration only (CFM-218) #342

Merged
merged 14 commits into from
Nov 22, 2025

Conversation

arlen
Copy link
Contributor

@arlen arlen commented Sep 18, 2025

No description provided.

@@ -74,6 +75,24 @@ public function initialize(array $config): void {
$this->setPrimaryLink(['external_identity_source_id']);
$this->setRequiresCO(true);

// All the tabs share the same configuration in the ModelTable file
// XXX Reenable when this doesn't throw an error (same error as https://todos.internet2.edu/browse/CFM-475 )
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I attempted to add the subnavigation for API Sources config similar to File Sources, Sql Sources (etc). When this block is included it throws an error similar to what we see in https://todos.internet2.edu/browse/CFM-475

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the plan to address this? ie: CFM-475 is marked resolved, so either we should have a plan to address the underlying issue or we shouldn't commit a bunch of commented out broken code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will pull this code out for now. We'll need to review all such places where subnavigation should be used - where configuration (for example) should be on a tab next to its entity.

@arlen arlen force-pushed the feature-cfm218-fieldsIncConfigOnly branch 2 times, most recently from 984681b to 46b3261 Compare September 23, 2025 17:57
@arlen arlen changed the title Refactor fields.inc to be configuration only - first pass. (CFM-218) Refactor fields.inc to be configuration only (CFM-218) Sep 24, 2025
@arlen arlen marked this pull request as ready for review September 24, 2025 18:26
@arlen arlen requested review from Ioannis and benno September 24, 2025 18:26
@arlen arlen force-pushed the feature-cfm218-fieldsIncConfigOnly branch from 29c718b to 620cdf5 Compare October 7, 2025 14:40
app/src/View/Helper/FieldHelper.php Outdated Show resolved Hide resolved
@arlen arlen force-pushed the feature-cfm218-fieldsIncConfigOnly branch 2 times, most recently from 1856b00 to c7b8668 Compare October 27, 2025 12:55
@arlen arlen force-pushed the feature-cfm218-fieldsIncConfigOnly branch from c7b8668 to 3cae121 Compare October 29, 2025 13:56
@arlen arlen marked this pull request as draft November 12, 2025 19:22
@arlen
Copy link
Contributor Author

arlen commented Nov 12, 2025

Moved this PR to draft mode while refactoring for recent updates to develop. Due to the refactoring, it has also become clear that CFM-465 (the ability to assign 'type' to a banner/alert message) is required. I will take this back out of draft mode when complete and pushed.

@arlen arlen force-pushed the feature-cfm218-fieldsIncConfigOnly branch from 0618b10 to e015a94 Compare November 13, 2025 18:42
@arlen arlen marked this pull request as ready for review November 13, 2025 18:49
@arlen
Copy link
Contributor Author

arlen commented Nov 13, 2025

This PR has been rebased against the lastest develop and opened back up for review.

@@ -74,6 +75,24 @@ public function initialize(array $config): void {
$this->setPrimaryLink(['external_identity_source_id']);
$this->setRequiresCO(true);

// All the tabs share the same configuration in the ModelTable file
// XXX Reenable when this doesn't throw an error (same error as https://todos.internet2.edu/browse/CFM-475 )
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the plan to address this? ie: CFM-475 is marked resolved, so either we should have a plan to address the underlying issue or we shouldn't commit a bunch of commented out broken code.

Comment on lines 72 to 97
foreach([
'env_identifier_sourcekey',
'env_address_street',
'env_address_locality',
'env_address_state',
'env_address_postalcode',
'env_address_country',
'env_affiliation',
'env_department',
'env_identifier_eppn',
'env_identifier_eptid',
'env_identifier_epuid',
'env_identifier_network',
'env_identifier_oidcsub',
'env_identifier_samlpairwiseid',
'env_identifier_samlsubjectid',
'env_mail',
'env_name_honorific',
'env_name_given',
'env_name_middle',
'env_name_family',
'env_name_suffix',
'env_organization',
'env_telephone_number',
'env_title'
] as $field) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can avoid duplicating the set of field names by doing something like this instead:

foreach($defaultNames as $field => $envName) {
  $fields[$field] = [
    'default' => $envName
  ];
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I think this was a direct conversion of the original file - it's nice to see things getting even further simplified. I've updated the code in the latest commit.

Comment on lines 25 to 27
msgid "add.a"
msgstr "Add an SSH Key"

Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this used, and why is it not using __d('operation', 'add.a', [__d('ssh_key_authenticator', 'controller.SshKeyAuthenticators')])?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've pulled this out. I suspect this may have been left behind after a rebase.

Comment on lines 624 to 626
msgid "Groups.members_group_id"
msgstr "Members Group"

Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this used?

Copy link
Contributor Author

@arlen arlen Nov 20, 2025

Choose a reason for hiding this comment

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

I've also removed this, and I also suspect a rebase miss.

The point of this string was to replace "Owners for Group" label that exists where an Owners group has the link back to the Members Group. I find the existing label a little confusing to read and felt "Members Group" was a better label. We can discuss - but it doesn't need to be part of this PR.

(Almost all labels name the field they represent in a simple way. "Owners for Group" refers back to the current group loaded in the form - it's unusual...and inconsistent.)

$mveasEntityType = "group";

// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of this file into fields.inc
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comment there was accidentally left in from the copy and paste out of fields-nav.inc. It's been removed.

@benno benno merged commit 686b45a into COmanage:develop Nov 22, 2025
@arlen arlen deleted the feature-cfm218-fieldsIncConfigOnly branch November 24, 2025 12:39
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants