Skip to content

Commit

Permalink
feat(core/application): app switch (#1007)
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Maurer <lukas.maurer@siemens.com>
  • Loading branch information
danielleroux and nuke-ellington committed Jan 10, 2024
1 parent 9ba9823 commit 3298e87
Show file tree
Hide file tree
Showing 229 changed files with 10,392 additions and 2,141 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-pages-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Deploy to GitHub Pages (DEV Version)

on:
workflow_dispatch:
schedule:
- cron: '0 6 * * 1-4'

permissions:
contents: write
Expand Down
25 changes: 25 additions & 0 deletions packages/angular-test-app/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import { RouterModule, Routes } from '@angular/router';
import AboutAndLegal from 'src/preview-examples/about-and-legal';
import ActionCard from 'src/preview-examples/action-card';
import AGGrid from 'src/preview-examples/aggrid';
import ApplicationExample from 'src/preview-examples/application';
import ApplicationAppSwitchExample from 'src/preview-examples/application-app-switch';
import ApplicationBreakpointExample from 'src/preview-examples/application-breakpoints';
import ApplicationHeaderExample from 'src/preview-examples/application-header';
import BasicNavigation from 'src/preview-examples/basic-navigation';
import BasicNavigationWithOutHeader from 'src/preview-examples/basic-navigation-without-header';
import Blind from 'src/preview-examples/blind';
Expand All @@ -28,6 +32,7 @@ import CategoryFilterSuggestions from 'src/preview-examples/category-filter-sugg
import Checkbox from 'src/preview-examples/checkbox';
import CheckboxIndeterminate from 'src/preview-examples/checkbox-indeterminate';
import Chip from 'src/preview-examples/chip';
import ContentExample from 'src/preview-examples/content';
import PageHeader from 'src/preview-examples/content-header';
import PageHeaderNoBack from 'src/preview-examples/content-header-no-back';
import DateDropdown from 'src/preview-examples/date-dropdown';
Expand Down Expand Up @@ -160,6 +165,26 @@ const routes: Routes = [
{
path: 'preview',
children: [
{
path: 'application',
component: ApplicationExample,
},
{
path: 'application-breakpoints',
component: ApplicationBreakpointExample,
},
{
path: 'application-app-switch',
component: ApplicationAppSwitchExample,
},
{
path: 'application-header',
component: ApplicationHeaderExample,
},
{
path: 'content',
component: ContentExample,
},
{
path: 'buttons',
component: Buttons,
Expand Down
10 changes: 10 additions & 0 deletions packages/angular-test-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import { AgGridModule } from 'ag-grid-angular';
import AboutAndLegal from 'src/preview-examples/about-and-legal';
import ActionCard from 'src/preview-examples/action-card';
import AGGrid from 'src/preview-examples/aggrid';
import ApplicationExample from 'src/preview-examples/application';
import ApplicationAppSwitchExample from 'src/preview-examples/application-app-switch';
import ApplicationBreakpointExample from 'src/preview-examples/application-breakpoints';
import ApplicationHeaderExample from 'src/preview-examples/application-header';
import BasicNavigation from 'src/preview-examples/basic-navigation';
import BasicNavigationWithOutHeader from 'src/preview-examples/basic-navigation-without-header';
import Blind from 'src/preview-examples/blind';
Expand All @@ -35,6 +39,7 @@ import CategoryFilterSuggestions from 'src/preview-examples/category-filter-sugg
import Checkbox from 'src/preview-examples/checkbox';
import CheckboxIndeterminate from 'src/preview-examples/checkbox-indeterminate';
import Chip from 'src/preview-examples/chip';
import ContentExample from 'src/preview-examples/content';
import ContentHeader from 'src/preview-examples/content-header';
import ContentHeaderNoBack from 'src/preview-examples/content-header-no-back';
import DateDropdown from 'src/preview-examples/date-dropdown';
Expand Down Expand Up @@ -142,7 +147,12 @@ import { NavigationTestComponent } from './components/navigation-test.component'

@NgModule({
declarations: [
ApplicationExample,
ApplicationBreakpointExample,
ApplicationAppSwitchExample,
ApplicationHeaderExample,
AppComponent,
ContentExample,
Buttons,
ButtonGroup,
AGGrid,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<ix-application>
<ix-application-header>
<div class="placeholder-logo" slot="logo"></div>
</ix-application-header>
<ix-menu #menu>
<ix-menu-about>
<ix-menu-about-item label="Tab 1">Content 1</ix-menu-about-item>
<ix-menu-about-item label="Tab 2">Content 2</ix-menu-about-item>
</ix-menu-about>
</ix-menu>
</ix-application>
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,7 @@ import { AfterViewInit, Component, ElementRef, ViewChild } from '@angular/core';

@Component({
selector: 'app-example',
template: `
<ix-basic-navigation>
<div class="placeholder-logo" slot="logo"></div>
<ix-menu #menu>
<ix-menu-about>
<ix-menu-about-item label="Tab 1">Content 1</ix-menu-about-item>
<ix-menu-about-item label="Tab 2">Content 2</ix-menu-about-item>
</ix-menu-about>
</ix-menu>
</ix-basic-navigation>
`,
templateUrl: './about-and-legal.html',
})
export default class AboutAndLegal implements AfterViewInit {
@ViewChild('menu', { read: ElementRef })
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<ix-application [appSwitchConfig]="appSwitchConfig">
<ix-application-header name="My Application">
<div class="placeholder-logo" slot="logo"></div>
</ix-application-header>
<ix-menu>
<ix-menu-item>Item 1</ix-menu-item>
<ix-menu-item>Item 2</ix-menu-item>
</ix-menu>

<ix-content>
<ix-content-header
slot="header"
header-title="My Content Page"
>
</ix-content-header>
</ix-content>
</ix-application>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* SPDX-FileCopyrightText: 2023 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import { Component } from '@angular/core';
import { AppSwitchConfiguration } from '@siemens/ix';

@Component({
selector: 'app-example',
templateUrl: './application-app-switch.html',
})
export default class ApplicationAppSwitchExample {
appSwitchConfig: AppSwitchConfiguration = {
i18nAppSwitch: 'Switch to Application',
currentAppId: 'demo-app-2',
apps: [
{
id: 'demo-app-1',
name: 'Floor App',
iconSrc: 'https://www.svgrepo.com/show/530661/genetic-data.svg',
url: 'https://ix.siemens.io/',
description: 'Example description for floor app',
target: '_self',
},
{
id: 'demo-app-2',
name: 'Calculator App',
iconSrc: 'https://www.svgrepo.com/show/530661/genetic-data.svg',
url: 'https://ix.siemens.io/',
description: 'Example description for floor app',
target: '_self',
},
],
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<ix-application application-name="Application name" [breakpoints]="breakpoints">
<ix-application-header name="My Application">
<div class="placeholder-logo" slot="logo"></div>

<ix-dropdown-button variant="secondary" label="Select config" ghost>
<ix-dropdown-item label="Config 1"></ix-dropdown-item>
<ix-dropdown-item label="Config 2"></ix-dropdown-item>
<ix-dropdown-item label="Config 3"></ix-dropdown-item>
</ix-dropdown-button>

<ix-avatar>
<ix-dropdown-item label="Action 1"></ix-dropdown-item>
<ix-dropdown-item label="Action 2"></ix-dropdown-item>
<ix-dropdown-item label="Action 3"></ix-dropdown-item>
</ix-avatar>
</ix-application-header>

<ix-menu>
<ix-menu-item>Item 1</ix-menu-item>
<ix-menu-item>Item 2</ix-menu-item>
</ix-menu>
<ix-content>
<ix-content-header
slot="header"
header-title="Choose breakpoint"
>
</ix-content-header>

<input id="small" type="radio" name="layout" value="sm" (change)="onCheckedChange('sm')" />
<label for="small">Small</label>

<input id="medium" type="radio" name="layout" value="md" (change)="onCheckedChange('md')" checked />
<label for="medium">Medium</label>

<input id="large" type="radio" name="layout" value="lg" (change)="onCheckedChange('lg')" />
<label for="large">Large</label>
</ix-content>
</ix-application>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* SPDX-FileCopyrightText: 2023 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { Component } from '@angular/core';
import { Breakpoint } from '@siemens/ix';

@Component({
selector: 'app-example',
templateUrl: './application-breakpoints.html',
})
export default class ApplicationBreakpointExample {
breakpoints: Breakpoint[] = ['md'];

onCheckedChange(breakpoint: Breakpoint) {
this.breakpoints = [breakpoint];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<ix-application-header name="My Application">
<div class="placeholder-logo" slot="logo"></div>

<ix-icon-button ghost icon="checkboxes"></ix-icon-button>
<ix-icon-button ghost icon="checkboxes"></ix-icon-button>
<ix-icon-button ghost icon="checkboxes"></ix-icon-button>

<ix-dropdown-button variant="secondary" label="Select config" ghost>
<ix-dropdown-item label="Config 1"></ix-dropdown-item>
<ix-dropdown-item label="Config 2"></ix-dropdown-item>
<ix-dropdown-item label="Config 3"></ix-dropdown-item>
</ix-dropdown-button>

<ix-avatar>
<ix-dropdown-item label="Action 1"></ix-dropdown-item>
<ix-dropdown-item label="Action 2"></ix-dropdown-item>
<ix-dropdown-item label="Action 3"></ix-dropdown-item>
</ix-avatar>
</ix-application-header>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2023 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import { Component } from '@angular/core';

@Component({
selector: 'app-example',
templateUrl: './application-header.html',
})
export default class ApplicationHeaderExample {}
17 changes: 17 additions & 0 deletions packages/angular-test-app/src/preview-examples/application.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<ix-application>
<ix-application-header name="My Application">
<div class="placeholder-logo" slot="logo"></div>
</ix-application-header>
<ix-menu>
<ix-menu-item>Item 1</ix-menu-item>
<ix-menu-item>Item 2</ix-menu-item>
</ix-menu>

<ix-content>
<ix-content-header
slot="header"
header-title="My Content Page"
>
</ix-content-header>
</ix-content>
</ix-application>
16 changes: 16 additions & 0 deletions packages/angular-test-app/src/preview-examples/application.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2023 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import { Component } from '@angular/core';

@Component({
selector: 'app-example',
templateUrl: './application.html',
})
export default class ApplicationExample {}
13 changes: 13 additions & 0 deletions packages/angular-test-app/src/preview-examples/content.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<ix-content>
<ix-content-header slot="header" header-title="My Content Page">
</ix-content-header>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua. At vero eos et accusam et justo duo dolores et ea
rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
ipsum dolor sit amet.
</ix-content>
16 changes: 16 additions & 0 deletions packages/angular-test-app/src/preview-examples/content.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: 2023 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

import { Component } from '@angular/core';

@Component({
selector: 'app-example',
templateUrl: './content.html',
})
export default class ContentExample {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ix-basic-navigation>
<ix-application>
<ix-menu>
<ix-menu-item home icon="home">Home</ix-menu-item>
<ix-menu-item icon="globe">Normal Tab</ix-menu-item>
Expand All @@ -7,4 +7,4 @@
<ix-menu-item icon="globe">Nested Tab</ix-menu-item>
</ix-menu-category>
</ix-menu>
</ix-basic-navigation>
</ix-application>
13 changes: 13 additions & 0 deletions packages/angular-test-app/src/preview-examples/popover-news.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<ix-application>
<ix-application-header>
<div class="placeholder-logo" slot="logo"></div>
</ix-application-header>
<ix-menu>
<ix-menu-about>
<ix-menu-about-item label="Example"> </ix-menu-about-item>
</ix-menu-about>
<ix-menu-about-news label="Test" show about-item-label="Example">
Test
</ix-menu-about-news>
</ix-menu>
</ix-application>
14 changes: 1 addition & 13 deletions packages/angular-test-app/src/preview-examples/popover-news.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@ import { Component } from '@angular/core';

@Component({
selector: 'app-example',
template: `
<ix-basic-navigation>
<div class="placeholder-logo" slot="logo"></div>
<ix-menu>
<ix-menu-about>
<ix-menu-about-item label="Example"> </ix-menu-about-item>
</ix-menu-about>
<ix-menu-about-news label="Test" show about-item-label="Example">
Test
</ix-menu-about-news>
</ix-menu>
</ix-basic-navigation>
`,
templateUrl: './popover-news.html',
})
export default class PopoverNews {}
Loading

0 comments on commit 3298e87

Please sign in to comment.