Skip to content

Commit

Permalink
feat(about-us): add multiversion team section
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-the-shark committed Jan 7, 2025
1 parent 927f455 commit 0cdcbe6
Show file tree
Hide file tree
Showing 9 changed files with 378 additions and 36 deletions.
233 changes: 233 additions & 0 deletions lib/api_base/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ type Query {
Scientific_Circles_by_id(id: ID!, version: String): Scientific_Circles
Scientific_Circles_aggregated(groupBy: [String], filter: Scientific_Circles_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [Scientific_Circles_aggregated!]!
Scientific_Circles_by_version(version: String!, id: ID!): version_Scientific_Circles
TeamVersions(filter: TeamVersions_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [TeamVersions!]!
TeamVersions_by_id(id: ID!, version: String): TeamVersions
TeamVersions_aggregated(groupBy: [String], filter: TeamVersions_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [TeamVersions_aggregated!]!
TeamVersions_by_version(version: String!, id: ID!): version_TeamVersions
TeamVersion_Members_AboutUs_Team_Social_Links(filter: TeamVersion_Members_AboutUs_Team_Social_Links_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [TeamVersion_Members_AboutUs_Team_Social_Links!]!
TeamVersion_Members_AboutUs_Team_Social_Links_by_id(id: ID!, version: String): TeamVersion_Members_AboutUs_Team_Social_Links
TeamVersion_Members_AboutUs_Team_Social_Links_aggregated(groupBy: [String], filter: TeamVersion_Members_AboutUs_Team_Social_Links_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [TeamVersion_Members_AboutUs_Team_Social_Links_aggregated!]!
TeamVersion_Members_AboutUs_Team_Social_Links_by_version(version: String!, id: ID!): version_TeamVersion_Members_AboutUs_Team_Social_Links
TeamVersion_Members(filter: TeamVersion_Members_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [TeamVersion_Members!]!
TeamVersion_Members_by_id(id: ID!, version: String): TeamVersion_Members
TeamVersion_Members_aggregated(groupBy: [String], filter: TeamVersion_Members_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [TeamVersion_Members_aggregated!]!
TeamVersion_Members_by_version(version: String!, id: ID!): version_TeamVersion_Members
}

type Scientific_Circles_Tags {
Expand Down Expand Up @@ -1614,6 +1626,206 @@ type version_Scientific_Circles {
links_func: count_functions
}

type TeamVersions {
id: ID!
sort: Int
user_created: String
date_created: Date
date_created_func: datetime_functions
user_updated: String
date_updated: Date
date_updated_func: datetime_functions
name: String
}

input TeamVersions_filter {
id: number_filter_operators
sort: number_filter_operators
user_created: string_filter_operators
date_created: date_filter_operators
date_created_func: datetime_function_filter_operators
user_updated: string_filter_operators
date_updated: date_filter_operators
date_updated_func: datetime_function_filter_operators
name: string_filter_operators
_and: [TeamVersions_filter]
_or: [TeamVersions_filter]
}

type TeamVersions_aggregated {
group: JSON
countAll: Int
count: TeamVersions_aggregated_count
countDistinct: TeamVersions_aggregated_count
avg: TeamVersions_aggregated_fields
sum: TeamVersions_aggregated_fields
avgDistinct: TeamVersions_aggregated_fields
sumDistinct: TeamVersions_aggregated_fields
min: TeamVersions_aggregated_fields
max: TeamVersions_aggregated_fields
}

type TeamVersions_aggregated_count {
id: Int
sort: Int
user_created: Int
date_created: Int
user_updated: Int
date_updated: Int
name: Int
}

type TeamVersions_aggregated_fields {
id: Float
sort: Float
}

""""""
type version_TeamVersions {
id: ID!
sort: Int
user_created: String
date_created: Date
date_created_func: datetime_functions
user_updated: String
date_updated: Date
date_updated_func: datetime_functions
name: String
}

type TeamVersion_Members_AboutUs_Team_Social_Links {
id: ID!
TeamVersion_Members_id(filter: TeamVersion_Members_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): TeamVersion_Members
AboutUs_Team_Social_Links_id(filter: AboutUs_Team_Social_Links_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): AboutUs_Team_Social_Links
}

type TeamVersion_Members {
id: ID!
sort: Int
user_created: String
date_created: Date
date_created_func: datetime_functions
user_updated: String
date_updated: Date
date_updated_func: datetime_functions
name: String!
subtitle: String
photo(filter: directus_files_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): directus_files
appVersion(filter: TeamVersions_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): TeamVersions
socialLinks(filter: TeamVersion_Members_AboutUs_Team_Social_Links_filter, sort: [String], limit: Int, offset: Int, page: Int, search: String): [TeamVersion_Members_AboutUs_Team_Social_Links]
socialLinks_func: count_functions
}

input TeamVersion_Members_AboutUs_Team_Social_Links_filter {
id: number_filter_operators
TeamVersion_Members_id: TeamVersion_Members_filter
AboutUs_Team_Social_Links_id: AboutUs_Team_Social_Links_filter
_and: [TeamVersion_Members_AboutUs_Team_Social_Links_filter]
_or: [TeamVersion_Members_AboutUs_Team_Social_Links_filter]
}

input TeamVersion_Members_filter {
id: number_filter_operators
sort: number_filter_operators
user_created: string_filter_operators
date_created: date_filter_operators
date_created_func: datetime_function_filter_operators
user_updated: string_filter_operators
date_updated: date_filter_operators
date_updated_func: datetime_function_filter_operators
name: string_filter_operators
subtitle: string_filter_operators
photo: directus_files_filter
appVersion: TeamVersions_filter
socialLinks: TeamVersion_Members_AboutUs_Team_Social_Links_filter
socialLinks_func: count_function_filter_operators
_and: [TeamVersion_Members_filter]
_or: [TeamVersion_Members_filter]
}

type TeamVersion_Members_AboutUs_Team_Social_Links_aggregated {
group: JSON
countAll: Int
count: TeamVersion_Members_AboutUs_Team_Social_Links_aggregated_count
countDistinct: TeamVersion_Members_AboutUs_Team_Social_Links_aggregated_count
avg: TeamVersion_Members_AboutUs_Team_Social_Links_aggregated_fields
sum: TeamVersion_Members_AboutUs_Team_Social_Links_aggregated_fields
avgDistinct: TeamVersion_Members_AboutUs_Team_Social_Links_aggregated_fields
sumDistinct: TeamVersion_Members_AboutUs_Team_Social_Links_aggregated_fields
min: TeamVersion_Members_AboutUs_Team_Social_Links_aggregated_fields
max: TeamVersion_Members_AboutUs_Team_Social_Links_aggregated_fields
}

type TeamVersion_Members_AboutUs_Team_Social_Links_aggregated_count {
id: Int
TeamVersion_Members_id: Int
AboutUs_Team_Social_Links_id: Int
}

type TeamVersion_Members_AboutUs_Team_Social_Links_aggregated_fields {
id: Float
TeamVersion_Members_id: Float
AboutUs_Team_Social_Links_id: Float
}

""""""
type version_TeamVersion_Members_AboutUs_Team_Social_Links {
id: ID!
TeamVersion_Members_id: JSON
AboutUs_Team_Social_Links_id: JSON
}

type TeamVersion_Members_aggregated {
group: JSON
countAll: Int
count: TeamVersion_Members_aggregated_count
countDistinct: TeamVersion_Members_aggregated_count
avg: TeamVersion_Members_aggregated_fields
sum: TeamVersion_Members_aggregated_fields
avgDistinct: TeamVersion_Members_aggregated_fields
sumDistinct: TeamVersion_Members_aggregated_fields
min: TeamVersion_Members_aggregated_fields
max: TeamVersion_Members_aggregated_fields
}

type TeamVersion_Members_aggregated_count {
id: Int
sort: Int
user_created: Int
date_created: Int
user_updated: Int
date_updated: Int
name: Int
subtitle: Int
photo: Int
appVersion: Int
socialLinks: Int
}

type TeamVersion_Members_aggregated_fields {
id: Float
sort: Float
appVersion: Float
}

""""""
type version_TeamVersion_Members {
id: ID!
sort: Int
user_created: String
date_created: Date
date_created_func: datetime_functions
user_updated: String
date_updated: Date
date_updated_func: datetime_functions
name: String!
subtitle: String
photo: JSON
appVersion: JSON
socialLinks: JSON
socialLinks_func: count_functions
}

type Subscription {
directus_files_mutated(event: EventEnum): directus_files_mutated
Scientific_Circles_Tags_mutated(event: EventEnum): Scientific_Circles_Tags_mutated
Expand All @@ -1639,6 +1851,9 @@ type Subscription {
Changelog_Change_mutated(event: EventEnum): Changelog_Change_mutated
Changelog_Screenshots_mutated(event: EventEnum): Changelog_Screenshots_mutated
Scientific_Circles_mutated(event: EventEnum): Scientific_Circles_mutated
TeamVersions_mutated(event: EventEnum): TeamVersions_mutated
TeamVersion_Members_AboutUs_Team_Social_Links_mutated(event: EventEnum): TeamVersion_Members_AboutUs_Team_Social_Links_mutated
TeamVersion_Members_mutated(event: EventEnum): TeamVersion_Members_mutated
}

type directus_files_mutated {
Expand Down Expand Up @@ -1789,4 +2004,22 @@ type Scientific_Circles_mutated {
key: ID!
event: EventEnum
data: Scientific_Circles
}

type TeamVersions_mutated {
key: ID!
event: EventEnum
data: TeamVersions
}

type TeamVersion_Members_AboutUs_Team_Social_Links_mutated {
key: ID!
event: EventEnum
data: TeamVersion_Members_AboutUs_Team_Social_Links
}

type TeamVersion_Members_mutated {
key: ID!
event: EventEnum
data: TeamVersion_Members
}
2 changes: 1 addition & 1 deletion lib/features/about_us_view/about_us_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class _AboutUsView extends ConsumerWidget {
),
SectionHeader(text: context.localize.meet_our_team),
TeamSection(
members: value.getMemberData(),
multiversionTeam: value.getMemberData(),
),
const AppVersionTile(),
],
Expand Down
39 changes: 28 additions & 11 deletions lib/features/about_us_view/models/about_us_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,37 @@ import "../../../utils/where_non_null_iterable.dart";
import "../repository/about_us_repository.dart";
import "member_data.dart";

typedef MultiversionTeam = ({
String versionName,
IList<MemberData> members,
});

class AboutUsDetails {
final AboutUs? aboutUs;
final IList<AboutUsTeam> aboutUsTeam;

AboutUsDetails({required this.aboutUs, required this.aboutUsTeam});
final IList<TeamVersion> versions;
final IList<TeamMember> teamMembers;
AboutUsDetails({
required this.aboutUs,
required this.versions,
required this.teamMembers,
});

IList<MemberData> getMemberData() {
return aboutUsTeam.map((e) {
return MemberData(
name: e.name,
directusImageUrl: e.photo?.filename_disk,
socialLinks: e.socialLinks.whereNonNull.map((e) => e.url).toIList(),
subtitle: e.subtitle,
);
IList<MultiversionTeam> getMemberData() {
return versions.map((version) {
final members = teamMembers
.where((member) => member.appVersion?.id == version.id)
.map((e) {
return MemberData(
name: e.name,
directusImageUrl: e.photo?.filename_disk,
socialLinks: e.socialLinks.whereNonNull
.map((e) => e.AboutUs_Team_Social_Links_id?.url)
.whereNonNull
.toIList(),
subtitle: e.subtitle,
);
}).toIList();
return (versionName: version.name ?? "v.0.0.0", members: members);
}).toIList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import "getAboutUsDetails.graphql.dart";
part "about_us_repository.g.dart";

typedef AboutUs = Query$getAbousUsDetails$AboutUs;
typedef AboutUsTeam = Query$getAbousUsDetails$AboutUs_Team;
typedef TeamVersion = Query$getAbousUsDetails$TeamVersions;
typedef TeamMember = Query$getAbousUsDetails$TeamVersion_Members;

@riverpod
Future<AboutUsDetails?> aboutUsRepository(Ref ref) async {
Expand All @@ -21,6 +22,7 @@ Future<AboutUsDetails?> aboutUsRepository(Ref ref) async {
if (results == null) return null;
return AboutUsDetails(
aboutUs: results.AboutUs,
aboutUsTeam: results.AboutUs_Team.lock,
versions: results.TeamVersions.lock,
teamMembers: results.TeamVersion_Members.lock,
);
}
21 changes: 16 additions & 5 deletions lib/features/about_us_view/repository/getAboutUsDetails.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,25 @@ query getAbousUsDetails {
url
}
}
AboutUs_Team{
TeamVersions {
name
socialLinks{
url
id
}
TeamVersion_Members {
appVersion {
name
id
}
photo{
name
subtitle
photo {
filename_disk
}
subtitle
socialLinks {
AboutUs_Team_Social_Links_id {
url
}
}
}

}
Loading

0 comments on commit 0cdcbe6

Please sign in to comment.