iachat/app/javascript/dashboard/components/widgets/forms/Input.vue
Cayo P. R. Oliveira 8e913236e5
feat: baileys messages reactions (#33)
* fix: update send_message method to handle  baileys-api send-message changes

* chore: simplify update of is_unsupported

* feat: add support for message reactions in WhatsApp Baileys service

* chore: update context description for unsupported message in send_message spec

* feat: enhance incoming messages Baileys service to support message reactions and external source ID handling

* fix: correct typo in comment for is_reaction attribute in Message model

* chore: simplify message handling by removing external source ID checks and unused methods

* fix: update comment to reflect necessary change for source_id in set_contact method

* fix: refactor message handling for reactions and simplify jid generation

* fix: add comment to clarify behavior of find_message_by_source_id method

* fix: update unsupported message handling

* chore: specs for reaction messages

* fix: simplify message update handling by removing redundant validation method

* fix: update reaction message handling to use in_reply_to_external_id and fix spec

* fix: enhance message handling for unsupported types and update specs

* fix: update reaction message handling to set is_reaction flag and enhance specs

* fix: update specs for send message in reaction

* revert: remove mb0 from input

* fix: streamline jid generation in send_message_request

* refactor: specs

* refactor: move content attributes to helper

* test: spec for empty reaction

* refactor: streamline references to replied message

* test: refactor spec

* test: refactor spec

---------

Co-authored-by: gabrieljablonski <contact@gabrieljablonski.com>
2025-04-29 20:57:36 -03:00

91 lines
1.8 KiB
Vue

<script>
/**
* @deprecated This component is deprecated and will be removed in the next major version.
* Please use v3/components/Form/Input.vue instead
*/
export default {
props: {
label: {
type: String,
default: '',
},
modelValue: {
type: [String, Number],
default: '',
},
type: {
type: String,
default: 'text',
},
placeholder: {
type: String,
default: '',
},
helpText: {
type: String,
default: '',
},
error: {
type: String,
default: '',
},
readonly: {
type: Boolean,
default: false,
},
styles: {
type: Object,
default: () => {},
},
},
emits: ['update:modelValue', 'input', 'blur'],
mounted() {
if (import.meta.env.DEV) {
// eslint-disable-next-line no-console
console.warn(
'[DEPRECATED] <WootInput> has be deprecated and will be removed soon. Please use v3/components/Form/Input.vue instead'
);
}
},
methods: {
onChange(e) {
this.$emit('input', e.target.value);
this.$emit('update:modelValue', e.target.value);
},
onBlur(e) {
this.$emit('blur', e.target.value);
},
},
};
</script>
<template>
<label class="input-container">
<span v-if="label">{{ label }}</span>
<input
:value="modelValue"
:type="type"
:placeholder="placeholder"
:readonly="readonly"
:style="styles"
@input="onChange"
@blur="onBlur"
/>
<p v-if="helpText" class="help-text">{{ helpText }}</p>
<span v-if="error" class="message">
{{ error }}
</span>
<slot name="masked" />
</label>
</template>
<style scoped lang="scss">
.help-text {
@apply mt-0.5 text-xs not-italic text-n-slate-11;
}
.message {
margin-top: 0 !important;
}
</style>