Skip to content

Commit

Permalink
Merge branch 'bugfix/token-modal' into 'devel'
Browse files Browse the repository at this point in the history
Restore TokenModal

Closes #1119

See merge request sds-dev/sd-connect/swift-browser-ui!155
  • Loading branch information
mradavi committed Aug 31, 2023
2 parents 2d70bf1 + 983d50d commit b1b221c
Showing 1 changed file with 65 additions and 71 deletions.
136 changes: 65 additions & 71 deletions swift_browser_ui_frontend/src/components/TokenModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,79 +4,74 @@
class="token-card"
@keydown="handleKeyDown"
>
<c-card
ref="tokenContainer"
class="token-card"
@keydown="handleKeyDown"
<c-card-actions
justify="space-between"
align="center"
>
<c-card-actions
<h2 class="title is-4">
{{ $t("message.tokens.title") }}
</h2>
<c-button
id="close-token-modal-btn"
text
@click="closeTokenModal"
@keyup.enter="closeTokenModal"
>
<c-icon
:path="mdiClose"
alt=""
aria-hidden="true"
/>
{{ $t("message.close") }}
</c-button>
</c-card-actions>
<c-card-content>
<c-text-field
id="token-input"
v-model="newIdentifier"
v-csc-control
name="newIdentifier"
:label="$t('message.tokens.identLabel')"
/>
<c-button
id="create-token-button"
@click="addToken(newIdentifier)"
@keyup.enter="addToken(newIdentifier)"
>
{{ $t('message.tokens.createToken') }}
</c-button>
<c-row
v-show="latest.token"
align="start"
justify="space-between"
align="center"
>
<h2 class="title is-4">
{{ $t("message.tokens.title") }}
</h2>
<p>
<strong>{{ $t('message.tokens.latestToken') }}</strong>
</p>
<div id="token">
<p>{{ latest.token }}</p>
</div>
<c-button
id="close-token-modal-btn"
text
@click="closeTokenModal"
@keyup.enter="closeTokenModal"
size="small"
@click="copyLatestToken"
@keyup.enter="copyLatestToken"
>
<c-icon
:path="mdiClose"
alt=""
aria-hidden="true"
<i
slot="icon"
class="mdi mdi-content-copy"
/>
{{ $t("message.close") }}
{{ $t('message.tokens.copy') }}
</c-button>
</c-card-actions>
<c-card-content>
<c-text-field
id="token-input"
v-model="newIdentifier"
v-csc-control
name="newIdentifier"
:label="$t('message.tokens.identLabel')"
/>
<c-button
id="create-token-button"
@click="addToken(newIdentifier)"
@keyup.enter="addToken(newIdentifier)"
>
{{ $t('message.tokens.createToken') }}
</c-button>
<c-row
v-show="latest.token"
align="start"
justify="space-between"
>
<p>
<strong>{{ $t('message.tokens.latestToken') }}</strong>
</p>
<div id="token">
<p>{{ latest.token }}</p>
</div>
<c-button
size="small"
@click="copyLatestToken"
@keyup.enter="copyLatestToken"
>
<i
slot="icon"
class="mdi mdi-content-copy"
/>
{{ $t('message.tokens.copy') }}
</c-button>
</c-row>
<c-alert
v-show="latest.token"
type="warning"
>
<p>{{ $t('message.tokens.copyWarning') }}</p>
</c-alert>
<!-- Footer options needs to be in CamelCase,
</c-row>
<c-alert
v-show="latest.token"
type="warning"
>
<p>{{ $t('message.tokens.copyWarning') }}</p>
</c-alert>
<!-- Footer options needs to be in CamelCase,
because csc-ui wont recognise it otherwise. -->
<!-- eslint-disable-->
<!-- eslint-disable-->
<c-data-table
sort-by="identifier"
sort-direction="asc"
Expand All @@ -89,12 +84,11 @@
@click="checkPage"
/>
<!-- eslint-enable-->
<c-toasts
id="token-toasts"
data-testid="token-toasts"
/>
</c-card-content>
</c-card>
<c-toasts
id="token-toasts"
data-testid="token-toasts"
/>
</c-card-content>
</c-card>
</template>

Expand Down

0 comments on commit b1b221c

Please sign in to comment.