Skip to content

Commit 0ca4592

Browse files
authored
Merge pull request #3 from fleetbase/dev-v0.0.3
v0.0.3
2 parents 27bd16a + 0bf8aef commit 0ca4592

File tree

91 files changed

+2142
-118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2142
-118
lines changed

.eslintrc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ module.exports = {
1616
env: {
1717
browser: true,
1818
},
19+
globals: {
20+
socketClusterClient: 'readonly',
21+
L: 'readonly',
22+
},
1923
rules: {
2024
'ember/no-array-prototype-extensions': 'off',
2125
'ember/no-computed-properties-in-native-classes': 'off',
@@ -27,7 +31,7 @@ module.exports = {
2731
'n/no-unpublished-require': [
2832
'error',
2933
{
30-
allowModules: ['resolve', 'broccoli-funnel'],
34+
allowModules: ['resolve'],
3135
},
3236
],
3337
},

.stylelintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@
66

77
# addons
88
/.node_modules.ember-try/
9+
10+
# server
11+
/server/
12+
/server_vendor/

.stylelintrc.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@
22

33
module.exports = {
44
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
5+
rules: {
6+
'selector-class-pattern': null,
7+
'no-descending-specificity': null,
8+
'color-function-notation': null,
9+
},
510
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<div id="next-view-section-subheader" class="next-view-section-subheader {{if @hideActions 'actions-hidden'}}" ...attributes>
2+
<div id="next-view-section-subheader-left" class="next-view-section-subheader-left {{@leftSubheaderClass}}">
3+
<div class="flex flex-row items-center">
4+
<FaIcon @icon="folder-tree" @size="sm" class="{{@iconClass}} text-gray-200 dark:text-gray-600 mr-2" />
5+
<div class="pod-explorer-breadcrumb-container">
6+
{{#each this.state as |content|}}
7+
<a href="#" class="pod-explorer-breadcrumb {{if (eq @current content.id) "active-breadcrumb"}} {{@breadcrumbClass}}" {{on "click" (fn this.onStateClicked content)}}>{{content.name}}</a>
8+
{{/each}}
9+
</div>
10+
</div>
11+
</div>
12+
<div id="next-view-section-subheader-actions" class="next-view-section-subheader-actions {{@actionsWrapperClass}}">
13+
{{#if @onSearch}}
14+
<Input @type="text" @value={{@searchQuery}} aria-label={{t "common.search-input"}} placeholder={{or @searchPlaceholder (concat (t "common.search") " " (pluralize @title))}} class="w-64 mr-2 form-input form-input-sm {{@searchInputClass}}" {{on "keyup" @onSearch}} />
15+
{{/if}}
16+
{{yield}}
17+
</div>
18+
</div>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import Component from '@glimmer/component';
2+
import { tracked } from '@glimmer/tracking';
3+
import { inject as service } from '@ember/service';
4+
import { action } from '@ember/object';
5+
6+
export default class ExplorerHeaderComponent extends Component {
7+
@service explorerState;
8+
@tracked state = [];
9+
10+
constructor(owner, { pod }) {
11+
super(...arguments);
12+
this.state = this.explorerState.get(pod);
13+
this.explorerState.on('change', (id, state) => {
14+
if (id === pod) {
15+
this.state = state;
16+
}
17+
});
18+
}
19+
20+
@action onStateClicked(content) {
21+
if (typeof this.args.onStateClicked === 'function') {
22+
this.args.onStateClicked(content);
23+
}
24+
}
25+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Modal::Default @modalIsOpened={{@modalIsOpened}} @options={{@options}} @confirm={{@onConfirm}} @decline={{@onDecline}}>
2+
<div class="modal-body-container"></div>
3+
</Modal::Default>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Modal::Default @modalIsOpened={{@modalIsOpened}} @options={{@options}} @confirm={{@onConfirm}} @decline={{@onDecline}}>
2+
<div class="modal-body-container">
3+
<InputGroup @name="Pod Name" @value={{@options.pod.name}} @helpText="Input a name for your new Pod" />
4+
</div>
5+
</Modal::Default>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Modal::Default @modalIsOpened={{@modalIsOpened}} @options={{@options}} @confirm={{@onConfirm}} @decline={{@onDecline}}>
2+
<div class="modal-body-container"></div>
3+
</Modal::Default>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<div class="cell-dropdown-button overflow-visible {{@column.wrapperClass}}" {{did-insert this.setupComponent}} ...attributes>
2+
<DropdownButton @icon={{@column.ddButtonIcon}} @iconPrefix={{@column.ddButtonIconPrefix}} @text={{this.buttonText}} @size="xs" @horizontalPosition="left" @calculatePosition={{this.calculatePosition}} @renderInPlace={{true}} as |dd|>
3+
<div class="next-dd-menu mt-0i" role="menu" aria-orientation="vertical" aria-labelledby="user-menu">
4+
{{#if @column.ddMenuLabel}}
5+
<div class="px-1">
6+
<div class="text-sm flex flex-row items-center px-3 py-1 rounded-md my-1 text-gray-800 dark:text-gray-300">
7+
{{@column.ddMenuLabel}}
8+
</div>
9+
</div>
10+
<div class="next-dd-menu-seperator"></div>
11+
{{/if}}
12+
{{#each this.actions as |action|}}
13+
{{#if action.separator}}
14+
<div class="next-dd-menu-seperator"></div>
15+
{{else}}
16+
{{#if (is-dd-item-visible @row action.isVisible)}}
17+
<div role="group" class="px-1">
18+
<a href="javascript:;" role="menuitem" class="next-dd-item {{action.class}}" {{on "click" (fn this.onDropdownItemClick action @row dd)}}>
19+
{{#if action.icon}}
20+
<span class="mr-1">
21+
<FaIcon class={{action.iconClass}} @icon={{action.icon}} @prefix={{action.iconPrefix}} />
22+
</span>
23+
{{/if}}
24+
{{action.label}}
25+
</a>
26+
</div>
27+
{{/if}}
28+
{{/if}}
29+
{{/each}}
30+
</div>
31+
</DropdownButton>
32+
</div>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import Component from '@glimmer/component';
2+
import { tracked } from '@glimmer/tracking';
3+
import { action, computed } from '@ember/object';
4+
import { isArray } from '@ember/array';
5+
6+
export default class TableCellPodContentActionsComponent extends Component {
7+
constructor(owner, { column, row }) {
8+
super(...arguments);
9+
if (isArray(column.actions)) {
10+
this.actions = column.actions;
11+
}
12+
13+
if (typeof column.actions === 'function') {
14+
this.actions = column.actions(row);
15+
}
16+
}
17+
18+
@tracked actions = [];
19+
@tracked defaultButtonText = 'Actions';
20+
21+
@computed('args.column.ddButtonText', 'defaultButtonText') get buttonText() {
22+
const { ddButtonText } = this.args.column;
23+
24+
if (ddButtonText === undefined) {
25+
return this.defaultButtonText;
26+
}
27+
28+
if (ddButtonText === false) {
29+
return null;
30+
}
31+
32+
return ddButtonText;
33+
}
34+
35+
@action setupComponent(dropdownWrapperNode) {
36+
const tableCellNode = this.getOwnerTableCell(dropdownWrapperNode);
37+
tableCellNode.style.overflow = 'visible';
38+
}
39+
40+
@action getOwnerTableCell(dropdownWrapperNode) {
41+
while (dropdownWrapperNode) {
42+
dropdownWrapperNode = dropdownWrapperNode.parentNode;
43+
44+
if (dropdownWrapperNode.tagName.toLowerCase() === 'td') {
45+
return dropdownWrapperNode;
46+
}
47+
}
48+
49+
return undefined;
50+
}
51+
52+
@action onDropdownItemClick(columnAction, row, dd) {
53+
if (typeof dd?.actions?.close === 'function') {
54+
dd.actions.close();
55+
}
56+
57+
if (typeof columnAction?.fn === 'function') {
58+
columnAction.fn(row);
59+
}
60+
}
61+
62+
@action calculatePosition(trigger) {
63+
let { width } = trigger.getBoundingClientRect();
64+
65+
let style = {
66+
marginTop: '0px',
67+
right: width + 3,
68+
top: 0,
69+
};
70+
71+
return { style };
72+
}
73+
}

0 commit comments

Comments
 (0)