Skip to content

Commit

Permalink
avniproject/avni-server#759 - support for organisation status and add…
Browse files Browse the repository at this point in the history
…ed new category.
  • Loading branch information
petmongrels committed Jul 29, 2024
1 parent d23d337 commit fcdc30d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ deps:
start:
yarn start

start-dark:
yarn start-dark

start-with-staging:
yarn start-with-staging

Expand Down
24 changes: 21 additions & 3 deletions src/adminApp/Organisation.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { CustomSelectInput } from "./components/CustomSelectInput";
import { Title } from "./components/Title";
import OpenOrganisation from "./components/OpenOrganisation";
import ToggleAnalyticsButton from "./ToggleAnalyticsButton";
import OrganisationCategory from "./domain/OrganisationCategory";
import OrganisationCategory, { OrganisationStatus } from "./domain/OrganisationCategory";

export const OrganisationFilter = props => (
<Filter {...props} style={{ marginBottom: "2em" }}>
Expand All @@ -39,9 +39,23 @@ const OrganisationCategoryInput = () => {
validate={isRequired}
choices={[
{ id: OrganisationCategory.Production, name: OrganisationCategory.Production },
{ id: OrganisationCategory.UAT, name: OrganisationCategory.UAT },
{ id: OrganisationCategory.Prototype, name: OrganisationCategory.Prototype },
{ id: OrganisationCategory.Temporary, name: OrganisationCategory.Temporary }
{ id: OrganisationCategory.Temporary, name: OrganisationCategory.Temporary },
{ id: OrganisationCategory.Trial, name: OrganisationCategory.Trial },
{ id: OrganisationCategory.UAT, name: OrganisationCategory.UAT }
]}
/>
);
};

const OrganisationStatusInput = () => {
return (
<SelectInput
source="status"
validate={isRequired}
choices={[
{ id: OrganisationStatus.Live, name: OrganisationStatus.Live },
{ id: OrganisationStatus.Archived, name: OrganisationStatus.Archived }
]}
/>
);
Expand All @@ -60,6 +74,7 @@ export const OrganisationList = ({ history, ...props }) => {
<TextField source="schemaName" label="Schema Name" />
<TextField source="mediaDirectory" label="Media Directory" />
<TextField source="usernameSuffix" label="Username Suffix" />
<TextField source="status" label="Status" />
<BooleanField source="analyticsDataSyncActive" label="Active analytics data sync" sortable={false} />
<ShowButton />
<OpenOrganisation porps={props} />
Expand All @@ -78,6 +93,7 @@ export const OrganisationDetails = props => {
<TextField source="mediaDirectory" label="Media Directory" />
<TextField source="usernameSuffix" label="Username Suffix" />
<TextField source="category" label="Category" />
<TextField source="status" label="Status" />
<ReferenceField resource="account" source="accountId" reference="account" label="Account Name" linkType="show" allowEmpty>
<TextField source="name" />
</ReferenceField>
Expand Down Expand Up @@ -106,6 +122,7 @@ export const OrganisationEdit = props => {
<DisabledInput source="mediaDirectory" />
<TextInput source="usernameSuffix" validate={isRequired} />
<OrganisationCategoryInput />
<OrganisationStatusInput />
<BooleanField source="analyticsDataSyncActive" />
<ToggleAnalyticsButton />
<br />
Expand Down Expand Up @@ -140,6 +157,7 @@ export const OrganisationCreate = props => {
<TextInput source="mediaDirectory" validate={isRequired} />
<TextInput source="usernameSuffix" validate={isRequired} />
<OrganisationCategoryInput />
<OrganisationStatusInput />
<ReferenceInput
resource="account"
source="accountId"
Expand Down
6 changes: 6 additions & 0 deletions src/adminApp/domain/OrganisationCategory.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ class OrganisationCategory {
static UAT = "UAT";
static Prototype = "Prototype";
static Temporary = "Temporary";
static Trial = "Trial";
}

export class OrganisationStatus {
static Live = "Live";
static Archived = "Archived";
}

export default OrganisationCategory;

0 comments on commit fcdc30d

Please sign in to comment.