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

custom views support #266

Merged
merged 23 commits into from Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cef4c67
chore: add env variable
victorgaard Nov 23, 2022
7befb57
feat: add save view button and isolate sidepanel component
victorgaard Nov 24, 2022
7c5216c
feat: populate filters info inside sidepanel
victorgaard Nov 24, 2022
44897c9
feat: add fetch, save, update and delete view methods to settings ser…
victorgaard Nov 24, 2022
d5ffaaa
feat: break down sidepanel components
victorgaard Nov 24, 2022
a89f835
fix: url endpoints for views
victorgaard Nov 24, 2022
3fbfcc3
feat: adding data to inventory table based on the view
victorgaard Nov 24, 2022
4a3e56e
feat: add InventoryViewsTabs component
victorgaard Nov 25, 2022
ab68bd3
fix: add PUT and DELETE to allowed methods on internal.go
victorgaard Nov 25, 2022
e57a72c
feat: syncronize add/edit/delete views with UI
victorgaard Nov 29, 2022
79d663b
feat: display active filters on views and views sidepanel
victorgaard Nov 29, 2022
357eb8c
feat: add skeleton for filters
victorgaard Nov 30, 2022
f7f50ef
fix: after renaming a view, persist the item active class
victorgaard Dec 1, 2022
5ccdf4c
style: make views tabs wrap
victorgaard Dec 1, 2022
447ce58
fix: updating a tag in a view no longer display duplicated results
victorgaard Dec 1, 2022
51ec0bf
fix: conditionals to render inventory stats only if there are resources
victorgaard Dec 1, 2022
576b2cf
style: delete button improvement
victorgaard Dec 1, 2022
6c75f1a
fix: renaming inventory to all resources
victorgaard Dec 1, 2022
1829c0b
fix: search for views
victorgaard Dec 1, 2022
a78a840
style: fix tags design
victorgaard Dec 1, 2022
5c1ce80
feat: add infinite scroll for searched filtered list or custom view
victorgaard Dec 1, 2022
fb62f69
chore: embeed dashboard
mlabouardy Dec 1, 2022
a568492
fix: update domain name
mlabouardy Dec 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions dashboard/components/button/Button.tsx
Expand Up @@ -6,6 +6,7 @@ export type ButtonProps = {
style?:
| 'primary'
| 'secondary'
| 'bulk'
| 'outline'
| 'ghost'
| 'delete'
Expand Down Expand Up @@ -55,23 +56,26 @@ function Button({
transition ? 'transition-colors' : ''
}`;

const primary = `${base} bg-komiser-600 hover:bg-komiser-700 text-white active:bg-secondary disabled:bg-komiser-600/30`;
const primary = `${base} bg-gradient-to-br from-primary bg-secondary hover:bg-primary active:from-secondary active:bg-secondary text-white disabled:from-primary disabled:bg-secondary disabled:opacity-50`;

const secondary = `${base} bg-black-100 hover:bg-black-200/50 active:bg-black-100 text-black-400 disabled:bg-black-100 disabled:opacity-50`;

const outline = `${base} bg-transparent text-secondary border-2 border-secondary hover:bg-komiser-100 active:border-secondary active:text-secondary disabled:bg-transparent disabled:opacity-50`;
const bulk = `${base} bg-white hover:bg-komiser-200 active:bg-komiser-300 text-secondary disabled:bg-white disabled:opacity-50`;

const outline = `${base} bg-transparent text-primary border-2 border-primary hover:bg-komiser-100 active:border-primary active:text-primary disabled:bg-transparent disabled:opacity-50`;

const ghost = `${base} bg-transparent hover:bg-black-400/10 active:bg-black-400/20 text-black-900/60 disabled:bg-transparent disabled:opacity-50`;

const deleteStyle = `${base} bg-error-600 text-white hover:bg-error-700 active:bg-error-600 disabled:bg-error-700 disabled:text-white/70`;

const deleteGhostStyle = `${base} bg-transparent text-error-600 hover:bg-error-600 hover:text-white active:bg-error-100 active:text-error-600 disabled:bg-error-600 disabled:text-white`;
const deleteGhostStyle = `${base} bg-error-100 text-error-600 hover:bg-error-600 hover:text-white active:bg-error-100 active:text-error-600 disabled:bg-error-600 disabled:text-white`;

function handleStyle() {
let buttonStyle;

if (style === 'primary') buttonStyle = primary;
if (style === 'secondary') buttonStyle = secondary;
if (style === 'bulk') buttonStyle = bulk;
if (style === 'outline') buttonStyle = outline;
if (style === 'ghost') buttonStyle = ghost;
if (style === 'delete-ghost') buttonStyle = deleteGhostStyle;
Expand Down
2 changes: 1 addition & 1 deletion dashboard/components/dropdown/Dropdown.tsx
Expand Up @@ -9,7 +9,7 @@ type DropdownProps = {
function Dropdown({ isOpen, toggle, children }: DropdownProps) {
return (
<button
className={`flex items-center font-medium text-sm rounded-lg h-[2.5rem] px-3 gap-2 text-secondary border-2 border-secondary active:border-secondary active:text-secondary transition-colors ${
className={`flex items-center font-medium text-sm rounded-lg h-[2.5rem] px-3 gap-2 text-primary border-2 border-primary active:border-primary active:text-primary transition-colors ${
isOpen
? 'bg-komiser-200/50'
: 'bg-transparent hover:bg-komiser-200/30 active:bg-komiser-200'
Expand Down
2 changes: 1 addition & 1 deletion dashboard/components/input/Input.tsx
Expand Up @@ -52,7 +52,7 @@ function Input({
<input
type={type}
name={name}
className={`w-full pt-[1.75rem] pb-[0.75rem] px-4 text-sm bg-white text-black-900 rounded caret-secondary outline outline-black-200 focus:outline-secondary focus:outline-2 peer ${
className={`w-full pt-[1.75rem] pb-[0.75rem] px-4 text-sm bg-white text-black-900 rounded caret-primary outline outline-black-200 focus:outline-primary focus:outline-2 peer ${
isValid === false && `outline-error-600 focus:outline-error-600`
}`}
placeholder=" "
Expand Down