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

Modify how principal sub-organization's are displayed #3512

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions client/src/models/Organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,14 @@ export default class Organization extends Model {
toString() {
return this.shortName || this.longName || this.identificationCode
}

static toIdentificationCodeString(organization) {
return organization.type === Organization.TYPE.PRINCIPAL_ORG
? `${organization.shortName} \\ ${
Settings.fields.advisor.org.identificationCode.label
}: ${organization.identificationCode || "Not specified"}`
: `${organization.shortName} ${organization.longName} ${
organization.identificationCode || ""
}`
}
}
6 changes: 3 additions & 3 deletions client/src/pages/organizations/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ const OrganizationForm = ({ edit, title, initialValues }) => {
modelType="Organization"
model={values.parentOrg}
>
{values.parentOrg.shortName}{" "}
{values.parentOrg.longName}{" "}
{values.parentOrg.identificationCode}
{Organization.toIdentificationCodeString(
values.parentOrg
)}
</LinkTo>
)
}
Expand Down
13 changes: 8 additions & 5 deletions client/src/pages/organizations/Show.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ const GQL_GET_ORGANIZATION = gql`
shortName
longName
identificationCode
type
}
childrenOrgs(query: { pageNum: 0, pageSize: 0, status: ACTIVE }) {
uuid
shortName
longName
identificationCode
type
}
positions {
uuid
Expand Down Expand Up @@ -315,9 +317,9 @@ const OrganizationShow = ({ pageDispatchers }) => {
modelType="Organization"
model={organization.parentOrg}
>
{organization.parentOrg.shortName}{" "}
{organization.parentOrg.longName}{" "}
{organization.parentOrg.identificationCode}
{Organization.toIdentificationCodeString(
organization.parentOrg
)}
</LinkTo>
)
}
Expand Down Expand Up @@ -370,8 +372,9 @@ const OrganizationShow = ({ pageDispatchers }) => {
modelType="Organization"
model={organization}
>
{organization.shortName} {organization.longName}{" "}
{organization.identificationCode}
{Organization.toIdentificationCodeString(
organization
)}
</LinkTo>
</ListGroupItem>
))}
Expand Down