Footer: Single footer component for both react & angular pages (#21389)

* Footer: Single footer implementation for both react & angular pages

* Export type

* Updates

* Use footer links in help menu

* Updates & Fixes

* Updated snapshot

* updated snapshot
This commit is contained in:
Torkel Ödegaard
2020-01-09 11:25:52 +01:00
committed by GitHub
parent 3866f609ce
commit 91ea3b15fa
40 changed files with 209 additions and 239 deletions

View File

@@ -1,29 +0,0 @@
import config from 'app/core/config';
import { BackendSrv } from 'app/core/services/backend_srv';
import { NavModelSrv } from 'app/core/core';
export default class StyleGuideCtrl {
theme: string;
buttonNames = ['primary', 'secondary', 'inverse', 'success', 'warning', 'danger'];
buttonSizes = ['btn-small', '', 'btn-large'];
buttonVariants = ['-'];
navModel: any;
/** @ngInject */
constructor(private $routeParams: any, private backendSrv: BackendSrv, navModelSrv: NavModelSrv) {
this.navModel = navModelSrv.getNav('admin', 'styleguide', 0);
this.theme = config.bootData.user.lightTheme ? 'light' : 'dark';
}
switchTheme() {
this.$routeParams.theme = this.theme === 'dark' ? 'light' : 'dark';
const cmd = {
theme: this.$routeParams.theme,
};
this.backendSrv.put('/api/user/preferences', cmd).then(() => {
window.location.href = window.location.href;
});
}
}

View File

@@ -159,14 +159,15 @@ exports[`ServerStats Should render table with stats 1`] = `
<ul>
<li>
<a
href="http://docs.grafana.org"
href="https://grafana.com/docs/grafana/latest/?utm_source=grafana_footer"
rel="noopener"
target="_blank"
>
<i
className="fa fa-file-code-o"
/>
Docs
Docs
</a>
</li>
<li>
@@ -178,19 +179,21 @@ exports[`ServerStats Should render table with stats 1`] = `
<i
className="fa fa-support"
/>
Support & Enterprise
Support & Enterprise
</a>
</li>
<li>
<a
href="https://community.grafana.com/"
href="https://community.grafana.com/?utm_source=grafana_footer"
rel="noopener"
target="_blank"
>
<i
className="fa fa-comments-o"
/>
Community
Community
</a>
</li>
<li>
@@ -199,16 +202,10 @@ exports[`ServerStats Should render table with stats 1`] = `
rel="noopener"
target="_blank"
>
Grafana
<i />
Grafana vv1.0 (commit: 1)
</a>
<span>
v
v1.0
(commit:
1
)
</span>
</li>
</ul>
</div>

View File

@@ -2,7 +2,6 @@ import AdminListUsersCtrl from './AdminListUsersCtrl';
import AdminEditUserCtrl from './AdminEditUserCtrl';
import AdminListOrgsCtrl from './AdminListOrgsCtrl';
import AdminEditOrgCtrl from './AdminEditOrgCtrl';
import StyleGuideCtrl from './StyleGuideCtrl';
import coreModule from 'app/core/core_module';
import { NavModelSrv } from 'app/core/core';
@@ -21,4 +20,3 @@ coreModule.controller('AdminEditUserCtrl', AdminEditUserCtrl);
coreModule.controller('AdminListOrgsCtrl', AdminListOrgsCtrl);
coreModule.controller('AdminEditOrgCtrl', AdminEditOrgCtrl);
coreModule.controller('AdminHomeCtrl', AdminHomeCtrl);
coreModule.controller('StyleGuideCtrl', StyleGuideCtrl);

View File

@@ -9,3 +9,4 @@
</div>
<footer />

View File

@@ -42,3 +42,5 @@
</tr>
</table>
</div>
<footer />

View File

@@ -181,3 +181,5 @@
</div>
</div>
</div>
<footer />

View File

@@ -28,3 +28,5 @@
</div>
</form>
</div>
<footer />

View File

@@ -37,3 +37,5 @@
</tbody>
</table>
</div>
<footer />

View File

@@ -76,3 +76,5 @@
</ol>
</div>
</div>
<footer />

View File

@@ -75,3 +75,5 @@
</div>
</form>
</div>
<footer />

View File

@@ -57,3 +57,5 @@
/>
</div>
</div>
<footer />

View File

@@ -32,3 +32,5 @@
</form>
</div>
<footer />

View File

@@ -1,5 +1,7 @@
<page-header ng-if="ctrl.navModel" model="ctrl.navModel"></page-header>
<div class="page-container page-body">
<manage-dashboards ng-if="ctrl.folderId && ctrl.uid" folder-id="ctrl.folderId" folder-uid="ctrl.uid" />
<manage-dashboards ng-if="ctrl.folderId && ctrl.uid" folder-id="ctrl.folderId" folder-uid="ctrl.uid" />
</div>
<footer />

View File

@@ -157,3 +157,5 @@
</div>
</div>
<footer />

View File

@@ -3,3 +3,5 @@
<div class="page-container page-body">
<manage-dashboards />
</div>
<footer />

View File

@@ -34,3 +34,5 @@
</table>
</div>
<footer />

View File

@@ -20,3 +20,5 @@
</div>
</form>
</div>
<footer />

View File

@@ -24,3 +24,4 @@
</div>
<footer />

View File

@@ -100,3 +100,5 @@
<a class="btn-text" ng-click="ctrl.backToList()">Cancel</a>
</div>
</div>
<footer />

View File

@@ -57,10 +57,12 @@
title="'There are no playlists created yet'"
buttonIcon="'fa fa-plus'"
buttonLink="'playlists/create'"
buttonTitle="'Create Playlist'"
buttonTitle="'Create Playlist'"
proTip="'You can use playlists to cycle dashboards on TVs without user control'"
proTipLink="'http://docs.grafana.org/reference/playlist/'"
proTipLink="'http://docs.grafana.org/reference/playlist/'"
proTipLinkTitle="'Learn more'"
proTipTarget="'_blank'" />
</div>
</div>
<footer />

View File

@@ -8,3 +8,5 @@
</div>
</div>
</div>
<footer />

View File

@@ -32,3 +32,5 @@
</table>
</div>
</div>
<footer />