mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-27 23:50:01 +03:00
fix(taglist-order): improve error handler when the order does not exists
This commit is contained in:
parent
92584fc3da
commit
c6dee14d79
4 changed files with 9 additions and 5 deletions
|
@ -55,7 +55,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
filter-results="{ state.filter }"
|
||||
on-authentication="{ onAuthentication }"
|
||||
use-control-cache-header="{ truthy(props.useControlCacheHeader) }"
|
||||
taglist-order="{ taglistOrderParser(props.taglistOrder) }"
|
||||
taglist-order="{ props.taglistOrder }"
|
||||
></tag-list>
|
||||
</route>
|
||||
<route path="{baseRoute}taghistory/(.*)">
|
||||
|
@ -130,7 +130,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
import { stripHttps, getRegistryServers, setRegistryServers, truthy, stringToArray } from '../scripts/utils';
|
||||
import router from '../scripts/router';
|
||||
import { loadTheme } from '../scripts/theme';
|
||||
import { taglistOrderParser } from '../scripts/taglist-order';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -243,7 +242,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
version,
|
||||
truthy,
|
||||
stringToArray,
|
||||
taglistOrderParser,
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
|
|
@ -66,7 +66,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
import Pagination from './pagination.riot';
|
||||
import TagTable from './tag-table.riot';
|
||||
import router from '../../scripts/router';
|
||||
import { getTagComparator } from '../../scripts/taglist-order';
|
||||
import { getTagComparator, taglistOrderParser } from '../../scripts/taglist-order';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -81,6 +81,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
asc: true,
|
||||
page: router.getPageQueryParam() || 1,
|
||||
};
|
||||
try {
|
||||
this.state.taglistOrder = taglistOrderParser(props.taglistOrder)
|
||||
} catch(e) {
|
||||
props.onNotify(e);
|
||||
}
|
||||
},
|
||||
onMounted(props, state) {
|
||||
this.display(props, state);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
export class DockerRegistryUIError extends Error {
|
||||
constructor(msg) {
|
||||
super(msg);
|
||||
this.isError = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ export const taglistOrderVariants = (taglistOrder) => {
|
|||
} else if (TAGLIST_ORDER_REGEX.test(taglistOrder)) {
|
||||
return taglistOrder;
|
||||
}
|
||||
throw new DockerRegistryUIError(`The order \`${taglistOrder}\` is not recognized.`);
|
||||
throw new DockerRegistryUIError(`The taglist order \`${taglistOrder}\` is not recognized.`);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue