2023-07-26 06:32:14 +00:00
|
|
|
import { objToQueryParams } from "helpers/string.helper";
|
2023-07-18 06:37:55 +00:00
|
|
|
import { IAnalyticsParams, IJiraMetadata, INotificationParams } from "types";
|
2023-04-19 10:10:31 +00:00
|
|
|
|
2023-03-16 12:45:08 +00:00
|
|
|
const paramsToKey = (params: any) => {
|
2023-08-11 10:29:13 +00:00
|
|
|
const {
|
|
|
|
state,
|
|
|
|
priority,
|
|
|
|
assignees,
|
|
|
|
created_by,
|
|
|
|
labels,
|
2023-08-24 14:15:23 +00:00
|
|
|
start_date,
|
2023-08-11 10:29:13 +00:00
|
|
|
target_date,
|
|
|
|
sub_issue,
|
|
|
|
start_target_date,
|
|
|
|
} = params;
|
2023-03-16 12:45:08 +00:00
|
|
|
|
2023-03-21 07:17:47 +00:00
|
|
|
let stateKey = state ? state.split(",") : [];
|
|
|
|
let priorityKey = priority ? priority.split(",") : [];
|
|
|
|
let assigneesKey = assignees ? assignees.split(",") : [];
|
2023-03-24 18:01:56 +00:00
|
|
|
let createdByKey = created_by ? created_by.split(",") : [];
|
2023-03-29 13:48:57 +00:00
|
|
|
let labelsKey = labels ? labels.split(",") : [];
|
2023-08-11 10:29:13 +00:00
|
|
|
const startTargetDate = start_target_date ? `${start_target_date}`.toUpperCase() : "FALSE";
|
2023-08-24 14:15:23 +00:00
|
|
|
const startDateKey = start_date ?? "";
|
2023-05-15 06:05:07 +00:00
|
|
|
const targetDateKey = target_date ?? "";
|
2023-03-21 07:17:47 +00:00
|
|
|
const type = params.type ? params.type.toUpperCase() : "NULL";
|
|
|
|
const groupBy = params.group_by ? params.group_by.toUpperCase() : "NULL";
|
|
|
|
const orderBy = params.order_by ? params.order_by.toUpperCase() : "NULL";
|
2023-03-16 12:45:08 +00:00
|
|
|
|
|
|
|
// sorting each keys in ascending order
|
2023-03-21 07:17:47 +00:00
|
|
|
stateKey = stateKey.sort().join("_");
|
|
|
|
priorityKey = priorityKey.sort().join("_");
|
|
|
|
assigneesKey = assigneesKey.sort().join("_");
|
2023-03-24 18:01:56 +00:00
|
|
|
createdByKey = createdByKey.sort().join("_");
|
2023-03-29 13:48:57 +00:00
|
|
|
labelsKey = labelsKey.sort().join("_");
|
2023-03-16 12:45:08 +00:00
|
|
|
|
2023-08-24 14:15:23 +00:00
|
|
|
return `${stateKey}_${priorityKey}_${assigneesKey}_${createdByKey}_${type}_${groupBy}_${orderBy}_${labelsKey}_${startDateKey}_${targetDateKey}_${sub_issue}_${startTargetDate}`;
|
2023-03-16 12:45:08 +00:00
|
|
|
};
|
2023-03-15 06:14:44 +00:00
|
|
|
|
2023-06-16 13:27:17 +00:00
|
|
|
const inboxParamsToKey = (params: any) => {
|
|
|
|
const { priority, inbox_status } = params;
|
|
|
|
|
|
|
|
let priorityKey = priority ? priority.split(",") : [];
|
|
|
|
let inboxStatusKey = inbox_status ? inbox_status.split(",") : [];
|
|
|
|
|
|
|
|
// sorting each keys in ascending order
|
|
|
|
priorityKey = priorityKey.sort().join("_");
|
|
|
|
inboxStatusKey = inboxStatusKey.sort().join("_");
|
|
|
|
|
|
|
|
return `${priorityKey}_${inboxStatusKey}`;
|
|
|
|
};
|
|
|
|
|
2023-07-26 12:21:26 +00:00
|
|
|
const myIssuesParamsToKey = (params: any) => {
|
2023-08-24 14:15:23 +00:00
|
|
|
const {
|
|
|
|
assignees,
|
|
|
|
created_by,
|
|
|
|
labels,
|
|
|
|
priority,
|
|
|
|
state_group,
|
|
|
|
subscriber,
|
|
|
|
start_date,
|
|
|
|
target_date,
|
|
|
|
} = params;
|
2023-07-26 12:21:26 +00:00
|
|
|
|
|
|
|
let assigneesKey = assignees ? assignees.split(",") : [];
|
|
|
|
let createdByKey = created_by ? created_by.split(",") : [];
|
|
|
|
let stateGroupKey = state_group ? state_group.split(",") : [];
|
2023-08-08 07:45:25 +00:00
|
|
|
let subscriberKey = subscriber ? subscriber.split(",") : [];
|
2023-07-26 12:21:26 +00:00
|
|
|
let priorityKey = priority ? priority.split(",") : [];
|
|
|
|
let labelsKey = labels ? labels.split(",") : [];
|
2023-08-24 14:15:23 +00:00
|
|
|
const startDateKey = start_date ?? "";
|
2023-07-26 12:21:26 +00:00
|
|
|
const targetDateKey = target_date ?? "";
|
|
|
|
const type = params.type ? params.type.toUpperCase() : "NULL";
|
|
|
|
const groupBy = params.group_by ? params.group_by.toUpperCase() : "NULL";
|
|
|
|
const orderBy = params.order_by ? params.order_by.toUpperCase() : "NULL";
|
|
|
|
|
|
|
|
// sorting each keys in ascending order
|
|
|
|
assigneesKey = assigneesKey.sort().join("_");
|
|
|
|
createdByKey = createdByKey.sort().join("_");
|
|
|
|
stateGroupKey = stateGroupKey.sort().join("_");
|
2023-08-08 07:45:25 +00:00
|
|
|
subscriberKey = subscriberKey.sort().join("_");
|
2023-07-26 12:21:26 +00:00
|
|
|
priorityKey = priorityKey.sort().join("_");
|
|
|
|
labelsKey = labelsKey.sort().join("_");
|
|
|
|
|
2023-08-24 14:15:23 +00:00
|
|
|
return `${assigneesKey}_${createdByKey}_${stateGroupKey}_${subscriberKey}_${priorityKey}_${type}_${groupBy}_${orderBy}_${labelsKey}_${startDateKey}_${targetDateKey}`;
|
2023-07-26 12:21:26 +00:00
|
|
|
};
|
|
|
|
|
2022-11-19 14:21:26 +00:00
|
|
|
export const CURRENT_USER = "CURRENT_USER";
|
|
|
|
export const USER_WORKSPACE_INVITATIONS = "USER_WORKSPACE_INVITATIONS";
|
|
|
|
export const USER_WORKSPACES = "USER_WORKSPACES";
|
|
|
|
|
2023-03-29 13:48:57 +00:00
|
|
|
export const WORKSPACE_DETAILS = (workspaceSlug: string) =>
|
|
|
|
`WORKSPACE_DETAILS_${workspaceSlug.toUpperCase()}`;
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
|
2023-03-29 13:48:57 +00:00
|
|
|
export const WORKSPACE_MEMBERS = (workspaceSlug: string) =>
|
|
|
|
`WORKSPACE_MEMBERS_${workspaceSlug.toUpperCase()}`;
|
2023-08-08 07:31:43 +00:00
|
|
|
export const WORKSPACE_MEMBERS_WITH_EMAIL = (workspaceSlug: string) =>
|
|
|
|
`WORKSPACE_MEMBERS_WITH_EMAIL_${workspaceSlug.toUpperCase()}`;
|
dev: promote stage release to production (#155)
* refractor: removed modules from user.context
* refractor: removed cycles from user context
* refractor: removed state from user context
* feat: implement channel protocol for tracking issue-activites
* refactor: remove blocking code and add todo
* refactor: refactor the consumer with function modules
* feat: add columns for identifiers for easier redirection
* style: minor padding, coloring and consistency changes
* feat: track blocker issues
* feat: track issue after creation
* feat: add runworker in procfile
* refractor: moved all context provider to _app for more clarity
* dev: added our icons
* refractor: removed issues from user context
* refactor: rename db names to plural and remove admin register file
* refactor: integrate permission layer in endpoints
* feat: create product email html templates
* refractor: changed to getServerSide from getInitialProps, removed unused component imports and minor refractoring
* feat: remirror added
* feat: workspace member user details endpoint
* fix: resolved build issue
* refactor: remove www
* feat: workspace details on user endpoint
* feat: added authorization in project settings
refractor: improved code readability
* fix: removed hard-coded workspace slug value, and added workspace in user interface
* refactor: invitation workflow for already existing users
* feat: modified remirror, fix: issue details sidebar
* fix: merge conflicts
* fix: merge conflicts
* fix: added missing dependencies
* refactor: remove user dependency from invitations
* refactor: issue description context is updated with manager
* dev: redis instance rewrite for ssl settings and remove REDIS_TLS env variable
* chore: upgrade python package requirements
* dev: added new migrations for changes
* dev: ssl config for django channels redis connection
* chore: upgrade channels requirements
* refactor: better function for connecting with redis ssl django channels
* chore: cleanup on manifest file
* revert: user endpoint changes
* build: setup asgi
* refactor: update invitation endpoint to do bulk operations
* style: cycles page, custom listbox, issue details page
* refractor: removed folder that were moved to workspaceSlug
* dev: uvicorn in requirements
* Update index.tsx
* refactor: get workspace slug on user endpoint
* fix: workspace slug redirections and slug value in user context
* fix: user context bugs, drag and drop in cycles and modules
* fix: merge conflicts
* fix: user context and create issue modal
* refactor: add extra columns for json and html description and script for back migrating old issues
* refactor: move all 500 errors to 400
* refractor: removed active project, active workspace, projects, and workspaces from user context
* refractor: change from /home to /, added home page redirection logic
added explict GET method on fetch request, and fixed invitation page not fetching all invitations
* fix: passing project id in command palette
* style: home page, feat: image in remirror
* fix: bugs
* chore: remove test_runner workflow from github actions
* dev: update Procfile worker count and python runtime upgrade
* refactor: update response from 404 to 403
* feat: filtering using both name and issue identifier in command palette
showing my issues instead of project issue in command palette, hiding again according to route in command palette
* fix: mutation on different CRUD operations
* fix: redirection in my issues pages
* feat: added authorization in workspace settings, moved command palette to app-layout
* feat: endpoint and column to store my issue props
* style: authorization new design,
fix: made whole button on authorization page clickable, lib/auth on unsuccessful api call redirecting to error page
* feat: return project details on modules and cycles
* fix: create cycle and state coming below issue modal, showing loader for rich text editor
refractor: changed from sprint to cycle in issue type
* fix: issue delete mustation
and some code refractor
* fix: mutation bugs, remirror bugs, style: consistent droopdowns and buttons
* feat: user role in model
* dev: added new migrations
* fix: add url for workspace availability check
* feat: onboarding screens
* fix: update url for workspace name check and add authentication layer and
fix invitation endpoint
* refactor: bulk invitations message
* refactor: response on workspace invitarions
* refactor: update identifier endpoint
* refactor: invitations endpoint
* feat: onboarding logic and validations
* fix: email striep
* dev: added workspace space member unique_together
* chore: back populate neccesary data for description field
* feat: emoji-picker gets close on select, public will be default option in create project
* fix: update error in project creation
* fix: mutation error on issue count in kanban view
some minor code refractoring
* fix: module bugs
* fix: issue activities and issue comments mutation handled at issue detail
* fix: error message for creating updates without permissions
* fix: showing no user left to invite in project invite
fix: - mutation in project settings control, style: - showing loader in project settings controller, - showing request pending for user that hasn't accepted invitation
* refactor: file asset upload directory
* fix: update last workspace id on user invitation accept
* style: onboarding screens
* style: cycles, issue activity
* feat: add json and html column in issue comments
* fix: submitting create issue modal on enter click, project not getting deselected
* feat: file size validator
* fix: emoji picker not closing on all emoji select
* feat: added validation in identifier such that it only accept uppercase text
* dev: commenting is now richer
* fix: shortcuts not getting opened in settings layouts
* style: showing sidebar on unauthorized pages
* fix: error code on exception
* fix: add issue button is working on my issues pages
* feat: new way of assets
* fix: updated activity content for description field
* fix: mutation on project settings control
style: blocker and blocked changed to outline button
* fix: description activity logging
* refactor: check for workspace slug on workspace creation
* fix: typo on workspace url check
* fix: workspace name uniqueness
* fix: remove workspace from read only field
* fix: file upload endpoint, workspace slug check
* chore: drop unique_together constraint for name and workspace
* chore: settings files cleanup and use PubSub backend on django channels
* chore: change in channels backend
* refactor: issue activity api to combine comments
* fix: instance created at key
* fix: result list
* style: create project, cycle modal, view dropdown
* feat: merged issue activities and issue comments into a single section
* fix: remirror dynamic update of issue description
* fix: removed commented code
* fix: issue acitivties mutation
* fix: empty comments cant be submitted
* fix: workspace avatar has been updated while loading
* refactor: update docker-compose to run redis and database in heroku and docker environment
* refactor: removesingle docker file configuration
* refactor: update take off script to run in asgi
* docs: added workspace, quickstart documentation
* fix: reading editor values on focus out
* refactor: cleanup environment variables and create .env.example
* refactor: add extra variables in example env
* fix: warning and erros on console
lazy loading images with low priority, added validation on onboarding for user to either join or create workspace, on onboarding user can't click button while form is getting submitted, profile page going into loading state when updated, refractor: made some state local, removed unnecessary console logs and comments, changed some variable and function name to make more sence
* feat: env examples
* fix: workspace member does not exist
* fi: remove pagination from issue list api
* refactor: remove env example from root
* feat: documentation for projects on plane
* feat: create code of conduct and contributing guidelines
* fix: update docker setup to check handle redis
* revert: bring back pagination to avoid breaking
* feat: made image uploader modal, used it in profile page and workspace page,
delete project from project settings page, join project modal in project list page
* feat: create workspace page, style: made ui consistent
* style: updated onboarding and create workspace page design
* style: responsive sidebar
* fix: updated ui imports
2023-01-10 18:25:47 +00:00
|
|
|
export const WORKSPACE_MEMBERS_ME = (workspaceSlug: string) =>
|
2023-03-28 12:58:26 +00:00
|
|
|
`WORKSPACE_MEMBERS_ME${workspaceSlug.toUpperCase()}`;
|
2022-11-19 14:21:26 +00:00
|
|
|
export const WORKSPACE_INVITATIONS = "WORKSPACE_INVITATIONS";
|
2023-08-08 07:31:43 +00:00
|
|
|
export const WORKSPACE_INVITATION_WITH_EMAIL = (workspaceSlug: string) =>
|
|
|
|
`WORKSPACE_INVITATION_WITH_EMAIL_${workspaceSlug.toUpperCase()}`;
|
2022-11-19 14:21:26 +00:00
|
|
|
export const WORKSPACE_INVITATION = "WORKSPACE_INVITATION";
|
2022-12-16 14:56:25 +00:00
|
|
|
export const LAST_ACTIVE_WORKSPACE_AND_PROJECTS = "LAST_ACTIVE_WORKSPACE_AND_PROJECTS";
|
2022-11-19 14:21:26 +00:00
|
|
|
|
2023-07-13 14:14:53 +00:00
|
|
|
export const PROJECTS_LIST = (
|
|
|
|
workspaceSlug: string,
|
|
|
|
params: {
|
|
|
|
is_favorite: "all" | boolean;
|
|
|
|
}
|
|
|
|
) => {
|
|
|
|
if (!params) return `PROJECTS_LIST_${workspaceSlug.toUpperCase()}`;
|
|
|
|
|
|
|
|
return `PROJECTS_LIST_${workspaceSlug.toUpperCase()}_${params.is_favorite
|
|
|
|
.toString()
|
|
|
|
.toUpperCase()}`;
|
|
|
|
};
|
2023-03-28 12:58:26 +00:00
|
|
|
export const PROJECT_DETAILS = (projectId: string) => `PROJECT_DETAILS_${projectId.toUpperCase()}`;
|
2022-11-19 14:21:26 +00:00
|
|
|
|
2023-03-28 12:58:26 +00:00
|
|
|
export const PROJECT_MEMBERS = (projectId: string) => `PROJECT_MEMBERS_${projectId.toUpperCase()}`;
|
2023-08-08 07:31:43 +00:00
|
|
|
export const PROJECT_MEMBERS_WITH_EMAIL = (workspaceSlug: string, projectId: string) =>
|
|
|
|
`PROJECT_MEMBERS_WITH_EMAIL_${workspaceSlug}_${projectId.toUpperCase()}`;
|
2022-11-19 14:21:26 +00:00
|
|
|
export const PROJECT_INVITATIONS = "PROJECT_INVITATIONS";
|
2023-08-08 07:31:43 +00:00
|
|
|
export const PROJECT_INVITATIONS_WITH_EMAIL = (workspaceSlug: string, projectId: string) =>
|
|
|
|
`PROJECT_INVITATIONS_WITH_EMAIL_${workspaceSlug}_${projectId.toUpperCase()}`;
|
2022-11-19 14:21:26 +00:00
|
|
|
|
|
|
|
export const PROJECT_ISSUES_LIST = (workspaceSlug: string, projectId: string) =>
|
2023-03-28 12:58:26 +00:00
|
|
|
`PROJECT_ISSUES_LIST_${workspaceSlug.toUpperCase()}_${projectId.toUpperCase()}`;
|
2023-03-16 12:45:08 +00:00
|
|
|
export const PROJECT_ISSUES_LIST_WITH_PARAMS = (projectId: string, params?: any) => {
|
2023-03-28 12:58:26 +00:00
|
|
|
if (!params) return `PROJECT_ISSUES_LIST_WITH_PARAMS_${projectId.toUpperCase()}`;
|
2023-03-16 12:45:08 +00:00
|
|
|
|
|
|
|
const paramsKey = paramsToKey(params);
|
|
|
|
|
2023-03-28 12:58:26 +00:00
|
|
|
return `PROJECT_ISSUES_LIST_WITH_PARAMS_${projectId.toUpperCase()}_${paramsKey}`;
|
2023-03-16 12:45:08 +00:00
|
|
|
};
|
2023-07-13 06:04:37 +00:00
|
|
|
export const PROJECT_ARCHIVED_ISSUES_LIST_WITH_PARAMS = (projectId: string, params?: any) => {
|
2023-07-13 11:34:24 +00:00
|
|
|
if (!params) return `PROJECT_ARCHIVED_ISSUES_LIST_WITH_PARAMS_${projectId.toUpperCase()}`;
|
2023-07-13 06:04:37 +00:00
|
|
|
|
|
|
|
const paramsKey = paramsToKey(params);
|
|
|
|
|
2023-07-13 11:34:24 +00:00
|
|
|
return `PROJECT_ARCHIVED_ISSUES_LIST_WITH_PARAMS_${projectId.toUpperCase()}_${paramsKey}`;
|
2023-07-13 06:04:37 +00:00
|
|
|
};
|
2023-03-29 13:48:57 +00:00
|
|
|
export const PROJECT_ISSUES_DETAILS = (issueId: string) =>
|
|
|
|
`PROJECT_ISSUES_DETAILS_${issueId.toUpperCase()}`;
|
2022-11-19 14:21:26 +00:00
|
|
|
export const PROJECT_ISSUES_PROPERTIES = (projectId: string) =>
|
2023-03-28 12:58:26 +00:00
|
|
|
`PROJECT_ISSUES_PROPERTIES_${projectId.toUpperCase()}`;
|
2023-03-29 13:48:57 +00:00
|
|
|
export const PROJECT_ISSUES_COMMENTS = (issueId: string) =>
|
|
|
|
`PROJECT_ISSUES_COMMENTS_${issueId.toUpperCase()}`;
|
|
|
|
export const PROJECT_ISSUES_ACTIVITY = (issueId: string) =>
|
|
|
|
`PROJECT_ISSUES_ACTIVITY_${issueId.toUpperCase()}`;
|
|
|
|
export const PROJECT_ISSUE_BY_STATE = (projectId: string) =>
|
|
|
|
`PROJECT_ISSUE_BY_STATE_${projectId.toUpperCase()}`;
|
|
|
|
export const PROJECT_ISSUE_LABELS = (projectId: string) =>
|
|
|
|
`PROJECT_ISSUE_LABELS_${projectId.toUpperCase()}`;
|
2023-07-26 12:21:26 +00:00
|
|
|
export const WORKSPACE_LABELS = (workspaceSlug: string) =>
|
|
|
|
`WORKSPACE_LABELS_${workspaceSlug.toUpperCase()}`;
|
2023-02-23 12:42:07 +00:00
|
|
|
export const PROJECT_GITHUB_REPOSITORY = (projectId: string) =>
|
2023-03-28 12:58:26 +00:00
|
|
|
`PROJECT_GITHUB_REPOSITORY_${projectId.toUpperCase()}`;
|
2022-11-19 14:21:26 +00:00
|
|
|
|
2023-05-28 21:08:16 +00:00
|
|
|
// cycles
|
|
|
|
export const CYCLES_LIST = (projectId: string) => `CYCLE_LIST_${projectId.toUpperCase()}`;
|
|
|
|
export const INCOMPLETE_CYCLES_LIST = (projectId: string) =>
|
|
|
|
`INCOMPLETE_CYCLES_LIST_${projectId.toUpperCase()}`;
|
|
|
|
export const CURRENT_CYCLE_LIST = (projectId: string) =>
|
|
|
|
`CURRENT_CYCLE_LIST_${projectId.toUpperCase()}`;
|
|
|
|
export const UPCOMING_CYCLES_LIST = (projectId: string) =>
|
|
|
|
`UPCOMING_CYCLES_LIST_${projectId.toUpperCase()}`;
|
|
|
|
export const DRAFT_CYCLES_LIST = (projectId: string) =>
|
|
|
|
`DRAFT_CYCLES_LIST_${projectId.toUpperCase()}`;
|
|
|
|
export const COMPLETED_CYCLES_LIST = (projectId: string) =>
|
|
|
|
`COMPLETED_CYCLES_LIST_${projectId.toUpperCase()}`;
|
2023-03-28 12:58:26 +00:00
|
|
|
export const CYCLE_ISSUES = (cycleId: string) => `CYCLE_ISSUES_${cycleId.toUpperCase()}`;
|
2023-03-16 12:45:08 +00:00
|
|
|
export const CYCLE_ISSUES_WITH_PARAMS = (cycleId: string, params?: any) => {
|
2023-03-28 12:58:26 +00:00
|
|
|
if (!params) return `CYCLE_ISSUES_WITH_PARAMS_${cycleId.toUpperCase()}`;
|
2023-03-16 12:45:08 +00:00
|
|
|
|
|
|
|
const paramsKey = paramsToKey(params);
|
|
|
|
|
2023-03-28 12:58:26 +00:00
|
|
|
return `CYCLE_ISSUES_WITH_PARAMS_${cycleId.toUpperCase()}_${paramsKey.toUpperCase()}`;
|
2023-03-16 12:45:08 +00:00
|
|
|
};
|
2023-03-28 12:58:26 +00:00
|
|
|
export const CYCLE_DETAILS = (cycleId: string) => `CYCLE_DETAILS_${cycleId.toUpperCase()}`;
|
2023-05-26 10:08:56 +00:00
|
|
|
|
2023-04-22 12:49:35 +00:00
|
|
|
export const STATES_LIST = (projectId: string) => `STATES_LIST_${projectId.toUpperCase()}`;
|
2022-11-19 14:21:26 +00:00
|
|
|
|
2023-03-28 12:58:26 +00:00
|
|
|
export const USER_ISSUE = (workspaceSlug: string) => `USER_ISSUE_${workspaceSlug.toUpperCase()}`;
|
2023-07-26 12:21:26 +00:00
|
|
|
export const USER_ISSUES = (workspaceSlug: string, params: any) => {
|
|
|
|
const paramsKey = myIssuesParamsToKey(params);
|
|
|
|
|
2023-07-28 08:09:42 +00:00
|
|
|
return `USER_ISSUES_${workspaceSlug.toUpperCase()}_${paramsKey}`;
|
2023-07-26 12:21:26 +00:00
|
|
|
};
|
2023-03-30 11:34:41 +00:00
|
|
|
export const USER_ACTIVITY = "USER_ACTIVITY";
|
2023-03-23 10:24:59 +00:00
|
|
|
export const USER_WORKSPACE_DASHBOARD = (workspaceSlug: string) =>
|
2023-03-28 12:58:26 +00:00
|
|
|
`USER_WORKSPACE_DASHBOARD_${workspaceSlug.toUpperCase()}`;
|
2023-03-29 13:48:57 +00:00
|
|
|
export const USER_PROJECT_VIEW = (projectId: string) =>
|
|
|
|
`USER_PROJECT_VIEW_${projectId.toUpperCase()}`;
|
2022-12-16 16:20:09 +00:00
|
|
|
|
2023-03-28 12:58:26 +00:00
|
|
|
export const MODULE_LIST = (projectId: string) => `MODULE_LIST_${projectId.toUpperCase()}`;
|
|
|
|
export const MODULE_ISSUES = (moduleId: string) => `MODULE_ISSUES_${moduleId.toUpperCase()}`;
|
2023-03-16 12:45:08 +00:00
|
|
|
export const MODULE_ISSUES_WITH_PARAMS = (moduleId: string, params?: any) => {
|
2023-03-28 12:58:26 +00:00
|
|
|
if (!params) return `MODULE_ISSUES_WITH_PARAMS_${moduleId.toUpperCase()}`;
|
2023-03-16 12:45:08 +00:00
|
|
|
|
|
|
|
const paramsKey = paramsToKey(params);
|
|
|
|
|
2023-05-10 20:45:39 +00:00
|
|
|
return `MODULE_ISSUES_WITH_PARAMS_${moduleId.toUpperCase()}_${paramsKey.toUpperCase()}`;
|
2023-03-16 12:45:08 +00:00
|
|
|
};
|
2023-03-28 12:58:26 +00:00
|
|
|
export const MODULE_DETAILS = (moduleId: string) => `MODULE_DETAILS_${moduleId.toUpperCase()}`;
|
2023-03-15 05:30:05 +00:00
|
|
|
|
2023-03-28 12:58:26 +00:00
|
|
|
export const VIEWS_LIST = (projectId: string) => `VIEWS_LIST_${projectId.toUpperCase()}`;
|
|
|
|
export const VIEW_DETAILS = (viewId: string) => `VIEW_DETAILS_${viewId.toUpperCase()}`;
|
2023-05-10 20:45:39 +00:00
|
|
|
export const VIEW_ISSUES = (viewId: string, params: any) => {
|
|
|
|
if (!params) return `VIEW_ISSUES_${viewId.toUpperCase()}`;
|
|
|
|
|
|
|
|
const paramsKey = paramsToKey(params);
|
|
|
|
|
|
|
|
return `VIEW_ISSUES_${viewId.toUpperCase()}_${paramsKey.toUpperCase()}`;
|
|
|
|
};
|
2023-01-26 18:12:20 +00:00
|
|
|
|
2023-06-16 13:27:17 +00:00
|
|
|
// inbox
|
|
|
|
export const INBOX_LIST = (projectId: string) => `INBOX_LIST_${projectId.toUpperCase()}`;
|
|
|
|
export const INBOX_DETAILS = (inboxId: string) => `INBOX_DETAILS_${inboxId.toUpperCase()}`;
|
|
|
|
export const INBOX_ISSUES = (inboxId: string, params?: any) => {
|
|
|
|
if (!params) return `INBOX_ISSUES_${inboxId.toUpperCase()}`;
|
|
|
|
|
|
|
|
const paramsKey = inboxParamsToKey(params);
|
|
|
|
|
|
|
|
return `INBOX_ISSUES_${inboxId.toUpperCase()}_${paramsKey.toUpperCase()}`;
|
|
|
|
};
|
|
|
|
export const INBOX_ISSUE_DETAILS = (inboxId: string, issueId: string) =>
|
|
|
|
`INBOX_ISSUE_DETAILS_${inboxId.toUpperCase()}_${issueId.toUpperCase()}`;
|
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
// Issues
|
2023-03-28 12:58:26 +00:00
|
|
|
export const ISSUE_DETAILS = (issueId: string) => `ISSUE_DETAILS_${issueId.toUpperCase()}`;
|
|
|
|
export const SUB_ISSUES = (issueId: string) => `SUB_ISSUES_${issueId.toUpperCase()}`;
|
2023-04-06 09:37:11 +00:00
|
|
|
export const ISSUE_ATTACHMENTS = (issueId: string) => `ISSUE_ATTACHMENTS_${issueId.toUpperCase()}`;
|
2023-07-13 06:04:37 +00:00
|
|
|
export const ARCHIVED_ISSUE_DETAILS = (issueId: string) =>
|
|
|
|
`ARCHIVED_ISSUE_DETAILS_${issueId.toUpperCase()}`;
|
2023-03-23 05:31:06 +00:00
|
|
|
|
2023-03-23 17:57:11 +00:00
|
|
|
// integrations
|
2023-04-05 19:21:15 +00:00
|
|
|
export const APP_INTEGRATIONS = "APP_INTEGRATIONS";
|
|
|
|
export const WORKSPACE_INTEGRATIONS = (workspaceSlug: string) =>
|
|
|
|
`WORKSPACE_INTEGRATIONS_${workspaceSlug.toUpperCase()}`;
|
|
|
|
|
2023-04-19 10:10:31 +00:00
|
|
|
export const JIRA_IMPORTER_DETAIL = (workspaceSlug: string, params: IJiraMetadata) => {
|
|
|
|
const { api_token, cloud_hostname, email, project_key } = params;
|
|
|
|
|
|
|
|
return `JIRA_IMPORTER_DETAIL_${workspaceSlug.toUpperCase()}_${api_token}_${cloud_hostname}_${email}_${project_key}`;
|
|
|
|
};
|
|
|
|
|
2023-04-05 19:21:15 +00:00
|
|
|
//import-export
|
|
|
|
export const IMPORTER_SERVICES_LIST = (workspaceSlug: string) =>
|
|
|
|
`IMPORTER_SERVICES_LIST_${workspaceSlug.toUpperCase()}`;
|
|
|
|
|
2023-08-14 06:14:17 +00:00
|
|
|
//export
|
|
|
|
export const EXPORT_SERVICES_LIST = (workspaceSlug: string, cursor: string, per_page: string) =>
|
|
|
|
`EXPORTER_SERVICES_LIST_${workspaceSlug.toUpperCase()}_${cursor.toUpperCase()}_${per_page.toUpperCase()}`;
|
|
|
|
|
2023-04-05 19:21:15 +00:00
|
|
|
// github-importer
|
|
|
|
export const GITHUB_REPOSITORY_INFO = (workspaceSlug: string, repoName: string) =>
|
|
|
|
`GITHUB_REPO_INFO_${workspaceSlug.toString().toUpperCase()}_${repoName.toUpperCase()}`;
|
2023-03-23 17:57:11 +00:00
|
|
|
|
2023-04-22 16:24:50 +00:00
|
|
|
// slack-project-integration
|
|
|
|
export const SLACK_CHANNEL_INFO = (workspaceSlug: string, projectId: string) =>
|
|
|
|
`SLACK_CHANNEL_INFO_${workspaceSlug.toString().toUpperCase()}_${projectId.toUpperCase()}`;
|
|
|
|
|
2023-03-23 05:31:06 +00:00
|
|
|
// Pages
|
2023-03-29 13:48:57 +00:00
|
|
|
export const RECENT_PAGES_LIST = (projectId: string) =>
|
|
|
|
`RECENT_PAGES_LIST_${projectId.toUpperCase()}`;
|
2023-03-28 12:58:26 +00:00
|
|
|
export const ALL_PAGES_LIST = (projectId: string) => `ALL_PAGES_LIST_${projectId.toUpperCase()}`;
|
2023-03-29 13:48:57 +00:00
|
|
|
export const FAVORITE_PAGES_LIST = (projectId: string) =>
|
|
|
|
`FAVORITE_PAGES_LIST_${projectId.toUpperCase()}`;
|
2023-03-28 12:58:26 +00:00
|
|
|
export const MY_PAGES_LIST = (projectId: string) => `MY_PAGES_LIST_${projectId.toUpperCase()}`;
|
2023-03-29 13:48:57 +00:00
|
|
|
export const OTHER_PAGES_LIST = (projectId: string) =>
|
|
|
|
`OTHER_PAGES_LIST_${projectId.toUpperCase()}`;
|
2023-03-28 12:58:26 +00:00
|
|
|
export const PAGE_DETAILS = (pageId: string) => `PAGE_DETAILS_${pageId.toUpperCase()}`;
|
|
|
|
export const PAGE_BLOCKS_LIST = (pageId: string) => `PAGE_BLOCK_LIST_${pageId.toUpperCase()}`;
|
|
|
|
export const PAGE_BLOCK_DETAILS = (pageId: string) => `PAGE_BLOCK_DETAILS_${pageId.toUpperCase()}`;
|
2023-04-06 09:39:24 +00:00
|
|
|
|
|
|
|
// estimates
|
|
|
|
export const ESTIMATES_LIST = (projectId: string) => `ESTIMATES_LIST_${projectId.toUpperCase()}`;
|
2023-04-19 10:10:31 +00:00
|
|
|
export const ESTIMATE_DETAILS = (estimateId: string) =>
|
|
|
|
`ESTIMATE_DETAILS_${estimateId.toUpperCase()}`;
|
2023-05-11 12:08:46 +00:00
|
|
|
|
|
|
|
// analytics
|
|
|
|
export const ANALYTICS = (workspaceSlug: string, params: IAnalyticsParams) =>
|
2023-05-16 05:11:37 +00:00
|
|
|
`ANALYTICS${workspaceSlug.toUpperCase()}_${params.x_axis}_${params.y_axis}_${
|
|
|
|
params.segment
|
|
|
|
}_${params.project?.toString()}`;
|
2023-05-11 12:08:46 +00:00
|
|
|
export const DEFAULT_ANALYTICS = (workspaceSlug: string, params?: Partial<IAnalyticsParams>) =>
|
2023-09-05 09:12:34 +00:00
|
|
|
`DEFAULT_ANALYTICS_${workspaceSlug.toUpperCase()}_${params?.project?.toString()}_${
|
|
|
|
params?.cycle
|
|
|
|
}_${params?.module}`;
|
2023-07-18 06:37:55 +00:00
|
|
|
|
|
|
|
// notifications
|
|
|
|
export const USER_WORKSPACE_NOTIFICATIONS = (
|
|
|
|
workspaceSlug: string,
|
|
|
|
params: INotificationParams
|
|
|
|
) => {
|
|
|
|
const { type, snoozed, archived, read } = params;
|
|
|
|
|
2023-07-26 06:32:14 +00:00
|
|
|
return `USER_WORKSPACE_NOTIFICATIONS_${workspaceSlug?.toUpperCase()}_TYPE_${(
|
2023-07-18 06:37:55 +00:00
|
|
|
type ?? "assigned"
|
2023-07-26 06:32:14 +00:00
|
|
|
)?.toUpperCase()}_SNOOZED_${snoozed}_ARCHIVED_${archived}_READ_${read}`;
|
2023-07-18 06:37:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const USER_WORKSPACE_NOTIFICATIONS_DETAILS = (
|
|
|
|
workspaceSlug: string,
|
|
|
|
notificationId: string
|
|
|
|
) =>
|
2023-07-26 06:32:14 +00:00
|
|
|
`USER_WORKSPACE_NOTIFICATIONS_DETAILS_${workspaceSlug?.toUpperCase()}_${notificationId?.toUpperCase()}`;
|
2023-07-18 06:37:55 +00:00
|
|
|
|
|
|
|
export const UNREAD_NOTIFICATIONS_COUNT = (workspaceSlug: string) =>
|
2023-07-26 06:32:14 +00:00
|
|
|
`UNREAD_NOTIFICATIONS_COUNT_${workspaceSlug?.toUpperCase()}`;
|
|
|
|
|
|
|
|
export const getPaginatedNotificationKey = (
|
|
|
|
index: number,
|
|
|
|
prevData: any,
|
|
|
|
workspaceSlug: string,
|
|
|
|
params: any
|
|
|
|
) => {
|
|
|
|
if (prevData && !prevData?.results?.length) return null;
|
|
|
|
|
|
|
|
if (index === 0)
|
|
|
|
return `/api/workspaces/${workspaceSlug}/users/notifications?${objToQueryParams({
|
|
|
|
...params,
|
2023-08-01 05:49:06 +00:00
|
|
|
cursor: "30:0:0",
|
2023-07-26 06:32:14 +00:00
|
|
|
})}`;
|
|
|
|
|
|
|
|
const cursor = prevData?.next_cursor;
|
|
|
|
const nextPageResults = prevData?.next_page_results;
|
|
|
|
|
|
|
|
if (!nextPageResults) return null;
|
|
|
|
|
|
|
|
return `/api/workspaces/${workspaceSlug}/users/notifications?${objToQueryParams({
|
|
|
|
...params,
|
|
|
|
cursor,
|
|
|
|
})}`;
|
|
|
|
};
|
2023-07-27 13:25:03 +00:00
|
|
|
|
2023-07-28 08:09:42 +00:00
|
|
|
// profile
|
|
|
|
export const USER_PROFILE_DATA = (workspaceSlug: string, userId: string) =>
|
|
|
|
`USER_PROFILE_ACTIVITY_${workspaceSlug.toUpperCase()}_${userId.toUpperCase()}`;
|
|
|
|
export const USER_PROFILE_ACTIVITY = (workspaceSlug: string, userId: string) =>
|
|
|
|
`USER_WORKSPACE_PROFILE_ACTIVITY_${workspaceSlug.toUpperCase()}_${userId.toUpperCase()}`;
|
|
|
|
export const USER_PROFILE_PROJECT_SEGREGATION = (workspaceSlug: string, userId: string) =>
|
|
|
|
`USER_PROFILE_PROJECT_SEGREGATION_${workspaceSlug.toUpperCase()}_${userId.toUpperCase()}`;
|
|
|
|
export const USER_PROFILE_ISSUES = (workspaceSlug: string, userId: string, params: any) => {
|
|
|
|
const paramsKey = myIssuesParamsToKey(params);
|
|
|
|
|
2023-08-08 07:45:25 +00:00
|
|
|
return `USER_PROFILE_ISSUES_${workspaceSlug.toUpperCase()}_${userId.toUpperCase()}_${paramsKey}`;
|
2023-07-28 08:09:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// reactions
|
2023-07-27 13:25:03 +00:00
|
|
|
export const ISSUE_REACTION_LIST = (workspaceSlug: string, projectId: string, issueId: string) =>
|
|
|
|
`ISSUE_REACTION_LIST_${workspaceSlug.toUpperCase()}_${projectId.toUpperCase()}_${issueId.toUpperCase()}`;
|
|
|
|
export const COMMENT_REACTION_LIST = (
|
|
|
|
workspaceSlug: string,
|
|
|
|
projectId: string,
|
|
|
|
commendId: string
|
|
|
|
) =>
|
|
|
|
`COMMENT_REACTION_LIST_${workspaceSlug.toUpperCase()}_${projectId.toUpperCase()}_${commendId.toUpperCase()}`;
|