- {gettext('Drag and drop a file here or click to select a file')} -
+ { + isDragActive ? ( +%s
."
+"This attribute will be added to the attribute "
+"%s
."
msgstr ""
"Dieses Attribut wird dem Attribut %s
"
"hinzugefügt."
@@ -154,8 +158,8 @@ msgstr ""
#: management/assets/js/components/edit/EditAttribute.js:68
#, javascript-format
msgid ""
-"This attribute will be added to the question set %s
."
+"This attribute will be added to the question set %s
."
msgstr ""
"Dieses Attribut wird dem Fragenset %s
"
"hinzugefügt."
@@ -163,8 +167,8 @@ msgstr ""
#: management/assets/js/components/edit/EditAttribute.js:75
#, javascript-format
msgid ""
-"This attribute will be added to the question %s
."
+"This attribute will be added to the question "
+"%s
."
msgstr ""
"Dieses Attribut wird der Frage %s
"
"hinzugefügt."
@@ -172,8 +176,8 @@ msgstr ""
#: management/assets/js/components/edit/EditAttribute.js:82
#, javascript-format
msgid ""
-"This attribute will be added to the condition %s
."
+"This attribute will be added to the condition %s
."
msgstr ""
"Dieses Attribut wird der Bedingung %s
"
"hinzugefügt."
@@ -219,8 +223,8 @@ msgstr "Neue Bedingung erstellen"
#: management/assets/js/components/edit/EditCondition.js:57
#, javascript-format
msgid ""
-"This condition will be added to the option set %s
."
+"This condition will be added to the option set "
+"%s
."
msgstr ""
"Diese Bedingung wird dem Optionenset %s
"
"hinzugefügt."
@@ -237,8 +241,8 @@ msgstr ""
#: management/assets/js/components/edit/EditCondition.js:71
#, javascript-format
msgid ""
-"This condition will be added to the question set %s
."
+"This condition will be added to the question set %s
."
msgstr ""
"Diese Bedingung wird dem Fragenset %s
"
"hinzugefügt."
@@ -246,8 +250,8 @@ msgstr ""
#: management/assets/js/components/edit/EditCondition.js:78
#, javascript-format
msgid ""
-"This condition will be added to the question %s
."
+"This condition will be added to the question "
+"%s
."
msgstr ""
"Diese Bedingung wird der Frage %s
"
"hinzugefügt."
@@ -307,8 +311,8 @@ msgstr "Neues Optionenset erstellen"
#: management/assets/js/components/edit/EditOptionSet.js:61
#, javascript-format
msgid ""
-"This option set will be added to the question %s
."
+"This option set will be added to the question "
+"%s
."
msgstr ""
"Dieser Optionenset wird der Frage %s
"
"hinzugefügt."
@@ -415,8 +419,8 @@ msgstr ""
#: management/assets/js/components/edit/EditQuestion.js:74
#, javascript-format
msgid ""
-"This question will be added to the question set %s
."
+"This question will be added to the question set %s
."
msgstr ""
"Diese Frage wird dem Fragenset %s
"
"hinzugefügt."
@@ -439,8 +443,8 @@ msgstr "Fragenset erstellen"
#: management/assets/js/components/edit/EditQuestionSet.js:96
#, javascript-format
msgid ""
-"This question set will be added to the page %s
."
+"This question set will be added to the page "
+"%s
."
msgstr ""
"Dieser Fragenset wird der Seite %s
"
"hinzugefügt."
@@ -1444,42 +1448,42 @@ msgstr "Projekt direkt importieren"
msgid "Import from file"
msgstr "Importieren aus Datei"
-#: projects/assets/js/components/main/Projects.js:22
+#: projects/assets/js/components/main/Projects.js:25
#: projects/assets/js/utils/translations.js:13
msgid "Pending invitations"
msgstr "Ausstehende Einladungen"
-#: projects/assets/js/components/main/Projects.js:28
+#: projects/assets/js/components/main/Projects.js:31
#: projects/assets/js/utils/translations.js:7
msgid "Import project"
msgstr "Projekt importieren"
-#: projects/assets/js/components/main/Projects.js:33
+#: projects/assets/js/components/main/Projects.js:36
#, javascript-format
msgid "%s of %s projects are displayed"
msgstr "%s von %s Projekten werden angezeigt"
-#: projects/assets/js/components/main/Projects.js:36
+#: projects/assets/js/components/main/Projects.js:39
#, javascript-format
msgid "%s of %s"
msgstr "%s von %s"
-#: projects/assets/js/components/main/Projects.js:47
+#: projects/assets/js/components/main/Projects.js:50
#: projects/assets/js/utils/translations.js:18
msgid "View all projects"
msgstr "Alle Projekte ansehen"
-#: projects/assets/js/components/main/Projects.js:47
+#: projects/assets/js/components/main/Projects.js:50
#: projects/assets/js/utils/translations.js:19
msgid "View my projects"
msgstr "Meine Projekte ansehen"
-#: projects/assets/js/components/main/Projects.js:48
+#: projects/assets/js/components/main/Projects.js:51
#: projects/assets/js/utils/translations.js:11
msgid "My projects"
msgstr "Meine Projekte"
-#: projects/assets/js/components/main/Projects.js:48
+#: projects/assets/js/components/main/Projects.js:51
#: projects/assets/js/utils/translations.js:3
msgid "All projects"
msgstr "Alle Projekte"
diff --git a/rdmo/projects/assets/js/api/ProjectsApi.js b/rdmo/projects/assets/js/api/ProjectsApi.js
index 5fc35590ad..359f2c81e2 100644
--- a/rdmo/projects/assets/js/api/ProjectsApi.js
+++ b/rdmo/projects/assets/js/api/ProjectsApi.js
@@ -3,83 +3,27 @@ import BaseApi from 'rdmo/core/assets/js/api/BaseApi'
import { encodeParams } from 'rdmo/core/assets/js/utils/api'
import baseUrl from 'rdmo/core/assets/js/utils/baseUrl'
-function BadRequestError(errors) {
- this.errors = errors
-}
-
class ProjectsApi extends BaseApi {
- static fetchProjects(params, fetchParams = {}) {
- return fetch('/api/v1/projects/projects/?' + encodeParams(params), fetchParams).then(response => {
- if (response.ok) {
- return response.json()
- } else if (response.status == 400) {
- return response.json().then(errors => {
- throw new BadRequestError(errors)
- })
- } else {
- throw new Error(response.statusText)
- }
- })
+ static fetchProjects(params) {
+ const url = '/api/v1/projects/projects/?' + encodeParams(params)
+ return this.get(url)
}
static fetchCatalogs() {
- return fetch('/api/v1/projects/catalogs/').then(response => {
- if (response.ok) {
- return response.json()
- } else {
- throw new Error(response.statusText)
- }
- })
+ return this.get('/api/v1/projects/catalogs/')
}
static fetchAllowedFileTypes() {
- return fetch('/api/v1/projects/projects/upload-accept/')
- .then(response => {
- if (response.ok) {
- return response.text()
- .then(text => {
- try {
- // Attempt to parse the text as JSON
- const jsonData = JSON.parse(text)
- // Check if the parsed data is an array
- if (Array.isArray(jsonData)) {
- return jsonData
- }
- } catch (error) {
- // If JSON.parse fails, handle text as plain string below
- }
-
- // If it's not a JSON array, process it as a string
- const cleanedText = text.replace(/^"|"$/g, '')
- return cleanedText ? cleanedText.split(',') : []
- })
- } else {
- throw new Error(response.statusText)
- }
- })
+ return this.get('/api/v1/projects/projects/upload-accept/')
}
static fetchDirectImportUrls() {
- return fetch('/api/v1/projects/projects/imports/')
- .then(response => {
- if (response.ok) {
- return response.json()
- } else {
- throw new Error(response.statusText)
- }
- })
+ return this.get('/api/v1/projects/projects/imports/')
}
static fetchInvites() {
- return fetch('/api/v1/projects/invites/user')
- .then(response => {
- if (response.ok) {
- return response.json()
- } else {
- throw new Error(response.statusText)
- }
- })
+ return this.get('/api/v1/projects/invites/user/')
}
static uploadProject(url, file) {
diff --git a/rdmo/projects/assets/js/components/helper/PendingInvitations.js b/rdmo/projects/assets/js/components/helper/PendingInvitations.js
index 9290ccb32c..e2c13fcfff 100644
--- a/rdmo/projects/assets/js/components/helper/PendingInvitations.js
+++ b/rdmo/projects/assets/js/components/helper/PendingInvitations.js
@@ -1,5 +1,8 @@
import React from 'react'
import PropTypes from 'prop-types'
+
+import baseUrl from 'rdmo/core/assets/js/utils/baseUrl'
+
import { ROLE_LABELS } from '../../utils'
const PendingInvitations = ({ invitations }) => {
@@ -14,8 +17,14 @@ const PendingInvitations = ({ invitations }) => {
{ROLE_LABELS[item.role]}