+);
+
+const TitleHeader = () => Label;
+const ActionHeader = () => Action;
+const TemplateHeader = () => Templates;
+
+const columnHelper = createColumnHelper();
+const columns = (actions: { edit: Function }) => [
+ columnHelper.accessor('name', {
+ id: 'name',
+ header: TitleHeader,
+ cell: TitleCell,
+ enableSorting: true,
+ meta: { headerClassName: 'w-1/2' },
+ }) as ColumnDef,
+ columnHelper.accessor('templates', {
+ header: TemplateHeader,
+ cell: templatesCells,
+ enableSorting: false,
+ meta: { headerClassName: 'w-1/2' },
+ }) as ColumnDef,
+ columnHelper.accessor('key', {
+ header: ActionHeader,
+ cell: EditButton,
+ enableSorting: false,
+ meta: { action: actions.edit, headerClassName: 'w-0 text-center' },
+ }) as ColumnDef,
+];
+export { EditButton, TitleHeader, TitleCell, columns };
+export type { TableRelationshipType };
diff --git a/app/react/V2/api/relationshiptypes/index.ts b/app/react/V2/api/relationshiptypes/index.ts
new file mode 100644
index 0000000000..e220f9c87f
--- /dev/null
+++ b/app/react/V2/api/relationshiptypes/index.ts
@@ -0,0 +1,32 @@
+import { IncomingHttpHeaders } from 'http';
+import { ClientRelationshipType } from 'app/apiResponseTypes';
+import api from 'app/utils/api';
+import { RequestParams } from 'app/utils/RequestParams';
+
+const get = async (headers?: IncomingHttpHeaders): Promise => {
+ const requestParams = new RequestParams({}, headers);
+ return api.get('relationtypes', requestParams).then((response: any) => response.json.rows);
+};
+
+const save = async (relationshipType: ClientRelationshipType): Promise => {
+ const requestParams = new RequestParams(relationshipType);
+ return api.post('relationtypes', requestParams).then((response: any) => response.json);
+};
+
+const deleteRelationtypes = async (ids: string[]) => {
+ const allDeleted = ids.map(async id => {
+ const requestParams = new RequestParams({ _id: id });
+ return api.delete('relationtypes', requestParams).then((response: any) => response.json);
+ });
+
+ return Promise.all(allDeleted);
+};
+
+const relationshipTypeBeingUsed = async (relationtypeId: string) => {
+ const requestParams = new RequestParams({ relationtypeId });
+ return api
+ .get('references/count_by_relationtype', requestParams)
+ .then((response: any) => response.json > 0);
+};
+
+export { get, save, deleteRelationtypes, relationshipTypeBeingUsed };
diff --git a/app/react/V2/atoms/relationshipTypes.ts b/app/react/V2/atoms/relationshipTypes.ts
new file mode 100644
index 0000000000..013e1ea5ad
--- /dev/null
+++ b/app/react/V2/atoms/relationshipTypes.ts
@@ -0,0 +1,18 @@
+import { atom } from 'recoil';
+import { ClientRelationshipType } from 'app/apiResponseTypes';
+import { store } from 'app/store';
+
+const relationshipTypesAtom = atom({
+ key: 'relationshipTypes',
+ default: [] as ClientRelationshipType[],
+ //sync deprecated redux store
+ effects: [
+ ({ onSet }) => {
+ onSet(newValue => {
+ store?.dispatch({ type: 'relationTypes/SET', value: newValue });
+ });
+ },
+ ],
+});
+
+export { relationshipTypesAtom };
diff --git a/app/react/apiResponseTypes.d.ts b/app/react/apiResponseTypes.d.ts
index d576a575a6..4278e3f0e5 100644
--- a/app/react/apiResponseTypes.d.ts
+++ b/app/react/apiResponseTypes.d.ts
@@ -5,9 +5,9 @@ import {
Settings,
SettingsFilterSchema,
SettingsLinkSchema,
- TemplateSchema,
} from 'shared/types/settingsType';
import { LanguageSchema } from 'shared/types/commonTypes';
+import { TemplateSchema } from 'shared/types/templateType';
export interface GroupMemberSchema {
refId: string;
@@ -50,7 +50,7 @@ export interface ClientLanguageSchema extends Omit {
_id?: string;
}
-export interface Template extends Omit {
+export interface Template extends TemplateSchema, Omit {
_id: string;
}
@@ -73,3 +73,8 @@ export interface ClientSettings
[k: string]: unknown | undefined;
};
}
+
+export interface ClientRelationshipType {
+ _id: string;
+ name: string;
+}
diff --git a/contents/ui-translations/ar.csv b/contents/ui-translations/ar.csv
index ec365b4ea7..5b03b46dfb 100644
--- a/contents/ui-translations/ar.csv
+++ b/contents/ui-translations/ar.csv
@@ -61,6 +61,7 @@ ALL,ALL
All,All
"All changes will be lost, are you sure you want to proceed?",ستحذف جميع التغييرات، هل أنت متأكد أنك تريد المتابعة؟
Allow captcha bypass,Allow captcha bypass
+Already exists,Already exists
An error has occured while deleting a language:,An error has occured while deleting a language:
An error has occured while installing languages:,An error has occured while installing languages:
An error has occurred during data export,An error has occurred during data export
@@ -75,7 +76,6 @@ Are you sure you want to delete this connection?,Are you sure you want to delete
Are you sure you want to delete this entity?,Are you sure you want to delete this entity?
Are you sure you want to delete this file?,Are you sure you want to delete this file?
Are you sure you want to delete this item?,Are you sure you want to delete this item?
-Are you sure you want to delete this relationship type?,Are you sure you want to delete this relationship type?
Are you sure you want to delete this thesaurus?,Are you sure you want to delete this thesaurus?
Are you sure?,Are you sure?
Attachment deleted,Attachment deleted
@@ -103,7 +103,6 @@ Can see,إمكانية الرؤية
Can view,إمكانية المعاينة
Cancel,الغاء
Canceling...,Canceling...
-Cannot delete relationship type:,Cannot delete relationship type:
Cannot delete template:,Cannot delete template:
Cannot delete thesaurus:,Cannot delete thesaurus:
Captcha,حروف التحقق
@@ -150,7 +149,6 @@ Confirm deletion,تأكيد الحذف
Confirm deletion of,Confirm deletion of
Confirm deletion of entity,Confirm deletion of entity
Confirm deletion of file,Confirm deletion of file
-Confirm deletion of relationship type:,Confirm deletion of relationship type:
Confirm deletion of template:,Confirm deletion of template:
Confirm deletion of thesaurus:,Confirm deletion of thesaurus:
Confirm discard changes,Confirm discard changes
@@ -200,7 +198,6 @@ Created thesaurus,Created thesaurus
Created user group,Created user group
Current value,Current value
Current Value/Suggestion,Current Value/Suggestion
-Currently connections only need a title.,لا تحتاج الاتصالات حالياً إلا لعنوان
Custom component error,خطأ في المكون المخصص
Custom CSS,CSS تنسيق
Custom Favicon,Custom Favicon
@@ -247,6 +244,7 @@ Discard changes,تجاهل التغييرات
Discard changes?,Discard changes?
Dismiss,Dismiss
Display entity view from page,عرض معاينة الكيان (الإدخال) من الصفحة
+Do you want to delete the following items?,Do you want to delete the following items?
Document,مستند
Document and entity types,انواع الوثائق والكيانات
Document contents,محتويات المستند
@@ -816,7 +814,6 @@ This property will appear in the library cards as part of the basic info.,ستظ
This property will be inherited from the related entities and shown as metadata of this type of entities.,ستورث هذه الخاصية من الكيانات (الإدخالات) ذات الصلة، وستظهر كبيانات وصفية لهذا النوع من الكيانات (الإدخالات)
This property will be shown using all the width available.,ستظهر هذه الخاصية باستخدام كل العرض المتاح
This property will be shown without the label.,ستظهر هذه الخاصية دون التسمية
-This relationship type is being used and cannot be deleted.,This relationship type is being used and cannot be deleted.
this template,this template
This template has associated entities,This template has associated entities
This template will be used as default for new entities.,سيستخدم القالب قالباً افتراضياً للكيانات (للإدخالات) الجديدة
diff --git a/contents/ui-translations/en.csv b/contents/ui-translations/en.csv
index 2e7d76a4b6..285c88bb09 100644
--- a/contents/ui-translations/en.csv
+++ b/contents/ui-translations/en.csv
@@ -61,6 +61,7 @@ ALL,ALL
All,All
"All changes will be lost, are you sure you want to proceed?","All changes will be lost, are you sure you want to proceed?"
Allow captcha bypass,Allow captcha bypass
+Already exists,Already exists
An error has occured while deleting a language:,An error has occured while deleting a language:
An error has occured while installing languages:,An error has occured while installing languages:
An error has occurred during data export,An error has occurred during data export
@@ -75,7 +76,6 @@ Are you sure you want to delete this connection?,Are you sure you want to delete
Are you sure you want to delete this entity?,Are you sure you want to delete this entity?
Are you sure you want to delete this file?,Are you sure you want to delete this file?
Are you sure you want to delete this item?,Are you sure you want to delete this item?
-Are you sure you want to delete this relationship type?,Are you sure you want to delete this relationship type?
Are you sure you want to delete this thesaurus?,Are you sure you want to delete this thesaurus?
Are you sure?,Are you sure?
Attachment deleted,Attachment deleted
@@ -103,7 +103,6 @@ Can see,Can see
Can view,Can view
Cancel,Cancel
Canceling...,Canceling...
-Cannot delete relationship type:,Cannot delete relationship type:
Cannot delete template:,Cannot delete template:
Cannot delete thesaurus:,Cannot delete thesaurus:
Captcha,Captcha
@@ -153,7 +152,6 @@ Confirm deletion,Confirm deletion
Confirm deletion of,Confirm deletion of
Confirm deletion of entity,Confirm deletion of entity
Confirm deletion of file,Confirm deletion of file
-Confirm deletion of relationship type:,Confirm deletion of relationship type:
Confirm deletion of template:,Confirm deletion of template:
Confirm deletion of thesaurus:,Confirm deletion of thesaurus:
Confirm discard changes,Confirm discard changes
@@ -203,7 +201,6 @@ Created thesaurus,Created thesaurus
Created user group,Created user group
Current value,Current value
Current Value/Suggestion,Current Value/Suggestion
-Currently connections only need a title.,Currently connections only need a title.
Custom component error,Custom component markup error: unsupported values! Please check your configuration
Custom CSS,Custom CSS
Custom Favicon,Custom Favicon
@@ -250,6 +247,7 @@ Discard changes,Discard changes
Discard changes?,Discard changes?
Dismiss,Dismiss
Display entity view from page,Display entity view from page
+Do you want to delete the following items?,Do you want to delete the following items?
Document,Document
Document and entity types,Document and entity types
Document contents,Document contents
@@ -819,7 +817,6 @@ This property will appear in the library cards as part of the basic info.,This p
This property will be inherited from the related entities and shown as metadata of this type of entities.,This property will be inherited from the related entities and shown as metadata of this type of entities.
This property will be shown using all the width available.,This property will be shown using all the width available.
This property will be shown without the label.,This property will be shown without the label.
-This relationship type is being used and cannot be deleted.,This relationship type is being used and cannot be deleted.
this template,this template
This template has associated entities,This template has associated entities
This template will be used as default for new entities.,This template will be used as default for new entities.
diff --git a/contents/ui-translations/es.csv b/contents/ui-translations/es.csv
index 40ddb74c41..aa24bfdec0 100644
--- a/contents/ui-translations/es.csv
+++ b/contents/ui-translations/es.csv
@@ -61,6 +61,7 @@ ALL,TODOS
All,TODOS
"All changes will be lost, are you sure you want to proceed?","Se perderán todos los cambios, ¿estás seguro de que quieres continuar?"
Allow captcha bypass,Permitir la omisión de captcha
+Already exists,Already exists
An error has occured while deleting a language:,An error has occured while deleting a language:
An error has occured while installing languages:,An error has occured while installing languages:
An error has occurred during data export,Se ha producido un error durante la exportación de datos.
@@ -75,7 +76,6 @@ Are you sure you want to delete this connection?,Estás seguro que quieres elimi
Are you sure you want to delete this entity?,Estás seguro que quieres eliminar esta entidad?
Are you sure you want to delete this file?,Estás seguro que quieres eliminar este archivo?
Are you sure you want to delete this item?,Estás seguro que quieres eliminar este elemento?
-Are you sure you want to delete this relationship type?,Estás seguro que quieres eliminar este tipo de relación?
Are you sure you want to delete this thesaurus?,Estás seguro que quieres eliminar este tesauro?
Are you sure?,Estás seguro?
Attachment deleted,Archivo adjunto eliminado
@@ -103,7 +103,6 @@ Can see,Puede visualizar
Can view,Puede visualizar
Cancel,Cancelar
Canceling...,Cancelando
-Cannot delete relationship type:,No se puede eliminar el tipo de relación:
Cannot delete template:,No se puede eliminar la plantilla:
Cannot delete thesaurus:,No se puede eliminar el tesauro:
Captcha,Captcha
@@ -149,7 +148,6 @@ Confirm deletion,Confirmar la eliminación
Confirm deletion of,Confirmar la eliminación de
Confirm deletion of entity,Confirmar eliminación de entidad
Confirm deletion of file,Confirmar eliminación de archivo
-Confirm deletion of relationship type:,Confirmar eliminación de tipo de relación:
Confirm deletion of template:,Confirmar eliminación de plantilla:
Confirm deletion of thesaurus:,Confirmar eliminación de tesauro:
Confirm discard changes,Confirmar descartar cambios
@@ -199,7 +197,6 @@ Created thesaurus,Tesauro creado
Created user group,Grupo de usuarios creado
Current value,Valor actual
Current Value/Suggestion,Current Value/Suggestion
-Currently connections only need a title.,Actualmente las conexiones sólo necesitan un título.
Custom component error,Error en el componente de marcado personalizado: valores no soportados! Por favor revisa tu configuración
Custom CSS,CSS personalizado
Custom Favicon,Custom Favicon
@@ -246,6 +243,7 @@ Discard changes,Descartar cambios
Discard changes?,Descartar cambios?
Dismiss,Descartar
Display entity view from page,Mostrar entidad de visualización desde la página
+Do you want to delete the following items?,Do you want to delete the following items?
Document,Documento
Document and entity types,Tipos de documento y entidad
Document contents,Contenidos del documento
@@ -814,7 +812,6 @@ This property will appear in the library cards as part of the basic info.,Esta p
This property will be inherited from the related entities and shown as metadata of this type of entities.,Esta propiedad será heredada desde las entidades relacionadas y se mostrará como metadato de este tipo de entidad.
This property will be shown using all the width available.,Esta propiedad se mostrará utilizando todo el espacio disponible.
This property will be shown without the label.,Esta propiedad se mostrará sin su etiqueta.
-This relationship type is being used and cannot be deleted.,Este tipo de relación esta siendo utilizado y no puede ser eliminado.
this template,esta plantilla
This template has associated entities,Esta plantilla tiene entidades asociadas
This template will be used as default for new entities.,Esta plantilla se utilizará como predeterminada para nuevas entidades
diff --git a/contents/ui-translations/fr.csv b/contents/ui-translations/fr.csv
index 4d75e266e0..f5b70dd6c9 100644
--- a/contents/ui-translations/fr.csv
+++ b/contents/ui-translations/fr.csv
@@ -61,6 +61,7 @@ ALL,ALL
All,All
"All changes will be lost, are you sure you want to proceed?","Tous les changements seront perdus, êtes-vous sûr de vouloir continuer ?"
Allow captcha bypass,Allow captcha bypass
+Already exists,Already exists
An error has occured while deleting a language:,An error has occured while deleting a language:
An error has occured while installing languages:,An error has occured while installing languages:
An error has occurred during data export,An error has occurred during data export
@@ -75,7 +76,6 @@ Are you sure you want to delete this connection?,Are you sure you want to delete
Are you sure you want to delete this entity?,Are you sure you want to delete this entity?
Are you sure you want to delete this file?,Are you sure you want to delete this file?
Are you sure you want to delete this item?,Are you sure you want to delete this item?
-Are you sure you want to delete this relationship type?,Are you sure you want to delete this relationship type?
Are you sure you want to delete this thesaurus?,Are you sure you want to delete this thesaurus?
Are you sure?,Are you sure?
Attachment deleted,Attachment deleted
@@ -103,7 +103,6 @@ Can see,Peut voir
Can view,Peut voir
Cancel,Annuler
Canceling...,Canceling...
-Cannot delete relationship type:,Cannot delete relationship type:
Cannot delete template:,Cannot delete template:
Cannot delete thesaurus:,Cannot delete thesaurus:
Captcha,Captcha
@@ -150,7 +149,6 @@ Confirm deletion,Confirmer la suppression
Confirm deletion of,Confirm deletion of
Confirm deletion of entity,Confirm deletion of entity
Confirm deletion of file,Confirm deletion of file
-Confirm deletion of relationship type:,Confirm deletion of relationship type:
Confirm deletion of template:,Confirm deletion of template:
Confirm deletion of thesaurus:,Confirm deletion of thesaurus:
Confirm discard changes,Confirm discard changes
@@ -200,7 +198,6 @@ Created thesaurus,Created thesaurus
Created user group,Created user group
Current value,Current value
Current Value/Suggestion,Current Value/Suggestion
-Currently connections only need a title.,"Actuellement, les connexions ne nécessitent qu'un titre."
Custom component error,Erreur de composant personnalisé
Custom CSS,CSS personnalisé
Custom Favicon,Custom Favicon
@@ -247,6 +244,7 @@ Discard changes,Annuler les modifications
Discard changes?,Discard changes?
Dismiss,Dismiss
Display entity view from page,Afficher la vue de l'entité depuis la page
+Do you want to delete the following items?,Do you want to delete the following items?
Document,Document
Document and entity types,Types de documents et d'entités
Document contents,Contenu du document
@@ -816,7 +814,6 @@ This property will appear in the library cards as part of the basic info.,Cette
This property will be inherited from the related entities and shown as metadata of this type of entities.,Cette propriété sera héritée des entités liées et affichée comme métadonnées de ce type d'entités.
This property will be shown using all the width available.,Cette propriété sera affichée en utilisant toute la largeur disponible.
This property will be shown without the label.,Cette propriété sera affichée sans l'étiquette.
-This relationship type is being used and cannot be deleted.,This relationship type is being used and cannot be deleted.
this template,this template
This template has associated entities,This template has associated entities
This template will be used as default for new entities.,Ce modèle sera utilisé par défaut pour les nouvelles entités.
diff --git a/contents/ui-translations/ko.csv b/contents/ui-translations/ko.csv
index ff91d6138e..cd0ab8efbb 100644
--- a/contents/ui-translations/ko.csv
+++ b/contents/ui-translations/ko.csv
@@ -61,6 +61,7 @@ ALL,전체 필터
All,전체 필터
"All changes will be lost, are you sure you want to proceed?",모든 변경 사항이 손실됩니다. 계속 진행하시겠습니까?
Allow captcha bypass,Allow captcha bypass
+Already exists,Already exists
An error has occured while deleting a language:,An error has occured while deleting a language:
An error has occured while installing languages:,An error has occured while installing languages:
An error has occurred during data export,An error has occurred during data export
@@ -75,7 +76,6 @@ Are you sure you want to delete this connection?,Are you sure you want to delete
Are you sure you want to delete this entity?,Are you sure you want to delete this entity?
Are you sure you want to delete this file?,Are you sure you want to delete this file?
Are you sure you want to delete this item?,Are you sure you want to delete this item?
-Are you sure you want to delete this relationship type?,Are you sure you want to delete this relationship type?
Are you sure you want to delete this thesaurus?,Are you sure you want to delete this thesaurus?
Are you sure?,Are you sure?
Attachment deleted,Attachment deleted
@@ -103,7 +103,6 @@ Can see,열람 가능
Can view,열람 가능
Cancel,취소
Canceling...,Canceling...
-Cannot delete relationship type:,Cannot delete relationship type:
Cannot delete template:,Cannot delete template:
Cannot delete thesaurus:,Cannot delete thesaurus:
Captcha,보안 문자
@@ -151,7 +150,6 @@ Confirm deletion,삭제 확인
Confirm deletion of,Confirm deletion of
Confirm deletion of entity,Confirm deletion of entity
Confirm deletion of file,Confirm deletion of file
-Confirm deletion of relationship type:,Confirm deletion of relationship type:
Confirm deletion of template:,Confirm deletion of template:
Confirm deletion of thesaurus:,Confirm deletion of thesaurus:
Confirm discard changes,Confirm discard changes
@@ -201,7 +199,6 @@ Created thesaurus,Created thesaurus
Created user group,Created user group
Current value,Current value
Current Value/Suggestion,Current Value/Suggestion
-Currently connections only need a title.,커넥션에 제목이 필요합니다.
Custom component error,사용자 맞춤 구성 오류
Custom CSS,사용자 맞춤 CSS
Custom Favicon,Custom Favicon
@@ -248,6 +245,7 @@ Discard changes,변경 취소
Discard changes?,Discard changes?
Dismiss,Dismiss
Display entity view from page,페이지에서 엔티티 뷰 표시
+Do you want to delete the following items?,Do you want to delete the following items?
Document,문서
Document and entity types,문서 및 엔티티 유형
Document contents,문서 내용
@@ -817,7 +815,6 @@ This property will appear in the library cards as part of the basic info.,이
This property will be inherited from the related entities and shown as metadata of this type of entities.,관련 엔티티에서 속성을 이어받아 현재 엔티티의 메타데이터에 포함시킵니다.
This property will be shown using all the width available.,디스플레이 가능한 너비 내에서 이 속성을 표시합니다.
This property will be shown without the label.,이 속성은 라벨 없이 표시됩니다.
-This relationship type is being used and cannot be deleted.,This relationship type is being used and cannot be deleted.
this template,this template
This template has associated entities,This template has associated entities
This template will be used as default for new entities.,이 템플릿을 새 엔티티의 기본값으로 사용합니다.
diff --git a/contents/ui-translations/my.csv b/contents/ui-translations/my.csv
index ca735e5a5a..a9edad5474 100644
--- a/contents/ui-translations/my.csv
+++ b/contents/ui-translations/my.csv
@@ -61,6 +61,7 @@ ALL,အားလုံး
All,အားလုံး
"All changes will be lost, are you sure you want to proceed?",အပြောင်းအလဲအားလုံးကို ဆုံးရှုံးပါမည်၊ ရှေ့ဆက်လိုသည်မှာ သေချာပါသလား။
Allow captcha bypass,Allow captcha bypass
+Already exists,Already exists
An error has occured while deleting a language:,An error has occured while deleting a language:
An error has occured while installing languages:,An error has occured while installing languages:
An error has occurred during data export,An error has occurred during data export
@@ -75,7 +76,6 @@ Are you sure you want to delete this connection?,Are you sure you want to delete
Are you sure you want to delete this entity?,Are you sure you want to delete this entity?
Are you sure you want to delete this file?,Are you sure you want to delete this file?
Are you sure you want to delete this item?,Are you sure you want to delete this item?
-Are you sure you want to delete this relationship type?,Are you sure you want to delete this relationship type?
Are you sure you want to delete this thesaurus?,Are you sure you want to delete this thesaurus?
Are you sure?,Are you sure?
Attachment deleted,Attachment deleted
@@ -103,7 +103,6 @@ Can see,မြင်နိုင်သည်
Can view,ကြည့်နိုင်သည်
Cancel,ပယ်ဖျက်ရန်
Canceling...,Canceling...
-Cannot delete relationship type:,Cannot delete relationship type:
Cannot delete template:,Cannot delete template:
Cannot delete thesaurus:,Cannot delete thesaurus:
Captcha,ကက်ပ်ချာ
@@ -151,7 +150,6 @@ Confirm deletion,ဖျက်ရန် အတည်ပြုပါ
Confirm deletion of,Confirm deletion of
Confirm deletion of entity,Confirm deletion of entity
Confirm deletion of file,Confirm deletion of file
-Confirm deletion of relationship type:,Confirm deletion of relationship type:
Confirm deletion of template:,Confirm deletion of template:
Confirm deletion of thesaurus:,Confirm deletion of thesaurus:
Confirm discard changes,Confirm discard changes
@@ -201,7 +199,6 @@ Created thesaurus,Created thesaurus
Created user group,Created user group
Current value,Current value
Current Value/Suggestion,Current Value/Suggestion
-Currently connections only need a title.,လက်ရှိတွင် ချိတ်ဆက်မှုအနည်းငယ်သာ လိုအပ်သည်။
Custom component error,စိတ်ကြိုက် အစိတ်အပိုင်း ချွတ်ယွင်းချက်
Custom CSS,စိတ်ကြိုက် CSS
Custom Favicon,Custom Favicon
@@ -248,6 +245,7 @@ Discard changes,အပြောင်းအလဲများကို ပယ်
Discard changes?,Discard changes?
Dismiss,Dismiss
Display entity view from page,စာမျက်နှာမှ ဖြည့်သွင်းချက် မြင်ကွင်းကို ပြသရန်
+Do you want to delete the following items?,Do you want to delete the following items?
Document,စာရွက်စာတမ်း
Document and entity types,စာရွက်စာတမ်းနှင့် ဖြည့်သွင်းချက် အမျိုးအစားများ
Document contents,စာရွက်စာတမ်း မာတိကာ
@@ -817,7 +815,6 @@ This property will appear in the library cards as part of the basic info.,ဤထ
This property will be inherited from the related entities and shown as metadata of this type of entities.,ဤထူးခြားချက်ကို သက်ဆိုင်ရာ ဖြည့်သွင်းချက်များမှ လက်ခံရယူပြီး ဤဖြည့်သွင်းချက် အမျိုးအစား၏ မီတာဒေတာအဖြစ် ပြသပါမည်။
This property will be shown using all the width available.,ဤထူးခြားချက်ကို ရရှိနိုင်သော အကျယ်အားလုံးသုံးပြီး ပြသပါမည်။
This property will be shown without the label.,ဤထူးခြားချက်ကို တံဆိပ်မှတ်သားမှုမပါဘဲ ပြသပါမည်။
-This relationship type is being used and cannot be deleted.,This relationship type is being used and cannot be deleted.
this template,this template
This template has associated entities,This template has associated entities
This template will be used as default for new entities.,ဤပုံစံပြားကို ဖြည့်သွင်းချက်အသစ်များအတွက် နဂိုမူလအဖြစ် သုံးပါမည်။
diff --git a/contents/ui-translations/ru.csv b/contents/ui-translations/ru.csv
index 834db67138..92cc5d175f 100644
--- a/contents/ui-translations/ru.csv
+++ b/contents/ui-translations/ru.csv
@@ -61,6 +61,7 @@ ALL,ВСЕ
All,ВСЕ
"All changes will be lost, are you sure you want to proceed?","Все изменения будут потеряны, вы уверены, что хотите продолжить?"
Allow captcha bypass,Allow captcha bypass
+Already exists,Already exists
An error has occured while deleting a language:,An error has occured while deleting a language:
An error has occured while installing languages:,An error has occured while installing languages:
An error has occurred during data export,An error has occurred during data export
@@ -75,7 +76,6 @@ Are you sure you want to delete this connection?,Are you sure you want to delete
Are you sure you want to delete this entity?,Are you sure you want to delete this entity?
Are you sure you want to delete this file?,Are you sure you want to delete this file?
Are you sure you want to delete this item?,Are you sure you want to delete this item?
-Are you sure you want to delete this relationship type?,Are you sure you want to delete this relationship type?
Are you sure you want to delete this thesaurus?,Are you sure you want to delete this thesaurus?
Are you sure?,Are you sure?
Attachment deleted,Attachment deleted
@@ -103,7 +103,6 @@ Can see,Может видеть
Can view,Может просматривать
Cancel,Отмена
Canceling...,Canceling...
-Cannot delete relationship type:,Cannot delete relationship type:
Cannot delete template:,Cannot delete template:
Cannot delete thesaurus:,Cannot delete thesaurus:
Captcha,Captcha
@@ -148,7 +147,6 @@ Confirm deletion,Подтвердить удаление
Confirm deletion of,Confirm deletion of
Confirm deletion of entity,Confirm deletion of entity
Confirm deletion of file,Confirm deletion of file
-Confirm deletion of relationship type:,Confirm deletion of relationship type:
Confirm deletion of template:,Confirm deletion of template:
Confirm deletion of thesaurus:,Confirm deletion of thesaurus:
Confirm discard changes,Confirm discard changes
@@ -198,7 +196,6 @@ Created thesaurus,Created thesaurus
Created user group,Created user group
Current value,Current value
Current Value/Suggestion,Current Value/Suggestion
-Currently connections only need a title.,В настоящий момент для подключений только требуется заголовок
Custom component error,Ошибка пользовательского компонента
Custom CSS,Персональные CSS
Custom Favicon,Custom Favicon
@@ -245,6 +242,7 @@ Discard changes,Отменить изменения
Discard changes?,Discard changes?
Dismiss,Dismiss
Display entity view from page,Показывать просматриваемый объект со страницы
+Do you want to delete the following items?,Do you want to delete the following items?
Document,Документ
Document and entity types,Типы документов и объектов
Document contents,Содержание документа
@@ -814,7 +812,6 @@ This property will appear in the library cards as part of the basic info.,Это
This property will be inherited from the related entities and shown as metadata of this type of entities.,Это свойство будет приобретено от взаимосвязанных объектов и отображаться как метаданные для этого типа объектов.
This property will be shown using all the width available.,Это свойство будет отображаться с использованием всей доступной ширины.
This property will be shown without the label.,Это свойство будет отображаться без метки.
-This relationship type is being used and cannot be deleted.,This relationship type is being used and cannot be deleted.
this template,this template
This template has associated entities,This template has associated entities
This template will be used as default for new entities.,Этот шаблон будет использоваться по умолчанию для новых объектов.
diff --git a/contents/ui-translations/th.csv b/contents/ui-translations/th.csv
index 3f5c5150d8..d888a29eee 100644
--- a/contents/ui-translations/th.csv
+++ b/contents/ui-translations/th.csv
@@ -61,6 +61,7 @@ ALL,ALL
All,All
"All changes will be lost, are you sure you want to proceed?",การเปลี่ยนแปลงทั้งหมดจะหายไปคุณแน่ใจหรือว่าต้องการดำเนินการต่อ?
Allow captcha bypass,Allow captcha bypass
+Already exists,Already exists
An error has occured while deleting a language:,An error has occured while deleting a language:
An error has occured while installing languages:,An error has occured while installing languages:
An error has occurred during data export,An error has occurred during data export
@@ -75,7 +76,6 @@ Are you sure you want to delete this connection?,Are you sure you want to delete
Are you sure you want to delete this entity?,Are you sure you want to delete this entity?
Are you sure you want to delete this file?,Are you sure you want to delete this file?
Are you sure you want to delete this item?,Are you sure you want to delete this item?
-Are you sure you want to delete this relationship type?,Are you sure you want to delete this relationship type?
Are you sure you want to delete this thesaurus?,Are you sure you want to delete this thesaurus?
Are you sure?,Are you sure?
Attachment deleted,Attachment deleted
@@ -103,7 +103,6 @@ Can see,มองเห็นได้
Can view,มองเห็นได้
Cancel,ยกเลิก
Canceling...,Canceling...
-Cannot delete relationship type:,Cannot delete relationship type:
Cannot delete template:,Cannot delete template:
Cannot delete thesaurus:,Cannot delete thesaurus:
Captcha,captcha
@@ -151,7 +150,6 @@ Confirm deletion,ยืนยันการลบ
Confirm deletion of,Confirm deletion of
Confirm deletion of entity,Confirm deletion of entity
Confirm deletion of file,Confirm deletion of file
-Confirm deletion of relationship type:,Confirm deletion of relationship type:
Confirm deletion of template:,Confirm deletion of template:
Confirm deletion of thesaurus:,Confirm deletion of thesaurus:
Confirm discard changes,Confirm discard changes
@@ -201,7 +199,6 @@ Created thesaurus,Created thesaurus
Created user group,Created user group
Current value,Current value
Current Value/Suggestion,Current Value/Suggestion
-Currently connections only need a title.,การเชื่อมต่อจำเป็นต้องกำหนดหัวข้อเรื่อง
Custom component error,เกิดข้อผิดพลาดในส่วนประกอบที่สร้างเอง
Custom CSS,CSS ที่กำหนดเอง
Custom Favicon,Custom Favicon
@@ -248,6 +245,7 @@ Discard changes,ยกเลิกการเปลี่ยนแปลง
Discard changes?,Discard changes?
Dismiss,Dismiss
Display entity view from page,แสดงมุมมองรายการจากหน้า
+Do you want to delete the following items?,Do you want to delete the following items?
Document,เอกสาร
Document and entity types,ประเภทเอกสารและรายการ
Document contents,เนื้อหาของเอกสาร
@@ -819,7 +817,6 @@ This property will appear in the library cards as part of the basic info.,คุ
This property will be inherited from the related entities and shown as metadata of this type of entities.,คุณสมบัตินี้จะถูกโอนย้ายมาจากรายการที่เกี่ยวข้องและจะถูกแสดงเป็นเมตาดาต้าสำหรับประเภทรายการนี้
This property will be shown using all the width available.,คุณสมบัตินี้จะถูกแสดงโดยใช้พื้นที่ทั้งหมดที่มีอยู่
This property will be shown without the label.,คุณสมบัตินี้จะถูกแสดงโดยไม่มีการจำแนกประเภท
-This relationship type is being used and cannot be deleted.,This relationship type is being used and cannot be deleted.
this template,this template
This template has associated entities,This template has associated entities
This template will be used as default for new entities.,แม่แบบนี้จะถูกตั้งเป็นค่าเริ่มต้นสำหรับรายการใหม่
diff --git a/contents/ui-translations/tr.csv b/contents/ui-translations/tr.csv
index 8e03f875db..c91d5fd900 100644
--- a/contents/ui-translations/tr.csv
+++ b/contents/ui-translations/tr.csv
@@ -61,6 +61,7 @@ ALL,ALL
All,All
"All changes will be lost, are you sure you want to proceed?","Tüm değişiklikler kaybolacak, devam etmek istediğinizden emin misiniz?"
Allow captcha bypass,Allow captcha bypass
+Already exists,Already exists
An error has occured while deleting a language:,An error has occured while deleting a language:
An error has occured while installing languages:,An error has occured while installing languages:
An error has occurred during data export,An error has occurred during data export
@@ -75,7 +76,6 @@ Are you sure you want to delete this connection?,Are you sure you want to delete
Are you sure you want to delete this entity?,Are you sure you want to delete this entity?
Are you sure you want to delete this file?,Are you sure you want to delete this file?
Are you sure you want to delete this item?,Are you sure you want to delete this item?
-Are you sure you want to delete this relationship type?,Are you sure you want to delete this relationship type?
Are you sure you want to delete this thesaurus?,Are you sure you want to delete this thesaurus?
Are you sure?,Are you sure?
Attachment deleted,Attachment deleted
@@ -103,7 +103,6 @@ Can see,Görebilir
Can view,Görüntüleyebilir
Cancel,İptal et
Canceling...,Canceling...
-Cannot delete relationship type:,Cannot delete relationship type:
Cannot delete template:,Cannot delete template:
Cannot delete thesaurus:,Cannot delete thesaurus:
Captcha,Güvenlik kodu
@@ -151,7 +150,6 @@ Confirm deletion,Silmeyi onayla
Confirm deletion of,Confirm deletion of
Confirm deletion of entity,Confirm deletion of entity
Confirm deletion of file,Confirm deletion of file
-Confirm deletion of relationship type:,Confirm deletion of relationship type:
Confirm deletion of template:,Confirm deletion of template:
Confirm deletion of thesaurus:,Confirm deletion of thesaurus:
Confirm discard changes,Confirm discard changes
@@ -201,7 +199,6 @@ Created thesaurus,Created thesaurus
Created user group,Created user group
Current value,Current value
Current Value/Suggestion,Current Value/Suggestion
-Currently connections only need a title.,Şu anda bağlantıların yalnızca bir başlığa ihtiyacı var.
Custom component error,Özel Yüklemeler
Custom CSS,Özel CSS
Custom Favicon,Custom Favicon
@@ -248,6 +245,7 @@ Discard changes,Değişiklikleri göz ardı et
Discard changes?,Discard changes?
Dismiss,Dismiss
Display entity view from page,Sayfadan varlık görünümünü görüntüle
+Do you want to delete the following items?,Do you want to delete the following items?
Document,Belge
Document and entity types,Belge ve varlık türü
Document contents,Belge içeriği
@@ -817,7 +815,6 @@ This property will appear in the library cards as part of the basic info.,"Bu ö
This property will be inherited from the related entities and shown as metadata of this type of entities.,"Bu özellik, ilgili varlıklardan devralınacak ve bu tür varlıkların meta verileri olarak gösterilecektir."
This property will be shown using all the width available.,"Bu özellik, mevcut tüm genişlik kullanılarak gösterilecektir."
This property will be shown without the label.,Bu özellik etiketsiz olarak gösterilecektir.
-This relationship type is being used and cannot be deleted.,This relationship type is being used and cannot be deleted.
this template,this template
This template has associated entities,This template has associated entities
This template will be used as default for new entities.,"Bu şablon, yeni varlıklar için varsayılan olarak kullanılacaktır."
diff --git a/cypress/e2e/settings/relationship-types.cy.ts b/cypress/e2e/settings/relationship-types.cy.ts
new file mode 100644
index 0000000000..78ce3e07ed
--- /dev/null
+++ b/cypress/e2e/settings/relationship-types.cy.ts
@@ -0,0 +1,79 @@
+/* eslint-disable max-statements */
+import 'cypress-axe';
+import { clearCookiesAndLogin } from '../helpers/login';
+
+describe('Relationship Types configuration', () => {
+ before(() => {
+ const env = { DATABASE_NAME: 'uwazi_e2e', INDEX_NAME: 'uwazi_e2e' };
+ cy.exec('yarn blank-state --force', { env });
+ clearCookiesAndLogin('admin', 'change this password now');
+ cy.get('.only-desktop a[aria-label="Settings"]').click();
+ cy.injectAxe();
+ cy.contains('span', 'Relationship types').click();
+ });
+
+ it('should have no detectable accessibility violations on load', () => {
+ cy.checkA11y();
+ });
+
+ beforeEach(() => {
+ cy.intercept('GET', 'api/relationtypes').as('fetchTypes');
+ cy.intercept('GET', 'api/templates').as('fetchtemplates');
+ });
+
+ it('tests add types', () => {
+ cy.getByTestId('relationship-types-add').click();
+ cy.checkA11y();
+ cy.get('#relationship-type-name').click();
+ cy.get('#relationship-type-name').type('Parent');
+
+ cy.getByTestId('relationship-type-form-submit').click();
+ cy.wait('@fetchTypes');
+ cy.contains('Dismiss').click();
+
+ cy.getByTestId('relationship-types-add').click();
+ cy.get('#relationship-type-name').click();
+ cy.get('#relationship-type-name').type('Son');
+
+ cy.getByTestId('relationship-type-form-submit').click();
+ cy.wait('@fetchTypes');
+ cy.contains('Dismiss').click();
+ });
+
+ it('tests Edit', () => {
+ cy.get('tbody tr:nth-of-type(1)').contains('Edit').click();
+ cy.get('#relationship-type-name').click();
+ cy.get('#relationship-type-name').type('Edited');
+ cy.getByTestId('relationship-type-form-submit').click();
+
+ cy.wait('@fetchTypes');
+ cy.contains('Dismiss').click();
+ });
+
+ it('tests delete', () => {
+ cy.get('tbody tr:nth-of-type(1) input').click();
+
+ cy.getByTestId('relationship-types-delete').click();
+ cy.checkA11y();
+ cy.getByTestId('cancel-button').click();
+
+ cy.getByTestId('relationship-types-delete').click();
+ cy.getByTestId('accept-button').click();
+ cy.wait('@fetchTypes');
+ cy.contains('Dismiss').click();
+ });
+
+ it('test cant delete when in use', () => {
+ cy.contains('span', 'Templates').click();
+ cy.contains('Edit').click();
+ cy.get('aside .list-group-item:nth-of-type(4) button').click();
+ cy.get('.metadataTemplate li:nth-of-type(3) .property-edit').click();
+ cy.get('select').eq(0).select('Son');
+
+ cy.contains('Save').click();
+ cy.wait('@fetchtemplates');
+ cy.contains('span', 'Relationship types').click();
+
+ cy.get('tbody tr:nth-of-type(1) input').should('be.disabled');
+ });
+});
diff --git a/e2e/suite1/metadata.spec.ts b/e2e/suite1/metadata.spec.ts
index ed821a0079..4a25ee2d8f 100644
--- a/e2e/suite1/metadata.spec.ts
+++ b/e2e/suite1/metadata.spec.ts
@@ -149,38 +149,4 @@ describe('Metadata', () => {
await expect(page).not.toMatch('My edited template');
});
});
-
- describe('Relationship types tests', () => {
- it('should create a new connection', async () => {
- await expect(page).toClick('a', { text: 'Relationship types' });
- await expect(page).toClick('a', { text: 'Add relationship' });
- await expect(page).toFill('input[placeholder="Template name"]', 'test connection');
- await expect(page).toClick('button', { text: 'Save' });
- await expect(page).toClick('.alert.alert-success');
- await expect(page).toClick('a', { text: 'Relationship types' });
- await expect(page).toMatch('test connection');
- });
-
- it('should go back to Connections then edit the created connection', async () => {
- await expect(page).toClick('a', { text: 'Relationship types' });
- await expect(page).toClick('a', { text: 'test connection' });
- await expect(page).toFill('input[value="test connection"]', 'test connection edited');
- await expect(page).toClick('button', { text: 'Save' });
- await expect(page).toClick('.alert.alert-success');
- await expect(page).toClick('a', { text: 'Relationship types' });
- await expect(page).toMatch('test connection edited');
- });
-
- it('should go back to connections then delete the created connection', async () => {
- await expect(page).toClick('a', { text: 'Relationship types' });
- await expect(page).toClick(
- // types not up to date pr here https://github.com/DefinitelyTyped/DefinitelyTyped/pull/60579
- // @ts-ignore
- { type: 'xpath', value: '//*[text() = "test connection edited"]/parent::li//a' },
- { text: 'Delete' }
- );
- await expect(page).toClick('button', { text: 'Accept' });
- await expect(page).not.toMatch('test connection edited');
- });
- });
});
diff --git a/package.json b/package.json
index 4d6e249ee1..d3b7dcb2ab 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "uwazi",
- "version": "1.157.1",
+ "version": "1.158.0",
"description": "Uwazi is a free, open-source solution for organising, analysing and publishing your documents.",
"keywords": [
"react"
@@ -230,7 +230,7 @@
"socket.io-client": "4.7.4",
"socket.io-parser": "4.2.4",
"stopword": "^3.0.1",
- "superagent": "8.0.9",
+ "superagent": "8.1.2",
"svg-captcha": "^1.4.0",
"tiny-cookie": "^2.5.1",
"typescript": "5.3.3",
diff --git a/yarn.lock b/yarn.lock
index 444cb749ae..7cba3c2d74 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -18796,10 +18796,10 @@ sucrase@^3.32.0:
pirates "^4.0.1"
ts-interface-checker "^0.1.9"
-superagent@8.0.9, superagent@^8.0.5:
- version "8.0.9"
- resolved "https://registry.yarnpkg.com/superagent/-/superagent-8.0.9.tgz#2c6fda6fadb40516515f93e9098c0eb1602e0535"
- integrity sha512-4C7Bh5pyHTvU33KpZgwrNKh/VQnvgtCSqPRfJAUdmrtSYePVzVg4E4OzsrbkhJj9O7SO6Bnv75K/F8XVZT8YHA==
+superagent@8.1.2, superagent@^8.0.5:
+ version "8.1.2"
+ resolved "https://registry.yarnpkg.com/superagent/-/superagent-8.1.2.tgz#03cb7da3ec8b32472c9d20f6c2a57c7f3765f30b"
+ integrity sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==
dependencies:
component-emitter "^1.3.0"
cookiejar "^2.1.4"