Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 18:08:38 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-20 18:08:38 +0300
commit93b6ee78bf98cbc42712b7c5486ab0e78adb339f (patch)
tree29efc441f06368d2ec05196fcba070ee37c765b7 /app
parent96add3eb957ee4256910087070e27850dd61cfe9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status.vue6
-rw-r--r--app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/image_list_row.vue2
-rw-r--r--app/assets/stylesheets/framework/variables.scss2
-rw-r--r--app/models/deploy_key.rb4
-rw-r--r--app/services/system_note_service.rb12
-rw-r--r--app/services/system_notes/issuables_service.rb41
-rw-r--r--app/services/work_items/parent_links/create_service.rb4
-rw-r--r--app/services/work_items/parent_links/destroy_service.rb4
8 files changed, 63 insertions, 12 deletions
diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status.vue b/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status.vue
index bfa99c01c3f..ce221a274c9 100644
--- a/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status.vue
+++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/cleanup_status.vue
@@ -60,7 +60,7 @@ export default {
return this.$options.i18n[`CLEANUP_STATUS_${this.status}`];
},
calculatedTimeTilNextRun() {
- return timeTilRun(this.expirationPolicy?.next_run);
+ return timeTilRun(this.expirationPolicy?.next_run_at);
},
expireIconName() {
return this.failedDelete ? 'expire' : 'clock';
@@ -90,9 +90,9 @@ export default {
{{ statusText }}
</span>
<gl-icon
- v-if="failedDelete"
+ v-if="failedDelete && calculatedTimeTilNextRun"
:id="iconId"
- :size="14"
+ :size="16"
class="gl-text-gray-500"
data-testid="extra-info"
name="information-o"
diff --git a/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/image_list_row.vue b/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/image_list_row.vue
index aecc0bf92ea..80bca536b7c 100644
--- a/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/image_list_row.vue
+++ b/app/assets/javascripts/packages_and_registries/container_registry/explorer/components/list_page/image_list_row.vue
@@ -95,7 +95,7 @@ export default {
if (this.showFullPath) {
return this.item.path;
}
- const projectPath = this.item?.project?.path ?? '';
+ const projectPath = this.item?.project?.path?.toLowerCase() ?? '';
if (this.item.name) {
return joinPaths(projectPath, this.item.name);
}
diff --git a/app/assets/stylesheets/framework/variables.scss b/app/assets/stylesheets/framework/variables.scss
index 1e921b4234e..03dfd0397b0 100644
--- a/app/assets/stylesheets/framework/variables.scss
+++ b/app/assets/stylesheets/framework/variables.scss
@@ -880,8 +880,6 @@ $image-comment-cursor-top-offset: 12;
Security & Compliance Carousel
*/
$security-and-compliance-carousel-image-carousel-width: 1000px;
-$security-and-compliance-carousel-image-discover-button-width: 45%;
-$security-and-compliance-carousel-image-discover-buttons-max-width: 280px;
$security-and-compliance-carousel-image-discover-footer-max-width: 500px;
$security-and-compliance-carousel-image-discover-text-carousel-max-width: 650px;
$security-and-compliance-carousel-image-discover-text-carousel-caption-height: 100%;
diff --git a/app/models/deploy_key.rb b/app/models/deploy_key.rb
index 4ed38f578ee..f9acd398374 100644
--- a/app/models/deploy_key.rb
+++ b/app/models/deploy_key.rb
@@ -40,6 +40,10 @@ class DeployKey < Key
super || User.ghost
end
+ def audit_details
+ title
+ end
+
def has_access_to?(project)
deploy_keys_project_for(project).present?
end
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb
index d7e4b53b5de..0a3a0ca00b5 100644
--- a/app/services/system_note_service.rb
+++ b/app/services/system_note_service.rb
@@ -280,6 +280,18 @@ module SystemNoteService
::SystemNotes::IssuablesService.new(noteable: mentioned).cross_reference_disallowed?(mentioned_in)
end
+ def relate_work_item(noteable, work_item, user)
+ ::SystemNotes::IssuablesService
+ .new(noteable: noteable, project: noteable.project, author: user)
+ .hierarchy_changed(work_item, 'relate')
+ end
+
+ def unrelate_work_item(noteable, work_item, user)
+ ::SystemNotes::IssuablesService
+ .new(noteable: noteable, project: noteable.project, author: user)
+ .hierarchy_changed(work_item, 'unrelate')
+ end
+
def zoom_link_added(issue, project, author)
::SystemNotes::ZoomService.new(noteable: issue, project: project, author: author).zoom_link_added
end
diff --git a/app/services/system_notes/issuables_service.rb b/app/services/system_notes/issuables_service.rb
index f9e5c3725d8..8da316987b1 100644
--- a/app/services/system_notes/issuables_service.rb
+++ b/app/services/system_notes/issuables_service.rb
@@ -178,6 +178,24 @@ module SystemNotes
create_note(NoteSummary.new(noteable, project, author, body, action: 'title'))
end
+ # Called when the hierarchy of a work item is changed
+ #
+ # noteable - Noteable object that responds to `work_item_parent` and `work_item_children`
+ # project - Project owning noteable
+ # author - User performing the change
+ #
+ # Example Note text:
+ #
+ # "added #1 as child Task"
+ #
+ # Returns the created Note object
+ def hierarchy_changed(work_item, action)
+ params = hierarchy_note_params(action, noteable, work_item)
+
+ create_note(NoteSummary.new(noteable, project, author, params[:parent_note_body], action: params[:parent_action]))
+ create_note(NoteSummary.new(work_item, project, author, params[:child_note_body], action: params[:child_action]))
+ end
+
# Called when the description of a Noteable is changed
#
# noteable - Noteable object that responds to `description`
@@ -506,6 +524,29 @@ module SystemNotes
def track_cross_reference_action
issue_activity_counter.track_issue_cross_referenced_action(author: author) if noteable.is_a?(Issue)
end
+
+ def hierarchy_note_params(action, parent, child)
+ return {} unless child && parent
+
+ child_type = child.issue_type.humanize(capitalize: false)
+ parent_type = parent.issue_type.humanize(capitalize: false)
+
+ if action == 'relate'
+ {
+ parent_note_body: "added #{child.to_reference} as child #{child_type}",
+ child_note_body: "added #{parent.to_reference} as parent #{parent_type}",
+ parent_action: 'relate_to_child',
+ child_action: 'relate_to_parent'
+ }
+ else
+ {
+ parent_note_body: "removed child #{child_type} #{child.to_reference}",
+ child_note_body: "removed parent #{parent_type} #{parent.to_reference}",
+ parent_action: 'unrelate_from_child',
+ child_action: 'unrelate_from_parent'
+ }
+ end
+ end
end
end
diff --git a/app/services/work_items/parent_links/create_service.rb b/app/services/work_items/parent_links/create_service.rb
index 9940776e367..e7906f1fcdd 100644
--- a/app/services/work_items/parent_links/create_service.rb
+++ b/app/services/work_items/parent_links/create_service.rb
@@ -41,10 +41,8 @@ module WorkItems
params[:issuable_references]
end
- # TODO: Create system notes when work item's parent or children are updated
- # See https://gitlab.com/gitlab-org/gitlab/-/issues/362213
def create_notes(work_item)
- # no-op
+ SystemNoteService.relate_work_item(issuable, work_item, current_user)
end
def target_issuable_type
diff --git a/app/services/work_items/parent_links/destroy_service.rb b/app/services/work_items/parent_links/destroy_service.rb
index 55870d44db9..19770b3e4b5 100644
--- a/app/services/work_items/parent_links/destroy_service.rb
+++ b/app/services/work_items/parent_links/destroy_service.rb
@@ -14,10 +14,8 @@ module WorkItems
private
- # TODO: Create system notes when work item's parent or children are removed
- # See https://gitlab.com/gitlab-org/gitlab/-/issues/362213
def create_notes
- # no-op
+ SystemNoteService.unrelate_work_item(parent, child, current_user)
end
def not_found_message