debian-mirror-gitlab/app/assets/javascripts/ide/constants.js

117 lines
2.9 KiB
JavaScript
Raw Normal View History

2018-10-15 14:42:47 +05:30
export const MAX_WINDOW_HEIGHT_COMPACT = 750;
// Commit message textarea
export const MAX_TITLE_LENGTH = 50;
export const MAX_BODY_LENGTH = 72;
2020-06-23 00:09:42 +05:30
export const SIDEBAR_INIT_WIDTH = 340;
2021-12-11 22:18:48 +05:30
export const SIDEBAR_MIN_WIDTH = 260;
2020-06-23 00:09:42 +05:30
export const SIDEBAR_NAV_WIDTH = 60;
2019-10-12 21:52:04 +05:30
// File view modes
export const FILE_VIEW_MODE_EDITOR = 'editor';
export const FILE_VIEW_MODE_PREVIEW = 'preview';
2020-03-13 15:44:24 +05:30
export const PERMISSION_CREATE_MR = 'createMergeRequestIn';
export const PERMISSION_READ_MR = 'readMergeRequest';
2020-04-22 19:07:51 +05:30
export const PERMISSION_PUSH_CODE = 'pushCode';
2021-04-17 20:07:23 +05:30
export const PUSH_RULE_REJECT_UNSIGNED_COMMITS = 'rejectUnsignedCommits';
2018-10-15 14:42:47 +05:30
2021-03-11 19:13:27 +05:30
// The default permission object to use when the project data isn't available yet.
// This helps us encapsulate checks like `canPushCode` without requiring an
// additional check like `currentProject && canPushCode`.
export const DEFAULT_PERMISSIONS = {
[PERMISSION_PUSH_CODE]: true,
};
2018-10-15 14:42:47 +05:30
export const viewerTypes = {
mr: 'mrdiff',
edit: 'editor',
diff: 'diff',
};
2018-11-08 19:23:39 +05:30
export const diffModes = {
replaced: 'replaced',
new: 'new',
deleted: 'deleted',
renamed: 'renamed',
2019-02-15 15:39:39 +05:30
mode_changed: 'mode_changed',
2018-11-08 19:23:39 +05:30
};
2019-07-07 11:18:12 +05:30
export const diffViewerModes = Object.freeze({
not_diffable: 'not_diffable',
no_preview: 'no_preview',
added: 'added',
deleted: 'deleted',
renamed: 'renamed',
mode_changed: 'mode_changed',
text: 'text',
image: 'image',
});
export const diffViewerErrors = Object.freeze({
too_large: 'too_large',
stored_externally: 'server_side_but_stored_externally',
});
2020-03-13 15:44:24 +05:30
export const leftSidebarViews = {
2021-01-03 14:25:43 +05:30
edit: { name: 'ide-tree' },
review: { name: 'ide-review' },
commit: { name: 'repo-commit-section' },
2020-03-13 15:44:24 +05:30
};
2018-11-08 19:23:39 +05:30
export const rightSidebarViews = {
2018-12-05 23:21:45 +05:30
pipelines: { name: 'pipelines-list', keepAlive: true },
jobsDetail: { name: 'jobs-detail', keepAlive: false },
mergeRequestInfo: { name: 'merge-request-info', keepAlive: true },
clientSidePreview: { name: 'clientside', keepAlive: false },
2020-06-23 00:09:42 +05:30
terminal: { name: 'terminal', keepAlive: true },
2018-11-08 19:23:39 +05:30
};
export const stageKeys = {
unstaged: 'unstaged',
staged: 'staged',
};
2018-11-18 11:00:15 +05:30
export const commitItemIconMap = {
addition: {
icon: 'file-addition',
2022-01-26 12:08:38 +05:30
class: 'file-addition ide-file-addition',
2018-11-18 11:00:15 +05:30
},
modified: {
icon: 'file-modified',
2022-01-26 12:08:38 +05:30
class: 'file-modified ide-file-modified',
2018-11-18 11:00:15 +05:30
},
deleted: {
icon: 'file-deletion',
2022-01-26 12:08:38 +05:30
class: 'file-deletion ide-file-deletion',
2018-11-18 11:00:15 +05:30
},
};
export const modalTypes = {
rename: 'rename',
tree: 'tree',
2020-05-24 23:13:21 +05:30
blob: 'blob',
2018-11-18 11:00:15 +05:30
};
2019-07-31 22:56:46 +05:30
export const commitActionTypes = {
move: 'move',
delete: 'delete',
create: 'create',
update: 'update',
};
2018-11-18 11:00:15 +05:30
export const packageJsonPath = 'package.json';
2020-06-23 00:09:42 +05:30
export const SIDE_LEFT = 'left';
export const SIDE_RIGHT = 'right';
2021-03-08 18:12:59 +05:30
// Live Preview feature
export const LIVE_PREVIEW_DEBOUNCE = 2000;
2021-03-11 19:13:27 +05:30
// This is the maximum number of files to auto open when opening the Web IDE
2021-04-29 21:17:54 +05:30
// from a merge request
2021-03-11 19:13:27 +05:30
export const MAX_MR_FILES_AUTO_OPEN = 10;
2021-09-04 01:27:46 +05:30
export const DEFAULT_BRANCH = 'main';