Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(site): allow selecting an organization when creating a template#14061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
aslilac merged 65 commits intomainfromkayla/multi-org-create-template
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
65 commits
Select commitHold shift + click to select a range
d640312
feat: initial changes for multi org template creation
jaaydenhJul 12, 2024
1c973ae
feat: styling and add template creation options
jaaydenhJul 18, 2024
6b5e7ec
chore: remove unused imports
jaaydenhJul 18, 2024
fbd6ca3
fix: use theme on cardTitle
jaaydenhJul 18, 2024
013522b
fix: remove unused import
jaaydenhJul 18, 2024
f547bfc
fix: pass key directly to JSX without using spread
jaaydenhJul 19, 2024
6b6c635
fix: use correct path
jaaydenhJul 19, 2024
b4e3c67
fix: fix test
jaaydenhJul 19, 2024
2636753
chore: handle merge changes
jaaydenhJul 19, 2024
c113979
fix: remove CreateTemplateButton
jaaydenhJul 19, 2024
cb53396
fix: update template examples for multi-org
jaaydenhJul 23, 2024
789699a
feat: pass along organizationId when creating templates
jaaydenhJul 23, 2024
8b03b11
fix: improve organization autocomplete
jaaydenhJul 24, 2024
b3aa04f
Feat: move org dropdown and add orgId search param
jaaydenhJul 24, 2024
03768c4
chore: show org autocomplete if experiment is enabled
jaaydenhJul 24, 2024
7baba1e
fix: remove unnecessary query param
jaaydenhJul 24, 2024
f513633
fix: cleanup
jaaydenhJul 24, 2024
b350b95
fix: fix tests
jaaydenhJul 24, 2024
2810cd3
fix: fix create template form stories
jaaydenhJul 24, 2024
6499543
fix
jaaydenhJul 24, 2024
c52c3dc
fix: merge issues
jaaydenhJul 25, 2024
6205129
chore: use default org for example templates
jaaydenhJul 26, 2024
b721a43
feat: add organizationId to the templates route
jaaydenhJul 26, 2024
41a414e
fix: add missing useMemo dependency
jaaydenhJul 26, 2024
e23475b
fix: add organizationId dependency
jaaydenhJul 26, 2024
53d4a3e
feat: update tests for organization in templates route
jaaydenhJul 26, 2024
7d92893
feat: gate org dropdown to multiple_organizations feature
jaaydenhJul 26, 2024
73ae86b
chore: set default for organization route param
jaaydenhJul 26, 2024
9bb1139
feat: update template routes for organizations
jaaydenhJul 26, 2024
1375b30
feat: add templates route
jaaydenhJul 26, 2024
aa452fe
feat: use templates_route
jaaydenhJul 26, 2024
0830dcc
Merge branch 'main' into multi-org-create-template
aslilacJul 26, 2024
b637620
the whirly durly
aslilacJul 26, 2024
fc9c6b4
oh boy
aslilacJul 29, 2024
85a6834
fix `pageTitle`
aslilacJul 29, 2024
2cf6662
:^)
aslilacJul 29, 2024
833c51c
Merge branch 'main' into kayla/multi-org-create-template
aslilacJul 30, 2024
bb996df
builds again
aslilacJul 30, 2024
b939177
Merge branch 'main' into kayla/multi-org-create-template
aslilacJul 30, 2024
f209a69
Merge branch 'main' into kayla/multi-org-create-template
aslilacJul 30, 2024
0316028
fix some pages
aslilacJul 30, 2024
36b6937
🧹
aslilacJul 30, 2024
1a88c60
:|
aslilacJul 30, 2024
2cf9e25
patch tests
aslilacJul 30, 2024
b358578
you dun
aslilacJul 30, 2024
9e9ae3f
these tests pass I swear
aslilacJul 30, 2024
833bb75
required
aslilacJul 30, 2024
c469959
🧹
aslilacJul 30, 2024
60b6a13
🧹
aslilacJul 31, 2024
ccbb35d
Merge branch 'main' into kayla/multi-org-create-template
aslilacJul 31, 2024
7c34bd9
fix some more links
aslilacJul 31, 2024
a60a9f6
don't use dashboard hooks in the form
aslilacJul 31, 2024
b61860e
dude bro man come on
aslilacJul 31, 2024
088d27c
yaaaay navigation code yay
aslilacAug 1, 2024
f9048a3
what
aslilacAug 1, 2024
3f4a430
🧹
aslilacAug 1, 2024
c034bdc
fix some tests
aslilacAug 1, 2024
d1db06a
nonsense
aslilacAug 1, 2024
e9031f8
fix a bunch of nav stuff
aslilacAug 1, 2024
f45fc20
fix even more tests forever
aslilacAug 1, 2024
fdff07f
and here
aslilacAug 1, 2024
f3e77a5
fmt
aslilacAug 1, 2024
af6413c
aaaand storybook
aslilacAug 1, 2024
958bea4
dense
aslilacAug 1, 2024
861a5c4
PLS I'M SO TIRED
aslilacAug 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletionsite/e2e/expectUrl.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -23,7 +23,12 @@ export const expectUrl = expect.extend({
pass,
actual,
expected,
message: () => "The page does not have the expected URL pathname.",
message: () =>
"The page does not have the expected URL pathname.\n" +
`Expected: ${this.isNot ? "not" : ""}${this.utils.printExpected(
expected,
)}\n` +
`Actual: ${this.utils.printReceived(actual)}`,
};
},
});
126 changes: 90 additions & 36 deletionssite/src/api/api.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -516,73 +516,97 @@ class ApiMethods {
return response.data;
};

