api keys text bug fixed (#2114)

This commit is contained in:
VitaliiShpital 2019-06-05 11:58:32 +03:00 committed by GitHub
parent a913f8303e
commit 7bd6767220
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,21 +4,23 @@
<template> <template>
<div id="addApiKeyPopup"> <div id="addApiKeyPopup">
<div class="save-api-popup"> <div class="save-api-popup">
<div class="save-api-popup__main"> <div class="save-api-popup__main">
<div class="save-api-popup__content"> <div class="save-api-popup__content">
<h1 class="save-api-popup__content__title">Success! Your API key has been created. It will only appear here once.</h1> <h1 class="save-api-popup__content__title">Success! Your API key has been created. It will only appear here once.</h1>
<p class="save-api-popup__content__name">This API key allow users or applications to interact with the project.</p> <p class="save-api-popup__content__name">This API key allow users or applications to interact with the project.</p>
<div class="save-api-popup__content__copy-area"> <div class="save-api-popup__content__copy-area">
<p class="save-api-popup__content__copy-area__save-api">{{apiKey}}</p> <div class="save-api-popup__content__copy-area__key" :class="apiKeyContainerClass">
<Button class="save-api-popup__content__copy-area__save-btn" v-clipboard="apiKey" label="Copy" width="140px" height="48px" :onPress="onCopyClick" /> <p class="save-api-popup__content__copy-area__save-api">{{apiKey}}</p>
</div> </div>
</div> <Button class="save-api-popup__content__copy-area__save-btn" v-clipboard="apiKey" label="Copy" width="140px" height="48px" :onPress="onCopyClick" />
<div class="save-api-popup__close-cross-container"> </div>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" v-on:click="onCloseClick"> </div>
<path d="M15.7071 1.70711C16.0976 1.31658 16.0976 0.683417 15.7071 0.292893C15.3166 -0.0976311 14.6834 -0.0976311 14.2929 0.292893L15.7071 1.70711ZM0.292893 14.2929C-0.0976311 14.6834 -0.0976311 15.3166 0.292893 15.7071C0.683417 16.0976 1.31658 16.0976 1.70711 15.7071L0.292893 14.2929ZM1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L1.70711 0.292893ZM14.2929 15.7071C14.6834 16.0976 15.3166 16.0976 15.7071 15.7071C16.0976 15.3166 16.0976 14.6834 15.7071 14.2929L14.2929 15.7071ZM14.2929 0.292893L0.292893 14.2929L1.70711 15.7071L15.7071 1.70711L14.2929 0.292893ZM0.292893 1.70711L14.2929 15.7071L15.7071 14.2929L1.70711 0.292893L0.292893 1.70711Z" fill="#384B65"/> <div class="save-api-popup__close-cross-container">
</svg> <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" v-on:click="onCloseClick">
</div> <path d="M15.7071 1.70711C16.0976 1.31658 16.0976 0.683417 15.7071 0.292893C15.3166 -0.0976311 14.6834 -0.0976311 14.2929 0.292893L15.7071 1.70711ZM0.292893 14.2929C-0.0976311 14.6834 -0.0976311 15.3166 0.292893 15.7071C0.683417 16.0976 1.31658 16.0976 1.70711 15.7071L0.292893 14.2929ZM1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L1.70711 0.292893ZM14.2929 15.7071C14.6834 16.0976 15.3166 16.0976 15.7071 15.7071C16.0976 15.3166 16.0976 14.6834 15.7071 14.2929L14.2929 15.7071ZM14.2929 0.292893L0.292893 14.2929L1.70711 15.7071L15.7071 1.70711L14.2929 0.292893ZM0.292893 1.70711L14.2929 15.7071L15.7071 14.2929L1.70711 0.292893L0.292893 1.70711Z" fill="#384B65"/>
</div> </svg>
</div>
</div>
<div class="notification-wrap"> <div class="notification-wrap">
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="40" height="40" rx="10" fill="#2683FF"/> <rect width="40" height="40" rx="10" fill="#2683FF"/>
@ -33,42 +35,57 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Vue } from 'vue-property-decorator'; import { Component, Vue } from 'vue-property-decorator';
import Button from '@/components/common/Button.vue'; import Button from '@/components/common/Button.vue';
import HeaderedInput from '@/components/common/HeaderedInput.vue'; import HeaderedInput from '@/components/common/HeaderedInput.vue';
import { EMPTY_STATE_IMAGES } from '@/utils/constants/emptyStatesImages'; import { EMPTY_STATE_IMAGES } from '@/utils/constants/emptyStatesImages';
import { APP_STATE_ACTIONS, NOTIFICATION_ACTIONS } from '@/utils/constants/actionNames'; import { APP_STATE_ACTIONS, NOTIFICATION_ACTIONS } from '@/utils/constants/actionNames';
@Component( @Component(
{ {
props: { props: {
onClose: { onClose: {
type: Function type: Function
},
apiKey: String
}, },
apiKey: String data: function () {
}, return {
data: function () { imageSource: EMPTY_STATE_IMAGES.ADD_API_KEY,
return { };
imageSource: EMPTY_STATE_IMAGES.ADD_API_KEY,
};
},
methods: {
onCloseClick: function (): void {
this.$store.dispatch(APP_STATE_ACTIONS.TOGGLE_NEW_API_KEY);
}, },
onCopyClick: function (): void { methods: {
this.$store.dispatch(NOTIFICATION_ACTIONS.SUCCESS, 'Key saved to clipboard'); onCloseClick: function (): void {
this.$store.dispatch(APP_STATE_ACTIONS.TOGGLE_NEW_API_KEY);
},
onCopyClick: function (): void {
this.$store.dispatch(NOTIFICATION_ACTIONS.SUCCESS, 'Key saved to clipboard');
},
},
computed: {
apiKeyContainerClass: function (): string {
let apiKeyClassName = '';
if (this.$props.apiKey.length > 100) {
apiKeyClassName = 'large';
}
if (this.$props.apiKey.length > 300) {
apiKeyClassName = 'extra-large';
}
return apiKeyClassName;
}
},
components: {
Button,
HeaderedInput
} }
},
components: {
Button,
HeaderedInput
} }
} )
)
export default class AddApiKeyPopup extends Vue { export default class AddApiKeyPopup extends Vue {
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@ -134,9 +151,17 @@ export default class AddApiKeyPopup extends Vue {
padding: 10px 20px; padding: 10px 20px;
width: 100%; width: 100%;
margin-top: 50px; margin-top: 50px;
border-radius: 6px;
height: auto;
&__save-api {
word-wrap: break-word;
width: 765px;
}
&__save-btn { &__save-btn {
margin-right: 10px; margin-right: 10px;
min-width: 140px;
} }
} }
} }
@ -174,4 +199,13 @@ export default class AddApiKeyPopup extends Vue {
} }
} }
} }
.large {
height: auto;
}
.extra-large {
height: 100px;
overflow-y: scroll;
}
</style> </style>