Skip to content
Snippets Groups Projects
Select Git revision
  • 3d80307f5714d28b618628035e7be19a7d3d34a7
  • main default protected
  • gitkeep
  • dev
  • ipynb
  • 81-add-id-to-figure-file-metadata
  • v0.3.2
  • v0.3.1
  • v0.3.0
  • v0.2.3
  • test_tag
  • v0.2.2
  • v.0.2.1
  • v0.2.1
  • v0.1.2
  • v0.1.1
  • v0.1.0
17 results

README.md

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    CreateAPModal.vue 1.77 KiB
    <template>
      <div class="modal">
        <b-modal
          id="createAPModal"
          :title="$t('page.createResource.applicationProfile.createAp.title')"
          :hide-footer="true"
        >
          <!-- Body -->
          <i18n path="page.createResource.applicationProfile.createAp.body" tag="p">
            <template #br><br /></template>
          </i18n>
    
          <!-- Buttons -->
          <div class="mt-3">
            <!-- Confirm Button -->
            <b-button
              class="createAPModalRightBtn float-right"
              variant="primary"
              @click="toAIMS"
              >{{ $t("buttons.confirm") }}
            </b-button>
    
            <!-- Cancel Button -->
            <b-button
              class="createAPModalLeftBtn"
              variant="secondary"
              @click="$bvModal.hide('createAPModal')"
              >{{ $t("buttons.cancel") }}
            </b-button>
          </div>
        </b-modal>
      </div>
    </template>
    
    <script lang="ts">
    import { defineComponent } from "vue";
    import useProjectStore from "@/modules/project/store";
    // import the main store
    import useMainStore from "@/store/index";
    import type { ProjectObject } from "@coscine/api-client/dist/types/Coscine.Api.Project";
    
    export default defineComponent({
      setup() {
        const mainStore = useMainStore();
        const projectStore = useProjectStore();
    
        return { mainStore, projectStore };
      },
    
      computed: {
        project(): ProjectObject | null {
          return this.projectStore.currentProject;
        },
      },
    
      methods: {
        async toAIMS() {
          this.projectStore.retrieveApplicationProfileAnalytics(this.project);
          const accessToken = this.mainStore.coscine.authorization.bearer;
          const url = this.$router.resolve({
            path: "/coscine/apps/aimsfrontend/",
            query: { token: accessToken },
          }).href;
          window.open(url);
        },
      },
    });
    </script>
    
    <style></style>