Revert "Add UI element to display messages of the day"

This reverts commit 1fbf53df60.

The message of the day functionality is still heavily depended on
components of Gerrit core. It is planned to move this functionality
completely to the plugin. Since it was not usable with the new UI for
a long while, the functionality will be removed completely until
then.

Change-Id: I7a1a0470932a0ba6275a54a4bc52b34237a219eb
This commit is contained in:
Thomas Draebing
2020-02-03 15:29:06 +01:00
parent 5623d66a99
commit 265559f5ad
5 changed files with 0 additions and 164 deletions

View File

@@ -1,41 +0,0 @@
<!--
@license
Copyright (C) 2020 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<link rel="import" href="../../../bower_components/polymer/polymer.html">
<link rel="import" href="../../shared/gr-button/gr-button.html">
<dom-module id="gr-message-header">
<template>
<style include="shared-styles">
#container {
background-color: lightyellow;
display: flex;
height: fit-content;
justify-content: space-between;
padding: 1em;
}
</style>
<div id="container" hidden$="[[_hidden]]">
<div id="message"></div>
<gr-button id="dismissMessageBtn"
link
on-tap="_handleDismissMessage">Dismiss</gr-button>
</div>
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
</template>
<script src="../../../scripts/util.js"></script>
<script src="gr-message-header.js"></script>
</dom-module>

View File

@@ -1,52 +0,0 @@
/**
* @license
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function() {
'use strict';
Polymer({
is: 'gr-message-header',
properties: {
message: {
type: Object,
reflectToAttribute: true,
},
_hidden: {
type: Boolean,
value: true,
},
},
attached() {
if (!this.message || !this.message.html) {
return;
}
this._isHidden();
this.$.message.innerHTML = this.message.html;
},
_handleDismissMessage() {
document.cookie =
`msg-${this.message.id}=1; expires=${this.message.redisplay}`;
this._hidden = true;
},
_isHidden() {
this._hidden = window.util.getCookie(`msg-${this.message.id}`) === '1';
},
});
})();

View File

@@ -1,60 +0,0 @@
<!DOCTYPE html>
<!--
@license
Copyright (C) 2020 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>gr-message-header</title>
<script src="../../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<script src="../../../bower_components/web-component-tester/browser.js"></script>
<link rel="import" href="../../../test/common-test-setup.html"/>
<link rel="import" href="gr-message-header.html">
<script>void(0);</script>
<test-fixture id="basic">
<template>
<gr-message-header></gr-message-header>
</template>
</test-fixture>
<script>
suite('gr-message-header tests', () => {
let element;
setup(() => {
element = fixture('basic');
});
test('show message', () => {
element.message = {html: 'This is a test message.'};
element.attached();
assert.equal(element.$.message.innerHTML, element.message.html);
});
test('hide message on dismiss', () => {
element.message = {html: 'This is a test message.', id: 'test'};
element.attached();
MockInteractions.tap(element.$.dismissMessageBtn);
assert.isTrue(element.$.container.hidden);
assert.isTrue(document.cookie.includes('msg-test=1'));
element.attached();
assert.isTrue(element.$.container.hidden);
});
});
</script>

View File

@@ -59,7 +59,6 @@ limitations under the License.
<link rel="import" href="./core/gr-error-manager/gr-error-manager.html">
<link rel="import" href="./core/gr-keyboard-shortcuts-dialog/gr-keyboard-shortcuts-dialog.html">
<link rel="import" href="./core/gr-main-header/gr-main-header.html">
<link rel="import" href="./core/gr-message-header/gr-message-header.html">
<link rel="import" href="./core/gr-navigation/gr-navigation.html">
<link rel="import" href="./core/gr-reporting/gr-reporting.html">
<link rel="import" href="./core/gr-router/gr-router.html">
@@ -165,12 +164,6 @@ limitations under the License.
on-mobile-search="_mobileSearchToggle">
</gr-main-header>
</gr-fixed-panel>
<template
is="dom-repeat"
items="[[_getMessages(_serverConfig)]]"
as="message">
<gr-message-header message="{{message}}"></gr-message-header>
</template>
<main>
<gr-smart-search
id="search"

View File

@@ -341,10 +341,6 @@
this.$.header.unfloat();
},
_getMessages(config) {
return config.messages ? config.messages : [];
},
_handlePageError(e) {
const props = [
'_showChangeListView',