Просмотр исходного кода

Fixes: Mobile - IsModelObject concern handling and usage.

Tobias Schäfer 1 год назад
Родитель
Сommit
3dfebda705

+ 0 - 32
app/frontend/shared/graphql/types.ts

@@ -77,15 +77,11 @@ export type Authorization = {
   __typename?: 'Authorization';
   /** Create date/time of the record */
   createdAt: Scalars['ISO8601DateTime'];
-  /** User that created this record */
-  createdBy?: Maybe<User>;
   id: Scalars['ID'];
   provider: Scalars['String'];
   uid: Scalars['String'];
   /** Last update date/time of the record */
   updatedAt: Scalars['ISO8601DateTime'];
-  /** Last user that updated this record */
-  updatedBy?: Maybe<User>;
   username?: Maybe<Scalars['String']>;
 };
 
@@ -465,16 +461,12 @@ export type KnowledgeBase = {
   colorHighlight: Scalars['String'];
   /** Create date/time of the record */
   createdAt: Scalars['ISO8601DateTime'];
-  /** User that created this record */
-  createdBy?: Maybe<User>;
   customAddress?: Maybe<Scalars['String']>;
   homepageLayout: Scalars['String'];
   iconset: Scalars['String'];
   id: Scalars['ID'];
   /** Last update date/time of the record */
   updatedAt: Scalars['ISO8601DateTime'];
-  /** Last user that updated this record */
-  updatedBy?: Maybe<User>;
 };
 
 /** Knowledge Base Answer */
@@ -545,14 +537,10 @@ export type KnowledgeBaseAnswerTranslationContent = {
   bodyPrepared?: Maybe<Scalars['String']>;
   /** Create date/time of the record */
   createdAt: Scalars['ISO8601DateTime'];
-  /** User that created this record */
-  createdBy?: Maybe<User>;
   hasAttachments: Scalars['Boolean'];
   id: Scalars['ID'];
   /** Last update date/time of the record */
   updatedAt: Scalars['ISO8601DateTime'];
-  /** Last user that updated this record */
-  updatedBy?: Maybe<User>;
 };
 
 /** Knowledge Base Category */
