Skip to content

Commit

Permalink
Inputs: UserGroup input: Fixed shown values when setting programmatic…
Browse files Browse the repository at this point in the history
…ally
  • Loading branch information
LaykDimon committed Dec 26, 2024
1 parent 8d852cb commit 554aa7d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
10 changes: 10 additions & 0 deletions js-api/src/api/grok_api.g.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,9 @@ export interface IDartApi {
grok_User_Get_Picture(u: any): any;
grok_User_ToMarkup(u: any): any;
grok_User_Get_Group(u: any): any;
grok_User_Test(): any;
grok_User_Admin(): any;
grok_User_System(): any;
grok_UserSession_Get_ExternalToken(s: any): any;
grok_UserSession_Get_Type(s: any): any;
grok_UserSession_Get_User(s: any): any;
Expand All @@ -844,6 +847,13 @@ export interface IDartApi {
grok_Group_Set_Personal(g: any, x: any): any;
grok_Group_Get_Hidden(g: any): any;
grok_Group_Set_Hidden(g: any, x: any): any;
grok_Group_AllUsers(): any;
grok_Group_Developers(): any;

This comment has been minimized.

Copy link
@skalkin

skalkin Dec 26, 2024

Collaborator

If it's a getter, the name should be prefixed with "Get".

grok_Group_NeedToCreate(): any;
grok_Group_Test(): any;
grok_Group_Admin(): any;
grok_Group_System(): any;
grok_Group_Administrators(): any;
grok_Property(name: String, type: String, getter: any, setter: any, defaultValue: any): any;
grok_Property_Get_Get(p: any): any;
grok_Property_Set_Get(p: any, x: any): any;
Expand Down
20 changes: 20 additions & 0 deletions js-api/src/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ export class User extends Entity {
"System": "3e32c5fa-ac9c-4d39-8b4b-4db3e576b3c3",
} as const;
}

static get test(): User { return new User(api.grok_User_Test()); }

static get admin(): User { return new User(api.grok_User_Admin()); }

static get system(): User { return new User(api.grok_User_System()); }
}


Expand Down Expand Up @@ -988,6 +994,20 @@ export class Group extends Entity {
"Administrators": "1ab8b38d-9c4e-4b1e-81c3-ae2bde3e12c5",
} as const;
}

static get allUsers(): Group { return new Group(api.grok_Group_AllUsers()); }

static get developers(): Group { return new Group(api.grok_Group_Developers()); }

static get needToCreate(): Group { return new Group(api.grok_Group_NeedToCreate()); }

static get test(): Group { return new Group(api.grok_Group_Test()); }

static get admin(): Group { return new Group(api.grok_Group_Admin()); }

static get system(): Group { return new Group(api.grok_Group_System()); }

static get administrators(): Group { return new Group(api.grok_Group_Administrators()); }
}

/** @extends Func
Expand Down
2 changes: 1 addition & 1 deletion packages/ApiSamples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dependencies": {
"@datagrok-libraries/utils": "^4.4.0",
"cash-dom": "^8.1.1",
"datagrok-api": "^1.23.0",
"datagrok-api": "../../js-api",
"dayjs": "^1.11.13",
"rxjs": "^6.6.7",
"wu": "^2.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ let object = {
choice: 'Apple',
multiChoice: ['Apple'],
//file: '',
users: [DG.User.current()],
userGroups: [DG.User.current()],
user: [DG.User.admin],
userGroups: [DG.Group.developers],
};

const div = ui.divV([
Expand Down

0 comments on commit 554aa7d

Please sign in to comment.