chore: Remove deprecated organization from code (#38878)
## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /test all ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/13012342671> > Commit: be3620ce2de03b3ca5ba06c0ebe944b79b6d3891 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13012342671&attempt=2" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Tue, 28 Jan 2025 16:03:08 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit Based on the comprehensive review of the changes, here are the updated release notes: - **Terminology Update** - Replaced "organization" references with "workspace" across multiple components - Updated role names from ORGANIZATION_* to WORKSPACE_* - Removed deprecated organization-related constants and fields - **API and Interface Changes** - Updated method signatures to use `workspaceId` instead of `organizationId` - Modified template and application import/export methods - Adjusted Git-related interfaces and method documentation - **Backend Modifications** - Refactored permission and role management to align with workspace context - Updated analytics event tracking to use workspace identifiers - Simplified datasource and action validation logic - **Frontend Adjustments** - Updated variable names in React components and sagas for clarity - Modified API call parameters to align with workspace terminology These changes represent a comprehensive transition from an organization-based to a workspace-based model across the application's architecture. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
b62c875bf5
commit
54332e4f49
|
|
@ -94,12 +94,12 @@ class TemplatesAPI extends Api {
|
|||
static async importTemplateToApplication(
|
||||
templateId: string,
|
||||
applicationId: string,
|
||||
organizationId: string,
|
||||
workspaceId: string,
|
||||
body?: string[],
|
||||
): Promise<AxiosPromise<ImportTemplateResponse>> {
|
||||
return Api.post(
|
||||
TemplatesAPI.baseUrl +
|
||||
`/app-templates/${templateId}/merge/${applicationId}/${organizationId}`,
|
||||
`/app-templates/${templateId}/merge/${applicationId}/${workspaceId}`,
|
||||
body,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -244,10 +244,10 @@ function SuccessMessages() {
|
|||
function ReconnectDatasourceModal() {
|
||||
const dispatch = useDispatch();
|
||||
const isModalOpen = useSelector(getIsReconnectingDatasourcesModalOpen);
|
||||
const workspaceId = useSelector(getWorkspaceIdForImport);
|
||||
const importWorkspaceId = useSelector(getWorkspaceIdForImport);
|
||||
const pageIdForImport = useSelector(getPageIdForImport);
|
||||
const environmentsFetched = useSelector((state: AppState) =>
|
||||
areEnvironmentsFetched(state, workspaceId),
|
||||
areEnvironmentsFetched(state, importWorkspaceId),
|
||||
);
|
||||
const unconfiguredDatasources = useSelector(getUnconfiguredDatasources);
|
||||
const unconfiguredDatasourceIds = unconfiguredDatasources.map(
|
||||
|
|
@ -297,7 +297,7 @@ function ReconnectDatasourceModal() {
|
|||
const [isTesting, setIsTesting] = useState(false);
|
||||
const queryDS = datasources.find((ds) => ds.id === queryDatasourceId);
|
||||
const dsName = queryDS?.name;
|
||||
const orgId = queryDS?.workspaceId;
|
||||
const datasourceWorkspaceId = queryDS?.workspaceId;
|
||||
|
||||
const checkIfDatasourceIsConfigured = (ds: Datasource | null) => {
|
||||
if (!ds || pluginsArray.length === 0) return false;
|
||||
|
|
@ -351,7 +351,7 @@ function ReconnectDatasourceModal() {
|
|||
environmentName: currentEnvDetails.name,
|
||||
pageId: queryPageId,
|
||||
oAuthPassOrFailVerdict: status,
|
||||
workspaceId: orgId,
|
||||
workspaceId: datasourceWorkspaceId,
|
||||
datasourceName: dsName,
|
||||
pluginName: plugins[datasource?.pluginId || ""]?.name,
|
||||
ideType,
|
||||
|
|
@ -404,14 +404,14 @@ function ReconnectDatasourceModal() {
|
|||
|
||||
// todo uncomment this to fetch datasource config
|
||||
useEffect(() => {
|
||||
if (isModalOpen && workspaceId && environmentsFetched) {
|
||||
if (isModalOpen && importWorkspaceId && environmentsFetched) {
|
||||
dispatch(
|
||||
initDatasourceConnectionDuringImportRequest({
|
||||
workspaceId: workspaceId as string,
|
||||
workspaceId: importWorkspaceId as string,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}, [workspaceId, isModalOpen, environmentsFetched]);
|
||||
}, [importWorkspaceId, isModalOpen, environmentsFetched]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isModalOpen) {
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ export function* loadBuildingBlocksIntoApplication(
|
|||
try {
|
||||
const dragDetails: DragDetails = yield select(getDragDetails);
|
||||
const applicationId: string = yield select(getCurrentApplicationId);
|
||||
const workspaceId: string = yield select(getCurrentWorkspaceId);
|
||||
const loadWorkspaceId: string = yield select(getCurrentWorkspaceId);
|
||||
const existingCopiedWidgets: unknown = yield call(getCopiedWidgets);
|
||||
const buildingBlockDragStartTimestamp: number = yield select(
|
||||
getBuildingBlockDragStartTimestamp,
|
||||
|
|
@ -272,7 +272,7 @@ export function* loadBuildingBlocksIntoApplication(
|
|||
|
||||
AnalyticsUtil.logEvent("DROP_BUILDING_BLOCK_COMPLETED", {
|
||||
applicationId,
|
||||
workspaceId,
|
||||
workspaceId: loadWorkspaceId,
|
||||
source: "explorer",
|
||||
eventData: {
|
||||
buildingBlockName: dragDetails.newWidget.displayName,
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ public class FileUtilsCEImpl implements FileInterface {
|
|||
ApplicationGitReference applicationGitReference = (ApplicationGitReference) artifactGitReference;
|
||||
|
||||
// Repo path will be:
|
||||
// baseRepo : root/orgId/defaultAppId/repoName/{applicationData}
|
||||
// baseRepo : root/workspaceId/defaultAppId/repoName/{applicationData}
|
||||
// Checkout to mentioned branch if not already checked-out
|
||||
Stopwatch processStopwatch = new Stopwatch("FS application save");
|
||||
return gitExecutor
|
||||
|
|
@ -245,7 +245,7 @@ public class FileUtilsCEImpl implements FileInterface {
|
|||
throws GitAPIException, IOException {
|
||||
|
||||
// Repo path will be:
|
||||
// baseRepo : root/orgId/defaultAppId/repoName/{applicationData}
|
||||
// baseRepo : root/workspaceId/defaultAppId/repoName/{applicationData}
|
||||
// Checkout to mentioned branch if not already checked-out
|
||||
return gitExecutor
|
||||
.resetToLastCommit(baseRepoSuffix, branchName)
|
||||
|
|
|
|||
|
|
@ -279,9 +279,9 @@ public class FSGitHandlerCEImpl implements FSGitHandler {
|
|||
});
|
||||
}
|
||||
|
||||
/** Clone the repo to the file path : container-volume/orgId/defaultAppId/repo/<Data>
|
||||
/** Clone the repo to the file path : container-volume/workspaceId/defaultAppId/repo/<Data>
|
||||
*
|
||||
* @param repoSuffix combination of orgId, defaultId and repoName
|
||||
* @param repoSuffix combination of workspaceId, defaultId and repoName
|
||||
* @param remoteUrl ssh url of the git repo(we support cloning via ssh url only with deploy key)
|
||||
* @param privateKey generated by us and specific to the defaultApplication
|
||||
* @param publicKey generated by us and specific to the defaultApplication
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import java.nio.file.Path;
|
|||
|
||||
public class StopwatchHelpers {
|
||||
public static Stopwatch startStopwatch(Path path, String flowName) {
|
||||
// path => ..../{orgId}/{appId}/{repoName}
|
||||
// path => ..../{workspaceId}/{appId}/{repoName}
|
||||
String modifiedFlowName = String.format(
|
||||
"JGIT %s, appId %s", flowName, path.getParent().getFileName().toString());
|
||||
return new Stopwatch(modifiedFlowName);
|
||||
|
|
|
|||
|
|
@ -271,9 +271,9 @@ public class GitExecutorCEImpl implements GitExecutor {
|
|||
});
|
||||
}
|
||||
|
||||
/** Clone the repo to the file path : container-volume/orgId/defaultAppId/repo/<Data>
|
||||
/** Clone the repo to the file path : container-volume/workspaceId/defaultAppId/repo/<Data>
|
||||
*
|
||||
* @param repoSuffix combination of orgId, defaultId and repoName
|
||||
* @param repoSuffix combination of workspaceId, defaultId and repoName
|
||||
* @param remoteUrl ssh url of the git repo(we support cloning via ssh url only with deploy key)
|
||||
* @param privateKey generated by us and specific to the defaultApplication
|
||||
* @param publicKey generated by us and specific to the defaultApplication
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public interface GitExecutor {
|
|||
|
||||
/**
|
||||
* Method to get the commit history
|
||||
* @param suffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param suffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @return list of git commits
|
||||
*/
|
||||
Mono<List<GitLogDTO>> getCommitHistory(Path suffix);
|
||||
|
|
@ -60,9 +60,9 @@ public interface GitExecutor {
|
|||
Mono<String> pushApplication(
|
||||
Path branchSuffix, String remoteUrl, String publicKey, String privateKey, String branchName);
|
||||
|
||||
/** Clone the repo to the file path : container-volume/orgId/defaultAppId/repo/applicationData
|
||||
/** Clone the repo to the file path : container-volume/workspaceId/defaultAppId/repo/applicationData
|
||||
*
|
||||
* @param repoSuffix combination of orgId, defaultId and repoName
|
||||
* @param repoSuffix combination of workspaceId, defaultId and repoName
|
||||
* @param remoteUrl ssh url of the git repo(we support cloning via ssh url only with deploy key)
|
||||
* @param privateKey generated by us and specific to the defaultApplication
|
||||
* @param publicKey generated by us and specific to the defaultApplication
|
||||
|
|
@ -73,7 +73,7 @@ public interface GitExecutor {
|
|||
/**
|
||||
* Create a new branch in the local repo and checkout to that branch
|
||||
*
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param branchName branch which needs to be created
|
||||
* @return created branch name
|
||||
*/
|
||||
|
|
@ -82,7 +82,7 @@ public interface GitExecutor {
|
|||
/**
|
||||
* Delete a branch in the local repo
|
||||
*
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param branchName branch which needs to be deleted
|
||||
* @return deleted branch name
|
||||
*/
|
||||
|
|
@ -91,7 +91,7 @@ public interface GitExecutor {
|
|||
/**
|
||||
* Git checkout to specific branch
|
||||
*
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param branchName name of the branch which needs to be checked out
|
||||
* @return if the operation is successful
|
||||
*/
|
||||
|
|
@ -99,7 +99,7 @@ public interface GitExecutor {
|
|||
|
||||
/**
|
||||
* Pull changes from remote branch and merge the changes
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param remoteUrl ssh url of the git repo(we support cloning via ssh url only with deploy key)
|
||||
* @param branchName remoteBranchName from which commits will be fetched and merged to the current branch
|
||||
* @param privateKey generated by us and specific to the defaultApplication
|
||||
|
|
@ -111,7 +111,7 @@ public interface GitExecutor {
|
|||
throws IOException;
|
||||
|
||||
/**
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @return List of branches for the application
|
||||
*/
|
||||
// Mono<List<GitBranchDTO>> listBranches(
|
||||
|
|
@ -131,7 +131,7 @@ public interface GitExecutor {
|
|||
Mono<GitStatusDTO> getStatus(Path repoPath, String branchName);
|
||||
|
||||
/**
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param sourceBranch name of the branch whose commits will be referred amd merged to destinationBranch
|
||||
* @param destinationBranch Merge operation is performed on this branch
|
||||
* @return Merge status
|
||||
|
|
@ -139,7 +139,7 @@ public interface GitExecutor {
|
|||
Mono<String> mergeBranch(Path repoSuffix, String sourceBranch, String destinationBranch);
|
||||
|
||||
/**
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param publicKey public ssh key
|
||||
* @param privateKey private ssh key
|
||||
* @param isRepoPath does the repoSuffix contains the complete repoPath or only the suffix
|
||||
|
|
@ -158,7 +158,7 @@ public interface GitExecutor {
|
|||
|
||||
/**
|
||||
*
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param sourceBranch name of the branch whose commits will be referred amd merged to destinationBranch
|
||||
* @param destinationBranch Merge operation is performed on this branch
|
||||
* @return Whether the two branches can be merged or not with list of files where the conflicts are present
|
||||
|
|
@ -168,7 +168,7 @@ public interface GitExecutor {
|
|||
/**
|
||||
* This method will reset the repo to last commit for the specific branch
|
||||
*
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param branchName branch for which the repo should hard reset
|
||||
* @return success status
|
||||
* @throws GitAPIException
|
||||
|
|
@ -178,7 +178,7 @@ public interface GitExecutor {
|
|||
|
||||
/**
|
||||
*
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param branchName Name of the remote branch
|
||||
* @return created branch name
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public interface FSGitHandler {
|
|||
|
||||
/**
|
||||
* Method to get the commit history
|
||||
* @param suffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param suffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @return list of git commits
|
||||
*/
|
||||
Mono<List<GitLogDTO>> getCommitHistory(Path suffix);
|
||||
|
|
@ -63,9 +63,9 @@ public interface FSGitHandler {
|
|||
Mono<String> pushApplication(
|
||||
Path branchSuffix, String remoteUrl, String publicKey, String privateKey, String branchName);
|
||||
|
||||
/** Clone the repo to the file path : container-volume/orgId/defaultAppId/repo/applicationData
|
||||
/** Clone the repo to the file path : container-volume/workspaceId/defaultAppId/repo/applicationData
|
||||
*
|
||||
* @param repoSuffix combination of orgId, defaultId and repoName
|
||||
* @param repoSuffix combination of workspaceId, defaultId and repoName
|
||||
* @param remoteUrl ssh url of the git repo(we support cloning via ssh url only with deploy key)
|
||||
* @param privateKey generated by us and specific to the defaultApplication
|
||||
* @param publicKey generated by us and specific to the defaultApplication
|
||||
|
|
@ -76,7 +76,7 @@ public interface FSGitHandler {
|
|||
/**
|
||||
* Create a new branch in the local repo and checkout to that branch
|
||||
*
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param branchName branch which needs to be created
|
||||
* @return created branch name
|
||||
*/
|
||||
|
|
@ -87,7 +87,7 @@ public interface FSGitHandler {
|
|||
/**
|
||||
* Delete a branch in the local repo
|
||||
*
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param branchName branch which needs to be deleted
|
||||
* @return deleted branch name
|
||||
*/
|
||||
|
|
@ -96,7 +96,7 @@ public interface FSGitHandler {
|
|||
/**
|
||||
* Git checkout to specific branch
|
||||
*
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param branchName name of the branch which needs to be checked out
|
||||
* @return if the operation is successful
|
||||
*/
|
||||
|
|
@ -104,7 +104,7 @@ public interface FSGitHandler {
|
|||
|
||||
/**
|
||||
* Pull changes from remote branch and merge the changes
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param remoteUrl ssh url of the git repo(we support cloning via ssh url only with deploy key)
|
||||
* @param branchName remoteBranchName from which commits will be fetched and merged to the current branch
|
||||
* @param privateKey generated by us and specific to the defaultApplication
|
||||
|
|
@ -116,7 +116,7 @@ public interface FSGitHandler {
|
|||
throws IOException;
|
||||
|
||||
/**
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @return List of branches for the application
|
||||
*/
|
||||
// Mono<List<GitBranchDTO>> listBranches(
|
||||
|
|
@ -138,7 +138,7 @@ public interface FSGitHandler {
|
|||
/**
|
||||
* This method merges source branch into destination branch for a git repository which is present on the partial
|
||||
* path provided. <B> This assumes that the branch on which the merge will happen is already checked out </B>
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param sourceBranch name of the branch whose commits will be referred amd merged to destinationBranch
|
||||
* @param destinationBranch Merge operation is performed on this branch
|
||||
* @return Merge status
|
||||
|
|
@ -146,7 +146,7 @@ public interface FSGitHandler {
|
|||
Mono<String> mergeBranch(Path repoSuffix, String sourceBranch, String destinationBranch);
|
||||
|
||||
/**
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param publicKey public ssh key
|
||||
* @param privateKey private ssh key
|
||||
* @param isRepoPath does the repoSuffix contains the complete repoPath or only the suffix
|
||||
|
|
@ -165,7 +165,7 @@ public interface FSGitHandler {
|
|||
|
||||
/**
|
||||
*
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param sourceBranch name of the branch whose commits will be referred amd merged to destinationBranch
|
||||
* @param destinationBranch Merge operation is performed on this branch
|
||||
* @return Whether the two branches can be merged or not with list of files where the conflicts are present
|
||||
|
|
@ -175,7 +175,7 @@ public interface FSGitHandler {
|
|||
/**
|
||||
* This method will reset the repo to last commit for the specific branch
|
||||
*
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param branchName branch for which the repo should hard reset
|
||||
* @return success status
|
||||
* @throws GitAPIException
|
||||
|
|
@ -185,7 +185,7 @@ public interface FSGitHandler {
|
|||
|
||||
/**
|
||||
*
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes orgId, defaultAppId, repoName
|
||||
* @param repoSuffix suffixedPath used to generate the base repo path this includes workspaceId, defaultAppId, repoName
|
||||
* @param branchName Name of the remote branch
|
||||
* @return created branch name
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -42,11 +42,6 @@ public class Datasource extends GitSyncedDomain {
|
|||
@JsonView(Views.Public.class)
|
||||
String pluginName;
|
||||
|
||||
// Organizations migrated to workspaces, kept the field as deprecated to support the old migration
|
||||
@Deprecated
|
||||
@JsonView(Views.Public.class)
|
||||
String organizationId;
|
||||
|
||||
@JsonView({Views.Public.class, FromRequest.class})
|
||||
String workspaceId;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
package com.appsmith.server.acl;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public interface AclConstants {
|
||||
Set<String> PERMISSIONS_CRUD_ORG = Set.of("create:organizations");
|
||||
|
||||
String GROUP_ORG_ADMIN = "org-admin";
|
||||
|
||||
String DEFAULT_ORG_ID = "default-org";
|
||||
|
||||
Set<String> PERMISSIONS_GROUP_ORG_ADMIN = Set.of(
|
||||
"create:organizations", "read:organizations", "create:groups", "read:groups", "create:users", "read:users");
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ import static com.appsmith.server.constants.FieldName.WORKSPACE_VIEWER_DESCRIPTI
|
|||
|
||||
@Getter
|
||||
public enum AppsmithRole {
|
||||
ORGANIZATION_ADMIN(
|
||||
WORKSPACE_ADMIN(
|
||||
ADMINISTRATOR,
|
||||
WORKSPACE_ADMINISTRATOR_DESCRIPTION,
|
||||
Set.of(
|
||||
|
|
@ -40,7 +40,7 @@ public enum AppsmithRole {
|
|||
WORKSPACE_DELETE_DATASOURCES,
|
||||
WORKSPACE_DELETE_APPLICATIONS,
|
||||
DELETE_WORKSPACES)),
|
||||
ORGANIZATION_DEVELOPER(
|
||||
WORKSPACE_DEVELOPER(
|
||||
DEVELOPER,
|
||||
WORKSPACE_DEVELOPER_DESCRIPTION,
|
||||
Set.of(
|
||||
|
|
@ -54,7 +54,7 @@ public enum AppsmithRole {
|
|||
WORKSPACE_CREATE_DATASOURCE,
|
||||
WORKSPACE_DELETE_DATASOURCES,
|
||||
WORKSPACE_DELETE_APPLICATIONS)),
|
||||
ORGANIZATION_VIEWER(
|
||||
WORKSPACE_VIEWER(
|
||||
VIEWER,
|
||||
WORKSPACE_VIEWER_DESCRIPTION,
|
||||
Set.of(
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ public class ApplicationServiceCEImpl extends BaseService<ApplicationRepository,
|
|||
if (error instanceof DuplicateKeyException) {
|
||||
// Error message : E11000 duplicate key error collection: appsmith.application index:
|
||||
// workspace_app_deleted_gitApplicationMetadata dup key:
|
||||
// { organizationId: "******", name: "AppName", deletedAt: null }
|
||||
// { workspaceId: "******", name: "AppName", deletedAt: null }
|
||||
if (error.getCause()
|
||||
.getMessage()
|
||||
.contains("workspace_app_deleted_gitApplicationMetadata")) {
|
||||
|
|
|
|||
|
|
@ -4,9 +4,6 @@ public class FieldNameCE {
|
|||
public static final String EMAIL = "email";
|
||||
public static final String PASSWORD = "password";
|
||||
|
||||
@Deprecated
|
||||
public static final String ORGANIZATION_ID = "organizationId";
|
||||
|
||||
public static final String WORKSPACE_ID = "workspaceId";
|
||||
public static final String DATASOURCE_ID = "datasourceId";
|
||||
public static final String DELETED = "deleted";
|
||||
|
|
|
|||
|
|
@ -73,14 +73,14 @@ public class ApplicationTemplateControllerCE {
|
|||
}
|
||||
|
||||
@JsonView(Views.Public.class)
|
||||
@PostMapping("{templateId}/merge/{branchedApplicationId}/{organizationId}")
|
||||
@PostMapping("{templateId}/merge/{branchedApplicationId}/{workspaceId}")
|
||||
public Mono<ResponseDTO<ApplicationImportDTO>> mergeTemplateWithApplication(
|
||||
@PathVariable String templateId,
|
||||
@PathVariable String branchedApplicationId,
|
||||
@PathVariable String organizationId,
|
||||
@PathVariable String workspaceId,
|
||||
@RequestBody(required = false) List<String> pagesToImport) {
|
||||
return applicationTemplateService
|
||||
.mergeTemplateWithApplication(templateId, branchedApplicationId, organizationId, pagesToImport)
|
||||
.mergeTemplateWithApplication(templateId, branchedApplicationId, workspaceId, pagesToImport)
|
||||
.map(importedApp -> new ResponseDTO<>(HttpStatus.OK.value(), importedApp, null));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2096,7 +2096,7 @@ public class CommonGitServiceCEImpl implements CommonGitServiceCE {
|
|||
analyticsProps.put(FieldName.IS_MERGEABLE, isMergeable);
|
||||
}
|
||||
analyticsProps.putAll(Map.of(
|
||||
FieldName.ORGANIZATION_ID,
|
||||
"organizationId",
|
||||
defaultIfNull(artifact.getWorkspaceId(), ""),
|
||||
"orgId",
|
||||
defaultIfNull(artifact.getWorkspaceId(), ""),
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public class GitAnalyticsUtils {
|
|||
analyticsProps.put(FieldName.IS_MERGEABLE, isMergeable);
|
||||
}
|
||||
analyticsProps.putAll(Map.of(
|
||||
FieldName.ORGANIZATION_ID,
|
||||
"organizationId",
|
||||
defaultIfNull(artifact.getWorkspaceId(), ""),
|
||||
"orgId",
|
||||
defaultIfNull(artifact.getWorkspaceId(), ""),
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ public class CommonGitFileUtilsCE {
|
|||
final Map<String, Object> data = Map.of(
|
||||
artifactConstant,
|
||||
repoPath.getParent().getFileName().toString(),
|
||||
FieldName.ORGANIZATION_ID,
|
||||
"organizationId",
|
||||
repoPath.getParent().getParent().getFileName().toString(),
|
||||
FieldName.FLOW_NAME,
|
||||
stopwatch.getFlow(),
|
||||
|
|
@ -676,7 +676,7 @@ public class CommonGitFileUtilsCE {
|
|||
final Map<String, Object> data = Map.of(
|
||||
constantsMap.get(FieldName.ID),
|
||||
baseArtifactId,
|
||||
FieldName.ORGANIZATION_ID,
|
||||
"organizationId",
|
||||
workspaceId,
|
||||
FieldName.FLOW_NAME,
|
||||
stopwatch.getFlow(),
|
||||
|
|
|
|||
|
|
@ -334,15 +334,6 @@ public class NewActionServiceCEImpl extends BaseService<NewActionRepository, New
|
|||
Mono<Datasource> datasourceMono = Mono.just(action.getDatasource());
|
||||
if (action.getPluginType() != PluginType.JS) {
|
||||
if (action.getDatasource().getId() == null) {
|
||||
|
||||
// This is a nested datasource. If the action is in bad state (aka without workspace id, add the
|
||||
// same)
|
||||
if (action.getDatasource().getWorkspaceId() == null
|
||||
&& action.getDatasource().getOrganizationId() != null) {
|
||||
action.getDatasource()
|
||||
.setWorkspaceId(action.getDatasource().getOrganizationId());
|
||||
}
|
||||
|
||||
datasourceMono = Mono.just(action.getDatasource()).flatMap(datasourceService::validateDatasource);
|
||||
} else {
|
||||
// TODO: check if datasource should be fetched with edit during action create or update.
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ public class ApplicationTemplateServiceCEImpl implements ApplicationTemplateServ
|
|||
*/
|
||||
@Override
|
||||
public Mono<ApplicationImportDTO> mergeTemplateWithApplication(
|
||||
String templateId, String branchedApplicationId, String organizationId, List<String> pagesToImport) {
|
||||
String templateId, String branchedApplicationId, String workspaceId, List<String> pagesToImport) {
|
||||
Mono<ApplicationImportDTO> importedApplicationMono = getApplicationJsonFromTemplate(templateId)
|
||||
.flatMap(applicationJson -> {
|
||||
String templateName = "";
|
||||
|
|
@ -235,7 +235,7 @@ public class ApplicationTemplateServiceCEImpl implements ApplicationTemplateServ
|
|||
|
||||
return importService
|
||||
.mergeArtifactExchangeJsonWithImportableArtifact(
|
||||
organizationId, branchedApplicationId, null, applicationJson, pagesToImport)
|
||||
workspaceId, branchedApplicationId, null, applicationJson, pagesToImport)
|
||||
.map(importableArtifact -> (Application) importableArtifact)
|
||||
.zipWith(Mono.just(templateName));
|
||||
})
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ public class WorkspaceServiceCEImpl extends BaseService<WorkspaceRepository, Wor
|
|||
.get();
|
||||
|
||||
// Administrator permissions
|
||||
Set<Permission> workspacePermissions = AppsmithRole.ORGANIZATION_ADMIN.getPermissions().stream()
|
||||
Set<Permission> workspacePermissions = AppsmithRole.WORKSPACE_ADMIN.getPermissions().stream()
|
||||
.filter(aclPermission -> aclPermission.getEntity().equals(Workspace.class))
|
||||
.map(aclPermission -> new Permission(workspace.getId(), aclPermission))
|
||||
.collect(Collectors.toSet());
|
||||
|
|
@ -313,7 +313,7 @@ public class WorkspaceServiceCEImpl extends BaseService<WorkspaceRepository, Wor
|
|||
adminPermissionGroup.setAssignedToUserIds(Set.of(user.getId()));
|
||||
|
||||
// Developer Permissions
|
||||
workspacePermissions = AppsmithRole.ORGANIZATION_DEVELOPER.getPermissions().stream()
|
||||
workspacePermissions = AppsmithRole.WORKSPACE_DEVELOPER.getPermissions().stream()
|
||||
.filter(aclPermission -> aclPermission.getEntity().equals(Workspace.class))
|
||||
.map(aclPermission -> new Permission(workspace.getId(), aclPermission))
|
||||
.collect(Collectors.toSet());
|
||||
|
|
@ -326,7 +326,7 @@ public class WorkspaceServiceCEImpl extends BaseService<WorkspaceRepository, Wor
|
|||
developerPermissionGroup.setPermissions(permissions);
|
||||
|
||||
// App Viewer Permissions
|
||||
workspacePermissions = AppsmithRole.ORGANIZATION_VIEWER.getPermissions().stream()
|
||||
workspacePermissions = AppsmithRole.WORKSPACE_VIEWER.getPermissions().stream()
|
||||
.filter(aclPermission -> aclPermission.getEntity().equals(Workspace.class))
|
||||
.map(aclPermission -> new Permission(workspace.getId(), aclPermission))
|
||||
.collect(Collectors.toSet());
|
||||
|
|
@ -375,12 +375,6 @@ public class WorkspaceServiceCEImpl extends BaseService<WorkspaceRepository, Wor
|
|||
generatePermissionsForDefaultPermissionGroups(permissionGroups, workspace, user));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create workspace needs to first fetch and embed Setting object in OrganizationSetting
|
||||
* for any settings that may have diverged from the default values. Once the
|
||||
* settings have been embedded in all the workspace settings, the library
|
||||
* function is called to store the enhanced workspace object back in the workspace object.
|
||||
*/
|
||||
@Override
|
||||
public Mono<Workspace> create(Workspace workspace) {
|
||||
return sessionUserService.getCurrentUser().flatMap(user -> create(workspace, user, Boolean.FALSE));
|
||||
|
|
|
|||
|
|
@ -3879,7 +3879,7 @@
|
|||
" { ...get_exported_app.data, decryptedFields: undefined, datasourceList: get_exported_app.data.datasourceList, \"datasourceConfigurationStructureList\": get_exported_app.data.datasourceList.map((source) => { return {datasourceId: source.name, structure: appsmith.store[source.pluginId] == undefined ? {}: appsmith.store[source.pluginId].data} } ) } "
|
||||
],
|
||||
"datasource": {
|
||||
"organizationId": "6171a062b7de236aa183ee0e",
|
||||
"workspaceId": "6171a062b7de236aa183ee0e",
|
||||
"invalids": [],
|
||||
"deleted": false,
|
||||
"pluginId": "restapi-plugin",
|
||||
|
|
@ -3926,7 +3926,7 @@
|
|||
" { ...get_exported_app.data, decryptedFields: undefined, datasourceList: get_exported_app.data.datasourceList, \"datasourceConfigurationStructureList\": get_exported_app.data.datasourceList.map((source) => { return {datasourceId: source.name, structure: appsmith.store[source.pluginId] == undefined ? {}: appsmith.store[source.pluginId].data} } ) } "
|
||||
],
|
||||
"datasource": {
|
||||
"organizationId": "6171a062b7de236aa183ee0e",
|
||||
"workspaceId": "6171a062b7de236aa183ee0e",
|
||||
"invalids": [],
|
||||
"deleted": false,
|
||||
"pluginId": "restapi-plugin",
|
||||
|
|
@ -4143,7 +4143,7 @@
|
|||
"async () => {\n get_exported_app.run(() => {\n const arr = JSON.parse(datasource_arr.text);\n arr.map(row => {\n get_datasource_structure.run((res, params) => {\n storeValue(params.name, res);\n }, undefined, row);\n });\n });\n}"
|
||||
],
|
||||
"datasource": {
|
||||
"organizationId": "6171a062b7de236aa183ee0e",
|
||||
"workspaceId": "6171a062b7de236aa183ee0e",
|
||||
"deleted": false,
|
||||
"pluginId": "js-plugin",
|
||||
"name": "UNUSED_DATASOURCE",
|
||||
|
|
@ -4183,7 +4183,7 @@
|
|||
"async () => {\n get_exported_app.run(() => {\n const arr = JSON.parse(datasource_arr.text);\n arr.map(row => {\n get_datasource_structure.run((res, params) => {\n storeValue(params.name, res);\n }, undefined, row);\n });\n });\n}"
|
||||
],
|
||||
"datasource": {
|
||||
"organizationId": "6171a062b7de236aa183ee0e",
|
||||
"workspaceId": "6171a062b7de236aa183ee0e",
|
||||
"deleted": false,
|
||||
"pluginId": "js-plugin",
|
||||
"name": "UNUSED_DATASOURCE",
|
||||
|
|
@ -4236,7 +4236,7 @@
|
|||
"tableName_input.text"
|
||||
],
|
||||
"datasource": {
|
||||
"organizationId": "6171a062b7de236aa183ee0e",
|
||||
"workspaceId": "6171a062b7de236aa183ee0e",
|
||||
"invalids": [],
|
||||
"deleted": false,
|
||||
"pluginId": "restapi-plugin",
|
||||
|
|
@ -4290,7 +4290,7 @@
|
|||
"tableName_input.text"
|
||||
],
|
||||
"datasource": {
|
||||
"organizationId": "6171a062b7de236aa183ee0e",
|
||||
"workspaceId": "6171a062b7de236aa183ee0e",
|
||||
"invalids": [],
|
||||
"deleted": false,
|
||||
"pluginId": "restapi-plugin",
|
||||
|
|
@ -4343,7 +4343,7 @@
|
|||
"search_keys_input.text"
|
||||
],
|
||||
"datasource": {
|
||||
"organizationId": "6171a062b7de236aa183ee0e",
|
||||
"workspaceId": "6171a062b7de236aa183ee0e",
|
||||
"invalids": [],
|
||||
"deleted": false,
|
||||
"pluginId": "restapi-plugin",
|
||||
|
|
@ -4395,7 +4395,7 @@
|
|||
"search_keys_input.text"
|
||||
],
|
||||
"datasource": {
|
||||
"organizationId": "6171a062b7de236aa183ee0e",
|
||||
"workspaceId": "6171a062b7de236aa183ee0e",
|
||||
"invalids": [],
|
||||
"deleted": false,
|
||||
"pluginId": "restapi-plugin",
|
||||
|
|
@ -4448,7 +4448,7 @@
|
|||
"gsheet_ds_input.text.split(\"datasources/\")[1].split(\"/\" || \"?\")[0]"
|
||||
],
|
||||
"datasource": {
|
||||
"organizationId": "6171a062b7de236aa183ee0e",
|
||||
"workspaceId": "6171a062b7de236aa183ee0e",
|
||||
"invalids": [],
|
||||
"deleted": false,
|
||||
"pluginId": "restapi-plugin",
|
||||
|
|
@ -4500,7 +4500,7 @@
|
|||
"gsheet_ds_input.text.split(\"datasources/\")[1].split(\"/\" || \"?\")[0]"
|
||||
],
|
||||
"datasource": {
|
||||
"organizationId": "6171a062b7de236aa183ee0e",
|
||||
"workspaceId": "6171a062b7de236aa183ee0e",
|
||||
"invalids": [],
|
||||
"deleted": false,
|
||||
"pluginId": "restapi-plugin",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -77,7 +77,7 @@ public class ApplicationControllerTest {
|
|||
|
||||
webTestClient
|
||||
.post()
|
||||
.uri(Url.APPLICATION_URL + "/import/orgId")
|
||||
.uri(Url.APPLICATION_URL + "/import/workspaceId")
|
||||
.contentType(MediaType.MULTIPART_FORM_DATA)
|
||||
.body(BodyInserters.fromMultipartData(bodyBuilder.build()))
|
||||
.exchange()
|
||||
|
|
@ -108,7 +108,7 @@ public class ApplicationControllerTest {
|
|||
|
||||
webTestClient
|
||||
.post()
|
||||
.uri(Url.APPLICATION_URL + "/import/orgId")
|
||||
.uri(Url.APPLICATION_URL + "/import/workspaceId")
|
||||
.contentType(MediaType.MULTIPART_FORM_DATA)
|
||||
.body(BodyInserters.fromMultipartData(bodyBuilder.build()))
|
||||
.exchange()
|
||||
|
|
|
|||
|
|
@ -189,10 +189,10 @@ public class GitFileUtilsTest {
|
|||
|
||||
Mockito.when(fileInterface.saveApplicationToGitRepo(
|
||||
Mockito.any(Path.class), Mockito.any(ApplicationGitReference.class), Mockito.anyString()))
|
||||
.thenReturn(Mono.just(Path.of("orgId", "appId", "repoName")));
|
||||
.thenReturn(Mono.just(Path.of("workspaceId", "appId", "repoName")));
|
||||
|
||||
Mono<Path> resultMono = commonGitFileUtils.saveArtifactToLocalRepoWithAnalytics(
|
||||
Path.of("orgId/appId/repoName"), validAppJson, "gitFileTest");
|
||||
Path.of("workspaceId/appId/repoName"), validAppJson, "gitFileTest");
|
||||
|
||||
StepVerifier.create(resultMono)
|
||||
.assertNext(path -> {
|
||||
|
|
@ -246,7 +246,7 @@ public class GitFileUtilsTest {
|
|||
|
||||
Mono<ApplicationJson> resultMono = commonGitFileUtils
|
||||
.reconstructArtifactExchangeJsonFromGitRepoWithAnalytics(
|
||||
"orgId", "appId", "repoName", "branch", ArtifactType.APPLICATION)
|
||||
"workspaceId", "appId", "repoName", "branch", ArtifactType.APPLICATION)
|
||||
.map(artifactExchangeJson -> (ApplicationJson) artifactExchangeJson)
|
||||
.cache();
|
||||
|
||||
|
|
|
|||
|
|
@ -1418,45 +1418,6 @@ public class ActionServiceCE_Test {
|
|||
.verifyComplete();
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithUserDetails(value = "api_user")
|
||||
public void updateAction_withoutWorkspaceId_withOrganizationId() {
|
||||
|
||||
Mockito.when(pluginExecutorHelper.getPluginExecutor(Mockito.any()))
|
||||
.thenReturn(Mono.just(new MockPluginExecutor()));
|
||||
|
||||
ActionDTO action = new ActionDTO();
|
||||
action.setName("validAction_nestedDatasource");
|
||||
action.setPageId(testPage.getId());
|
||||
action.setExecuteOnLoad(true);
|
||||
ActionConfiguration actionConfiguration = new ActionConfiguration();
|
||||
actionConfiguration.setHttpMethod(HttpMethod.GET);
|
||||
action.setActionConfiguration(actionConfiguration);
|
||||
action.setDatasource(datasource);
|
||||
|
||||
Mono<ActionDTO> createActionMono =
|
||||
layoutActionService.createSingleAction(action, Boolean.FALSE).cache();
|
||||
|
||||
ActionDTO updateAction = new ActionDTO();
|
||||
Datasource nestedDatasource = new Datasource();
|
||||
nestedDatasource.setOrganizationId(workspaceId);
|
||||
nestedDatasource.setName("DEFAULT_REST_DATASOURCE");
|
||||
nestedDatasource.setPluginId(datasource.getPluginId());
|
||||
nestedDatasource.setDatasourceConfiguration(new DatasourceConfiguration());
|
||||
|
||||
updateAction.setDatasource(nestedDatasource);
|
||||
Mono<ActionDTO> actionMono = createActionMono.flatMap(
|
||||
savedAction -> layoutActionService.updateAction(savedAction.getId(), updateAction));
|
||||
|
||||
StepVerifier.create(actionMono)
|
||||
.assertNext(updatedAction -> {
|
||||
Datasource datasource1 = updatedAction.getDatasource();
|
||||
assertThat(datasource1.getWorkspaceId()).isNotNull();
|
||||
assertThat(datasource1.getInvalids()).isEmpty();
|
||||
})
|
||||
.verifyComplete();
|
||||
}
|
||||
|
||||
@Test
|
||||
@WithUserDetails("api_user")
|
||||
public void validateAndSaveActionToRepository_noDatasourceEditPermission() {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"clientSchemaVersion": 1,
|
||||
"serverSchemaVersion": 1,
|
||||
"exportedApplication": {
|
||||
"name": "importApplicationIntoOrganization_pageRemovedInBranchApplication_Success",
|
||||
"name": "importApplicationIntoWorkspace_pageRemovedInBranchApplication_Success",
|
||||
"isPublic": false,
|
||||
"appIsExample": false,
|
||||
"unreadCommentThreads": 0,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user