Skip to content

Commit

Permalink
🚧 AnnotationButton attribute to ignore contract
Browse files Browse the repository at this point in the history
  • Loading branch information
vokimon committed May 10, 2024
1 parent 051a91b commit 98e35f2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions tomatic/ui/src/pages/CallinfoPage/AnnotationButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Auth from '../../services/auth'
import TypificationDialog from './TypificationDialog'
import ContentPasteIcon from '@mui/icons-material/ContentPaste'

export default function AnnotationButton() {
export default function AnnotationButton({ ignoreContract }) {
const [openDialog, closeDialog] = useDialog()

return (
Expand All @@ -20,7 +20,12 @@ export default function AnnotationButton() {
}
openDialog({
maxWidth: 'md',
children: <TypificationDialog onClose={onClose} />,
children: (
<TypificationDialog
onClose={onClose}
ignoreContract={ignoreContract}
/>
),
onClose: onClose,
})
}}
Expand All @@ -30,5 +35,3 @@ export default function AnnotationButton() {
</IconButton>
)
}


2 changes: 1 addition & 1 deletion tomatic/ui/src/pages/CallinfoPage/AttendedCalls.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export default function AttendedCalls({ data }) {
<Stack direction="row">
<CallLockButton />
<NewTabButton />
<AnnotationButton />
<AnnotationButton ignoreContract />
</Stack>
}
></CardHeader>
Expand Down
4 changes: 2 additions & 2 deletions tomatic/ui/src/pages/CallinfoPage/TypificationDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import CallInfo from '../../contexts/callinfo'
import TypificationChooser from './TypificationChooser'
import AuthContext from '../../contexts/AuthContext'

export default function TypificationDialog({ onClose }) {
export default function TypificationDialog({ onClose, ignoreContract }) {
const now = new Date().toISOString()
const [comment, setComment] = React.useState('')
const [typification, setTypification] = React.useState([])
const { userid, fullname } = React.useContext(AuthContext)
const partner = CallInfo.selectedPartner()
const contract = CallInfo.selectedContract()
const contract = ignoreContract ? null : CallInfo.selectedContract()
const call_id = CallInfo.currentCall.use()

const call = CallInfo.callData(call_id)
Expand Down

0 comments on commit 98e35f2

Please sign in to comment.