Skip to content

Commit 43559db

Browse files
feat: add clone record action in dashboards (#1208)
AB#118658
1 parent d8dceb8 commit 43559db

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/models/actionButton.model.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export interface Button {
2929
template?: string;
3030
autoReload?: boolean;
3131
};
32+
// Clone Record
33+
cloneRecord?: {
34+
template?: string;
35+
autoReload?: boolean;
36+
};
3237
// Add Record
3338
addRecord?: {
3439
resource?: string;
@@ -86,6 +91,17 @@ export const buttonSchema = new Schema<Button>(
8691
href: String,
8792
openInNewTab: Boolean,
8893
previousPage: Boolean,
94+
// Clone Record
95+
cloneRecord: {
96+
type: new Schema(
97+
{
98+
template: String,
99+
autoReload: Boolean,
100+
},
101+
{ _id: false }
102+
),
103+
default: null,
104+
},
89105
// Edit Record
90106
editRecord: {
91107
type: new Schema(

src/schema/inputs/button-action.input.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ const ActionButtonInputType = new GraphQLInputObjectType({
5555
},
5656
}),
5757
},
58+
// Clone Record
59+
cloneRecord: {
60+
type: new GraphQLInputObjectType({
61+
name: 'CloneRecordInputType',
62+
fields: {
63+
template: { type: GraphQLString },
64+
autoReload: { type: GraphQLBoolean },
65+
},
66+
}),
67+
},
5868
// Add Record
5969
addRecord: {
6070
type: new GraphQLInputObjectType({

0 commit comments

Comments
 (0)