Skip to content

Commit

Permalink
Merge pull request #294 from Inchoo/feature/#239-fastly-version-ui-an…
Browse files Browse the repository at this point in the history
…d-generated-vcl-view

Changed VCL version history action icons
  • Loading branch information
vvuksan authored Jul 18, 2019
2 parents 1b9586b + 5aa786f commit 296cb78
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
24 changes: 24 additions & 0 deletions view/adminhtml/templates/system/config/dialogs.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2500,6 +2500,30 @@ $isFastlyEnabled = $block->getConfig()->isFastlyEnabled();
font-size: 2rem;
}

.admin__control-table .fastly-activate-vcl-action {
background-image: url("<?php /* @noEscape */ echo $block->getViewFileUrl('Fastly_Cdn::images/cloud.svg') ?>");
width: 2.5rem;
height: 2.5rem;
background-color: transparent;
border-color: transparent;
box-shadow: none;
padding-left: 0;
padding-right: 0;
background-repeat: no-repeat;
}

.admin__control-table .fastly-view-vcl-action {
background-image: url("<?php /* @noEscape */ echo $block->getViewFileUrl('Fastly_Cdn::images/view.svg') ?>");
width: 2.5rem;
height: 2.5rem;
background-color: transparent;
border-color: transparent;
box-shadow: none;
padding-left: 0;
padding-right: 0;
background-repeat: no-repeat;
}

.dialog-item {
border: none;
background-color: transparent;
Expand Down
1 change: 1 addition & 0 deletions view/adminhtml/web/images/cloud.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions view/adminhtml/web/images/view.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions view/adminhtml/web/js/version-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ define([
let text = document.createTextNode('Activated');
let span = document.createElement('span');
let button = document.createElement('button');
button.setAttribute('class', 'action-delete fastly-save-action activate-action');
button.setAttribute('class', 'fastly-activate-vcl-action activate-action');
button.setAttribute('id', 'action_version_' + response.old_version);
button.setAttribute('title', 'Activate');
button.setAttribute('data-version-number', response.old_version);
Expand Down Expand Up @@ -260,7 +260,7 @@ define([
let span = document.createElement('span');

let showVCLButton = document.createElement('button');
showVCLButton.setAttribute('class', 'action-delete fastly-edit-active-modules-icon show-VCL-action');
showVCLButton.setAttribute('class', 'fastly-view-vcl-action show-vcl-action');
showVCLButton.setAttribute('id', 'action_show_VCL_' + version.number);
showVCLButton.setAttribute('title', 'Show VCL');
showVCLButton.setAttribute('data-version-number', version.number);
Expand All @@ -273,7 +273,7 @@ define([
actionCell.setAttribute('id', 'action_cell_' + version.number);
if (active_version !== version.number) {
button = document.createElement('button');
button.setAttribute('class', 'action-delete fastly-save-action activate-action');
button.setAttribute('class', 'fastly-activate-vcl-action activate-action');
button.setAttribute('id', 'action_version_' + version.number);
button.setAttribute('title', 'Activate');
button.setAttribute('data-version-number', version.number);
Expand Down Expand Up @@ -347,7 +347,7 @@ define([
/**
* Activate version
*/
$('body').on('click', 'button.fastly-save-action', function () {
$('body').on('click', 'button.activate-action', function () {
resetAllMessages();
let version_number = $(this).data('version-number');
confirm({
Expand All @@ -366,7 +366,7 @@ define([
/**
* Show versions's VCL
*/
$('body').on('click', 'button.fastly-edit-active-modules-icon', function () {
$('body').on('click', 'button.show-vcl-action', function () {
resetAllMessages();
let version_number = $(this).data('version-number');
overlay(showVCLOptions);
Expand Down

0 comments on commit 296cb78

Please sign in to comment.