chore: Replace packages with native functions (#5140)
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
<script>
|
||||
import { mixin as clickaway } from 'vue-clickaway';
|
||||
import { VeTable } from 'vue-easytable';
|
||||
import flag from 'country-code-emoji';
|
||||
import { getCountryFlag } from 'dashboard/helper/flag';
|
||||
|
||||
import Spinner from 'shared/components/Spinner.vue';
|
||||
import Thumbnail from 'dashboard/components/widgets/Thumbnail.vue';
|
||||
@@ -200,7 +200,7 @@ export default {
|
||||
if (row.country) {
|
||||
return (
|
||||
<div class="text-truncate">
|
||||
{`${flag(row.countryCode)} ${row.country}`}
|
||||
{`${getCountryFlag(row.countryCode)} ${row.country}`}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ import ContactMergeModal from 'dashboard/modules/contact/ContactMergeModal';
|
||||
import alertMixin from 'shared/mixins/alertMixin';
|
||||
import adminMixin from '../../../../mixins/isAdmin';
|
||||
import { mapGetters } from 'vuex';
|
||||
import flag from 'country-code-emoji';
|
||||
import { getCountryFlag } from 'dashboard/helper/flag';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -244,7 +244,7 @@ export default {
|
||||
},
|
||||
findCountryFlag(countryCode, cityAndCountry) {
|
||||
try {
|
||||
const countryFlag = countryCode ? flag(countryCode) : '🌎';
|
||||
const countryFlag = countryCode ? getCountryFlag(countryCode) : '🌎';
|
||||
return `${cityAndCountry} ${countryFlag}`;
|
||||
} catch (error) {
|
||||
return '';
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import copy from 'copy-text-to-clipboard';
|
||||
import alertMixin from 'shared/mixins/alertMixin';
|
||||
import EmojiOrIcon from 'shared/components/EmojiOrIcon';
|
||||
import { copyTextToClipboard } from 'shared/helpers/clipboard';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -60,9 +60,9 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onCopy(e) {
|
||||
async onCopy(e) {
|
||||
e.preventDefault();
|
||||
copy(this.value);
|
||||
await copyTextToClipboard(this.value);
|
||||
this.showAlert(this.$t('CONTACT_PANEL.COPY_SUCCESSFUL'));
|
||||
},
|
||||
},
|
||||
|
||||
@@ -20,10 +20,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import copy from 'copy-text-to-clipboard';
|
||||
import CustomAttribute from 'dashboard/components/CustomAttribute.vue';
|
||||
import alertMixin from 'shared/mixins/alertMixin';
|
||||
import attributeMixin from 'dashboard/mixins/attributeMixin';
|
||||
import { copyTextToClipboard } from 'shared/helpers/clipboard';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CustomAttribute,
|
||||
@@ -86,8 +87,8 @@ export default {
|
||||
this.showAlert(errorMessage);
|
||||
}
|
||||
},
|
||||
onCopy(attributeValue) {
|
||||
copy(attributeValue);
|
||||
async onCopy(attributeValue) {
|
||||
await copyTextToClipboard(attributeValue);
|
||||
this.showAlert(this.$t('CUSTOM_ATTRIBUTES.COPY_SUCCESSFUL'));
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user