-
Notifications
You must be signed in to change notification settings - Fork 2k
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: Key-value pair view for environment[INS-4256] #8071
Conversation
ee16325
to
7578f6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had review as pass 1 and will do more checks later.
packages/insomnia/src/ui/components/modals/workspace-environments-edit-modal.tsx
Outdated
Show resolved
Hide resolved
packages/insomnia/src/ui/components/panes/request-group-pane.tsx
Outdated
Show resolved
Hide resolved
kvPair.push({ | ||
id: generateId('envPair'), | ||
name: key, | ||
value: isValObject ? JSON.stringify(val) : String(val), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON.stringify
may not work with nunjucks tags as values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id: string; | ||
name: string; | ||
value: string; | ||
type: EnvironmentKvPairDataType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we infer the data types for other primitives like number, boolean etc?
Currently if I add a number or boolean it is recognized as string in the table editor.
This might be difficult if we try to infer nunjucks templates that are not inside quotes but not quite sure about it.
packages/insomnia/src/ui/components/editors/environment-key-value-editor/key-value-editor.tsx
Show resolved
Hide resolved
}, | ||
]; | ||
|
||
const renderPairItem = (kvPair: EnvironmentKvPairData) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should turn this into a component in the module scope?
}, []); | ||
|
||
return ( | ||
<div className="p-[--padding-sm] min-w-max h-full overflow-hidden flex flex-col"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there is extra padding around the toolbar. If we want we could add padding in the key-value editor ListBox bellow
<div className="p-[--padding-sm] min-w-max h-full overflow-hidden flex flex-col"> | |
<div className="min-w-max h-full overflow-hidden flex flex-col"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will remove the padding for toolbar
2.add message for duplicate items
2.Set default folder environment type to be key-value pair
7d5f4c6
to
c239fbe
Compare
Highlight and Changes:
Add new KV-pair view for environment