/**
* @param organization Can be the organization's ID or name
*/
updateOrganization = async (
organizationId: string,
organization: string,
params: TypesGen.UpdateOrganizationRequest,
) => {
const response = await this.axios.patch<TypesGen.Organization>(
`/api/v2/organizations/${organizationId}`,
`/api/v2/organizations/${organization}`,
params,
);
return response.data;
};

deleteOrganization = async (organizationId: string) => {
/**
* @param organization Can be the organization's ID or name
*/
deleteOrganization = async (organization: string) => {
await this.axios.delete<TypesGen.Organization>(
`/api/v2/organizations/${organizationId}`,
`/api/v2/organizations/${organization}`,
);
};

/**
* @param organization Can be the organization's ID or name
*/
getOrganization = async (
organizationId: string,
organization: string,
): Promise<TypesGen.Organization> => {
const response = await this.axios.get<TypesGen.Organization>(
`/api/v2/organizations/${organizationId}`,
`/api/v2/organizations/${organization}`,
);

return response.data;
};

getOrganizationMembers = async (organizationId: string) => {
/**
* @param organization Can be the organization's ID or name
*/
getOrganizationMembers = async (organization: string) => {
const response = await this.axios.get<
TypesGen.OrganizationMemberWithUserData[]
>(`/api/v2/organizations/${organizationId}/members`);
>(`/api/v2/organizations/${organization}/members`);

return response.data;
};

getOrganizationRoles = async (organizationId: string) => {
/**
* @param organization Can be the organization's ID or name
*/
getOrganizationRoles = async (organization: string) => {
const response = await this.axios.get<TypesGen.AssignableRoles[]>(
`/api/v2/organizations/${organizationId}/members/roles`,
`/api/v2/organizations/${organization}/members/roles`,
);

return response.data;
};

/**
* @param organization Can be the organization's ID or name
*/
updateOrganizationMemberRoles = async (
organizationId: string,
organization: string,
userId: string,
roles: TypesGen.SlimRole["name"][],
): Promise<TypesGen.User> => {
const response = await this.axios.put<TypesGen.User>(
`/api/v2/organizations/${organizationId}/members/${userId}/roles`,
`/api/v2/organizations/${organization}/members/${userId}/roles`,
{ roles },
);

return response.data;
};

addOrganizationMember = async (organizationId: string, userId: string) => {
/**
* @param organization Can be the organization's ID or name
*/
addOrganizationMember = async (organization: string, userId: string) => {
const response = await this.axios.post<TypesGen.OrganizationMember>(
`/api/v2/organizations/${organizationId}/members/${userId}`,
`/api/v2/organizations/${organization}/members/${userId}`,
);

return response.data;
};

removeOrganizationMember = async (organizationId: string, userId: string) => {
/**
* @param organization Can be the organization's ID or name
*/
removeOrganizationMember = async (organization: string, userId: string) => {
await this.axios.delete(
`/api/v2/organizations/${organizationId}/members/${userId}`,
`/api/v2/organizations/${organization}/members/${userId}`,
);
};

Expand All@@ -601,8 +625,11 @@ class ApiMethods {
return response.data;
};

/**
* @param organization Can be the organization's ID or name
*/
getTemplates = async (
organizationId: string,
organization: string,
options?: TemplateOptions,
): Promise<TypesGen.Template[]> => {
const params: Record<string, string> = {};
Expand All@@ -614,19 +641,22 @@ class ApiMethods {
}

const response = await this.axios.get<TypesGen.Template[]>(
`/api/v2/organizations/${organizationId}/templates`,
`/api/v2/organizations/${organization}/templates`,
{ params },
);

return response.data;
};

/**
* @param organization Can be the organization's ID or name
*/
getTemplateByName = async (
organizationId: string,
organization: string,
name: string,
): Promise<TypesGen.Template> => {
const response = await this.axios.get<TypesGen.Template>(
`/api/v2/organizations/${organizationId}/templates/${name}`,
`/api/v2/organizations/${organization}/templates/${name}`,
);

return response.data;
Expand DownExpand Up@@ -675,26 +705,32 @@ class ApiMethods {
return response.data;
};

/**
* @param organization Can be the organization's ID or name
*/
getTemplateVersionByName = async (
organizationId: string,
organization: string,
templateName: string,
versionName: string,
): Promise<TypesGen.TemplateVersion> => {
const response = await this.axios.get<TypesGen.TemplateVersion>(
`/api/v2/organizations/${organizationId}/templates/${templateName}/versions/${versionName}`,
`/api/v2/organizations/${organization}/templates/${templateName}/versions/${versionName}`,
);

return response.data;
};

/**
* @param organization Can be the organization's ID or name
*/
getPreviousTemplateVersionByName = async (
organizationId: string,
organization: string,
templateName: string,
versionName: string,
) => {
try {
const response = await this.axios.get<TypesGen.TemplateVersion>(
`/api/v2/organizations/${organizationId}/templates/${templateName}/versions/${versionName}/previous`,
`/api/v2/organizations/${organization}/templates/${templateName}/versions/${versionName}/previous`,
);

return response.data;
Expand All@@ -713,12 +749,15 @@ class ApiMethods {
}
};

/**
* @param organization Can be the organization's ID or name
*/
createTemplateVersion = async (
organizationId: string,
organization: string,
data: TypesGen.CreateTemplateVersionRequest,
): Promise<TypesGen.TemplateVersion> => {
const response = await this.axios.post<TypesGen.TemplateVersion>(
`/api/v2/organizations/${organizationId}/templateversions`,
`/api/v2/organizations/${organization}/templateversions`,
data,
);

Expand All@@ -744,12 +783,15 @@ class ApiMethods {
return response.data;
};

/**
* @param organization Can be the organization's ID or name
*/
createTemplate = async (
organizationId: string,
organization: string,
data: TypesGen.CreateTemplateRequest,
): Promise<TypesGen.Template> => {
const response = await this.axios.post(
`/api/v2/organizations/${organizationId}/templates`,
`/api/v2/organizations/${organization}/templates`,
data,
);

Expand DownExpand Up@@ -1480,31 +1522,40 @@ class ApiMethods {
return response.data;
};

getGroups = async (organizationId: string): Promise<TypesGen.Group[]> => {
/**
* @param organization Can be the organization's ID or name
*/
getGroups = async (organization: string): Promise<TypesGen.Group[]> => {
const response = await this.axios.get(
`/api/v2/organizations/${organizationId}/groups`,
`/api/v2/organizations/${organization}/groups`,
);

return response.data;
};

/**
* @param organization Can be the organization's ID or name
*/
createGroup = async (
organizationId: string,
organization: string,
data: TypesGen.CreateGroupRequest,
): Promise<TypesGen.Group> => {
const response = await this.axios.post(
`/api/v2/organizations/${organizationId}/groups`,
`/api/v2/organizations/${organization}/groups`,
data,
);
return response.data;
};

/**
* @param organization Can be the organization's ID or name
*/
getGroup = async (
organizationId: string,
organization: string,
groupName: string,
): Promise<TypesGen.Group> => {
const response = await this.axios.get(
`/api/v2/organizations/${organizationId}/groups/${groupName}`,
`/api/v2/organizations/${organization}/groups/${groupName}`,
);
return response.data;
};
Expand DownExpand Up@@ -1673,11 +1724,14 @@ class ApiMethods {
return response.data;
};

/**
* @param organization Can be the organization's ID or name
*/
getTemplateExamples = async (
organizationId: string,
organization: string,
): Promise<TypesGen.TemplateExample[]> => {
const response = await this.axios.get(
`/api/v2/organizations/${organizationId}/templates/examples`,
`/api/v2/organizations/${organization}/templates/examples`,
);

return response.data;
Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp