From 8de5cea076b0bc40e84f13a7b936cb06cb39f291 Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 16 Apr 2018 16:29:34 +0100 Subject: [PATCH] moved CSS out of the components hooked up commit section to activity bar fixed commit section SVGs not loading added the different theme defintions to the activity bar --- .../ide/components/activity_bar.vue | 63 +++--------------- app/assets/javascripts/ide/components/ide.vue | 8 --- .../ide/components/ide_project_tree.vue | 22 +++---- .../ide/components/ide_side_bar.vue | 11 ++-- .../ide/components/repo_commit_section.vue | 12 +--- app/assets/javascripts/ide/index.js | 9 ++- app/assets/javascripts/ide/stores/actions.js | 4 ++ app/assets/javascripts/ide/stores/getters.js | 2 + .../javascripts/ide/stores/mutation_types.js | 1 + .../javascripts/ide/stores/mutations.js | 10 +++ .../stylesheets/framework/gitlab_theme.scss | 12 ++++ app/assets/stylesheets/pages/repo.scss | 64 ++++++++++++++----- 12 files changed, 111 insertions(+), 107 deletions(-) diff --git a/app/assets/javascripts/ide/components/activity_bar.vue b/app/assets/javascripts/ide/components/activity_bar.vue index f7ef283cdbc..20495127bf7 100644 --- a/app/assets/javascripts/ide/components/activity_bar.vue +++ b/app/assets/javascripts/ide/components/activity_bar.vue @@ -30,80 +30,33 @@ export default { />
  • - - +
  • - - +
  • - - diff --git a/app/assets/javascripts/ide/components/ide.vue b/app/assets/javascripts/ide/components/ide.vue index a04fdd837bd..1575d4cde8e 100644 --- a/app/assets/javascripts/ide/components/ide.vue +++ b/app/assets/javascripts/ide/components/ide.vue @@ -19,14 +19,6 @@ export default { type: String, required: true, }, - noChangesStateSvgPath: { - type: String, - required: true, - }, - committedStateSvgPath: { - type: String, - required: true, - }, }, computed: { ...mapState(['changedFiles', 'openFiles', 'viewer', 'currentMergeRequestId']), diff --git a/app/assets/javascripts/ide/components/ide_project_tree.vue b/app/assets/javascripts/ide/components/ide_project_tree.vue index a27fcf3b759..3179300a44f 100644 --- a/app/assets/javascripts/ide/components/ide_project_tree.vue +++ b/app/assets/javascripts/ide/components/ide_project_tree.vue @@ -1,28 +1,24 @@ diff --git a/app/assets/javascripts/ide/components/ide_side_bar.vue b/app/assets/javascripts/ide/components/ide_side_bar.vue index b2c529fc36f..77c958a6f8f 100644 --- a/app/assets/javascripts/ide/components/ide_side_bar.vue +++ b/app/assets/javascripts/ide/components/ide_side_bar.vue @@ -8,6 +8,7 @@ import Identicon from '../../vue_shared/components/identicon.vue'; import projectTree from './ide_project_tree.vue'; import ResizablePanel from './resizable_panel.vue'; import ActivityBar from './activity_bar.vue'; +import CommitSection from './repo_commit_section.vue'; export default { components: { @@ -19,6 +20,7 @@ export default { ActivityBar, ProjectAvatarImage, Identicon, + CommitSection, }, computed: { ...mapState(['loading']), @@ -75,10 +77,11 @@ export default { - +
    + +
    diff --git a/app/assets/javascripts/ide/components/repo_commit_section.vue b/app/assets/javascripts/ide/components/repo_commit_section.vue index 14673754503..8639912b877 100644 --- a/app/assets/javascripts/ide/components/repo_commit_section.vue +++ b/app/assets/javascripts/ide/components/repo_commit_section.vue @@ -21,16 +21,6 @@ export default { directives: { tooltip, }, - props: { - noChangesStateSvgPath: { - type: String, - required: true, - }, - committedStateSvgPath: { - type: String, - required: true, - }, - }, computed: { ...mapState([ 'currentProjectId', @@ -38,6 +28,8 @@ export default { 'rightPanelCollapsed', 'lastCommitMsg', 'changedFiles', + 'noChangesStateSvgPath', + 'committedStateSvgPath', ]), ...mapState('commit', ['commitMessage', 'submitCommitLoading']), ...mapGetters('commit', ['commitButtonDisabled', 'discardDraftButtonDisabled', 'branchName']), diff --git a/app/assets/javascripts/ide/index.js b/app/assets/javascripts/ide/index.js index cbfb3dc54f2..bbe3398e416 100644 --- a/app/assets/javascripts/ide/index.js +++ b/app/assets/javascripts/ide/index.js @@ -14,12 +14,17 @@ function initIde(el) { components: { ide, }, + created() { + this.$store.dispatch('setEmptyStateSvgs', { + emptyStateSvgPath: el.dataset.emptyStateSvgPath, + noChangesStateSvgPath: el.dataset.noChangesStateSvgPath, + committedStateSvgPath: el.dataset.committedStateSvgPath, + }); + }, render(createElement) { return createElement('ide', { props: { emptyStateSvgPath: el.dataset.emptyStateSvgPath, - noChangesStateSvgPath: el.dataset.noChangesStateSvgPath, - committedStateSvgPath: el.dataset.committedStateSvgPath, }, }); }, diff --git a/app/assets/javascripts/ide/stores/actions.js b/app/assets/javascripts/ide/stores/actions.js index 37e28568cc0..e7b98404ebc 100644 --- a/app/assets/javascripts/ide/stores/actions.js +++ b/app/assets/javascripts/ide/stores/actions.js @@ -116,6 +116,10 @@ export const updateActivityBarView = ({ commit }, view) => { commit(types.UPDATE_ACTIVITY_BAR_VIEW, view); }; +export const setEmptyStateSvgs = ({ commit }, svgs) => { + commit(types.SET_EMPTY_STATE_SVGS, svgs); +}; + export * from './actions/tree'; export * from './actions/file'; export * from './actions/project'; diff --git a/app/assets/javascripts/ide/stores/getters.js b/app/assets/javascripts/ide/stores/getters.js index 1a61a26e088..c2899f12f18 100644 --- a/app/assets/javascripts/ide/stores/getters.js +++ b/app/assets/javascripts/ide/stores/getters.js @@ -56,6 +56,8 @@ export const activityBarComponent = state => { switch (state.currentActivityView) { case ActivityBarViews.edit: return 'project-tree'; + case ActivityBarViews.commit: + return 'commit-section'; default: return null; } diff --git a/app/assets/javascripts/ide/stores/mutation_types.js b/app/assets/javascripts/ide/stores/mutation_types.js index 7eb507545f3..ae720f613cf 100644 --- a/app/assets/javascripts/ide/stores/mutation_types.js +++ b/app/assets/javascripts/ide/stores/mutation_types.js @@ -5,6 +5,7 @@ export const SET_LAST_COMMIT_MSG = 'SET_LAST_COMMIT_MSG'; export const SET_LEFT_PANEL_COLLAPSED = 'SET_LEFT_PANEL_COLLAPSED'; export const SET_RIGHT_PANEL_COLLAPSED = 'SET_RIGHT_PANEL_COLLAPSED'; export const SET_RESIZING_STATUS = 'SET_RESIZING_STATUS'; +export const SET_EMPTY_STATE_SVGS = 'SET_EMPTY_STATE_SVGS'; // Project Mutation Types export const SET_PROJECT = 'SET_PROJECT'; diff --git a/app/assets/javascripts/ide/stores/mutations.js b/app/assets/javascripts/ide/stores/mutations.js index 13ade71324a..8f58bd7350e 100644 --- a/app/assets/javascripts/ide/stores/mutations.js +++ b/app/assets/javascripts/ide/stores/mutations.js @@ -100,6 +100,16 @@ export default { currentActivityView, }); }, + [types.SET_EMPTY_STATE_SVGS]( + state, + { emptyStateSvgPath, noChangesStateSvgPath, committedStateSvgPath }, + ) { + Object.assign(state, { + emptyStateSvgPath, + noChangesStateSvgPath, + committedStateSvgPath, + }); + }, ...projectMutations, ...mergeRequestMutation, ...fileMutations, diff --git a/app/assets/stylesheets/framework/gitlab_theme.scss b/app/assets/stylesheets/framework/gitlab_theme.scss index 54a44facb5e..6a03c302d9c 100644 --- a/app/assets/stylesheets/framework/gitlab_theme.scss +++ b/app/assets/stylesheets/framework/gitlab_theme.scss @@ -184,6 +184,18 @@ .ide-file-list .file.file-active { color: $color-700; } + + .ide-sidebar-link { + &:hover, + &:focus, + &.active { + color: $color-700; + } + + &.active { + box-shadow: inset 3px 0 $color-700; + } + } } body { diff --git a/app/assets/stylesheets/pages/repo.scss b/app/assets/stylesheets/pages/repo.scss index 919d76c72bc..e9f4abd91d2 100644 --- a/app/assets/stylesheets/pages/repo.scss +++ b/app/assets/stylesheets/pages/repo.scss @@ -112,14 +112,6 @@ .multi-file-loading-container { margin-top: 10px; padding: 10px; - - .animation-container { - background: $gray-light; - - div { - background: $gray-light; - } - } } .multi-file-table-col-commit-message { @@ -423,7 +415,7 @@ width: 340px; padding: 0; background-color: $gray-light; - padding-right: 3px; + padding-right: 1px; .context-header { width: auto; @@ -438,9 +430,10 @@ .multi-file-commit-panel-inner { display: flex; + flex: 1; flex-direction: column; height: 100%; - width: 100%; + width: 0; } .multi-file-commit-panel-inner-scroll { @@ -448,8 +441,10 @@ flex: 1; flex-direction: column; overflow: auto; - background-color: #fff; - border-left: 1px solid #eaeaea; + background-color: $white-light; + border-left: 1px solid $white-dark; + border-top: 1px solid $white-dark; + border-top-left-radius: $border-radius-small; } .branch-header { @@ -763,7 +758,7 @@ position: absolute; top: 0; bottom: 0; - width: 3px; + width: 1px; background-color: $white-dark; &.dragright { @@ -791,10 +786,49 @@ } .ide-sidebar-link { - padding: $gl-padding-8 $gl-padding; display: flex; align-items: center; - font-weight: $gl-font-weight-bold; + position: relative; + height: 55px; + width: 100%; + margin: 2.5px 0; + padding: $gl-padding-8 $gl-padding; + color: $gl-text-color-secondary; + background-color: transparent; + border: 0; + border-top: 1px solid transparent; + border-bottom: 1px solid transparent; + outline: 0; + + svg { + margin: 0 auto; + } + + &:hover, + &:focus { + background-color: $white-light; + } + + &.active { + background-color: $white-light; + border-top-color: $white-dark; + border-bottom-color: $white-dark; + + &::after { + content: ''; + position: absolute; + right: -1px; + top: 0; + bottom: 0; + width: 1px; + background: $white-light; + } + } +} + +.ide-activity-bar { + position: relative; + flex: 0 0 60px; } .ide-commit-message-field {