Skip to content

Commit a7a7081

Browse files
authored
feat(openscd): Move progress indicator beneath plugin tabs (openscd#1181)
Move progress indicator beneath plugin tabs, closes openscd#1178
1 parent a238cc9 commit a7a7081

File tree

8 files changed

+23
-104
lines changed

8 files changed

+23
-104
lines changed

package-lock.json

Lines changed: 0 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"module": "open-scd.js",
1818
"type": "module",
1919
"dependencies": {
20-
"@material/mwc-circular-progress-four-color": "0.22.1",
2120
"@material/mwc-dialog": "0.22.1",
2221
"@material/mwc-drawer": "0.22.1",
2322
"@material/mwc-fab": "0.22.1",

src/Hosting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export function Hosting<
286286
wrapFocus
287287
@action=${(ae: CustomEvent<ActionDetail>) => {
288288
//FIXME: dirty hack to be fixed in open-scd-core
289-
// if clause not neccassary when oscd... compenents in open-scd not list
289+
// if clause not necessary when oscd... components in open-scd not list
290290
if (ae.target instanceof List)
291291
(<MenuItem>(
292292
this.menu.filter(

src/Waiting.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { html, property, TemplateResult } from 'lit-element';
22

3-
import '@material/mwc-circular-progress-four-color';
3+
import '@material/mwc-linear-progress';
44

55
import {
66
LitElementConstructor,
@@ -41,10 +41,10 @@ export function Waiting<TBase extends LitElementConstructor>(Base: TBase) {
4141

4242
render(): TemplateResult {
4343
return html`${ifImplemented(super.render())}
44-
<mwc-circular-progress-four-color
44+
<mwc-linear-progress
4545
.closed=${!this.waiting}
4646
indeterminate
47-
></mwc-circular-progress-four-color>`;
47+
></mwc-linear-progress>`;
4848
}
4949
}
5050

src/open-scd.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import { Wizarding } from './Wizarding.js';
2323
/** The `<open-scd>` custom element is the main entry point of the
2424
* Open Substation Configuration Designer. */
2525
@customElement('open-scd')
26-
export class OpenSCD extends Hosting(
27-
Setting(Wizarding(Waiting(Plugging(Editing(Logging(LitElement))))))
26+
export class OpenSCD extends Waiting(
27+
Hosting(Setting(Wizarding(Plugging(Editing(Logging(LitElement))))))
2828
) {
2929
private currentSrc = '';
3030
/** The current file's URL. `blob:` URLs are *revoked after parsing*! */
@@ -119,15 +119,21 @@ export class OpenSCD extends Hosting(
119119
margin-top: 16px;
120120
}
121121
122-
mwc-circular-progress-four-color {
122+
mwc-linear-progress {
123123
position: fixed;
124-
top: 50%;
125-
left: 50%;
126-
transform: translate(-50%, -50%);
127-
z-index: 99;
124+
--mdc-theme-primary: var(--mdc-theme-secondary);
125+
left: 0px;
126+
top: 112px;
127+
width: 100%;
128128
pointer-events: none;
129129
}
130130
131+
@media (max-width: 599px) {
132+
mwc-linear-progress {
133+
top: 104px;
134+
}
135+
}
136+
131137
tt {
132138
font-family: 'Roboto Mono', monospace;
133139
font-weight: 300;

src/themes.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ export function getTheme(theme: Settings['theme']): TemplateResult {
3737
3838
--mdc-dialog-heading-ink-color: var(--base00);
3939
40-
--mdc-circular-progress-bar-color-1: var(--mdc-theme-primary);
41-
--mdc-circular-progress-bar-color-2: var(--mdc-theme-on-background);
42-
--mdc-circular-progress-bar-color-3: var(--mdc-theme-secondary);
43-
--mdc-circular-progress-bar-color-4: var(--mdc-theme-on-background);
44-
4540
--mdc-icon-font: 'Material Icons Outlined';
4641
}
4742

test/integration/__snapshots__/open-scd.test.snap.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,13 +1200,6 @@ snapshots["open-scd looks like its snapshot"] =
12001200
>
12011201
</mwc-button>
12021202
</mwc-dialog>
1203-
<mwc-circular-progress-four-color
1204-
closed=""
1205-
density="0"
1206-
indeterminate=""
1207-
progress="0"
1208-
>
1209-
</mwc-circular-progress-four-color>
12101203
<wizard-dialog>
12111204
</wizard-dialog>
12121205
<mwc-dialog
@@ -1380,6 +1373,11 @@ snapshots["open-scd looks like its snapshot"] =
13801373
Save
13811374
</mwc-button>
13821375
</mwc-dialog>
1376+
<mwc-linear-progress
1377+
closed=""
1378+
indeterminate=""
1379+
>
1380+
</mwc-linear-progress>
13831381
`;
13841382
/* end snapshot open-scd looks like its snapshot */
13851383

test/integration/open-scd.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('open-scd', () => {
6161

6262
it('renders a progress indicator on `waiting`', async () => {
6363
const progressBar = element.shadowRoot!.querySelector(
64-
'mwc-circular-progress-four-color[indeterminate]'
64+
'mwc-linear-progress[indeterminate]'
6565
);
6666
expect(progressBar).property('closed').to.be.true;
6767
element.waiting = true;

0 commit comments

Comments
 (0)