Skip to content

Commit

Permalink
feat: mark instances as public (#156)
Browse files Browse the repository at this point in the history
* feat: mark instances as public

* chore: run workflow form master
  • Loading branch information
tonsV2 authored Jul 7, 2023
1 parent 2a89a2a commit a8c66f2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ on: pull_request

jobs:
dependabot:
uses: dhis2-sre/gha-workflows/.github/workflows/dependabot.yaml@v0.8.0
uses: dhis2-sre/gha-workflows/.github/workflows/dependabot.yaml@master
3 changes: 2 additions & 1 deletion src/components/InstancesLists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
DataTableToolbar as TableToolbar,
Help,
IconAdd24,
IconWorld24,
Tag,
} from '@dhis2/ui'
import { useNavigate } from 'react-router-dom'
Expand Down Expand Up @@ -123,7 +124,7 @@ const InstancesList = () => {
<DataTableCell>
<Tag positive>Running</Tag>
</DataTableCell>
<DataTableCell>{instance.name}</DataTableCell>
<DataTableCell>{instance.name} {instance.public === true ? <IconWorld24/> : <></>}</DataTableCell>
<DataTableCell>
<Moment date={instance.createdAt} fromNow />
</DataTableCell>
Expand Down
6 changes: 5 additions & 1 deletion src/components/StackConfigurator.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Divider, InputField, SingleSelectField, SingleSelectOption, TextAreaField } from '@dhis2/ui'
import { CheckboxField, Divider, InputField, SingleSelectField, SingleSelectOption, TextAreaField } from '@dhis2/ui'
import cx from 'classnames'
import { getStack } from '../api/stacks'
import { Stack } from '../types/stack'
import { useApi } from '../api/useApi'
Expand Down Expand Up @@ -63,6 +64,7 @@ export const StackConfigurator = forwardRef(function StackConfigurator({ name: s
const { data: groups, isLoading: isLoadingGroups } = useApi<Group[]>(getGroups)
const [group, setGroup] = useState('')
const [ttl, setTtl] = useState('')
const [publicity, setPublicity] = useState(false)

useImperativeHandle(
ref,
Expand All @@ -73,6 +75,7 @@ export const StackConfigurator = forwardRef(function StackConfigurator({ name: s
description: description,
groupName: group,
ttl: ttlMap.get(ttl),
public: publicity,
requiredParameters: toArray(requiredStackParameters),
optionalParameters: toArray(optionalStackParameters),
}
Expand Down Expand Up @@ -131,6 +134,7 @@ export const StackConfigurator = forwardRef(function StackConfigurator({ name: s
<SingleSelectOption key={key} label={key} value={key} />
))}
</SingleSelectField>
<CheckboxField className={cx(styles.field, styles.checkboxfield)} label="Public?" checked={publicity} onChange={({ checked }) => setPublicity(checked)} />
</div>

{requiredStackParameters && (
Expand Down
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type Instance = {
groupName: string
stackName: string
ttl: number
public: boolean
requiredParameters:
| [
{
Expand Down

0 comments on commit a8c66f2

Please sign in to comment.