dev: hello world
This commit is contained in:
commit
6037fed3f4
145 changed files with 16848 additions and 0 deletions
117
constants/api-routes.ts
Normal file
117
constants/api-routes.ts
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
// Base URLS
|
||||
export const BASE_PROD = "https://api.plane.so";
|
||||
export const BASE_STAGING = "https://api.plane.so";
|
||||
export const BASE_LOCAL = "http://localhost:8000";
|
||||
|
||||
// authentication urls
|
||||
export const SIGN_IN_ENDPOINT = "/api/sign-in/";
|
||||
export const SIGN_UP_ENDPOINT = "/api/sign-up/";
|
||||
export const SIGN_OUT_ENDPOINT = "/api/sign-out/";
|
||||
export const SOCIAL_AUTH_ENDPOINT = "/api/social-auth/";
|
||||
export const MAGIC_LINK_GENERATE = "/api/magic-generate/";
|
||||
export const MAGIC_LINK_SIGNIN = "/api/magic-sign-in/";
|
||||
|
||||
// user
|
||||
export const USER_ENDPOINT = "/api/users/me/";
|
||||
export const CHANGE_PASSWORD = "/api/users/me/change-password/";
|
||||
export const USER_ONBOARD_ENDPOINT = "/api/users/me/onboard/";
|
||||
export const USER_ISSUES_ENDPOINT = "/api/users/me/issues/";
|
||||
export const USER_WORKSPACES = "/api/users/me/workspaces";
|
||||
|
||||
// s3 file url
|
||||
export const S3_URL = `/api/file-assets/`;
|
||||
|
||||
// LIST USER INVITATIONS ---- RESPOND INVITATIONS IN BULK
|
||||
export const USER_WORKSPACE_INVITATIONS = "/api/users/me/invitations/workspaces/";
|
||||
export const USER_PROJECT_INVITATIONS = "/api/users/me/invitations/projects/";
|
||||
|
||||
export const USER_WORKSPACE_INVITATION = (invitationId: string) =>
|
||||
`/api/users/me/invitations/${invitationId}/`;
|
||||
|
||||
export const JOIN_WORKSPACE = (workspaceSlug: string, invitationId: string) =>
|
||||
`/api/users/me/invitations/workspaces/${workspaceSlug}/${invitationId}/join/`;
|
||||
export const JOIN_PROJECT = (workspaceSlug: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/join/`;
|
||||
|
||||
export const USER_ISSUES = "/api/users/me/issues/";
|
||||
|
||||
// workspaces
|
||||
export const WORKSPACES_ENDPOINT = "/api/workspaces/";
|
||||
export const WORKSPACE_DETAIL = (workspaceSlug: string) => `/api/workspaces/${workspaceSlug}/`;
|
||||
|
||||
export const INVITE_WORKSPACE = (workspaceSlug: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/invite/`;
|
||||
|
||||
export const WORKSPACE_MEMBERS = (workspaceSlug: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/members/`;
|
||||
export const WORKSPACE_MEMBER_DETAIL = (workspaceSlug: string, memberId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/members/${memberId}/`;
|
||||
|
||||
export const WORKSPACE_INVITATIONS = (workspaceSlug: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/invitations/`;
|
||||
export const WORKSPACE_INVITATION_DETAIL = (workspaceSlug: string, invitationId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/invitations/${invitationId}/`;
|
||||
|
||||
// projects
|
||||
export const PROJECTS_ENDPOINT = (workspaceSlug: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/`;
|
||||
export const PROJECT_DETAIL = (workspaceSlug: string, projectId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/`;
|
||||
|
||||
export const INVITE_PROJECT = (workspaceSlug: string, projectId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/members/add/`;
|
||||
|
||||
export const PROJECT_MEMBERS = (workspaceSlug: string, projectId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/members/`;
|
||||
export const PROJECT_MEMBER_DETAIL = (workspaceSlug: string, projectId: string, memberId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/members/${memberId}/`;
|
||||
|
||||
export const PROJECT_INVITATIONS = (workspaceSlug: string, projectId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/invitations/`;
|
||||
export const PROJECT_INVITATION_DETAIL = (
|
||||
workspaceSlug: string,
|
||||
projectId: string,
|
||||
invitationId: string
|
||||
) => `/api/workspaces/${workspaceSlug}/projects/${projectId}/invitations/${invitationId}/`;
|
||||
|
||||
export const CHECK_PROJECT_IDENTIFIER = (workspaceSlug: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/project-identifiers`;
|
||||
|
||||
// issues
|
||||
export const ISSUES_ENDPOINT = (workspaceSlug: string, projectId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/`;
|
||||
export const ISSUE_DETAIL = (workspaceSlug: string, projectId: string, issueId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/`;
|
||||
export const ISSUES_BY_STATE = (workspaceSlug: string, projectId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/?group_by=state`;
|
||||
export const ISSUE_PROPERTIES_ENDPOINT = (workspaceSlug: string, projectId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issue-properties/`;
|
||||
export const ISSUE_COMMENTS = (workspaceSlug: string, projectId: string, issueId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/comments/`;
|
||||
export const ISSUE_COMMENT_DETAIL = (
|
||||
workspaceSlug: string,
|
||||
projectId: string,
|
||||
issueId: string,
|
||||
commentId: string
|
||||
) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/comments/${commentId}/`;
|
||||
export const ISSUE_ACTIVITIES = (workspaceSlug: string, projectId: string, issueId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/${issueId}/history/`;
|
||||
|
||||
export const ISSUE_LABELS = (workspaceSlug: string, projectId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issue-labels/`;
|
||||
|
||||
export const FILTER_STATE_ISSUES = (workspaceSlug: string, projectId: string, state: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/issues/?state=${state}`;
|
||||
|
||||
// states
|
||||
export const STATES_ENDPOINT = (workspaceSlug: string, projectId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/states/`;
|
||||
export const STATE_DETAIL = (workspaceSlug: string, projectId: string, stateId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/states/${stateId}/`;
|
||||
|
||||
// CYCLES
|
||||
export const CYCLES_ENDPOINT = (workspaceSlug: string, projectId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/cycles/`;
|
||||
export const CYCLE_DETAIL = (workspaceSlug: string, projectId: string, cycleId: string) =>
|
||||
`/api/workspaces/${workspaceSlug}/projects/${projectId}/cycles/${cycleId}/cycle-issues/`;
|
||||
109
constants/common.ts
Normal file
109
constants/common.ts
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
export const classNames = (...classes: string[]) => {
|
||||
return classes.filter(Boolean).join(" ");
|
||||
};
|
||||
|
||||
export const renderDateFormat = (date: string | Date) => {
|
||||
var d = new Date(date),
|
||||
month = "" + (d.getMonth() + 1),
|
||||
day = "" + d.getDate(),
|
||||
year = d.getFullYear();
|
||||
|
||||
if (month.length < 2) month = "0" + month;
|
||||
if (day.length < 2) day = "0" + day;
|
||||
|
||||
return [year, month, day].join("-");
|
||||
};
|
||||
|
||||
export const renderShortNumericDateFormat = (date: string | Date) => {
|
||||
return new Date(date).toLocaleDateString("en-UK", {
|
||||
day: "numeric",
|
||||
month: "short",
|
||||
});
|
||||
};
|
||||
|
||||
export const groupBy = (array: any[], key: string) => {
|
||||
const innerKey = key.split("."); // split the key by dot
|
||||
return array.reduce((result, currentValue) => {
|
||||
const key = innerKey.reduce((obj, i) => obj[i], currentValue); // get the value of the inner key
|
||||
(result[key] = result[key] || []).push(currentValue);
|
||||
return result;
|
||||
}, {});
|
||||
};
|
||||
|
||||
export const timeAgo = (time: any) => {
|
||||
switch (typeof time) {
|
||||
case "number":
|
||||
break;
|
||||
case "string":
|
||||
time = +new Date(time);
|
||||
break;
|
||||
case "object":
|
||||
if (time.constructor === Date) time = time.getTime();
|
||||
break;
|
||||
default:
|
||||
time = +new Date();
|
||||
}
|
||||
var time_formats = [
|
||||
[60, "seconds", 1], // 60
|
||||
[120, "1 minute ago", "1 minute from now"], // 60*2
|
||||
[3600, "minutes", 60], // 60*60, 60
|
||||
[7200, "1 hour ago", "1 hour from now"], // 60*60*2
|
||||
[86400, "hours", 3600], // 60*60*24, 60*60
|
||||
[172800, "Yesterday", "Tomorrow"], // 60*60*24*2
|
||||
[604800, "days", 86400], // 60*60*24*7, 60*60*24
|
||||
[1209600, "Last week", "Next week"], // 60*60*24*7*4*2
|
||||
[2419200, "weeks", 604800], // 60*60*24*7*4, 60*60*24*7
|
||||
[4838400, "Last month", "Next month"], // 60*60*24*7*4*2
|
||||
[29030400, "months", 2419200], // 60*60*24*7*4*12, 60*60*24*7*4
|
||||
[58060800, "Last year", "Next year"], // 60*60*24*7*4*12*2
|
||||
[2903040000, "years", 29030400], // 60*60*24*7*4*12*100, 60*60*24*7*4*12
|
||||
[5806080000, "Last century", "Next century"], // 60*60*24*7*4*12*100*2
|
||||
[58060800000, "centuries", 2903040000], // 60*60*24*7*4*12*100*20, 60*60*24*7*4*12*100
|
||||
];
|
||||
var seconds = (+new Date() - time) / 1000,
|
||||
token = "ago",
|
||||
list_choice = 1;
|
||||
|
||||
if (seconds == 0) {
|
||||
return "Just now";
|
||||
}
|
||||
if (seconds < 0) {
|
||||
seconds = Math.abs(seconds);
|
||||
token = "from now";
|
||||
list_choice = 2;
|
||||
}
|
||||
var i = 0,
|
||||
format;
|
||||
while ((format = time_formats[i++]))
|
||||
if (seconds < format[0]) {
|
||||
if (typeof format[2] == "string") return format[list_choice];
|
||||
else return Math.floor(seconds / format[2]) + " " + format[1] + " " + token;
|
||||
}
|
||||
return time;
|
||||
};
|
||||
|
||||
export const debounce = (func: any, wait: number, immediate: boolean = false) => {
|
||||
let timeout: any;
|
||||
return function executedFunction(...args: any) {
|
||||
const later = () => {
|
||||
timeout = null;
|
||||
if (!immediate) func(...args);
|
||||
};
|
||||
|
||||
const callNow = immediate && !timeout;
|
||||
|
||||
clearTimeout(timeout);
|
||||
|
||||
timeout = setTimeout(later, wait);
|
||||
|
||||
if (callNow) func(...args);
|
||||
};
|
||||
};
|
||||
|
||||
export const addSpaceIfCamelCase = (str: string) => {
|
||||
return str.replace(/([a-z])([A-Z])/g, "$1 $2");
|
||||
};
|
||||
|
||||
export const replaceUnderscoreIfSnakeCase = (str: string) => {
|
||||
return str.replace(/_/g, " ");
|
||||
};
|
||||
32
constants/fetch-keys.ts
Normal file
32
constants/fetch-keys.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
export const CURRENT_USER = "CURRENT_USER";
|
||||
export const USER_WORKSPACE_INVITATIONS = "USER_WORKSPACE_INVITATIONS";
|
||||
export const USER_WORKSPACES = "USER_WORKSPACES";
|
||||
|
||||
export const WORKSPACE_MEMBERS = "WORKSPACE_MEMBERS";
|
||||
export const WORKSPACE_INVITATIONS = "WORKSPACE_INVITATIONS";
|
||||
export const WORKSPACE_INVITATION = "WORKSPACE_INVITATION";
|
||||
|
||||
export const PROJECTS_LIST = (workspaceSlug: string) => `PROJECTS_LIST_${workspaceSlug}`;
|
||||
export const PROJECT_DETAILS = "PROJECT_DETAILS";
|
||||
|
||||
export const PROJECT_MEMBERS = (projectId: string) => `PROJECT_MEMBERS_${projectId}`;
|
||||
export const PROJECT_INVITATIONS = "PROJECT_INVITATIONS";
|
||||
|
||||
export const PROJECT_ISSUES_LIST = (workspaceSlug: string, projectId: string) =>
|
||||
`PROJECT_ISSUES_LIST_${workspaceSlug}_${projectId}`;
|
||||
export const PROJECT_ISSUES_DETAILS = (issueId: string) => `PROJECT_ISSUES_DETAILS_${issueId}`;
|
||||
export const PROJECT_ISSUES_PROPERTIES = (projectId: string) =>
|
||||
`PROJECT_ISSUES_PROPERTIES_${projectId}`;
|
||||
export const PROJECT_ISSUES_COMMENTS = "PROJECT_ISSUES_COMMENTS";
|
||||
export const PROJECT_ISSUES_ACTIVITY = "PROJECT_ISSUES_ACTIVITY";
|
||||
export const PROJECT_ISSUE_BY_STATE = (projectId: string) => `PROJECT_ISSUE_BY_STATE_${projectId}`;
|
||||
export const PROJECT_ISSUE_LABELS = (projectId: string) => `PROJECT_ISSUE_LABELS_${projectId}`;
|
||||
|
||||
export const CYCLE_LIST = (projectId: string) => `CYCLE_LIST_${projectId}`;
|
||||
export const CYCLE_ISSUES = (sprintId: string) => `CYCLE_ISSUES_${sprintId}`;
|
||||
export const CYCLE_DETAIL = "CYCLE_DETAIL";
|
||||
|
||||
export const STATE_LIST = (projectId: string) => `STATE_LIST_${projectId}`;
|
||||
export const STATE_DETAIL = "STATE_DETAIL";
|
||||
|
||||
export const USER_ISSUE = "USER_ISSUE";
|
||||
8
constants/seo/seo-variables.ts
Normal file
8
constants/seo/seo-variables.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
export const SITE_NAME = "Plane";
|
||||
export const SITE_TITLE = "Plane | Accelerate software development with peace.";
|
||||
export const SITE_DESCRIPTION =
|
||||
"Plane accelerated the software development by order of magnitude for agencies and product companies.";
|
||||
export const SITE_KEYWORDS =
|
||||
"software development, plan, ship, software, accelerate, code management, release management";
|
||||
export const SITE_URL = "http://localhost:3000/";
|
||||
export const TWITTER_USER_NAME = "caravel";
|
||||
4
constants/theme.context.constants.ts
Normal file
4
constants/theme.context.constants.ts
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
export const TOGGLE_SIDEBAR = "TOGGLE_SIDEBAR";
|
||||
export const REHYDRATE_THEME = "REHYDRATE_THEME";
|
||||
export const SET_ISSUE_VIEW = "SET_ISSUE_VIEW";
|
||||
export const SET_GROUP_BY_PROPERTY = "SET_GROUP_BY_PROPERTY";
|
||||
2
constants/toast.context.constants.ts
Normal file
2
constants/toast.context.constants.ts
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export const SET_TOAST_ALERT = "SET_TOAST_ALERT";
|
||||
export const REMOVE_TOAST_ALERT = "REMOVE_TOAST_ALERT";
|
||||
Loading…
Add table
Add a link
Reference in a new issue