Skip to content

Commit 2519344

Browse files
committed
feat: can now hide application menu by default
1 parent 20ff5d8 commit 2519344

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

src/models/application.model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface Application extends Document {
2525
modifiedAt: Date;
2626
description?: string;
2727
sideMenu?: boolean;
28+
hideMenu?: boolean;
2829
status?: any;
2930
createdBy?: mongoose.Types.ObjectId;
3031
pages?: (mongoose.Types.ObjectId | Page)[];
@@ -73,6 +74,7 @@ const applicationSchema = new Schema<Application>(
7374
settings: mongoose.Schema.Types.Mixed,
7475
description: String,
7576
sideMenu: Boolean,
77+
hideMenu: Boolean,
7678
permissions: {
7779
canSee: [
7880
{

src/schema/mutation/duplicateApplication.mutation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export default {
8787
name: args.name,
8888
description: baseApplication.description,
8989
sideMenu: baseApplication.sideMenu,
90+
hideMenu: baseApplication.hideMenu,
9091
status: status.pending,
9192
createdBy: user._id,
9293
permissions: {

src/schema/mutation/editApplication.mutation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type EditApplicationArgs = {
2424
id: string | Types.ObjectId;
2525
description?: string;
2626
sideMenu?: boolean;
27+
hideMenu?: boolean;
2728
name?: string;
2829
status?: StatusType;
2930
pages?: string[] | Types.ObjectId[];
@@ -43,6 +44,7 @@ export default {
4344
id: { type: new GraphQLNonNull(GraphQLID) },
4445
description: { type: GraphQLString },
4546
sideMenu: { type: GraphQLBoolean },
47+
hideMenu: { type: GraphQLBoolean },
4648
name: { type: GraphQLString },
4749
status: { type: StatusEnumType },
4850
pages: { type: new GraphQLList(GraphQLID) },
@@ -96,7 +98,8 @@ export default {
9698
args.contextualFilterPosition && {
9799
contextualFilterPosition: args.contextualFilterPosition,
98100
},
99-
!isNil(args.sideMenu) && { sideMenu: args.sideMenu }
101+
!isNil(args.sideMenu) && { sideMenu: args.sideMenu },
102+
!isNil(args.hideMenu) && { hideMenu: args.hideMenu }
100103
);
101104
application = await Application.findOneAndUpdate(filters, update, {
102105
new: true,

src/schema/types/application.type.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ export const ApplicationType = new GraphQLObjectType({
6565
}
6666
},
6767
},
68+
hideMenu: {
69+
type: GraphQLBoolean,
70+
resolve(parent) {
71+
// Default to true
72+
if (isNil(parent.hideMenu)) {
73+
return false;
74+
} else {
75+
return parent.hideMenu;
76+
}
77+
},
78+
},
6879
status: { type: StatusEnumType },
6980
locked: {
7081
type: GraphQLBoolean,

0 commit comments

Comments
 (0)