Skip to content

Commit ba2107f

Browse files
committed
fix(riot-ui): upgrade tag dialogs
1 parent f779f43 commit ba2107f

File tree

3 files changed

+29
-22
lines changed

3 files changed

+29
-22
lines changed

src/components/dialogs/add-registry-url.riot

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
-->
1717
<add-registry-url>
1818
<material-popup opened="{ props.opened }" onClick="{ props.onClose }">
19-
<div slot="title">Add your Server ?</div>
20-
<div slot="content">
21-
<material-input onkeyup="{ onKeyUp }" placeholder="Server URL"></material-input>
19+
<div class="material-popup-title">Add your Server ?</div>
20+
<div class="material-popup-content">
21+
<material-input onkeyup="{ onKeyUp }" label="Server URL" label-color="#666" valid="{ registryUrlValidator }"></material-input>
2222
<span>Write your URL without /v2</span>
2323
</div>
24-
<div slot="action">
25-
<material-button class="dialog-button" waves-color="rgba(158,158,158,.4)" onClick="{ add }">
24+
<div class="material-popup-action">
25+
<material-button class="dialog-button" waves-color="rgba(158,158,158,.4)" onClick="{ add }" color="#000" inverted>
2626
Add
2727
</material-button>
28-
<material-button class="dialog-button" waves-color="rgba(158,158,158,.4)" onClick="{ props.onClose }">
28+
<material-button class="dialog-button" waves-color="rgba(158,158,158,.4)" onClick="{ props.onClose }" color="#000" inverted>
2929
Cancel
3030
</material-button>
3131
</div>
@@ -55,6 +55,9 @@
5555
this.props.onClose();
5656
setTimeout(() => router.updateUrlQueryParam(url), 100);
5757
},
58+
registryUrlValidator(input) {
59+
return /^https?:\/\//.test(input) && !/\/v2\/?$/.test(input)
60+
}
5861
};
5962
</script>
6063
</add-registry-url>

src/components/dialogs/change-registry-url.riot

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@
1515
along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
-->
1717
<change-registry-url>
18-
<material-popup opened="{ props.opened }" onClick="{ props.onClick }">
19-
<div slot="title">Change your Server ?</div>
20-
<div slot="content">
18+
<material-popup opened="{ props.opened }" onClick="{ props.onClose }">
19+
<div class="material-popup-title">Change your Server ?</div>
20+
<div class="material-popup-content">
2121
<select>
2222
<option each="{ url in getRegistryServers() }" value="{ url }">{ url }</option>
2323
</select>
2424
</div>
25-
<div slot="action">
26-
<material-button class="dialog-button" waves-color="rgba(158,158,158,.4)" onClick="{ change }">
25+
<div class="material-popup-action">
26+
<material-button class="dialog-button" waves-color="rgba(158,158,158,.4)" onClick="{ change }" color="#000" inverted>
2727
Change
2828
</material-button>
29-
<material-button class="dialog-button" waves-color="rgba(158,158,158,.4)" onClick="{ props.onClose }">
29+
<material-button class="dialog-button" waves-color="rgba(158,158,158,.4)" onClick="{ props.onClose }" color="#000" inverted>
3030
Cancel
3131
</material-button>
3232
</div>
@@ -62,6 +62,7 @@
6262
background: 0 0;
6363
border: none;
6464
font-weight: 400;
65+
font-size: 1em;
6566
line-height: 24px;
6667
height: 24px;
6768
border-bottom: 1px solid #2f6975;

src/components/dialogs/remove-registry-url.riot

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
-->
1717
<remove-registry-url>
1818
<material-popup opened="{ props.opened }" onClick="{ props.onClose }">
19-
<div slot="title">Remove your Registry Server ?</div>
20-
<div slot="content">
19+
<div class="material-popup-title">Remove your Registry Server ?</div>
20+
<div class="material-popup-content">
2121
<ul class="list">
2222
<li each="{ url in getRegistryServers() }">
2323
<span>
2424
<material-button
25-
onClick="{ remove }"
25+
onClick="{ remove(url) }"
2626
url="{ url }"
27-
rounded="true"
2827
waves-color="rgba(158,158,158,.4)"
2928
waves-center="true"
29+
inverted
30+
icon
3031
>
3132
<i class="material-icons">delete</i>
3233
</material-button>
@@ -35,19 +36,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3536
</li>
3637
</ul>
3738
</div>
38-
<div slot="action">
39-
<material-button class="dialog-button" waves-color="rgba(158,158,158,.4)" onClick="{ props.onClose }">
39+
<div class="material-popup-action">
40+
<material-button class="dialog-button" waves-color="rgba(158,158,158,.4)" onClick="{ props.onClose }" color="#000" inverted>
4041
Close
4142
</material-button>
4243
</div>
4344
</material-popup>
4445
<script>
4546
import { getRegistryServers, removeRegistryServers } from '../../scripts/utils';
4647
export default {
47-
remove(event) {
48-
const url = event.currentTarget.attributes.url && event.currentTarget.attributes.url.value;
49-
removeRegistryServers(url);
50-
setTimeout(() => this.update(), 100);
48+
remove(url) {
49+
return (event) => {
50+
console.log(url, event)
51+
removeRegistryServers(url);
52+
setTimeout(() => this.update(), 100);
53+
}
5154
},
5255
getRegistryServers,
5356
};

0 commit comments

Comments
 (0)