forked from gitlabhq/gitlabhq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add latest changes from gitlab-org/gitlab@master
- Loading branch information
GitLab Bot
committed
Aug 2, 2024
1 parent
2f2a542
commit 88d3d2b
Showing
15 changed files
with
133 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// legacyWebIDE.js | ||
import { identity } from 'lodash'; | ||
import Vue from 'vue'; | ||
// eslint-disable-next-line no-restricted-imports | ||
import { mapActions } from 'vuex'; | ||
import { parseBoolean } from '../lib/utils/common_utils'; | ||
import { DEFAULT_BRANCH } from './constants'; | ||
import ide from './components/ide.vue'; | ||
import { createRouter } from './ide_router'; | ||
import { DEFAULT_THEME } from './lib/themes'; | ||
import { createStore } from './stores'; | ||
|
||
export const initLegacyWebIDE = (el, options = {}) => { | ||
if (!el) return null; | ||
|
||
const { rootComponent = ide, extendStore = identity } = options; | ||
|
||
const store = createStore(); | ||
const project = JSON.parse(el.dataset.project); | ||
store.dispatch('setProject', { project }); | ||
|
||
// fire and forget fetching non-critical project info | ||
store.dispatch('fetchProjectPermissions'); | ||
|
||
const router = createRouter(store, el.dataset.defaultBranch || DEFAULT_BRANCH); | ||
|
||
return new Vue({ | ||
el, | ||
store: extendStore(store, el), | ||
router, | ||
created() { | ||
this.setEmptyStateSvgs({ | ||
emptyStateSvgPath: el.dataset.emptyStateSvgPath, | ||
noChangesStateSvgPath: el.dataset.noChangesStateSvgPath, | ||
committedStateSvgPath: el.dataset.committedStateSvgPath, | ||
pipelinesEmptyStateSvgPath: el.dataset.pipelinesEmptyStateSvgPath, | ||
promotionSvgPath: el.dataset.promotionSvgPath, | ||
switchEditorSvgPath: el.dataset.switchEditorSvgPath, | ||
}); | ||
this.setLinks({ | ||
webIDEHelpPagePath: el.dataset.webIdeHelpPagePath, | ||
newWebIDEHelpPagePath: el.dataset.newWebIdeHelpPagePath, | ||
forkInfo: el.dataset.forkInfo ? JSON.parse(el.dataset.forkInfo) : null, | ||
}); | ||
this.init({ | ||
renderWhitespaceInCode: parseBoolean(el.dataset.renderWhitespaceInCode), | ||
editorTheme: window.gon?.user_color_scheme || DEFAULT_THEME, | ||
previewMarkdownPath: el.dataset.previewMarkdownPath, | ||
userPreferencesPath: el.dataset.userPreferencesPath, | ||
}); | ||
}, | ||
beforeDestroy() { | ||
// This helps tests do Singleton cleanups which we don't really have responsibility to know about here. | ||
this.$emit('destroy'); | ||
}, | ||
methods: { | ||
...mapActions(['setEmptyStateSvgs', 'setLinks', 'init']), | ||
}, | ||
render(createElement) { | ||
return createElement(rootComponent); | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -433,4 +433,10 @@ | |
color: $color; | ||
} | ||
} | ||
|
||
@each $i, $color in $xterm-colors { | ||
.xterm-bg-#{$i} { | ||
background-color: $color; | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
db/post_migrate/20240719033346_tmp_index_on_vulnerability_reads.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
# See https://docs.gitlab.com/ee/development/migration_style_guide.html | ||
# for more information on how to write migrations for GitLab. | ||
|
||
class TmpIndexOnVulnerabilityReads < Gitlab::Database::Migration[2.2] | ||
disable_ddl_transaction! | ||
milestone '17.3' | ||
|
||
# TODO: remove this index in https://gitlab.com/gitlab-org/gitlab/-/issues/475161 | ||
INDEX_NAME = 'tmp_index_vulnerability_reads_where_state_is_detected' | ||
TABLE_NAME = :vulnerability_reads | ||
|
||
def up | ||
add_concurrent_index TABLE_NAME, :id, name: INDEX_NAME, where: "state = 1" | ||
end | ||
|
||
def down | ||
remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME | ||
end | ||
end |
16 changes: 16 additions & 0 deletions
16
db/post_migrate/20240730072136_remove_index_projects_on_id_namespace_id.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
class RemoveIndexProjectsOnIdNamespaceId < Gitlab::Database::Migration[2.2] | ||
milestone '17.3' | ||
disable_ddl_transaction! | ||
|
||
INDEX_NAME = 'index_projects_on_id_and_namespace_id' | ||
|
||
def up | ||
remove_concurrent_index_by_name :projects, INDEX_NAME | ||
end | ||
|
||
def down | ||
add_concurrent_index :projects, [:id, :namespace_id], name: INDEX_NAME | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
c4556edb2ff21ee43addc7eb7a49d6fc42d934f56817229eee0187d53c25de89 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
084d9556891e811b540ba11e11e464c2fa35dff9754b1893ca0c105c54a3ed31 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters