-
Notifications
You must be signed in to change notification settings - Fork 19
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: add description to drip lists (closes #642) #643
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d2876bf
feat: add drip list description to funder flow (untested submit)
evvvritt b5e162d
feat: description on drip-list-card and edit-drip-list
evvvritt 4bd35f4
feat: new text-expandable component for drip-list-description
evvvritt 0f76f62
fix: description gets added in tx
evvvritt 6dad7c0
test: add desc to drip-list tests
evvvritt 6cdc26e
chore: package-lock rewrite from tailwindcss edit
evvvritt c9d45fe
fix: missing description param
evvvritt a9e3e08
style: rmv hover bg on text-expandable text
evvvritt 1345d52
fix: handle dripList versioning/typing better
evvvritt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/lib/components/drip-list-editor/drip-list-editor.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<script lang="ts" context="module"> | ||
export interface DripListConfig { | ||
items: Items; | ||
percentages: Percentages; | ||
title: string; | ||
description: string | undefined; | ||
} | ||
</script> | ||
|
||
<script lang="ts"> | ||
import type { | ||
Items, | ||
Percentages, | ||
} from '$lib/components/drip-list-members-editor/drip-list-members-editor.svelte'; | ||
import ListEditor from '$lib/components/drip-list-members-editor/drip-list-members-editor.svelte'; | ||
import FormField from '../form-field/form-field.svelte'; | ||
import TextInput from '../text-input/text-input.svelte'; | ||
import TextArea from '../text-area/text-area.svelte'; | ||
import type { TextInputValidationState } from 'radicle-design-system/TextInput'; | ||
|
||
export let dripList: DripListConfig = { | ||
title: 'My Drip List', | ||
percentages: {}, | ||
items: {}, | ||
description: undefined, | ||
}; | ||
export let showListFirst = false; | ||
export let projectUrlToAdd: string | undefined = undefined; | ||
|
||
// validation | ||
let listValid = false; | ||
$: titleValid = dripList.title.length > 0; | ||
$: descriptionValid = textAreaValidationState.type === 'valid'; | ||
|
||
export let isValid = false; | ||
$: isValid = listValid && titleValid && descriptionValid; | ||
|
||
let textAreaValidationState: TextInputValidationState; | ||
$: textAreaValidationState = !dripList.description | ||
? { type: 'valid' } | ||
: dripList.description.length >= 1000 | ||
? { type: 'invalid', message: `Cannot exceed ${Number(1000).toLocaleString()} characters.` } | ||
: /<[^>]+>/gi.test(dripList.description) | ||
? { type: 'invalid', message: 'HTML currently not allowed.' } | ||
: { type: 'valid' }; | ||
</script> | ||
|
||
<section class="flex flex-col gap-8"> | ||
<FormField title="Title*"> | ||
<TextInput bind:value={dripList.title} /> | ||
</FormField> | ||
|
||
<FormField title="Description"> | ||
<TextArea | ||
bind:value={dripList.description} | ||
resizable={true} | ||
validationState={textAreaValidationState} | ||
/> | ||
</FormField> | ||
|
||
<div class:order-first={showListFirst}> | ||
<FormField title="Members*"> | ||
<!-- TODO: This crashes when entering some non-valid github url --> | ||
<ListEditor | ||
bind:percentages={dripList.percentages} | ||
bind:items={dripList.items} | ||
bind:valid={listValid} | ||
addOnMount={projectUrlToAdd} | ||
/> | ||
</FormField> | ||
</div> | ||
</section> |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...s/list-editor/item-templates/drip-list.ts → ...embers-editor/item-templates/drip-list.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...list-editor/item-templates/eth-address.ts → ...bers-editor/item-templates/eth-address.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nts/list-editor/item-templates/project.ts → ...-members-editor/item-templates/project.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is that still a thing? 🤔
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.
what is a non-valid github url?