2
0

Merge pull request #20 from baptisteArno/fix/delete-collaborator

fix(share): 🐛 Delete collaborator
This commit is contained in:
Baptiste Arnaud
2022-04-08 16:00:56 +02:00
committed by GitHub
3 changed files with 10 additions and 7 deletions

View File

@@ -50,7 +50,7 @@ export const EditableUrl = ({
<HStack>
<EditButton size="xs" />
<CopyButton size="xs" textToCopy={`${hostname}/${pathname}`} />
<CopyButton size="xs" textToCopy={`${hostname}/${pathname ?? ''}`} />
</HStack>
</Editable>
)

View File

@@ -200,7 +200,7 @@ export const CollaborationList = () => {
name={user.name ?? undefined}
type={type}
isOwner={isOwner}
onDeleteClick={handleDeleteCollaboration(user.email ?? '')}
onDeleteClick={handleDeleteCollaboration(userId ?? '')}
onChangeCollaborationType={handleChangeCollaborationType(userId)}
/>
))}

View File

@@ -88,19 +88,22 @@ const executeCondition = (
const executeComparison =
(variables: Variable[]) => (comparison: Comparison) => {
if (!comparison?.variableId) return false
const inputValue =
const inputValue = (
variables.find((v) => v.id === comparison.variableId)?.value ?? ''
const value = parseVariables(variables)(comparison.value)
)
.toString()
.trim()
const value = parseVariables(variables)(comparison.value).toString().trim()
if (isNotDefined(value)) return false
switch (comparison.comparisonOperator) {
case ComparisonOperators.CONTAINS: {
return inputValue.toString().includes(value.toString())
return inputValue.toLowerCase().includes(value.toLowerCase())
}
case ComparisonOperators.EQUAL: {
return inputValue.toString() === value.toString()
return inputValue === value
}
case ComparisonOperators.NOT_EQUAL: {
return inputValue.toString() !== value.toString()
return inputValue !== value
}
case ComparisonOperators.GREATER: {
return parseFloat(inputValue) >= parseFloat(value)