Skip to content

Commit

Permalink
feat: add ui components for the edit page panels
Browse files Browse the repository at this point in the history
  • Loading branch information
d-rita committed Dec 18, 2024
1 parent 5ba3657 commit d60b78d
Show file tree
Hide file tree
Showing 9 changed files with 399 additions and 74 deletions.
109 changes: 35 additions & 74 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,104 +5,65 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-12-05T03:27:06.316Z\n"
"PO-Revision-Date: 2024-12-05T03:27:06.317Z\n"
"POT-Creation-Date: 2024-12-18T09:41:03.249Z\n"
"PO-Revision-Date: 2024-12-18T09:41:03.250Z\n"

msgid "View keys"
msgstr "View keys"
msgid "An error has occurred"
msgstr "An error has occurred"

msgid "Click a namespace to view its keys"
msgstr "Click a namespace to view its keys"
msgid "Back to datastore"
msgstr "Back to datastore"

msgid "Add New Key"
msgstr "Add New Key"
msgid "Back to all namespaces"
msgstr "Back to all namespaces"

msgid "Add New Namespace"
msgstr "Add New Namespace"
msgid "Search namespaces"
msgstr "Search namespaces"

msgid "New Namespace"
msgstr "New Namespace"

msgid "Namespace"
msgstr "Namespace"

msgid "Key"
msgstr "Key"

msgid "Cancel"
msgstr "Cancel"

msgid "Add Key"
msgstr "Add Key"
msgid "Close"
msgstr "Close"

msgid "Add Namespace"
msgstr "Add Namespace"

msgid "Key created successfully"
msgstr "Key created successfully"

msgid "There was an error creating the key"
msgstr "There was an error creating the key"

msgid "Add new namespace"
msgstr "Add new namespace"

msgid "New namespace"
msgstr "New namespace"

msgid "Add new key"
msgstr "Add new key"

msgid "New key"
msgstr "New key"

msgid "Delete"
msgstr "Delete"

msgid "Failed to fetch key values!"
msgstr "Failed to fetch key values!"

msgid "Key successfully updated"
msgstr "Key successfully updated"

msgid "There was an error updating the key"
msgstr "There was an error updating the key"

msgid "Loading"
msgstr "Loading"
msgid "Save"
msgstr "Save"

msgid "Save changes"
msgstr "Save changes"

msgid "Key deleted successfully"
msgstr "Key deleted successfully"

msgid "There was an error deleting the key"
msgstr "There was an error deleting the key"
msgid "Choose a key to start editing"
msgstr "Choose a key to start editing"

msgid "There was an error while deleting the key"
msgstr "There was an error while deleting the key"
msgid "Keys"
msgstr "Keys"

msgid "Error fetching namespaces"
msgstr "Error fetching namespaces"
msgid "New Key"
msgstr "New Key"

msgid "Namespaces"
msgstr "Namespaces"
msgid "Search keys"
msgstr "Search keys"

msgid "This will delete all the keys in this namespace"
msgstr "This will delete all the keys in this namespace"
msgid "Key"
msgstr "Key"

msgid "DataStore"
msgstr "DataStore"

msgid "User DataStore"
msgstr "User DataStore"
msgid "UserDataStore"
msgstr "UserDataStore"

msgid "Search"
msgstr "Search"

msgid "An error has occurred"
msgstr "An error has occurred"
msgid "Delete"
msgstr "Delete"

msgid "Back"
msgstr "Back"
msgid "Actions"
msgstr "Actions"

msgid "Back to DataStore"
msgstr "Back to DataStore"
msgid "Share"
msgstr "Share"
159 changes: 159 additions & 0 deletions src/App.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
/* layout */
.page {
height: 100%;
background-color: var(--colors-grey300);
box-sizing: border-box;
overflow-y: hidden;
}

/* first page */

.firstPage {
margin: 0 auto;
padding: 0;
width: 70vw;
}

.firstPageContainer {
margin: 0 auto;
padding: 0;
width: 100%;
font-size: 1rem;
background-color: white;
border: 1px solid var(--colors-grey400);
border-radius: 4px;
}

/* second page */

.secondPage {
margin: 0 auto;
width: 98vw;
padding: 0;
}

.secondPageContainer {
display: grid;
grid-template-columns: 40% 60%;
width: 100%;
font-size: 1rem;
background-color: white;
border: 1px solid var(--colors-grey400);
border-radius: 4px;
}

/* page header */
.pageHeader {
height: 40px;
display: flex;
}

.firstPageHeader {
font-size: 20px;
font-weight: 400;
align-self: center;
}

.secondPageHeader {
width: fit-content;
color: var(--colors-grey700);
text-decoration: none;
align-self: center;
font-size: 14px;
}

.secondPageHeader span {
display: grid;
grid-template-columns: auto auto;
gap: 5px;
}

/* panel header */

.panelHeader {
height: 50px;
padding: 0 0.5em;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
border: 1px solid var(--colors-grey300);
}

.keysPanelHeader {
font-weight: 500;
font-size: 18px;
color: var(--colors-grey800);
}

.keysPanelMidSection {
padding: 10px;
}

.emptyEditorPanelHeader {
font-style: italic;
font-size: 16px;
color: var(--colors-grey600);
}

.editorPanelHeader {
font-size: 16px;
color: var(--colors-grey800);
font-weight: 500;
}

/* namespace view */

.midSection {
padding: 0.7em;
display: grid;
grid-template-columns: repeat(1fr, 4);
}

.search {
grid-column: 1 / 2;
}

.createButton {
grid-column: 5;
color: var(--colors-grey600);
}

.createButton button {
width: fit-content;
float: right;
}

/* table */
.columnHeader {
font-size: 14px;
font-weight: 600;
}

.actionButtons {
padding: 0;
margin: 0;
}

.actionButtons button {
height: fit-content;
border: none;
margin: 0 0.3em;
background-color: transparent;
}

.actionButtons button:active button:focus-visible {
background-color: transparent;
}

/* edit page */

.editButtons {
display: grid;
grid-template-columns: auto auto;
gap: 10px;
}

.editButtons button {
width: fit-content;
}
10 changes: 10 additions & 0 deletions src/components/header/PanelHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
import classes from '../../App.module.css'

type HeaderProps = {
children?: React.ReactNode
}

export default function PanelHeader({ children }: HeaderProps) {
return <div className={classes.panelHeader}>{children}</div>
}
File renamed without changes.
33 changes: 33 additions & 0 deletions src/components/pages/Edit.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { IconArrowLeft16 } from '@dhis2/ui'
import React from 'react'
import { Link, Outlet, useParams } from 'react-router-dom'
import classes from '../../App.module.css'
import i18n from '../../locales'
import KeysPanel from '../panels/KeysPanel'
import PageHeader from '../header/PageHeader'

const EditPage = () => {
const { store } = useParams()

return (
<div className={classes.secondPage}>
<PageHeader>
<Link to={`/${store}`} className={classes.secondPageHeader}>
<span>
<IconArrowLeft16 /> {i18n.t('Back to all namespaces')}
</span>
</Link>
</PageHeader>
<div className={classes.secondPageContainer}>
<div className={classes.keysPanel}>
<KeysPanel />
</div>
<div className={classes.editorPanel}>
<Outlet />
</div>
</div>
</div>
)
}

export default EditPage
Loading

0 comments on commit d60b78d

Please sign in to comment.