diff --git a/.github/config/.finnishwords.txt b/.github/config/.finnishwords.txt index 07f9255bb..98b2ffbe0 100644 --- a/.github/config/.finnishwords.txt +++ b/.github/config/.finnishwords.txt @@ -64,6 +64,7 @@ hinnoittelulaskuri hyväksy hyväksyä hyväksyäksesi +ikkunan ilman ja jaa @@ -338,6 +339,7 @@ ota ottaneesi ovat oy +paikkaan paina painikkeella painikkeesta @@ -464,6 +466,7 @@ sivupyynnössä sivutus sopimus sulje +suljet suodata suositellut suuren @@ -549,6 +552,7 @@ tunnus tunti tuo tuottaa +turvalliseen tyhjennä tyhjä tyyppi @@ -557,6 +561,7 @@ tägejä tägillä tägit tähän +tälle tällä tältä tämä diff --git a/CHANGELOG.md b/CHANGELOG.md index 13647359e..986bf2025 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -55,6 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - (GH #989) Make selected Display Options consistent when browsing between pages - (GH #944) Create new Taginput component to replace Buefy's taginput component - (GL #944) Replace buefy upload button with a new component: `CUploadButton` +- (GL #940) Added TokenModal to replace token page ### Changed diff --git a/swift_browser_ui_frontend/src/common/lang.js b/swift_browser_ui_frontend/src/common/lang.js index 3b62798c0..86d0ff57c 100644 --- a/swift_browser_ui_frontend/src/common/lang.js +++ b/swift_browser_ui_frontend/src/common/lang.js @@ -197,6 +197,7 @@ let default_translations = { complete: "Uploading completed", cancelled: "Uploading cancelled", }, + close: "Close", copy: " Copy", copied: "Share ID copied to clipboard", copy_failed: "Copying failed", @@ -242,20 +243,21 @@ let default_translations = { }, tokens: { empty: "No API tokens created for the project", - identifier: "Identifier", - revoke: "Revoke", - identLabel: "New token identifier", - identMessage: "Insert new token identifier here", + title: "Create API-tokens", + identifier: "Token identifier", + identLabel: "Insert new token identifier", createToken: "Create token", latestToken: "Latest token: ", - copyToken: - "The token will be displayed just this once after its " + - "creation, and recovering it will not be possible " + - "afterwards. Please make sure that you have stored " + - "the token somewhere before navigating away from the " + - "token page.", + copy: "Copy token", + copyWarning: + "Token will be displayed just this once " + + "and recovering it is not be possible. " + + "Please store the token somewhere " + + "safe before closing this modal.", tokenCopied: "Token copied.", - back: "Back to all folders", + tokenRemoved: "Token removed.", + inUse: "Token identifier already in use.", + creationFailed: "Token creation failed.", }, encrypt: { uploadFiles: "Upload files", @@ -557,6 +559,7 @@ let default_translations = { complete: "Lähetys on valmis", cancelled: "Lähetys peruutettu", }, + close: "Sulje", copy: " Kopioi", copied: "Jakamistunnus kopioitu leikepöydälle.", copy_failed: "Kopiointi epäonnistui.", @@ -598,20 +601,22 @@ let default_translations = { name_newFolder: "Nimeä uusi kansio", }, tokens: { - empty: "Projektille ei ole luotu API-avaimia", - identifier: "Tunniste", - revoke: "Mitätöi", - identLabel: "Uuden avaimen tunniste", - identMessage: "Syötä tunniste uudelle API-avaimelle", + empty: "Tälle projektille ei ole luotu API-avaimia", + title: "Luo API-avaimet", + identifier: "Avainten tunnisteet", + identLabel: "Syötä tunniste uudelle API-avaimelle", createToken: "Luo avain", latestToken: "Viimeisin avain: ", - back: "Palaa päänäkymään", - copyToken: - "Avain näytetään vain kerran luonnin jälkeen, eikä sen " + - "kopiointi tai palautus jälkeenpäin ole mahdollista. " + - "Kopioi avain talteen ennen kuin " + - "poistut tältä sivulta.", + copy: "Kopioi avain", + copyWarning: + "Avain näytetään vain tämän kerran, " + + "eikä sen kopiointi tai palautus ole mahdollista jälkeenpäin. " + + "Tallenna avain turvalliseen paikkaan " + + "ennen kuin suljet tämän ikkunan.", tokenCopied: "Avain kopioitu.", + tokenRemoved: "Avain poistettu.", + creationFailed: "Avaimen luonti epäonnistui.", + inUse: "Avaimen tunniste on jo käytössä.", }, encrypt: { uploadFiles: "Lataa tiedostoja", diff --git a/swift_browser_ui_frontend/src/common/router.js b/swift_browser_ui_frontend/src/common/router.js index 8e3c08ae7..989cd45a2 100644 --- a/swift_browser_ui_frontend/src/common/router.js +++ b/swift_browser_ui_frontend/src/common/router.js @@ -2,7 +2,6 @@ import { createRouter, createWebHistory } from "vue-router"; import FoldersView from "@/views/Folders.vue"; import ObjectsView from "@/views/Objects.vue"; import SharedObjects from "@/views/SharedObjects.vue"; -import TokensView from "@/views/Tokens.vue"; export default createRouter({ history: createWebHistory(), @@ -12,11 +11,6 @@ export default createRouter({ name: "AllFolders", component: FoldersView, }, - { - path: "/browse/:user/:project/tokens", - name: "TokensView", - component: TokensView, - }, { path: "/browse/:user/:project/:container/shared/:owner", name: "SharedObjects", diff --git a/swift_browser_ui_frontend/src/common/store.js b/swift_browser_ui_frontend/src/common/store.js index 4b3825d20..ac3a9c117 100644 --- a/swift_browser_ui_frontend/src/common/store.js +++ b/swift_browser_ui_frontend/src/common/store.js @@ -51,6 +51,7 @@ const store = createStore({ selectedObjectName: "", openCopyFolderModal: false, openDeleteModal: false, + openTokenModal: false, deletableObjects: [], isFolderCopied: false, sourceProjectId: "", @@ -231,6 +232,9 @@ const store = createStore({ toggleDeleteModal(state, payload) { state.openDeleteModal = payload; }, + toggleTokenModal(state, payload) { + state.openTokenModal = payload; + }, setDeletableObjects(state, payload) { state.deletableObjects = payload; }, diff --git a/swift_browser_ui_frontend/src/components/BrowserMainNavbar.vue b/swift_browser_ui_frontend/src/components/BrowserMainNavbar.vue index 13e5f2da3..e1e32a828 100644 --- a/swift_browser_ui_frontend/src/components/BrowserMainNavbar.vue +++ b/swift_browser_ui_frontend/src/components/BrowserMainNavbar.vue @@ -157,10 +157,8 @@ export default { href: this.$t("message.supportMenu.itemLink2"), }, { - title: this.$t("message.supportMenu.item3"), - route: {name: "TokensView", params: { - user: this.uname, - project: this.active.id}}, + title: this.$t("message.supportMenu.sharing"), + action: () => this.$store.commit("toggleTokenModal", true), }, { title: this.$t("message.supportMenu.item4"), diff --git a/swift_browser_ui_frontend/src/components/TokenModal.vue b/swift_browser_ui_frontend/src/components/TokenModal.vue new file mode 100644 index 000000000..13bfecb17 --- /dev/null +++ b/swift_browser_ui_frontend/src/components/TokenModal.vue @@ -0,0 +1,299 @@ + + + + + {{ $t("message.tokens.title") }} + + + + {{ $t("message.close") }} + + + + + + {{ $t('message.tokens.createToken') }} + + + + {{ $t('message.tokens.latestToken') }} + + + {{ latest }} + + + + {{ $t('message.tokens.copy') }} + + + + {{ $t('message.tokens.copyWarning') }} + + + + + + + + + + diff --git a/swift_browser_ui_frontend/src/entries/main.js b/swift_browser_ui_frontend/src/entries/main.js index 8836376b7..18488dcc4 100644 --- a/swift_browser_ui_frontend/src/entries/main.js +++ b/swift_browser_ui_frontend/src/entries/main.js @@ -12,6 +12,7 @@ import EditTagsModal from "@/components/EditTagsModal.vue"; import ShareModal from "@/components/ShareModal.vue"; import CopyFolderModal from "@/components/CopyFolderModal.vue"; import DeleteModal from "@/components/DeleteModal.vue"; +import TokenModal from "@/components/TokenModal.vue"; // CSC UI things import { applyPolyfills, defineCustomElements } from "csc-ui/dist/loader"; @@ -110,6 +111,7 @@ const app = createApp({ ShareModal, CopyFolderModal, DeleteModal, + TokenModal, }, data: function () { return { @@ -202,6 +204,12 @@ const app = createApp({ }, set() { }, }, + openTokenModal: { + get() { + return this.$store.state.openTokenModal; + }, + set() { }, + }, }, watch: { openCreateFolderModal: function () { diff --git a/swift_browser_ui_frontend/src/pages/BrowserPage.vue b/swift_browser_ui_frontend/src/pages/BrowserPage.vue index 39e130393..d1803d022 100644 --- a/swift_browser_ui_frontend/src/pages/BrowserPage.vue +++ b/swift_browser_ui_frontend/src/pages/BrowserPage.vue @@ -56,6 +56,13 @@ > + + + - - - - - - {{ $t('message.tokens.back') }} - - - - - - {{ $t('message.tokens.createToken') }} - - - - - - - {{ $t('message.tokens.latestToken') }} {{ latest }} - - - - {{ $t('message.copy') }} - - - - - - - - - - - -
+ {{ $t('message.tokens.latestToken') }} +
{{ latest }}
{{ $t('message.tokens.copyWarning') }}