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

feat: mark instances as public #156

Merged
merged 2 commits into from
Jul 7, 2023
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
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