Skip to content
Snippets Groups Projects
Commit 3674c97c authored by Hanna Führ's avatar Hanna Führ Committed by Petar Hristov
Browse files

Update: Changes in Participating Organizations Search (rpdm/issues#39)

parent 80516740
Branches
Tags
2 merge requests!80Sprint/2021 21,!79Update: Changes in Participating Organizations Search (rpdm/issues#39)
module.exports = {
root: true,
env: {
node: true,
},
extends: [
"plugin:vue/essential",
"eslint:recommended",
"@vue/typescript/recommended",
"@vue/prettier",
"@vue/prettier/@typescript-eslint",
],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
},
};
This diff is collapsed.
<template>
<div>
<b-button variant="danger" @click="resetModal = true">{{ $t('deleteButton') }}</b-button>
<b-button variant="danger" @click="resetModal = true">{{
$t("deleteButton")
}}</b-button>
<coscine-modal
v-model="resetModal"
:title="$t('deleteModalHeadline')"
:headerText="$t('deleteModalDescription')"
:hideFooter="false"
@confirmModal="handleSubmit">
<form ref="form" @submit.stop.prevent="handleSubmit">
<b-form-group
:state="deleteInputState"
@confirmModal="handleSubmit"
>
<form ref="form" @submit.stop.prevent="handleSubmit">
<b-form-group :state="deleteInputState">
<div id="displayName">
{{ this.displayName }}
</div>
......@@ -22,40 +23,44 @@
@change="disableHelp"
></b-form-input>
<div class="invalid-tooltip" v-show="showHelp">
{{ $t('deleteModalHelp') }}
{{ $t("deleteModalHelp") }}
</div>
</b-form-group>
</form>
</coscine-modal>
<coscine-loading-spinner
:isWaitingForResponse="isWaitingForResponse"
/>
<coscine-loading-spinner :isWaitingForResponse="isWaitingForResponse" />
</div>
</template>
<script lang="ts">
import { FormGroupPlugin , BFormInput } from 'bootstrap-vue';
import Vue from 'vue';
import { FormGroupPlugin, BFormInput } from "bootstrap-vue";
import Vue from "vue";
Vue.use(FormGroupPlugin);
Vue.component('b-form-input', BFormInput);
Vue.component("b-form-input", BFormInput);
import { CoscineLoadingSpinner, CoscineModal } from '@coscine/component-library';
import '@coscine/component-library/dist/index.css';
import { ProjectApi, SubProjectApi } from '@coscine/api-connection';
import {
CoscineLoadingSpinner,
CoscineModal,
} from "@coscine/component-library";
import "@coscine/component-library/dist/index.css";
import { ProjectApi, SubProjectApi } from "@coscine/api-connection";
import VueI18n from 'vue-i18n';
import { LinkUtil } from '@coscine/app-util';
import VueI18n from "vue-i18n";
import { LinkUtil } from "@coscine/app-util";
Vue.use(VueI18n);
const i18n = new VueI18n({
locale: 'en',
messages: coscine.i18n['project-creation'],
locale: "en",
messages:
window.coscine && window.coscine.i18n
? window.coscine.i18n["project-creation"]
: undefined,
silentFallbackWarn: true,
});
export default Vue.extend({
i18n,
name: 'DeleteModal',
name: "DeleteModal",
components: {
CoscineLoadingSpinner,
CoscineModal,
......@@ -63,7 +68,7 @@ export default Vue.extend({
data() {
return {
resetModal: false,
deleteName: '',
deleteName: "",
deleteInputState: null,
showHelp: false,
isWaitingForResponse: false,
......@@ -74,7 +79,7 @@ export default Vue.extend({
},
props: {
languageLocale: {
default: 'en',
default: "en",
type: String,
},
projectId: String,
......@@ -83,7 +88,7 @@ export default Vue.extend({
// --- reset modal by changing visibility state (show/hide modal) ---
watch: {
resetModal() {
this.deleteName = '';
this.deleteName = "";
this.deleteInputState = null;
},
},
......@@ -99,8 +104,8 @@ export default Vue.extend({
disableHelp() {
this.showHelp = false;
},
afterDeleteHandler(projectSlug: string = '') {
if (projectSlug !== '') {
afterDeleteHandler(projectSlug = "") {
if (projectSlug !== "") {
LinkUtil.redirectToExternalProject(projectSlug);
} else {
LinkUtil.redirectToRoot();
......@@ -115,7 +120,8 @@ export default Vue.extend({
this.isWaitingForResponse = true;
SubProjectApi.getAccessibleParent(this.projectId, (response: any) => {
const parentId = response.data.id;
ProjectApi.getProjectInformation(parentId,
ProjectApi.getProjectInformation(
parentId,
(response: any) => {
ProjectApi.deleteProject(
this.projectId,
......@@ -124,8 +130,10 @@ export default Vue.extend({
},
(innerErrorResponse: any) => {
this.afterDeleteHandler(response.data.slug);
});
}, (error: any) => {
}
);
},
(error: any) => {
ProjectApi.deleteProject(
this.projectId,
(innerResponse: any) => {
......@@ -133,8 +141,10 @@ export default Vue.extend({
},
(innerErrorResponse: any) => {
this.afterDeleteHandler();
});
});
}
);
}
);
});
this.resetModal = false;
},
......@@ -156,10 +166,8 @@ export default Vue.extend({
min-width: auto;
}
.modal-backdrop {
opacity: .5;
opacity: 0.5;
}
</style>
<style scoped>
.invalid-tooltip {
margin-top: -5rem;
}
......
declare var coscine: {
declare type CoscineType = {
language: {
locale: string,
},
locale: string;
};
i18n: {
'project-creation': {},
},
"project-creation": VueI18n.LocaleMessages | undefined;
};
};
declare var _spPageContextInfo: any;
declare const coscine: CoscineType;
declare interface Window {
coscine: CoscineType;
}
declare let _spPageContextInfo: any;
declare class Organization {
public url: string;
......
import CreateProject from './CreateProject.vue';
import CreateProject from "./CreateProject.vue";
export default {
install(Vue: any, options: any) {
// Let's register our component globally
// https://vuejs.org/v2/guide/components-registration.html
Vue.component('CreateProject', CreateProject);
Vue.component("CreateProject", CreateProject);
},
};
import Vue, { VNode } from 'vue';
import Vue, { VNode } from "vue";
declare global {
namespace JSX {
......
declare module '*.vue' {
import Vue from 'vue';
declare module "*.vue" {
import Vue from "vue";
export default Vue;
}
declare module '@voerro/vue-tagsinput';
declare module '@coscine/api-connection';
declare module '@coscine/app-util';
declare module '@coscine/component-library';
declare module "@voerro/vue-tagsinput";
declare module "@coscine/api-connection";
declare module "@coscine/app-util";
declare module "@coscine/component-library";
......@@ -2,7 +2,7 @@ export default {
checkKeywords(value: any, maxCount: any) {
// check if the total sum of characters for keywords is <= 1000
let count = 0;
if (typeof value === 'string') {
if (typeof value === "string") {
count = value.length;
} else if (value !== undefined) {
for (const keyword of value) {
......@@ -11,10 +11,10 @@ export default {
}
return count <= maxCount;
},
parseKeywords(form: any, delimiter = ';') {
parseKeywords(form: any, delimiter = ";") {
// combine array values to a string (using the 'keyword' form input)
if (typeof form.Keywords !== 'string') {
let keywordString = '';
if (typeof form.Keywords !== "string") {
let keywordString = "";
for (const keyword of form.Keywords) {
keywordString += keyword + delimiter;
}
......
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"target": "es6",
"module": "es6",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
......@@ -24,7 +24,7 @@
]
},
"lib": [
"esnext",
"es6",
"dom",
"dom.iterable",
"scripthost"
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment