-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat/rtl-support
- Loading branch information
Showing
14 changed files
with
237 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// eslint-disable-next-line | ||
function toggleSecretField(e) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
|
||
const toggler = e.currentTarget; | ||
const secretField = toggler.parentElement; | ||
const textElement = secretField.querySelector('[data-secret-masked]'); | ||
|
||
if (!textElement) return; | ||
|
||
if (textElement.dataset.secretMasked === 'false') { | ||
textElement.textContent = '•'.repeat(10); | ||
textElement.dataset.secretMasked = 'true'; | ||
toggler.querySelector('svg use').setAttribute('xlink:href', '#eye-show'); | ||
|
||
return; | ||
} | ||
|
||
textElement.textContent = secretField.dataset.secretText; | ||
textElement.dataset.secretMasked = 'false'; | ||
toggler.querySelector('svg use').setAttribute('xlink:href', '#eye-hide'); | ||
} | ||
|
||
// eslint-disable-next-line | ||
function copySecretField(e) { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
|
||
const toggler = e.currentTarget; | ||
const secretField = toggler.parentElement; | ||
|
||
navigator.clipboard.writeText(secretField.dataset.secretText); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require 'administrate/field/base' | ||
|
||
class SecretField < Administrate::Field::String | ||
end |
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,63 @@ | ||
<template> | ||
<div class="text--container"> | ||
<woot-button size="small" class=" button--text" @click="onCopy"> | ||
{{ $t('COMPONENTS.CODE.BUTTON_TEXT') }} | ||
</woot-button> | ||
<woot-button | ||
variant="clear" | ||
size="small" | ||
class="button--visibility" | ||
color-scheme="secondary" | ||
:icon="masked ? 'eye-show' : 'eye-hide'" | ||
@click.prevent="toggleMasked" | ||
/> | ||
<highlightjs v-if="value" :code="masked ? '•'.repeat(10) : value" /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import 'highlight.js/styles/default.css'; | ||
import { copyTextToClipboard } from 'shared/helpers/clipboard'; | ||
export default { | ||
props: { | ||
value: { | ||
type: String, | ||
default: '', | ||
}, | ||
}, | ||
data() { | ||
return { | ||
masked: true, | ||
}; | ||
}, | ||
methods: { | ||
async onCopy(e) { | ||
e.preventDefault(); | ||
await copyTextToClipboard(this.value); | ||
bus.$emit('newToastMessage', this.$t('COMPONENTS.CODE.COPY_SUCCESSFUL')); | ||
}, | ||
toggleMasked() { | ||
this.masked = !this.masked; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.text--container { | ||
position: relative; | ||
text-align: left; | ||
.button--text, | ||
.button--visibility { | ||
margin-top: 0; | ||
position: absolute; | ||
right: 0; | ||
} | ||
.button--visibility { | ||
right: 60px; | ||
} | ||
} | ||
</style> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import advancedFilters from './advancedFilters.json'; | ||
import agentBots from './agentBots.json'; | ||
import agentMgmt from './agentMgmt.json'; | ||
import attributesMgmt from './attributesMgmt.json'; | ||
import automation from './automation.json'; | ||
import bulkActions from './bulkActions.json'; | ||
import campaign from './campaign.json'; | ||
import cannedMgmt from './cannedMgmt.json'; | ||
import chatlist from './chatlist.json'; | ||
import contact from './contact.json'; | ||
import contactFilters from './contactFilters.json'; | ||
import conversation from './conversation.json'; | ||
import csatMgmt from './csatMgmt.json'; | ||
import emoji from './emoji.json'; | ||
import generalSettings from './generalSettings.json'; | ||
import helpCenter from './helpCenter.json'; | ||
import inboxMgmt from './inboxMgmt.json'; | ||
import integrationApps from './integrationApps.json'; | ||
import integrations from './integrations.json'; | ||
import labelsMgmt from './labelsMgmt.json'; | ||
import login from './login.json'; | ||
import macros from './macros.json'; | ||
import report from './report.json'; | ||
import resetPassword from './resetPassword.json'; | ||
import setNewPassword from './setNewPassword.json'; | ||
import settings from './settings.json'; | ||
import signup from './signup.json'; | ||
import teamsSettings from './teamsSettings.json'; | ||
import whatsappTemplates from './whatsappTemplates.json'; | ||
|
||
export default { | ||
...advancedFilters, | ||
...agentBots, | ||
...agentMgmt, | ||
...attributesMgmt, | ||
...automation, | ||
...bulkActions, | ||
...campaign, | ||
...cannedMgmt, | ||
...chatlist, | ||
...contact, | ||
...contactFilters, | ||
...conversation, | ||
...csatMgmt, | ||
...emoji, | ||
...generalSettings, | ||
...helpCenter, | ||
...inboxMgmt, | ||
...integrationApps, | ||
...integrations, | ||
...labelsMgmt, | ||
...login, | ||
...macros, | ||
...report, | ||
...resetPassword, | ||
...setNewPassword, | ||
...settings, | ||
...signup, | ||
...teamsSettings, | ||
...whatsappTemplates, | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<%# | ||
# SecretField Index Partial | ||
%> | ||
<%= javascript_include_tag "secretField" %> | ||
<div data-secret-text="<%= field.data %>" class="cell-data__secret-field"> | ||
<span data-secret-masked="true">••••••••••</span> | ||
<button onclick="toggleSecretField(event)" data-secret-toggler> | ||
<svg width="20" height="20"> | ||
<use xlink:href="#eye-show" /> | ||
</svg> | ||
</button> | ||
<button onclick="copySecretField(event)" data-secret-copier> | ||
<svg width="20" height="20"> | ||
<use xlink:href="#icon-copy" /> | ||
</svg> | ||
</button> | ||
</div> |
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,18 @@ | ||
<%# | ||
# SecretField Show Partial | ||
%> | ||
<%= javascript_include_tag "secretField" %> | ||
|
||
<div data-secret-text="<%= field.data %>" class="cell-data__secret-field"> | ||
<span data-secret-masked="true">••••••••••</span> | ||
<button onclick="toggleSecretField(event)" data-secret-toggler> | ||
<svg width="20" height="20"> | ||
<use xlink:href="#eye-show" /> | ||
</svg> | ||
</button> | ||
<button onclick="copySecretField(event)" data-secret-copier> | ||
<svg width="20" height="20"> | ||
<use xlink:href="#icon-copy" /> | ||
</svg> | ||
</button> | ||
</div> |
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