[Tex/LaTex] How to add dots in the table of contents on chapter name

chapterstable of contents

I have a probleme with table of contents. The chapter's dots didn't work. How to fix it. This is my code

\documentclass[a5paper,11pt]{book}
\usepackage[a5paper,hmargin={2.5cm,1.5cm},vmargin={1.5cm,1.5cm}]{geometry}
\usepackage{times}
\usepackage[indonesian]{babel}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{indentfirst}
\usepackage{titlesec}
\usepackage{mathrsfs}
%\usepackage{enumitem}
\usepackage{fancyhdr}
\usepackage{fancyvrb}
\usepackage{natbib}
\usepackage{titletoc}
\usepackage[titles]{tocloft}
\usepackage{ragged2e}
\usepackage{amsthm}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,arrows}
\usepackage{caption}
\usepackage{lscape}
\usepackage{afterpage}
\usepackage{tocbasic}
\usepackage{setspace}
\usepackage{hyperref}
\usepackage{listings}
%\usepackage[utf8]{inputenc}
\usepackage{placeins}
\allowdisplaybreaks

\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000



\titleformat{\section}
{\normalfont\fontsize{11}{15}\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\fontsize{11}{15}\bfseries}{\thesubsection}{1em}{}
\DeclareTOCStyleEntry[
linefill=\bfseries\TOCLineLeaderFill,beforeskip=2pt,entrynumberformat=\chapterprefixintoc,dynnumwidth
]{tocline}{chapter}
%format daftar isi
\titlecontents{chapter}% <section-type>
[0pt]% <left>
{\bfseries}% <above-code>
{\MakeUppercase{\chaptername} 
\thecontentslabel \quad}%<numbered-entry-format>
{}% <numberless-entry-format>
{\mdseries\titlerule*[0.75]{.}\bfseries}
\titleformat{\chapter}[hang]{\centering\huge\bfseries}{\thechapter.}{1em}{}
\titlespacing*{\chapter}{0pt}{-3em}{1.1\parskip}
\titlelabel{\thetitle\quad}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}  
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
%format daftar lampiran
\newcommand\listappendixname{\centering \normalsize DAFTAR LAMPIRAN}
\newcommand\appcaption[1]{%
    \addcontentsline{app}{chapter}{#1}}
\makeatletter
\newcommand\listofappendices{
    \chapter*{\listappendixname}\@starttoc{app}}
\makeatother
\theoremstyle{definition}
\newtheorem{lemma}[subsection]{Lemma}
\newtheorem{defn}[subsection]{Definisi}
\newtheorem{prop}[subsection]{Proposisi}
\newtheorem{exmp}[subsection]{Contoh}
\newtheorem{thm}[subsection]{Teorema}

\begin{document}
    \tableofcontents
\chapter{tes}
\chapter{a}
\section{b}
\subsection{c}

\end{document}

What is the problem? Thank you.

Best Answer

Do not use tocloft, titletoc and tocbasic in the same document.

Suggestion using tocbasic (tocloft, titletoc and \titlecontents are removed):

\documentclass[a5paper,11pt]{book}
\usepackage[a5paper,hmargin={2.5cm,1.5cm},vmargin={1.5cm,1.5cm}]{geometry}
\usepackage{times}
\usepackage[indonesian]{babel}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{indentfirst}
\usepackage{titlesec}
\usepackage{mathrsfs}
%\usepackage{enumitem}
\usepackage{fancyhdr}
\usepackage{fancyvrb}
\usepackage{natbib}
\usepackage{ragged2e}
\usepackage{amsthm}
\usepackage{tikz}% loads also graphicx
\usetikzlibrary{shapes.geometric,arrows}
\usepackage{caption}
\usepackage{lscape}
\usepackage{afterpage}
\usepackage{tocbasic}
\usepackage{setspace}
\usepackage{listings}
%\usepackage[utf8]{inputenc}
\usepackage{placeins}
\usepackage{hyperref}% <- load as last package
\allowdisplaybreaks

\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000

\titleformat{\section}
{\normalfont\fontsize{11}{15}\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\fontsize{11}{15}\bfseries}{\thesubsection}{1em}{}

\DeclareTOCStyleEntry[
linefill=\bfseries\TOCLineLeaderFill,beforeskip=2pt,entrynumberformat=\chapterprefixintoc,dynnumwidth
]{tocline}{chapter}
\newcommand\chapterprefixintoc[1]{\MakeUppercase{\chaptername}~#1~}% <- added

\titleformat{\chapter}[hang]{\centering\huge\bfseries}{\thechapter.}{1em}{}
\titlespacing*{\chapter}{0pt}{-3em}{1.1\parskip}
\titlelabel{\thetitle\quad}
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{chapter}.\arabic{section}}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}

%format daftar lampiran using package tocbasic
\DeclareNewTOC[
  owner=\jobname,
  type=appendix,types=appendices,
  listname={Daftar Lampiran}
]{app}
\DeclareTOCStyleEntry[
  level=\chaptertocdepth,
  indent=0pt,numwidth=0pt,dynnumwidth,
  entryformat=\textbf,
  linefill=\bfseries\TOCLineLeaderFill,
  pagenumberformat=\textbf
]{tocline}{appendix}

\newcommand\appcaption[1]{%
    \addxcontentsline{app}{appendix}{#1}}

\theoremstyle{definition}
\newtheorem{lemma}[subsection]{Lemma}
\newtheorem{defn}[subsection]{Definisi}
\newtheorem{prop}[subsection]{Proposisi}
\newtheorem{exmp}[subsection]{Contoh}
\newtheorem{thm}[subsection]{Teorema}

\begin{document}
\tableofcontents
\chapter{tes}
\chapter{a}
\section{b}
\subsection{c}
\end{document}

Note that I have used tocbasic to define the List of Appendices, too.

enter image description here