diff --git a/anet-dictionary.yml b/anet-dictionary.yml index 501c18be68..1932ab318e 100644 --- a/anet-dictionary.yml +++ b/anet-dictionary.yml @@ -874,6 +874,10 @@ fields: label: Location placeholder: Search for the location where this Position will operate from… optional: false + filter: [POINT_LOCATION] + organizationsAdministrated: + label: Organizations administrated + placeholder: Search for an organization… role: label: Position Role types: @@ -988,6 +992,10 @@ fields: location: label: Location placeholder: Search for the location where this Organization will operate from… + filter: [POINT_LOCATION, COUNTRY] + administratingPositions: + label: Assigned Superusers + placeholder: Search for a position… profile: label: Profile placeholder: Fill in the profile of this organization @@ -1958,20 +1966,10 @@ fields: position: name: Regular type: Regular position - location: - filter: [POINT_LOCATION] - organizationsAdministrated: - label: Organizations administrated - placeholder: Search for an organization… org: name: Organization allOrgName: Top-level Organizations - location: - filter: [POINT_LOCATION, COUNTRY] - administratingPositions: - label: Assigned Superusers - placeholder: Search for a position… pinned_ORGs: [Key Leader Engagement] non_reporting_ORGs: [ANET Administrators] diff --git a/client/src/components/EditAdministratingPositionsModal.js b/client/src/components/EditAdministratingPositionsModal.js index 6b4fe2809e..f2a0d6e99f 100644 --- a/client/src/components/EditAdministratingPositionsModal.js +++ b/client/src/components/EditAdministratingPositionsModal.js @@ -51,7 +51,6 @@ const EditAdministratingPositionsModal = ({ return ( {({ setFieldValue, values, submitForm, setFieldTouched }) => { - const orgSettings = Settings.fields.regular.org return ( - Edit {utils.noCase(orgSettings.administratingPositions.label)} + Edit{" "} + {utils.noCase( + Settings.fields.organization.administratingPositions.label + )} @@ -72,7 +74,9 @@ const EditAdministratingPositionsModal = ({ { diff --git a/client/src/components/EditOrganizationsAdministratedModal.js b/client/src/components/EditOrganizationsAdministratedModal.js index 69029aabac..f7977e235a 100644 --- a/client/src/components/EditOrganizationsAdministratedModal.js +++ b/client/src/components/EditOrganizationsAdministratedModal.js @@ -44,7 +44,7 @@ const EditOrganizationsAdministratedModal = ({ {({ setFieldValue, values, submitForm, setFieldTouched }) => { const organizationsAdministratedSettings = - Settings.fields.regular.position.organizationsAdministrated + Settings.fields.position.organizationsAdministrated return ( { ) const allAdministratingPositions = getAllAdministratingPositions(organization) - const orgSettings = Settings.fields.regular.org - return ( <>
@@ -116,7 +114,9 @@ const OrganizationLaydown = ({ organization, refetch, readOnly }) => {
{ onClick={() => setShowAdministratingPositionsModal(true)} variant="outline-secondary" > - Edit {utils.noCase(orgSettings.administratingPositions.label)} + Edit{" "} + {utils.noCase( + Settings.fields.organization.administratingPositions.label + )} ) } diff --git a/client/src/pages/organizations/Show.js b/client/src/pages/organizations/Show.js index 067078c1a6..e3131bcc0f 100644 --- a/client/src/pages/organizations/Show.js +++ b/client/src/pages/organizations/Show.js @@ -228,7 +228,6 @@ const OrganizationShow = ({ pageDispatchers }) => { const canAdministrateOrg = currentUser && currentUser.hasAdministrativePermissionsForOrganization(organization) - const orgSettings = Settings.fields.regular.org const attachmentsEnabled = !Settings.fields.attachment.featureDisabled const { parentContext, parentStandardIdentity } = Organization.getApp6ParentFields(organization, organization) @@ -254,7 +253,7 @@ const OrganizationShow = ({ pageDispatchers }) => { - {orgSettings.administratingPositions.label} + {Settings.fields.organization.administratingPositions.label} diff --git a/client/src/pages/positions/Show.js b/client/src/pages/positions/Show.js index 05f77483af..5d83f89340 100644 --- a/client/src/pages/positions/Show.js +++ b/client/src/pages/positions/Show.js @@ -110,9 +110,6 @@ const PositionShow = ({ pageDispatchers }) => { const position = new Position(data ? data.position : {}) const isSuperuser = position.type === Position.TYPE.SUPERUSER - const assignedRole = Settings.fields.regular.person.name - const positionSettings = Settings.fields.regular.position - const canEdit = // Admins can edit anybody currentUser.isAdmin() || @@ -353,7 +350,7 @@ const PositionShow = ({ pageDispatchers }) => {
{ onClick={() => setShowAssociatedPositionsModal(true)} variant="outline-secondary" > - Change assigned {assignedRole} + Change assigned {Settings.fields.regular.person.name} ) } @@ -371,7 +368,8 @@ const PositionShow = ({ pageDispatchers }) => { /> {position.associatedPositions.length === 0 && ( - {position.name} has no associated {assignedRole} + {position.name} has no associated{" "} + {Settings.fields.regular.person.name} )} @@ -413,7 +411,7 @@ const PositionShow = ({ pageDispatchers }) => {
{ > Edit{" "} {utils.noCase( - positionSettings.organizationsAdministrated.label + Settings.fields.position.organizationsAdministrated + .label )} ) diff --git a/src/main/resources/anet-schema.yml b/src/main/resources/anet-schema.yml index c1335d7511..1945448d62 100644 --- a/src/main/resources/anet-schema.yml +++ b/src/main/resources/anet-schema.yml @@ -727,7 +727,7 @@ properties: items: type: string enum: - [VIRTUAL_LOCATION, PHYSICAL_LOCATION, GEOGRAPHICAL_AREA, POINT_LOCATION] + [VIRTUAL_LOCATION, PHYSICAL_LOCATION, GEOGRAPHICAL_AREA, COUNTRY, POINT_LOCATION] reportPeople: required: [optionalAttendingAuthor, optionalPrimaryAdvisor, optionalPrimaryPrincipal] properties: @@ -867,7 +867,7 @@ properties: position: type: object additionalProperties: false - required: [status, name, type, code, organization, role, emailAddresses, authorizationGroups] + required: [status, name, type, code, organization, location, organizationsAdministrated, role, emailAddresses, authorizationGroups] properties: status: "$ref": "#/$defs/labeledField" @@ -880,7 +880,19 @@ properties: organization: "$ref": "#/$defs/inputField" location: - "$ref": "#/$defs/optionableInputField" + required: [filter] + allOf: + - "$ref": "#/$defs/extensibleInputField" + - properties: + filter: + type: array + uniqueItems: true + items: + type: string + enum: + [VIRTUAL_LOCATION, PHYSICAL_LOCATION, GEOGRAPHICAL_AREA, COUNTRY, POINT_LOCATION] + organizationsAdministrated: + "$ref": "#/$defs/inputField" emailAddresses: "$ref": "#/$defs/restrictableLabeledField" authorizationGroups: @@ -917,7 +929,7 @@ properties: type: object additionalProperties: false required: [status, shortName, longName, identificationCode, type, parentOrg, childrenOrgs, - location, profile, app6context, app6standardIdentity, app6symbolSet, app6hq, + location, administratingPositions, profile, app6context, app6standardIdentity, app6symbolSet, app6hq, app6amplifier, emailAddresses, authorizationGroups] properties: status: @@ -935,6 +947,18 @@ properties: childrenOrgs: "$ref": "#/$defs/labeledField" location: + required: [filter] + allOf: + - "$ref": "#/$defs/extensibleInputField" + - properties: + filter: + type: array + uniqueItems: true + items: + type: string + enum: + [VIRTUAL_LOCATION, PHYSICAL_LOCATION, GEOGRAPHICAL_AREA, COUNTRY, POINT_LOCATION] + administratingPositions: "$ref": "#/$defs/inputField" profile: "$ref": "#/$defs/inputField" @@ -1068,7 +1092,7 @@ properties: position: type: object additionalProperties: false - required: [name, type, location, organizationsAdministrated] + required: [name, type] properties: name: type: string @@ -1078,25 +1102,11 @@ properties: type: string title: The permissions type of this field description: Used in the UI for the type/permissions of a position. - location: - type: object - additionalProperties: false - required: [filter] - properties: - filter: - type: array - uniqueItems: true - items: - type: string - enum: - [VIRTUAL_LOCATION, PHYSICAL_LOCATION, GEOGRAPHICAL_AREA, POINT_LOCATION] - organizationsAdministrated: - "$ref": "#/$defs/inputField" org: type: object additionalProperties: false - required: [name, allOrgName, location, administratingPositions] + required: [name, allOrgName] properties: name: type: string @@ -1106,20 +1116,6 @@ properties: type: string title: The name used to represent 'all organizations' description: Used in the UI to refer to all organizations collectively. - location: - type: object - additionalProperties: false - required: [filter] - properties: - filter: - type: array - uniqueItems: true - items: - type: string - enum: - [VIRTUAL_LOCATION, PHYSICAL_LOCATION, GEOGRAPHICAL_AREA, COUNTRY, POINT_LOCATION] - administratingPositions: - "$ref": "#/$defs/inputField" superuser: type: object diff --git a/testDictionaries/no-custom-fields.yml b/testDictionaries/no-custom-fields.yml index 5e04bcc681..2ef2f7c392 100644 --- a/testDictionaries/no-custom-fields.yml +++ b/testDictionaries/no-custom-fields.yml @@ -537,6 +537,10 @@ fields: label: Location placeholder: Search for the location where this Position will operate from… optional: false + filter: [POINT_LOCATION] + organizationsAdministrated: + label: Organizations administrated + placeholder: Search for an organization… role: label: Position Role types: @@ -572,6 +576,10 @@ fields: location: label: Location placeholder: Search for the location where this Organization will operate from… + filter: [POINT_LOCATION, COUNTRY] + administratingPositions: + label: Assigned Superusers + placeholder: Search for a position… profile: label: Profile placeholder: Fill in the profile of this organization @@ -1446,20 +1454,10 @@ fields: position: name: Regular type: Regular position - location: - filter: [POINT_LOCATION] - organizationsAdministrated: - label: Organizations administrated - placeholder: Search for an organization… org: name: Organization allOrgName: Top-level Organizations - location: - filter: [POINT_LOCATION, COUNTRY] - administratingPositions: - label: Assigned Superusers - placeholder: Search for a position… pinned_ORGs: [Key Leader Engagement] non_reporting_ORGs: [ANET Administrators]