@@ -561,8 +549,6 @@ export type KnowledgeBaseCategory = {
   categoryIcon: Scalars['String'];
   /** Create date/time of the record */
   createdAt: Scalars['ISO8601DateTime'];
-  /** User that created this record */
-  createdBy?: Maybe<User>;
   id: Scalars['ID'];
   /** resolver for Rails' belongs_to relationship */
   knowledgeBase: KnowledgeBase;
@@ -572,8 +558,6 @@ export type KnowledgeBaseCategory = {
   translations: Array<KnowledgeBaseCategoryTranslation>;
   /** Last update date/time of the record */
   updatedAt: Scalars['ISO8601DateTime'];
-  /** Last user that updated this record */
-  updatedBy?: Maybe<User>;
 };
 
 /** Knowledge Base Category Translation */
@@ -583,16 +567,12 @@ export type KnowledgeBaseCategoryTranslation = {
   category: KnowledgeBaseCategory;
   /** Create date/time of the record */
   createdAt: Scalars['ISO8601DateTime'];
-  /** User that created this record */
-  createdBy?: Maybe<User>;
   id: Scalars['ID'];
   /** resolver for Rails' belongs_to relationship */
   kbLocale: KnowledgeBaseLocale;
   title: Scalars['String'];
   /** Last update date/time of the record */
   updatedAt: Scalars['ISO8601DateTime'];
-  /** Last user that updated this record */
-  updatedBy?: Maybe<User>;
 };
 
 /** Knowledge Base Locale */
@@ -600,8 +580,6 @@ export type KnowledgeBaseLocale = {
   __typename?: 'KnowledgeBaseLocale';
   /** Create date/time of the record */
   createdAt: Scalars['ISO8601DateTime'];
-  /** User that created this record */
-  createdBy?: Maybe<User>;
   id: Scalars['ID'];
   /** resolver for Rails' belongs_to relationship */
   knowledgeBase: KnowledgeBase;
@@ -610,8 +588,6 @@ export type KnowledgeBaseLocale = {
   systemLocale: Locale;
   /** Last update date/time of the record */
   updatedAt: Scalars['ISO8601DateTime'];
-  /** Last user that updated this record */
-  updatedBy?: Maybe<User>;
 };
 
 /** Locales available in the system */
@@ -621,16 +597,12 @@ export type Locale = {
   alias?: Maybe<Scalars['String']>;
   /** Create date/time of the record */
   createdAt: Scalars['ISO8601DateTime'];
-  /** User that created this record */
-  createdBy?: Maybe<User>;
   dir: EnumTextDirection;
   id: Scalars['ID'];
   locale: Scalars['String'];
   name: Scalars['String'];
   /** Last update date/time of the record */
   updatedAt: Scalars['ISO8601DateTime'];
-  /** Last user that updated this record */
-  updatedBy?: Maybe<User>;
 };
 
 /** Locate an organization via id or internalId. */
@@ -1597,8 +1569,6 @@ export type StoredFile = {
   __typename?: 'StoredFile';
   /** Create date/time of the record */
   createdAt: Scalars['ISO8601DateTime'];
-  /** User that created this record */
-  createdBy?: Maybe<User>;
   id: Scalars['ID'];
   /** Internal database ID */
   internalId: Scalars['Int'];
@@ -1611,8 +1581,6 @@ export type StoredFile = {
   type?: Maybe<Scalars['String']>;
   /** Last update date/time of the record */
   updatedAt: Scalars['ISO8601DateTime'];
-  /** Last user that updated this record */
-  updatedBy?: Maybe<User>;
 };
 
 /** All available subscriptions */

+ 1 - 1
app/graphql/gql/types/authorization_type.rb

@@ -2,7 +2,7 @@
 
 module Gql::Types
   class AuthorizationType < Gql::Types::BaseObject
-    include Gql::Types::Concerns::IsModelObject
+    include Gql::Types::Concerns::HasDefaultModelFields
 
     description 'Authorization for an account linked to a user'
 

+ 1 - 1
app/graphql/gql/types/knowledge_base/answer/translation/content_type.rb

@@ -2,7 +2,7 @@
 
 module Gql::Types::KnowledgeBase::Answer::Translation
   class ContentType < Gql::Types::BaseObject
-    include Gql::Types::Concerns::IsModelObject
+    include Gql::Types::Concerns::HasDefaultModelFields
     include Gql::Types::Concerns::HasPunditAuthorization
     include KnowledgeBaseRichTextHelper
 

+ 1 - 1
app/graphql/gql/types/knowledge_base/category/translation_type.rb

@@ -2,7 +2,7 @@
 
 module Gql::Types::KnowledgeBase::Category
   class TranslationType < Gql::Types::BaseObject
-    include Gql::Types::Concerns::IsModelObject
+    include Gql::Types::Concerns::HasDefaultModelFields
     include Gql::Types::Concerns::HasPunditAuthorization
 
     description 'Knowledge Base Category Translation'

+ 1 - 1
app/graphql/gql/types/knowledge_base/category_type.rb

@@ -2,7 +2,7 @@
 
 module Gql::Types::KnowledgeBase
   class CategoryType < Gql::Types::BaseObject
-    include Gql::Types::Concerns::IsModelObject
+    include Gql::Types::Concerns::HasDefaultModelFields
     include Gql::Types::Concerns::HasPunditAuthorization
 
     description 'Knowledge Base Category'

+ 1 - 1
app/graphql/gql/types/knowledge_base/locale_type.rb

@@ -2,7 +2,7 @@
 
 module Gql::Types::KnowledgeBase
   class LocaleType < Gql::Types::BaseObject
-    include Gql::Types::Concerns::IsModelObject
+    include Gql::Types::Concerns::HasDefaultModelFields
 
     description 'Knowledge Base Locale'
 

+ 1 - 1
app/graphql/gql/types/knowledge_base_type.rb

@@ -2,7 +2,7 @@
 
 module Gql::Types
   class KnowledgeBaseType < Gql::Types::BaseObject
-    include Gql::Types::Concerns::IsModelObject
+    include Gql::Types::Concerns::HasDefaultModelFields
     include Gql::Types::Concerns::HasPunditAuthorization
 
     description 'Knowledge Base'

+ 1 - 1
app/graphql/gql/types/locale_type.rb

@@ -2,7 +2,7 @@
 
 module Gql::Types
   class LocaleType < Gql::Types::BaseObject
-    include Gql::Types::Concerns::IsModelObject
+    include Gql::Types::Concerns::HasDefaultModelFields
 
     description 'Locales available in the system'
 

+ 1 - 1
app/graphql/gql/types/stored_file_type.rb

@@ -2,7 +2,7 @@
 
 module Gql::Types
   class StoredFileType < Gql::Types::BaseObject
-    include Gql::Types::Concerns::IsModelObject
+    include Gql::Types::Concerns::HasDefaultModelFields
     include Gql::Types::Concerns::HasInternalIdField
     include Gql::Types::Concerns::HasPunditAuthorization
 

+ 2 - 0
app/models/avatar.rb

@@ -1,6 +1,8 @@
 # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
 
 class Avatar < ApplicationModel
+  include HasDefaultModelUserRelations
+
   belongs_to :object_lookup, optional: true
 
 =begin

Некоторые файлы не были показаны из-за большого количества измененных файлов