Module: Ecoportal::API::GraphQL::Input::WorkflowCommand::EditFieldConfiguration::People

Defined in:
lib/ecoportal/api/graphql/input/workflow_command/field_config/people.rb

Constant Summary collapse

SCHEMA_VERSION =
'20260725'.freeze
VALID_KEYS =

20260725: addViewableFields/removeViewableFields were REMOVED from WorkflowEditFieldConfigurationPeopleInput — they lived on here as dead keys the server rejects. Viewable fields are now three dedicated commands (add/move/removeViewableField), which also added ordering the flat arrays could not express. The same drift added the six attached-people-permission / allowed-user-group keys below, which had never been reachable from this gem.

%i[
  personSchemaId singular requiresNumber attachMode isMeButton
  autoSelectMode autoSelectSupervisorFieldRef autoSelectDefaultLocations
  addAllowedUserGroupIds removeAllowedUserGroupIds
  attachedPeoplePermissionsEnabled attachedPeoplePermissionsEditable
  attachedPeoplePermissionsFlags applyAttachedPeoplePermissionsTo
].freeze
AUTO_SELECT_MODES =

WorkflowAutoSelectModeEnum — autoSelectMode was retyped String -> enum in the same drift. Values pass through as strings (valid for enum variables).

%w[NONE CREATOR CREATOR_SUPERVISOR PEOPLE_SUPERVISOR].freeze
APPLY_PERMISSIONS_TO =

WorkflowApplyAttachedPeoplePermissionsToEnum

%w[PAGE_ONLY PAGE ALL_STAGES CURRENT_STAGE].freeze
PERMISSION_FLAGS =

Nested WorkflowEditFieldConfigurationAttachedPeoplePermissionsFlagsInput keys.

%i[
  canRestructure canConfigure canPermission canCreateActions
  canAdministrateActions subscribed subscribedToTasks
].freeze

Class Method Summary collapse

Class Method Details

.build(**kwargs) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/ecoportal/api/graphql/input/workflow_command/field_config/people.rb', line 33

def self.build(**kwargs)
  out = kwargs.slice(*VALID_KEYS).compact
  # Filter the nested flags hash to the keys the schema actually declares, so a
  # stray key can't sink the whole command server-side.
  if (flags = out[:attachedPeoplePermissionsFlags]).is_a?(Hash)
    out[:attachedPeoplePermissionsFlags] = flags.slice(*PERMISSION_FLAGS).compact
  end
  { people: out }
end